content stringlengths 4 20k |
|---|
"""Transform a roidb into a trainable roidb by adding a bunch of metadata."""
import numpy as np
from fast_rcnn.config import cfg
import utils.cython_bbox
def prepare_roidb(imdb):
"""Enrich the imdb's roidb by adding some derived quantities that
are useful for training. This function precomputes the maximum
... |
import webob
from webob import exc
from nova.api.openstack import wsgi
from nova.console import api as console_api
from nova import exception
def _translate_keys(cons):
"""Coerces a console instance into proper dictionary format."""
pool = cons['pool']
info = {'id': cons['id'],
'console_type'... |
import logging
logger = logging.getLogger()
import hostapd
def wait_acs(hapd):
ev = hapd.wait_event(["ACS-STARTED", "ACS-COMPLETED", "ACS-FAILED",
"AP-ENABLED"], timeout=5)
if not ev:
raise Exception("ACS start timed out")
if "ACS-STARTED" not in ev:
raise Excepti... |
import logging
import re
from autotest.client.shared import error
from virttest import libvirt_xml
from virttest import libvirt_vm
from virttest import utils_test
from virttest.utils_test import libvirt
def run(test, params, env):
"""
Test: vcpu hotplug.
The command can change the number of virtual CPU... |
"""multipart/form-data encoding module
This module provides functions that faciliate encoding name/value pairs
as multipart/form-data suitable for a HTTP POST or PUT request.
multipart/form-data is the standard way to upload files over HTTP"""
import mimetypes
import os
import re
import urllib
from email.header impo... |
"""
Classes representing uploaded files.
"""
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.core.files.base import File
from django.core.files import temp as tempfile
from django.utils.encoding import smart_str
__al... |
from optparse import OptionParser
# -- global options -----------------------------------------------------------
global __Options__
# -- getOption ===-------------------------------------------------------------
def getOption(string):
"""
Fetches an option by name
"""
return getattr(__Options__, string)
#... |
"""
Helper functions for loading environment settings.
"""
from __future__ import print_function
import os
import sys
import json
from lazy import lazy
from path import path
import memcache
class Env(object):
"""
Load information about the execution environment.
"""
# Root of the git repository (edx-p... |
import sys
import argparse
import logging
from wlauto.core.bootstrap import settings
from wlauto.core.extension_loader import ExtensionLoader
from wlauto.exceptions import WAError
from wlauto.utils.misc import get_traceback
from wlauto.utils.log import init_logging
from wlauto.utils.cli import init_argument_parser
fro... |
"""
Management command which fixes ungraded certificates for students
"""
from certificates.models import GeneratedCertificate
from courseware import grades, courses
from django.test.client import RequestFactory
from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseC... |
import unittest
import sys
sys.path.append('..')
from common.model import Model
from common.vocabulary import Vocabulary
from topic_words_stat import TopicWordsStat
class TopicWordsStatTest(unittest.TestCase):
def setUp(self):
self.model = Model(20)
self.model.load('../testdata/lda_model')
... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import errno
import itertools
import json
import multiprocessing
import os
import shutil
import subprocess
import sys
import traceback
BARE_INTERFACE_SEARCH_PATHS = [
"usr/lib/swift",
"System/iOSSupport/usr/lib/swift"
]
DEFAULT_FRAME... |
"""The test for the statistics sensor platform."""
import unittest
import statistics
from homeassistant.setup import setup_component
from homeassistant.const import (ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS)
from tests.common import get_test_home_assistant
class TestStatisticsSensor(unittest.TestCase):
"""Test the... |
#!/bin/python
import random
import math
import copy
import roomai.kuhn.KuhnPokerUtils
import roomai.common
logger = roomai.get_logger()
class KuhnPokerEnv(roomai.common.AbstractEnv):
'''
The KuhnPoker game environment
'''
#@override
def init(self, params=dict()):
'''
Initialize th... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 13 12:10:33 2017
@author: apezeshk
"""
from matplotlib import pyplot as plt
import numpy as np
#Use this to display a single slice of the original/transformed patch in one figure,
#and every slice of the original and the transformed copies in another figure. This can be u... |
import random as rand
import scholar.scholar as sch
import os, random, copy, re
import cPickle as pickle
import nltk
class AgentWord2Vec:
# Sets all initial learning variables of behavior parameters
def __init__(self, initial_epsilon, training_cycles):
# GLOBAL VARIABLES
# Used for making Word2Vec queries
se... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... |
def freq0_carrier_calculation(freq_desired, fxosc=26.0, debug=False):
"""
Calculates the FREQ0, FREQ1, and FREQ2 24 bit word for main carrier frequency of the CC430.
:param freq_desired: Frequency in MHz that is desired to tune to (Integer or float)
:param fxosc: CC430 High Frequency crystal frequency ... |
"""
kombu.utils.compat
==================
Helps compatibility with older Python versions.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
import sys
############## collections.OrderedDict #######################################
import weakref
try:
from collections imp... |
"""
This module contains utility functions for loading Horizon's
configuration from .ini files using the oslo.config library.
"""
import six
from oslo_config import cfg
# XXX import the actual config groups here
# from openstack_dashboard.config import config_compress
def load_config(files=None, root_path=None, lo... |
"""
Views for managing Neutron Subnets.
"""
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from horizon.utils import memoized
from horizon import workflows
from openstack_dashboard import api
from openstack_... |
###
### Simplify parental putative_SNP list to contain only those loci with an allelic ratio on range [0.25 .. 0.75].
###
### Uses genome definition files to only output data lines for chromosomes of interest.
###
def process_ParentLine(entry_line):
global chrNums
global chrName
global chrCount
# Process 'putativ... |
import urllib2
import json
from lib.auth import Auth
BASE_URL = 'https://peatio.com'
API_BASE_PATH = '/api/v2'
API_PATH_DICT = {
# GET
'members': '%s/members/me.json',
'markets': '%s/markets.json',
#market code required in url as {market}.json
'tickers' : '%s/tickers/%%s.json',
#market requi... |
pass |
"""
Unit tests for utility decorators
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import sys
import time
import tests.utils as utils
class TestRepeat(unittest.TestCase):
"""
Test the Repeat decorator
"""
# lowest p... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import json
from itertools import chain
from ansible.module_utils._text import to_bytes, to_text
from ansible.module_utils.network.common.utils import to_list
from ansible.plugins.cliconf import CliconfBase, enable_mode... |
# -*- coding: utf-8 -*-
import hashlib
import os
import unittest
from io import BytesIO
from unittest import mock
from PIL import Image
from thumbnails.conf import settings
from thumbnails.images import SourceFile, Thumbnail
from . import data
from .utils import has_installed
class ThumbnailTestCase(unittest.TestC... |
from logging import getLogger
from ..util import split, SplitterTail
logger = getLogger(__name__)
def filter_models(ifile, ofile, negate=False, models={('RF00001', '5S_rRNA'),
('RF00002', '5_8S_rRNA'),
# Per... |
#
# __PYDOC__
#
# [TITLE]
# TODO:Add Document Title
#
# [DESCRIPTION]
# TODO: Add Document Description
#
# [CREATION INFO]
# Email: <EMAIL>
# Company: Blur Studios
#
# [HISTORY]
# --1.0 - Created
#
# [DEPENDENCIES]
#
# __END__
#
import ConfigParser, os.path, sys;
configFile = 'c:/blur/config.in... |
{
'name': 'Thailand - Accounting',
'version': '1.0',
'category': 'Localization/Account Charts',
'description': """
Chart of Accounts for Thailand.
===============================
Thai accounting chart and localization.
""",
'author': 'Almacom',
'website': 'http://almacom.co.th/',
'depen... |
from __future__ import with_statement
import unittest
import os.path
import shutil
import IECore
import IECoreGL
IECoreGL.init( False )
class CoordinateSystemTest( unittest.TestCase ) :
__outputFileName = os.path.dirname( __file__ ) + "/output/testCoordinateSystem.tif"
def testNoVisualisation( self ) :
r = I... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'StaticPlaceholder'
db.create_table(u'cms_staticplaceholder', (
(u'id', self.gf('... |
"""
These utility functions are meant for computing basic statistics in a set of tfrecord
files. They can be used to sanity check the training and testing files.
"""
import argparse
import tensorflow as tf
def class_stats(tfrecords):
"""
Sum the number of images and compute the number of images available for eac... |
"""
Gimp image parser (XCF file, ".xcf" extension).
You can find informations about XCF file in Gimp source code. URL to read
CVS online:
http://cvs.gnome.org/viewcvs/gimp/app/xcf/
\--> files xcf-read.c and xcf-load.c
Author: Victor Stinner
"""
from hachoir_parser import Parser
from hachoir_core.field import (St... |
from boto.ses.connection import SESConnection
from boto.regioninfo import RegionInfo, get_regions
def regions():
"""
Get all available regions for the SES service.
:rtype: list
:return: A list of :class:`boto.regioninfo.RegionInfo` instances
"""
return get_regions('ses', connection_cls=SESCon... |
"""Tests for custom user ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import tensorflow as tf
class DuplicateOpTest(tf.test.TestCase):
def testBasic(self):
library_filename = os.path.join(tf.resource_loader.get_data_files_... |
from copy import deepcopy
from redbot.core import Config
from collections import namedtuple
user_defaults = {
"Pending_Credits": 0,
"Membership": {
"Name": "Basic",
"Assigned": False
},
"Played": {
"Allin": 0,
"Blackjack": 0,
"Coin": 0,
"Craps": 0,
... |
import os
import willow
from django.conf import settings
from django.core.exceptions import ValidationError
from django.forms.fields import ImageField
from django.template.defaultfilters import filesizeformat
from django.utils.translation import gettext_lazy as _
ALLOWED_EXTENSIONS = ['gif', 'jpg', 'jpeg', 'png', '... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
import re
from functools import partial
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.eos import get_config, load_config
from ansible.module_utils.six imp... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: purefa_connect
version_added: '2.9'
short_description: Manag... |
"""Regression test for DNNLinearCombinedEstimator."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import tempfile
from tensorflow.contrib.layers.python.layers import feature_column
from tensorflow.contrib.learn.python.learn.datasets import b... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'community'}
import os
import re
import traceback
from ansible.module_utils.basic import AnsibleM... |
# -*- coding: utf-8 -*-
from openerp.addons.web.http import request
from openerp.osv import orm
class QWeb(orm.AbstractModel):
""" QWeb object for rendering stuff in the website context
"""
_inherit = 'ir.qweb'
URL_ATTRS = {
'form': 'action',
'a': 'href',
}
CDN_TRIGGERS = {
... |
{
'name': 'Invoice Picking Directly',
'version': '1.0',
'category' : 'Warehouse Management',
'description': """
Invoice Wizard for Delivery.
============================
When you send or deliver goods, this module automatically launch the invoicing
wizard if the delivery is to be invoiced.
""",
... |
import collections
import json
import os
import re
import subprocess
import sys
from telemetry.core import forwarders
from telemetry.core import util
NamedPort = collections.namedtuple('NamedPort', ['name', 'port'])
class LocalServerBackend(object):
def __init__(self):
pass
def StartAndGetNamedPorts(self, ... |
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.deletion import CASCADE
from django.db.models.signals import post_migrate
from django.db.utils import DEFAULT_DB_ALIAS
from django.utils.translat... |
import pytest
import os
import UM.Settings.InstanceContainer
# import UM.Settings.SettingDefinition
from UM.Resources import Resources
Resources.addSearchPath(os.path.dirname(os.path.abspath(__file__)))
def test_create():
container = UM.Settings.InstanceContainer.InstanceContainer("test")
assert container.get... |
"""
BibField Reader
"""
__revision__ = "$Id$"
import datetime
import six
from invenio.importutils import try_to_eval
from invenio.containerutils import SmartDict
from invenio.bibfield_config_engine import BibFieldParser as FieldParser
class ReaderException(Exception):
"""Exception raised when some error happe... |
import sys
from PIL import Image
if __name__ == "__main__":
param = sys.argv
if len(param) == 1 or len(param) > 3:
sys.exit(0)
image = Image.open(param[1])
# Size of the one image.
size = int(image.size[1] / 2)
if len(param) == 3 and param[2] == "-t":
new_image = Image.new("... |
"""Test for version 3 of the zero_out op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.python.platform
import tensorflow as tf
from tensorflow.g3doc.how_tos.adding_an_op import gen_zero_out_op_3
class ZeroOut3Test(tf.test.TestCase... |
import numpy as np
import pandas as pd
import re
import os
import yaml
import itertools
from typing import Mapping
from larch import P, X, DataFrames, Model
from larch.util import Dict
from pathlib import Path
import logging
from ...log import logger_name
from .general import remove_apostrophes, linear_utility_from_sp... |
#!/usr/bin/python
import os
import shutil
import subprocess
import sys
import tempfile
def rel_to_abs(rel_path):
return os.path.join(script_path, rel_path)
java_bin_path = os.getenv('JAVA_HOME', '')
if java_bin_path:
java_bin_path = os.path.join(java_bin_path, 'bin')
main_class = 'org.chromium.devtools.co... |
import os
import sys
import shutil
from Utils.WAAgentUtil import waagent
from AbstractPatching import AbstractPatching
class SuSEPatching(AbstractPatching):
def __init__(self, hutil):
super(SuSEPatching,self).__init__(hutil)
self.patched_pkgs = None
self.cache_dir = os.path.join(os.path.d... |
"""
==============
SGD: Penalties
==============
Plot the contours of the three penalties.
All of the above are supported by
:class:`sklearn.linear_model.stochastic_gradient`.
"""
from __future__ import division
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def l1(xs):
return np.array([np.... |
from cStringIO import StringIO
from zope.interface import implements, Interface, Attribute
from twisted.internet.protocol import Protocol, ServerFactory, ClientFactory, \
connectionDone
from twisted.internet import defer
from twisted.protocols import basic
from twisted.python import log
from twisted.web import ser... |
import os
from cattle.plugins.docker import DockerConfig
from cattle import Config
from cattle.process_manager import background
class HostApi(object):
def on_startup(self):
env = dict(os.environ)
env['HOST_API_CATTLE_ACCESS_KEY'] = Config.access_key()
env['HOST_API_CATTLE_SECRET_KEY'] =... |
import grpc
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities
import helloworld_pb2 as helloworld__pb2
class GreeterStub(object):
"""The greeting service definition.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel... |
import os
import pickle
from collections import defaultdict
import six
from enum import Enum
import numpy as np
import pandas as pd
from rqalpha.interface import AbstractMod
from rqalpha.events import EVENT
from rqalpha.const import ACCOUNT_TYPE, EXIT_CODE
from rqalpha.utils.risk import Risk
from rqalpha.utils.repr i... |
import decimal
import pytest
from shuup.core.models import OrderLineType
from shuup.testing.factories import create_product, get_default_supplier
from .test_order_creator import seed_source
@pytest.mark.django_db
def test_order_source_total_gross_weight(rf, admin_user):
source = seed_source(admin_user)
supp... |
"""
Enrollment operations for use by instructor APIs.
Does not include any access control, be sure to check access before calling.
"""
import json
import logging
from django.contrib.auth.models import User
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.mail import send_... |
import java.lang.String
from org.python.core import PyString
x = 100
if x > 0:
print('wow this is elegant')
else:
print('Oranization is the key.')
print('hello ' + ' ' + 'world')
def my_function(a='zz'):
print(a)
my_function()
class my_class:
def __init__(self, x, y ):
... |
# stdlib
import os
import tempfile
import threading
import time
from types import ListType
import unittest
# 3p
from mock import patch
from nose.plugins.attrib import attr
import yaml
# project
from aggregator import MetricsAggregator
from dogstatsd import Server
from jmxfetch import JMXFetch
from tests.checks.common... |
from django.http import HttpResponse
from django.shortcuts import render
from django.template import RequestContext
from django.template.base import Template
from django.views.generic import DetailView
from cms.test_utils.project.placeholderapp.models import (
Example1, MultilingualExample1, CharPksExample)
from cm... |
#-------------------------------------------------------------------------------
# elftools example: dwarf_location_lists.py
#
# Examine DIE entries which have location list values, and decode these
# location lists.
#
# Eli Bendersky (<EMAIL>)
# This code is in the public domain
#--------------------------------------... |
"""Tests the RPC Framework Core's implementation of the Base interface."""
import logging
import random
import time
import unittest
from grpc.framework.core import implementations
from grpc.framework.interfaces.base import utilities
from grpc_test.framework.common import test_constants
from grpc_test.framework.interf... |
from django.template.defaultfilters import default
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class DefaultTests(SimpleTestCase):
"""
Literal string arguments to the default filter are always treated as
safe strings, regardless of the au... |
import os
import sys
import time
import yum
import re
import errno
from yum import Errors
from optparse import OptionParser
from distutils import version
YUM_PID_FILE='/var/run/yum.pid'
YUM_VER = version.StrictVersion(yum.__version__)
YUM_MAJOR = YUM_VER.version[0]
if YUM_MAJOR > 3 or YUM_MAJOR < 2:
print >> sys.... |
def test_class():
class X:
pass
class <warning descr="Redeclared 'X' defined above without usage">X</warning>:
pass
def test_function():
def foo():
pass
def <warning descr="Redeclared 'foo' defined above without usage">foo</warning>():
pass
# Top-level variable test
... |
import unittest
from sail_sms import SMSImporter, SMSParser
class SMSImporterTest(unittest.TestCase):
def setUp(self):
parser = SMSParser("assets/samples.xml")
self.sms_list = parser.get_all_sms_in_sf_format()
self.importer = SMSImporter("assets/test_commhistory.db")
def tearDown(sel... |
import ee
import csv
import StringIO
from datetime import datetime
from flask import Blueprint, jsonify, abort, request, make_response
from flask_cors import cross_origin
from app import EE_CREDENTIALS, cache, app
from app.gzipped import gzipped
mod = Blueprint('chirps', __name__, url_prefix='/chirps')
def accumulate... |
from __future__ import absolute_import
import re
from twisted.internet import reactor, error
from twisted.internet.defer import Deferred, DeferredList, maybeDeferred
from twisted.python import failure
from twisted.trial import unittest
from scrapy.downloadermiddlewares.robotstxt import (RobotsTxtMiddleware,
... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import glob
import imp
import inspect
import os
import os.path
import sys
from collections import defaultdict
from ansible import constants as C
try:
from __main__ import display
except ImportError:
from ansible.utils.dis... |
import gdb
import string
from linux import utils
class LxDmesg(gdb.Command):
"""Print Linux kernel log buffer."""
def __init__(self):
super(LxDmesg, self).__init__("lx-dmesg", gdb.COMMAND_DATA)
def invoke(self, arg, from_tty):
log_buf_addr = int(str(gdb.parse_and_eval("log_buf")).split(... |
from typing import Any, Dict, List, Tuple
import random
import time
import unittest
from otns.cli import OTNS
from silk.tools.otns_manager import OtnsManager
from silk.unit_tests.mock_device import MockThreadDevBoard
from silk.unit_tests.testcase import SilkTestCase
class OTNSIntegrationTest(SilkTestCase):
"""S... |
"""Unit tests for fix_encoding.py."""
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import fix_encoding
class FixEncodingTest(unittest.TestCase):
# Nice mix of latin, hebrew, arabic and chinese. Doesn't mean anything.
text = u'Héllô 偉大 سيد'... |
"""
Authoritative resolvers.
"""
import os
import time
from twisted.names import dns, error
from twisted.internet import defer
from twisted.python import failure
from twisted.python.compat import execfile
import common
def getSerial(filename = '/tmp/twisted-names.serial'):
"""Return a monotonically increasing (... |
from __future__ import unicode_literals
from django.apps.registry import Apps
from django.db import models
from django.db.utils import DatabaseError
from django.utils.encoding import python_2_unicode_compatible
from django.utils.timezone import now
from .exceptions import MigrationSchemaMissing
class MigrationRecor... |
"""Power state is the state we get by calling virt driver on a particular
domain. The hypervisor is always considered the authority on the status
of a particular VM, and the power_state in the DB should be viewed as a
snapshot of the VMs's state in the (recent) past. It can be periodically
updated, and should also be u... |
import re
import six
import time
import pytz
import string
import operator
import humanize
from holster.enum import Enum
from holster.emitter import Priority
from datetime import datetime
from collections import defaultdict
from disco.bot import CommandLevels
from disco.types.base import UNSET, cached_property
from d... |
from ansiblelint import AnsibleLintRule
format = "{}"
class RoleRelativePath(AnsibleLintRule):
id = 'E201'
shortdesc = "Doesn't need a relative path in role"
description = ''
tags = ['role']
def matchplay(self, file, play):
# assume if 'roles' in path, inside a role.
if 'roles' n... |
"""
.. todo::
WRITEME
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import numpy as np
from theano.compat.six.moves import xrange
from ... |
{
'name': 'Margins in Sales Orders',
'version':'1.0',
'category' : 'Sales Management',
'description': """
This module adds the 'Margin' on sales order.
=============================================
This gives the profitability by calculating the difference between the Unit
Price and Cost Price.
"""... |
from spack import *
import os
class Memkind(AutotoolsPackage):
"""The memkind library is a user extensible heap manager built on top of
jemalloc which enables control of memory characteristics and a partitioning
of the heap between kinds of memory. The kinds of memory are defined by
operating system m... |
from osv import osv, fields
from tools.translate import _
import netsvc
import logging
_logger = logging.getLogger(__name__)
class wizard_ticket_deposit(osv.osv_memory):
_name = 'wizard.ticket.deposit'
_columns = {
'name':fields.char('Ticket deposited number', size=30),
'bank_acco... |
"""Provides a seam for transaction services."""
from __future__ import absolute_import # pylint: disable=import-only-modules
from __future__ import unicode_literals # pylint: disable=import-only-modules
from google.appengine.ext import ndb
def run_in_transaction(fn, *args, **kwargs):
"""Runs a function in a t... |
import logging
import subprocess
import time
from autotest.client.shared import error
from autotest.client.shared import utils
from autotest.client.shared import ssh_key
from virttest import virsh, utils_misc
from virttest.utils_test import libvirt as utlv
def get_page_size():
"""
Get the current memory page ... |
from gammalib import *
from math import *
# ====================== #
# Test Gaussian gradient #
# ====================== #
def gauss(dir, sigma):
"""
Test Gaussian gradient.
"""
# Compute derivative
dh = 0.0001
s = GSkyDir()
e = GEnergy()
t = GTime()
f1 = GModelSpatialRadialGaus... |
"""
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import re
import warnings
from django.conf import settings
from django.db import utils
from django.db.backends import utils ... |
"""Tests for tensorflow.python.framework.errors."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import warnings
import tensorflow as tf
from tensorflow.core.lib.core import error_codes_pb2
class ErrorsTest(tf.test.TestCase):
def testUniqueClassForE... |
__all__ = ['ExplorerTableElementWdg', 'ExplorerElementWdg']
from pyasm.common import TacticException, Common
from pyasm.biz import Project
from pyasm.web import Widget
from pyasm.widget import IconWdg
from tactic.ui.common import BaseTableElementWdg
from tactic.ui.widget import IconButtonWdg
class ExplorerElementWd... |
"""Support for getting information from Arduino pins."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components import arduino
from homeassistant.const import CONF_NAME
from homeassistant.helpers.entity import Entity
import homeassistant.helpe... |
from __future__ import print_function
import os
import re
from setuptools import setup
package_name = "pyensembl"
current_directory = os.path.dirname(__file__)
readme_filename = 'README.md'
readme_path = os.path.join(current_directory, readme_filename)
github_url = "https://github.com/openvax/%s" % package_name
try:... |
import math
import os
from metrics import power
from telemetry import benchmark
from telemetry.page import page_set
from telemetry.page import page_test
from telemetry.value import scalar
class _DromaeoMeasurement(page_test.PageTest):
def __init__(self):
super(_DromaeoMeasurement, self).__init__()
self._po... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import difflib
import json
import sys
from copy import deepcopy
from ansible import constants as C
from ansible.module_utils.common._collections_compat import MutableMapping
from ansible.module_utils.six import PY3
from ansible.m... |
from __future__ import absolute_import
from . import Section
import subprocess
from .Ffs import SectionSuffix
import Common.LongFilePathOs as os
from .GenFdsGlobalVariable import GenFdsGlobalVariable
from .GenFdsGlobalVariable import FindExtendTool
from CommonDataClass.FdfClass import GuidSectionClassObject
imp... |
#._cv_part guppy.sets
from setsc import BitSet # base bitset type
from setsc import ImmBitSet # immutable bitset type
from setsc import immbit # immutable bitset singleton constructor
from setsc import immbitrange # immutable bitset range constructor
from setsc import immbitset # immutable bitset constructor
from sets... |
raise Exception("XERROR proposal not available")
from nupic.math.dist import *
class Proposal(object):
# Must support the following methods:
# sample, logForward, logBackward = propose(currentValue, randomNumberGenerator)
# None = adapt(accepted)
def adapt(self, accepted):
pass
class RangeWrapper(Propos... |
import wx
from grid_plotter_base import grid_plotter_base
from OpenGL import GL
import common
import numpy
LEGEND_TEXT_FONT_SIZE = 8
LEGEND_BOX_PADDING = 3
MIN_PADDING = 0, 0, 0, 70 #top, right, bottom, left
#constants for the waveform storage
SAMPLES_KEY = 'samples'
COLOR_SPEC_KEY = 'color_spec'
MARKERY_KEY = 'marker... |
from json import loads, dumps
from itertools import chain
import toredis
from tornado.web import authenticated
from tornado.websocket import WebSocketHandler
from tornado.gen import engine, Task
from qiita_core.qiita_settings import r_client
from qiita_pet.handlers.base_handlers import BaseHandler
from qiita_db.artif... |
"""AES symmetric cipher
AES `(Advanced Encryption Standard)`__ is a symmetric block cipher standardized
by NIST_ . It has a fixed data block size of 16 bytes.
Its keys can be 128, 192, or 256 bits long.
AES is very fast and secure, and it is the de facto standard for symmetric
encryption.
As an example, encryption c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.