gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
from __future__ import print_function
"""
test_with_logger.py
"""
import os
tempdir = os.path.relpath(os.path.abspath(os.path.splitext(__file__)[0])) + "/"
input_file_names = [os.path.join(tempdir, "%d.1" % fn) for fn in range(20)]
final_file_name = os.path.join(tempdir, "final.result")
t... | |
"""
Unit tests for optimization routines from optimize.py
Authors:
Ed Schofield, Nov 2005
Andrew Straw, April 2008
To run it in its simplest form::
nosetests test_optimize.py
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import (a... | |
from collections import defaultdict
import atexit
import difflib
import jinja2
import json
import os
import socket
import subprocess
RULES_TEMPLATE = jinja2.Template('''
{% if nat_rules %}
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
{% for chain in nat_chains|defaul... | |
#
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | |
"""
In this module, the similarity classes of the item-based approach are defined.
The most important classes are the CombinedRecordSimilarity, the
CollaborativeRecordSimilarity and the ContentRecordSimilarity. The first one
combines the record similarity values of two underlying item based similarity
classes. The seco... | |
import sys
import os
import gzip
import zipfile
from optparse import make_option
import traceback
from django.conf import settings
from django.core import serializers
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from django.db import (connections, router, transa... | |
import re
import string
import math
from operator import itemgetter
from itertools import groupby
import itertools
import operator
import foofah_utils
COST_DELETE_EXISTING_CELL = 1
COST_DELETE_CELL = 1
COST_DELETE_EMPTY = 1
COST_ADD_EMPTY = 1
COST_MOVE_EMPTY = 1
COST_MOVE_CELL = 1
COST_SPLIT = 1
COST_MERGE = 1
COST_... | |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
import operator
from appengine_url_fetcher import AppEngineUrlFetcher
import url_constants
class ChannelInfo(object):
'''... | |
"""
Python script to generate a zero-offset synthetic from a 3-layer wedge model.
Created by: Wes Hamlyn
Create Date: 19-Aug-2014
Last Mod: 1-Nov-2014
This script is provided without warranty of any kind.
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
##########... | |
"""\
PyQuante2 contains a more structured interface to all of the functions
in PyQuante.
solver = SCF(molecule,**options)
Create a solver that can perform a HF calculation on *molecule*.
General options
Option Value Description
-------- ----- -----------
method HF Use the HF method for t... | |
# third party
# third party
import torch as th
# syft absolute
import syft as sy
from syft import serialize
from syft.core.common import UID
from syft.core.store.dataset import Dataset
from syft.core.store.storeable_object import StorableObject
def test_create_dataset_with_store_obj() -> None:
id = UID()
dat... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
from concurrent.futures import ThreadPoolExecutor, as_completed
from db import commit_db_item
from db.player import Player
from db.team import Team
from utils.player_finder import PlayerFinder
from utils.player_data_retriever import PlayerDataRetrie... | |
#!/usr/bin/env python
import json
import time
import xml.etree.ElementTree as ET
import argparse
import sys
import subprocess
import requests
from decimal import Decimal
from gomatic.gocd.pipelines import Pipeline, PipelineGroup, PipelineEnvironment
from gomatic.gocd.repositories import GenericArtifactoryRepository
f... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
import csv
from django import http
from django.conf import settings
from django.contrib import admin, messages
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.shortcuts import redirect, render
from django.views import debug
import commonware.... | |
from math import *
import numpy as np
from PyQt5.QtCore import QPoint
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QColor, QOpenGLShaderProgram, QOpenGLShader, QMatrix4x4, QVector3D, QVector2D
from Data import read_text_from_disk
from Data.Edges import Edge, EdgeType
from Data.Feature import FeatureType
from G... | |
# -*- Mode: Python; tab-width: 4 -*-
# Id: asynchat.py,v 2.26 2000/09/07 22:29:26 rushing Exp
# Author: Sam Rushing <rushing@nightmare.com>
# ======================================================================
# Copyright 1996 by Sam Rushing
#
# All Rights Reserved
#
# Permission... | |
from pandac.PandaModules import *
from MsgTypes import *
from direct.showbase import ShowBase # __builtin__.config
from direct.task.TaskManagerGlobal import * # taskMgr
from direct.directnotify import DirectNotifyGlobal
from ConnectionRepository import ConnectionRepository
from PyDatagram import PyDatagram
from PyDatag... | |
from collections import OrderedDict
volumesObjects = OrderedDict([("ot",{
"volume_id":1,
"volume_title":"Old Testament",
}), ("nt",{
"volume_id":2,
"volume_title":"New Testament",
}), ("bm",{
"volume_id":3,
"volume_title":"Book of Mormon",
}), ("dc",{
"volume_id":4,
"volume_title":"Doctrine and Covenants",
}), ... | |
"""Unit tests for the memoryview
XXX We need more tests! Some tests are in test_bytes
"""
import unittest
import sys
import gc
import weakref
import array
from test import test_support
import io
class AbstractMemoryTests:
source_bytes = b"abcdef"
@property
def _source(self):
return self.source_... | |
import os
import types
from tempfile import TemporaryFile, NamedTemporaryFile
import unittest
import numpy
import scipy.io.wavfile as sp_wavfile
from .__init__ import A440_MONO_16B, A440_STEREO_16B, STEPS_MONO_16B
from pychedelic import stream_functions
from pychedelic import config
from pychedelic.core import errors... | |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | |
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Rico Sennrich
"""Use byte pair encoding (BPE) to learn a variable-length encoding of the vocabulary in a text.
Unlike the original BPE, it does not compress the plain text, but can be used to reduce the vocabulary
of a text to a configurable number of symbols, wi... | |
import theano.tensor as T
from .. import init
from .. import nonlinearities
from ..utils import as_tuple
from ..theano_extensions import conv, padding
from .base import Layer
__all__ = [
"Conv1DLayer",
"Conv2DLayer",
]
def conv_output_length(input_length, filter_size, stride, pad=0):
"""Helper functio... | |
#!/usr/bin/env python
# Create some test images we need
command += oiiotool ("--create 320x240 3 -d uint8 -o black.tif")
command += oiiotool ("--pattern constant:color=0.5,0.5,0.5 128x128 3 -d half -o grey128.exr")
command += oiiotool ("--pattern constant:color=0.5,0.5,0.5 64x64 3 -d half -o grey64.exr")
command += oi... | |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
import unittest
from .. import dispatchonvalue as dv
class TestExamples(unittest.TestCase):
def test_example1(self):
called = [0]
dispatch_on_value = dv.DispatchOnValue()
@dispatch_on_value.add([1, 2, 3])
def _(a):
called[0] = 1
return 2
@dispatch... | |
# Copyright (c) 2015 Faculty of Engineering of the University of Porto
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... | |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozil... | |
import py, pytest
from _pytest.mark import MarkGenerator as Mark
class TestMark:
def test_markinfo_repr(self):
from _pytest.mark import MarkInfo
m = MarkInfo("hello", (1,2), {})
repr(m)
def test_pytest_exists_in_namespace_all(self):
assert 'mark' in py.test.__all__
asse... | |
"""
Backrefs Re parser.
Licensed under MIT
Copyright (c) 2011 - 2018 Isaac Muse <isaacmuse@gmail.com>
"""
from __future__ import unicode_literals
import re as _re
from . import util as _util
import sre_parse as _sre_parse
import unicodedata as _unicodedata
from . import uniprops as _uniprops
__all__ = ("ReplaceTempla... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 17 13:47:34 2014
@author: Slawomir Figiel
"""
import click
import scipy.io
from os.path import isfile
from numpy import average as avr, std as nstd, load
from matrixmultiplication import multiply_cpu, multiply_ellpack, \
multiply_sliced, ... | |
#!/usr/bin/env python3
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
from collections import defaultdict
import logging
import os
import re
import shutil
import sys
import tempfile
impo... | |
"""
This bootstrap module contains code for ensuring that the astropy_helpers
package will be importable by the time the setup.py script runs. It also
includes some workarounds to ensure that a recent-enough version of setuptools
is being used for the installation.
This module should be the first thing imported in th... | |
from __future__ import unicode_literals
from django.db.models import CharField, TextField, Value as V
from django.db.models.functions import (
Coalesce, Concat, Length, Lower, Substr, Upper,
)
from django.test import TestCase
from django.utils import six, timezone
from .models import Article, Author
lorem_ipsum... | |
import unittest
class SolrEscapeTests(unittest.TestCase):
def _callFUT(self, s):
from alm.solrindex.handlers import solr_escape
return solr_escape(s)
def test_empty(self):
self.assertEqual(self._callFUT(''), '')
def test_simple(self):
self.assertEqual(self._callFUT('abc... | |
# -*- coding: utf-8 -*-
"""Unit tests for checking the InfluxDB server.
The good/expected interaction between:
+ the python client.. (obviously)
+ and a *_real_* server instance running.
This basically duplicates what's in client_test.py
but without mocking around every call.
"""
from __future__ import absolute_impo... | |
# =======================================================================
# 2019 Changes by Natalia Clementi @ncclementi
# Add documentation and comments.
# Add translation center to allow creation of meshes not centered on (0,0,0)
# Modify script to save faces and vertices in different files
# Add argument parser to a... | |
import unittest
from unittest.mock import Mock
from constants import TEMPERATURE, PRECIPITATION_CHANCE, PRECIPITATION_AMOUNT, WIND
from chief_lunch_officer import ChiefLunchOfficer, WeatherOpinion, FoodTaste
class FoodTasteTest(unittest.TestCase):
def setUp(self):
self.food_taste = FoodTaste()
se... | |
"""Implementation of the WebSocket protocol.
`WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional
communication between the browser and server.
WebSockets are supported in the current versions of all major browsers,
although older versions that do not support WebSockets are still in use
(refer ... | |
"""
A directive for including a matplotlib plot in a Sphinx document.
By default, in HTML output, `plot` will include a .png file with a
link to a high-res .png and .pdf. In LaTeX output, it will include a
.pdf.
The source code for the plot may be included in one of three ways:
1. **A path to a source file** as t... | |
from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.ec2.utils import filters_from_querystring
class ElasticBlockStore(BaseResponse):
def attach_volume(self):
volume_id = self._get_param("VolumeId")
instance_id = self._get_param("InstanceId")
devic... | |
from datetime import timedelta
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.core import mail
from django.core.paginator import Paginator
from django.utils import timezone
from ... | |
"""Utilities for input validation"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
from ..externals... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# simple library for stroring python dictionaries in sqlite database
#
__author__ = 'Andrey Usov <https://github.com/ownport/scrapy-dblite>'
__version__ = '0.2.7'
import os
import re
import inspect
import sqlite3
from .query import SQLBuilder
from urlparse import urlp... | |
"""File wrangling."""
from coverage.backward import to_string
from coverage.misc import CoverageException
import fnmatch, os, re, sys
class FileLocator(object):
"""Understand how filenames work."""
def __init__(self):
# The absolute path to our current directory.
self.relative_dir = self.abs_... | |
#!/usr/bin/env python
"""
AUTHOR: Gabriel Bassett
DATE: 12-17-2013
DEPENDENCIES: ipwhois
Copyright 2014 Gabriel Bassett
LICENSE:
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding c... | |
""" Test usage of communication.authenticate and communication.gen_request
"""
from unittest import TestCase
from pythonzimbra.exceptions.communication import UnknownRequestType
from pythonzimbra.request_json import RequestJson
from pythonzimbra.request_xml import RequestXml
from pythonzimbra.tools.auth import authenti... | |
# -*- coding: utf-8 -*-
from tensor_analysis.arraypy import Arraypy, TensorArray, list2arraypy, \
list2tensor, matrix2arraypy, matrix2tensor
from tensor_analysis.tensor_methods import tensor_product
from sympy import Symbol, symbols
from sympy.matrices import Matrix, MatrixSymbol
import sys
def test_arraypy_init... | |
"""praw constants."""
import sys
__version__ = '6.0.0'
API_PATH = {
'about_edited': 'r/{subreddit}/about/edited/',
'about_log': 'r/{subreddit}/about/log/',
'about_modqueue': 'r/{subreddit}/about/modqueue/',
'about_reports': 'r/{subreddit}/about/reports/',
'... | |
# Copyright 2011 OpenStack Foundation.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance w... | |
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | |
# Lint as: python2, python3
# Copyright 2020 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law ... | |
"""pblite message schemas and related enums."""
# Stop pylint from complaining about enums:
# pyline: disable=too-few-public-methods
import enum
from hangups.pblite import Message, Field, RepeatedField, EnumField
##############################################################################
# Enums
###############... | |
# -*- coding: utf-8 -*-
from lettuce import step, world
from nose.tools import assert_equals, assert_true, assert_in
import fudge
from editor.models import Dataset, Format
from editor.tests.factories import SourceFactory
def _get_formset_block(name):
if name == 'Data files':
fieldset_index = 0
eli... | |
# python3
# coding=utf-8
# Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | |
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""build query for doclistview and return results"""
import frappe, json
from six.moves import range
import frappe.permissions
from frappe.model.db_query import DatabaseQuery
fro... | |
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 Metaswitch Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | |
# pylint: disable=invalid-name
# pylint: disable=missing-docstring
# pylint: disable=too-few-public-methods
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-locals
import json
import os
import re
import subprocess
import sys
import warnings
import yaml
from pkg_resources import parse_version
... | |
#!/usr/bin/env python
# pragma: no testimport
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.or... | |
# -*- coding: utf-8 -*-
#
# SelfTest/Cipher/DES.py: Self-test for the (Single) DES cipher
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicat... | |
#################################PUNKEMON YO!!!!!###############################
import pygame
from pygame.locals import *
import random
from random import *
import math
from math import *
import os
import string
fontLoaderCode=open("menu sprite code.py")
exec(fontLoaderCode.read())
################### Menu stuff ##... | |
import datetime
from django.conf import settings
from django.db import models
from django.utils.translation import (
activate, to_locale, get_language, ugettext)
import bleach
import caching.base
from babel import Locale, numbers
from jinja2.filters import do_dictsort
from olympia import amo
from olympia.amo.mod... | |
import nltk
import nltk.translate.chrf_score # This is necessary to avoid an AttributeError in NLTK
import sacrebleu
import numpy as np
import math
import re
import subprocess
import tempfile
from collections import Counter
from itertools import chain
from compare_mt import corpus_utils
from compare_mt import align_u... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# -*- coding: utf-8 -*-
"""Tests for test plugin."""
import unittest
from plaso.lib import eventdata
from plaso.lib import timelib
from plaso.parsers.sqlite_plugins import test
from tests import test_lib as shared_test_lib
from tests.parsers.sqlite_plugins import test_lib
class TestTest(test_lib.SQLitePluginTestCas... | |
"""Utilities related archives.
"""
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
import logging
import os
import shutil
import stat
import tarfile
import zipfile
from pip._internal.excep... | |
"""Class for managing, downloading and extracting features from genbank files."""
# Standard Library
import os
import shutil
from pathlib import Path
# BioPython
from BioSQL import BioSeqDatabase
from Bio import SeqIO
# OrthoEvol
from OrthoEvol.Tools.logit import LogIt
from OrthoEvol.Orthologs.Blast import OrthoBlastN
... | |
# -*- coding: utf-8 -*-
#
# Cilium documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 12 18:34:43 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | |
'''
Created on Mar 30, 2014
Requires PySerial and PyGTK
***************WorkLog******************
5/7/14: initial install of pyserial and pygtk, loading up of code I worked on previously
5/8/14: testing methods to make scales change when new scale selected
5/8/14: debugging
5/12/14: Completely redid arduino code, chan... | |
from __future__ import (print_function, unicode_literals, division,
absolute_import)
import argparse
import copy
import io
import json
import os
import pprint
import re
import sys
from dfs_sdk import get_api as _get_api
IPRE_STR = r'(\d{1,3}\.){3}\d{1,3}'
IPRE = re.compile(IPRE_STR)
SIP = re... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{twisted.names.client}.
"""
import sys
from zope.interface.verify import verifyObject
from twisted.python.compat import set
from twisted.python import failure
from twisted.python.runtime import platform
from twisted.interne... | |
# -*- encoding: utf-8 -*-
import collections
import re
from abjad.tools import abctools
from abjad.tools import datastructuretools
class CreditRole(abctools.AbjadValueObject):
### CLASS VARIABLES ###
class Category(datastructuretools.Enumeration):
ACTING_LITERARY_AND_SPOKEN = 1
COMPANIES = 2... | |
###
# Copyright (c) 2014, Kristian Berg
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions... | |
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name,too-many-locals
import pytest
from raiden.transfer.architecture import TransitionResult
from raiden.transfer.state_change import Block
from raiden.transfer.mediated_transfer import target
from raiden.transfer.mediated_transfer.state import TargetState
from raiden.... | |
"""
Sparse matrix functions
"""
#
# Authors: Travis Oliphant, March 2002
# Anthony Scopatz, August 2012 (Sparse Updates)
# Jake Vanderplas, August 2012 (Sparse Updates)
#
from __future__ import division, print_function, absolute_import
__all__ = ['expm', 'inv']
import math
import numpy as np
imp... | |
from datetime import datetime
import hashlib
from werkzeug.security import generate_password_hash, check_password_hash
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from markdown import markdown
import bleach
from flask import current_app, request
from flask_login import UserMixin, AnonymousUse... | |
r"""
SQL Connection object (:mod:`qiita_db.sql_connection`)
======================================================
.. currentmodule:: qiita_db.sql_connection
This modules provides wrappers for the psycopg2 module to allow easy use of
transaction blocks and SQL execution/data retrieval.
This module provides the varia... | |
from abstractStatelessProxyTestCase import AbstractStatelessProxyTestCase
from ..sipmessaging import SIPURI
from ..siptransport import SimulatedSIPTransport
from ..sipentity import SIPStatelessProxy
from ..siptransport import SimulatedNetwork
class TestStatelessProxyWithSimulatedTransport(AbstractStatelessProxyTestCa... | |
from os.path import dirname, abspath, join, isfile, expanduser
from subprocess import check_output, CalledProcessError, Popen, check_call
import sys
import vim
from clangd import vimsupport
from clangd.vimsupport import GetBoolValue, GetIntValue, GetVariableValue
from clangd.lsp_client import LSPClient, TimedOutError
... | |
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... | |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
r"""Shared subfunctions.
"""
import random
import textwrap
from math import ceil, log2
def wrapped_docstring():
'''Return a text-wrapped version of the module docstrin... | |
# -*- coding: utf-8 -*-
"""Validation classes for various types of data."""
from __future__ import unicode_literals
import re
from operator import attrgetter
from marshmallow.compat import basestring, text_type, zip_longest
from marshmallow.exceptions import ValidationError
class Validator(object):
"""Base abs... | |
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... | |
#!/usr/bin/env python
# Copyright (c) 2014-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same director... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import colorful.fields
import django.contrib.gis.db.models.fields
from django.conf import settings
import webmap.utils
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dep... | |
from collections import defaultdict, namedtuple
import glob
import gzip
import logging
import os
import shutil
import StringIO
import stat
import subprocess
import tempfile
import common
import opkg
import release as bismark_release
_NodePackage = namedtuple('NodePackage',
['node', 'name', '... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_ve... | |
"""
Testing for the forest module (sklearn.ensemble.forest).
"""
# Authors: Gilles Louppe,
# Brian Holt,
# Andreas Mueller,
# Arnaud Joly
# License: BSD 3 clause
import pickle
from collections import defaultdict
from itertools import combinations
from itertools import product
import numpy ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Variational Inference on Gridworld
@author: thomas
"""
import tensorflow as tf
import numpy as np
from tfutils.helpers import anneal_linear, HParams
import matplotlib.pyplot as plt
from rlenv.grid import grid_env as grid_env
from rlutils.policies import egreedy
from rl... | |
# -*- coding: utf-8 -*-
#
# Receives and responds to the HTTP request from the Python server.
#
# Copyright (c) 2015 carlosperate https://github.com/carlosperate/
# Licensed under the Apache License, Version 2.0 (the "License"):
# http://www.apache.org/licenses/LICENSE-2.0
#
from __future__ import unicode_literals, a... | |
#!/usr/bin/python
import getpass as gp
import os,re,sys,curses
from Crypto.Cipher import AES
from Clipboard import Clipboard
import WiKID
from WiKID import Domain,TokenConfig
def clear():
curses.setupterm()
sys.stdout.write(curses.tigetstr("clear"))
sys.stdout.flush()
def daemonize(tc, sc, pidfile = None):
im... | |
#!/usr/bin/python
import sys
import paho.mqtt.client as paho
import json
import threading
import Queue
from time import sleep
import numpy as np
import time
from random import random
from random import randint
# queue of commands for inter thread communication
file_lock = threading.Lock()
# Create topic from bot_i... | |
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import math
import numpy as np
from coremltools.converters.mil.mil import types
from coremltools.conv... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 - 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
... | |
# (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import os
import time
import socket
# 3p
from nose.plugins.attrib import attr
import requests
# project
from config import get_version
from tests.checks.common import AgentCheckTest, load_check
# Clust... | |
r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix', 'nt', 'os2' or 'ce'.
- os.curdir is a string representing the current directory ('.' or... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.