code stringlengths 1 199k |
|---|
"""Tests for manipulating Conductors via the DB API"""
import datetime
import mock
from oslo_utils import timeutils
from ironic.common import exception
from ironic.tests.db import base
from ironic.tests.db import utils
class DbConductorTestCase(base.DbTestCase):
def test_register_conductor_existing_fails(self):
... |
from __future__ import absolute_import
from openpyxl.xml.constants import CHART_NS
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors.excel import Relation
class ChartRelation(Serialisable):
tagname = "chart"
namespace = CHART_NS
id = Relation()
def __init__(self, id):
... |
"""Constants for ebus component."""
from homeassistant.const import (
ENERGY_KILO_WATT_HOUR,
PRESSURE_BAR,
TEMP_CELSIUS,
TIME_SECONDS,
)
DOMAIN = "ebusd"
SENSOR_TYPES = {
"700": {
"ActualFlowTemperatureDesired": [
"Hc1ActualFlowTempDesired",
TEMP_CELSIUS,
... |
import random
from oslo.serialization import jsonutils
from oslo.utils import timeutils
from neutron.common import constants
from neutron.common import exceptions
from neutron import context
from neutron.db import external_net_db
from neutron.db import l3_db
from neutron.db import models_v2
from neutron.extensions impo... |
"""Functional test for learning rate decay."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
from absl.testing import parameterized
from tensorflow.python.eager import backprop
from tensorflow.python.eager import context
from tensorflow.python.e... |
'''
Created on
@author: Mark
'''
import numpy as np
import string
import scipy.linalg
from scipy.spatial.distance import euclidean
import matplotlib.pyplot as plt
def readIn(name):
return np.fromfile(name, np.float64, sep=' ').reshape((-1, 3))
def dataSet(d):
def f(x):
x1, x2 = x[0], x[1]
return [1, x1, x2,... |
from nova import db
from nova import ipv6
def get_ipam_lib(net_man):
return QuantumNovaIPAMLib(net_man)
class QuantumNovaIPAMLib(object):
"""Implements Quantum IP Address Management (IPAM) interface
using the local Nova database. This implementation is inline
with how IPAM is used by other Networ... |
import requests
from datetime import datetime
from lib.base import API_HOST
def GetScanExecutions(config, scan_id):
"""
The template class for
Returns: An blank Dict.
Raises:
ValueError: On lack of key in config.
"""
results = {}
url = "https://{}/api/scan/v1/scans/{}".format(API_HOST,
... |
import time
import cv2
class Screen(object):
last_update = 0
def on_frame_read(self, context):
cv2.imshow('IkaLog', cv2.resize(
context['engine']['frame'], self.video_size))
def on_frame_next(self, context):
r = None
if (self.wait_ms == 0):
now = time.time()
... |
r"""Convert raw COCO dataset to TFRecord for object_detection.
Please note that this tool creates sharded output files.
Example usage:
python create_coco_tf_record.py --logtostderr \
--train_image_dir="${TRAIN_IMAGE_DIR}" \
--val_image_dir="${VAL_IMAGE_DIR}" \
--test_image_dir="${TEST_IMAGE_DIR}" ... |
"""
Management class for host-related functions (start, reboot, etc).
"""
from nova import exception
from nova.openstack.common import log as logging
from nova.virt.vmwareapi import vim_util
from nova.virt.vmwareapi import vm_util
LOG = logging.getLogger(__name__)
class Host(object):
"""
Implements host related... |
"""Tests for email output plugin."""
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import email_alerts
from grr.lib import flags
from grr.lib import test_lib
from grr.lib import utils
from grr.lib.output_plugins import email_plugin
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.r... |
"""
Why our own memcache client?
By Michael Barton
python-memcached doesn't use consistent hashing, so adding or
removing a memcache server from the pool invalidates a huge
percentage of cached items.
If you keep a pool of python-memcached client objects, each client
object has its own connection to every memcached ser... |
alice_name = "Alice"
alice_age = 20
alice_is_drinking = True
bob_name = "Bob"
bob_age = 12
bob_is_drinking = False
charles_name = "Charles"
charles_age = 22
charles_is_drinking = True |
import pandas as pd
import numpy as np
import statsmodels.api as sm
import math
def initialize(context):
use_beta_hedging = True # Set to False to trade unhedged
# Initialize a universe of liquid assets
schedule_function(buy_assets,
date_rule=date_rules.month_start(),
... |
from __future__ import absolute_import
from __future__ import division
"""Manage Excel date weirdness."""
import datetime
from datetime import timedelta, tzinfo
from math import isnan
import re
from jdcal import (
gcal2jd,
jd2gcal,
MJD_0
)
MAC_EPOCH = datetime.date(1904, 1, 1)
WINDOWS_EPOCH = datetime.date(... |
"""
This code wraps the vendored appdirs module to so the return values are
compatible for the current pip code base.
The intention is to rewrite current usages gradually, keeping the tests pass,
and eventually drop this after all usages are changed.
"""
import os
from typing import List
from pip._vendor import appdirs... |
"""
Persistent caching FUSE filesystem
Copyright 2012 Jonny Tyers
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 a... |
import re
import logging
from streamlink.plugin import Plugin
from streamlink.plugin.api import useragents
from streamlink.plugin.api.utils import itertags
from streamlink.stream import HLSStream
from streamlink.utils import parse_json
from streamlink.compat import urlparse, parse_qsl
from streamlink.utils.times import... |
from __future__ import unicode_literals
from mezzanine.utils.cache import (cache_key_prefix, cache_installed,
cache_get, cache_set)
DEPRECATED = {
"PAGES_MENU_SHOW_ALL": True
}
class TemplateSettings(dict):
"""
Dict wrapper for template settings. This exists only to warn w... |
import unittest
from webkitpy.common.unified_diff import unified_diff
class TestUnifiedDiff(unittest.TestCase):
def test_unified_diff(self):
self.assertEqual(
unified_diff('foo\n', 'bar\n', 'exp.txt', 'act.txt'),
'--- exp.txt\n+++ act.txt\n@@ -1 +1 @@\n-foo\n+bar\n')
def test_uni... |
import random
from olympia.addons.models import Review
from olympia.users.models import UserProfile
def generate_ratings(addon, num):
"""Given an `addon`, generate `num` random ratings."""
for n in range(1, num + 1):
email = 'testuser{n}@example.com'.format(n=n)
user, _created = UserProfile.obje... |
import networkx as nx
__author__ = """\n""".join(['Ben Edwards',
'Aric Hagberg <hagberg@lanl.gov>'])
__all__ = ['rich_club_coefficient']
def rich_club_coefficient(G, normalized=True, Q=100):
"""Return the rich-club coefficient of the graph G.
The rich-club coefficient is the ratio, f... |
import os
import sys
from zipimport import zipimporter
from django.utils import unittest
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
class DefaultLoader(unittest.TestCase):
def test_loader(self):
"Normal module existence can be tested"
... |
from django.db.models import Model
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
class ObjectPermissionBackend(object):
def has_perm(self, user_obj, perm, obj=None):
if user_obj and user_obj.is_superuser:
return True
elif obj... |
from fparser import api
def test_reproduce_issue():
source_str = '''\
subroutine bndfp()
include "events.ins"
end
'''
tree = api.parse(source_str, isfree=False, isstrict=False,
ignore_comments=False)
print tree
return
assert str(tree).strip().split('\n')[1:]=='... |
from __future__ import absolute_import
import six
from django.core.urlresolvers import reverse
from sentry.testutils import APITestCase
class UserOrganizationsTest(APITestCase):
def test_simple(self):
user = self.create_user(email="a@example.com")
org = self.create_organization(name="foo")
s... |
import sys
import subprocess
from pipsi import IS_WIN
def test_create_env(tmpdir):
subprocess.check_call([
sys.executable, 'get-pipsi.py',
str(tmpdir.join('venv')),
str(tmpdir.join('test_bin')),
'.'
])
if IS_WIN:
subprocess.check_call([
str(tmpdir.join('te... |
import sys
import math
import numpy as np
import theano
import theano.tensor as T
from cnn4nlp import (WordEmbeddingLayer,
ConvFoldingPoolLayer)
from logreg import LogisticRegression
rng = np.random.RandomState(1234)
EMB_DIM = 6
x = T.imatrix('x') # the vector of word indices
l1 = WordEmbeddingLaye... |
"""
Test suite for pptx.text.text module
"""
from __future__ import absolute_import, print_function
import pytest
from pptx.compat import is_unicode
from pptx.dml.color import ColorFormat
from pptx.dml.fill import FillFormat
from pptx.enum.text import MSO_ANCHOR, MSO_AUTO_SIZE, MSO_UNDERLINE, PP_ALIGN
from pptx.opc.con... |
import torchfile
import argparse
import torch
from torch.nn.parameter import Parameter
import numpy as np
import models.crnn as crnn
layer_map = {
'SpatialConvolution': 'Conv2d',
'SpatialBatchNormalization': 'BatchNorm2d',
'ReLU': 'ReLU',
'SpatialMaxPooling': 'MaxPool2d',
'SpatialAveragePooling': 'A... |
import uuid
from openstack.network.v2 import security_group
from openstack.tests.functional import base
class TestSecurityGroup(base.BaseFunctionalTest):
NAME = uuid.uuid4().hex
ID = None
@classmethod
def setUpClass(cls):
super(TestSecurityGroup, cls).setUpClass()
sot = cls.conn.network.... |
import sys
if sys.version_info < (3, 7):
from ._values import ValuesValidator
from ._templateitemname import TemplateitemnameValidator
from ._pattern import PatternValidator
from ._name import NameValidator
from ._enabled import EnabledValidator
from ._dvalue import DvalueValidator
from ._bo... |
"""
Coordination geometry files.
""" |
from pythonforandroid.recipe import PythonRecipe
class OmemoRecipe(PythonRecipe):
name = 'omemo'
version = '0.11.0'
url = 'https://pypi.python.org/packages/source/O/OMEMO/OMEMO-{version}.tar.gz'
site_packages_name = 'omemo'
depends = [
'setuptools',
'x3dh',
'cryptography',
... |
"""
tests.test_component_logbook
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the logbook component.
"""
import unittest
from datetime import timedelta
import homeassistant as ha
from homeassistant.const import (
EVENT_STATE_CHANGED, EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP)
import homeassistant.util.dt as dt_util... |
def grade(arg, key):
if "flag{y0u_l34k3d_m3!}".lower() == key.lower():
return True, "Infoleaks are the gateway to further exploitation."
else:
return False, "How can you make the program behave in a way not " \
"intended by the programmer?" |
"""
EasyBuild support for building and installing a Pythonpackage independend of a python version as an easyblock.
This easyblock is deprecated, and is replaced by VersionIndependentPythonPackage (fixes a typo in the class name).
@author: Kenneth Hoste, Jens Timmerman (Ghent University)
"""
from easybuild.easyblocks.ge... |
import sys
import regex
import os
from stat import *
err = sys.stderr.write
dbg = err
rep = sys.stdout.write
def main():
bad = 0
if not sys.argv[1:]: # No arguments
err('usage: ' + sys.argv[0] + ' file-or-directory ...\n')
sys.exit(2)
for arg in sys.argv[1:]:
if os.path.isdir(arg):
... |
"""
***************************************************************************
__init__.py
---------------------
Date : January 2016
Copyright : (C) 2016 by Matthias Kuhn
Email : matthias@opengis.ch
**********************************************************... |
import angr
import claripy
import sys
def main(argv):
path_to_binary = argv[1]
project = angr.Project(path_to_binary)
# Since Angr can handle the initial call to scanf, we can start from the
# beginning.
initial_state = project.factory.entry_state()
# Hook the address of where check_equals_ is called.
# (... |
import contextlib
import logging
import os
from unittest import mock
import fixtures
from testtools.matchers import HasLength
import snapcraft
from snapcraft import (
storeapi,
tests
)
from snapcraft.plugins import kernel
class KernelPluginTestCase(tests.TestCase):
def setUp(self):
super().setUp()
... |
DOCUMENTATION = '''
---
module: irc
version_added: "1.2"
short_description: Send a message to an IRC channel
description:
- Send a message to an IRC channel. This is a very simplistic implementation.
options:
server:
description:
- IRC server name/address
required: false
default: localhost
port... |
from django.contrib.auth.models import User
from tastypie.resources import ModelResource
from tastypie.throttle import BaseThrottle
class UserResource(ModelResource):
"""User Model
**Read**:
CURL Usage::
curl -u username:password -H 'Accept: application/json' http://localhost:8000/api/v1/use... |
{
'name': 'CAMT Format Bank Statements Import',
'version': '8.0.0.4.0',
'license': 'AGPL-3',
'author': 'Odoo Community Association (OCA), Therp BV',
'website': 'https://github.com/OCA/bank-statement-import',
'category': 'Banking addons',
'depends': [
'account_bank_statement_import',
... |
"""
Plinth module for Minetest server.
"""
import augeas
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.me... |
import hr_attendance_importer
import wizard
import res_company
import res_config |
from openerp import tools
from openerp.osv import fields, osv
class sale_report(osv.osv):
_name = "sale.report"
_description = "Sales Orders Statistics"
_auto = False
_rec_name = 'date'
_columns = {
'date': fields.datetime('Date Order', readonly=True), # TDE FIXME master: rename into date_o... |
from . import model |
import os
print(os.__doc__) |
source("../../shared/qtcreator.py")
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
createProject_Qt_GUI(tempDir(), "DesignerTestApp")
selectFromLocator("mainwindow.ui")
widgetIndex = "{container=':qdesigner_internal::WidgetBoxCategoryListV... |
import sys
import gzip
import struct
import socket
import argparse
import StringIO
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import IP, TCP, conf
from monitor import QuantumTip, TIP_LEN, TIP_STRUCT
PAYLOAD_BANG = "BANG! BANG! BANG! BANG! BANG! BANG!\r\n" * 8
def create_200... |
import logging
import os
import re
from pylib import constants
from pylib import pexpect
from pylib.base import base_test_result
from pylib.base import base_test_runner
from pylib.device import device_errors
from pylib.perf import perf_control
def _TestSuiteRequiresMockTestServer(suite_name):
"""Returns True if the t... |
"""Test KNX switch."""
from unittest.mock import patch
from homeassistant.components.knx.const import (
CONF_RESPOND_TO_READ,
CONF_STATE_ADDRESS,
KNX_ADDRESS,
)
from homeassistant.components.knx.schema import SwitchSchema
from homeassistant.const import CONF_NAME, STATE_OFF, STATE_ON
from homeassistant.core... |
import firenado.core
class IndexHandler(firenado.core.TornadoHandler):
def get(self):
self.render('index.html')
class StreamHandler(firenado.core.TornadoHandler):
def get(self):
self.render('stream.html') |
import re
import os
import sys
import tempfile
def fetch_server_certificate (host, port):
def subproc(cmd):
from subprocess import Popen, PIPE, STDOUT
proc = Popen(cmd, stdout=PIPE, stderr=STDOUT, shell=True)
status = proc.wait()
output = proc.stdout.read()
return status, out... |
import json
from ducktape.mark import parametrize
from ducktape.tests.test import Test
from kafkatest.services.kafka import KafkaService
from kafkatest.services.trogdor.produce_bench_workload import ProduceBenchWorkloadService, ProduceBenchWorkloadSpec
from kafkatest.services.trogdor.consume_bench_workload import Consu... |
"""Tests for `tf.data.experimental.sleep()`."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
from tensorflow.python.data.experimental.ops import sleep
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.data.ops imp... |
from unittest import TestCase
from project_generator_definitions.definitions import ProGenTargets
from project_generator_definitions.target.targets import PROGENDEF_TARGETS
class TestAllTargets(TestCase):
"""test all targets"""
def setUp(self):
self.progen_target = ProGenTargets()
self.targets_l... |
import unittest
import pytest
class ConnectionTests(unittest.TestCase):
@pytest.mark.ignore_firefox
def testWeCanSeeTheBrowserIsOnline(self):
self._loadPage('html5Page')
self.assertTrue(self.driver.is_online())
def _pageURL(self, name):
return "http://localhost:%d/%s.html" % (self.we... |
'''
New Integration Test for testing deleting l2
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.header.vm as vm_header
import zstackwoodpecker.operations.resource_operations as res_op... |
import mock
from oslo_serialization import jsonutils
from nova import objects
from nova.tests.unit.objects import test_objects
fake_net_interface_meta = objects.NetworkInterfaceMetadata(
mac='52:54:00:f6:35:8f',
tags=['mytag1'],
bus=obj... |
'''
Cleanup all VIPs.
@author: Youyk
'''
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.config_operations as con_ops
import zstackwoodpecker.operations.net_operations as net_ops
import zstackwoodpecker.operations.account_operations as acc_ops
import zstackwoodpecker... |
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server import util
class TapiTopologyGetnodedetailsInput(Model):
"""NOTE: This class is auto generated by OpenAPI Generator ... |
"""Publish message to SQS queue"""
import warnings
from typing import TYPE_CHECKING, Optional, Sequence
from airflow.models import BaseOperator
from airflow.providers.amazon.aws.hooks.sqs import SqsHook
if TYPE_CHECKING:
from airflow.utils.context import Context
class SqsPublishOperator(BaseOperator):
"""
P... |
"""Functional tests for SpaceToBatch and BatchToSpace ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
class SpaceToBatchTest(tf.test.TestCase):
"""Tests input-output pairs for the SpaceToBatch and BatchToSp... |
DEFAULT_SCRIPT = "DFLT"
SCRIPT_EXCEPTIONS = {
"Hira": "kana",
"Hrkt": "kana",
"Laoo": "lao ",
"Yiii": "yi ",
"Nkoo": "nko ",
"Vaii": "vai ",
"Zinh": DEFAULT_SCRIPT,
"Zyyy": DEFAULT_SCRIPT,
"Zzzz": DEFAULT_SCRIPT,
}
NEW_SCRIPT_TAGS = {
"Beng": ("bng2",),
"Deva": ("dev2",),
... |
"""Filters for Google Cloud Bigtable Row classes."""
from google.cloud._helpers import _microseconds_from_datetime
from google.cloud._helpers import _to_bytes
from google.cloud.bigtable_v2.proto import data_pb2 as data_v2_pb2
class RowFilter(object):
"""Basic filter to apply to cells in a row.
These values can ... |
import unittest
import simulation_cancellation
import util
class TestMultiGetSimulation(unittest.TestCase):
def setUp(self):
simulation_cancellation.CANCELLATION = True
self.simulation = simulation_cancellation.Simulation(5, "", 0.9,
util.... |
"""This code example gets all suggested ad units.
To approve suggested ad units, run approve_suggested_ad_units.py. This feature
is only available to DFP premium solution networks.
"""
from googleads import dfp
def main(client):
# Initialize appropriate service.
suggested_ad_unit_service = client.GetService(
... |
import textwrap
from django.core.management.base import NoArgsCommand
from django.utils.termcolors import make_style
from ...check import get_check
from ...conf import conf
class Command(NoArgsCommand):
def handle_noargs(self, **options):
verbosity = int(options.get("verbosity"))
self.style.SUCCESS ... |
from __future__ import absolute_import, division, print_function
from logging import getLogger, basicConfig
basicConfig()
logger = getLogger("glue") |
from rpy2.robjects.packages import importr
import os
import numpy as np
from scipy.stats import norm as ndist
from selection.covtest import reduced_covtest, covtest
from selection.affine import constraints, gibbs_test
from selection.forward_step import forward_stepwise
n, p, sigma = 50, 80, 1.
from multi_forward_step i... |
def transform_scalars(dataset, shift=[0, 0, 0]):
from tomviz import utils
import numpy as np
data_py = utils.get_array(dataset) # Get data as numpy array.
if data_py is None: #Check if data exists
raise RuntimeError("No data array found!")
data_py[:] = np.roll(data_py, shift[0], axis=0)
... |
from pylab import *
from numpy import *
from itertools import *
def generate_toy_data(n_train=100, mean_a=asarray([0, 0]), std_dev_a=1.0, mean_b=3, std_dev_b=0.5):
# positive examples are distributed normally
X1 = (random.randn(n_train, 2)*std_dev_a+mean_a).T
# negative examples have a "ring"-like form
... |
__usage__ = """
Run:
python return_logical.py [<f2py options>]
Examples:
python return_logical.py --fcompiler=Gnu --no-wrap-functions
python return_logical.py --quiet
"""
import f2py2e
from Numeric import array
try: True
except NameError:
True = 1
False = 0
def build(f2py_opts):
try:
import f7... |
import sys
is_3 = sys.version_info >= (3, 0)
if is_3:
import io
else:
import StringIO
try:
import cStringIO
except ImportError:
cStringIO = None
__all__ = ['jsmin', 'JavascriptMinify']
__version__ = '2.0.3'
def jsmin(js):
"""
returns a minified version of the javascript string
... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Comunidad',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=Fa... |
def can_build(platform):
# should probably change this to only be true on iOS and Android
return True
def configure(env):
pass
def get_doc_classes():
return ["MobileVRInterface"]
def get_doc_path():
return "doc_classes" |
"""
PRE-PROCESSORS
=============================================================================
Preprocessors work on source text before we start doing anything too
complicated.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from . import util
from . import odict
import re
def build... |
import logging
from optparse import make_option
from django.core.management.base import BaseCommand
from projects import tasks
from projects.models import Project
from builds.models import Version
log = logging.getLogger(__name__)
class Command(BaseCommand):
"""Custom management command to rebuild documentation for... |
from __future__ import print_function
print("Hello World!") |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from froide.helper.auth_migration_util import USER_DB_NAME, APP_MODEL, APP_MODEL_NAME
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Profile.private'
db.add_column('a... |
"""
***************************************************************************
lassort.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Martin Isenburg
Email : martin near rapidlasso point com
******************************************... |
from Screens.Screen import Screen
from Components.ActionMap import NumberActionMap
from Components.SystemInfo import SystemInfo
from Components.Label import Label
from Components.config import config
MAX_X = 720
MAX_Y = 576
MAX_W = MAX_X * 3 / 4
MAX_H = MAX_Y * 3 / 4
MIN_W = MAX_X / 8
MIN_H = MAX_Y / 8
def clip(val, mi... |
"""
Support for OpenMPI as toolchain MPI library.
@author: Stijn De Weirdt (Ghent University)
@author: Kenneth Hoste (Ghent University)
"""
from easybuild.tools.toolchain.mpi import Mpi
from easybuild.tools.toolchain.variables import CommandFlagList
TC_CONSTANT_OPENMPI = "OpenMPI"
TC_CONSTANT_MPI_TYPE_OPENMPI = "MPI_TY... |
import unittest, pygame
import shutil, os, sys
from GameEngine import GameEngine
from Song import Song, Note
import Config
import Version
class SongTest(unittest.TestCase):
def testLoading(self):
config = Config.load(Version.PROGRAM_UNIXSTYLE_NAME + ".ini", setAsDefault = True)
e = GameEngine(config)
info... |
MCUREGS = {
'ADCSRB': '&123',
'ADCSRB_ACME': '$40',
'ACSR': '&80',
'ACSR_ACD': '$80',
'ACSR_ACBG': '$40',
'ACSR_ACO': '$20',
'ACSR_ACI': '$10',
'ACSR_ACIE': '$08',
'ACSR_ACIC': '$04',
'ACSR_ACIS': '$03',
'DIDR1': '&127',
'DIDR1_AIN1D': '$02',
'DIDR1_AIN0D': '$01',
'UDR0': '&198',
'UCS... |
from __future__ import absolute_import
import os
import sys
import copy
import codecs
import base64
import io
try:
import gdata.docs.service
except ImportError:
pass
from . import keyczar
from .. import errors
from .. import credentials
from ..py27compat import input, pickle
from ..backend import KeyringBackend... |
import pylab as pl
from numpy import *
from Polymode import *
from Polymode.mathlink import blockarray
air = Material.Air()
pmma = Material.Polymer()
pmma = Material.Fixed(1.49)
symmetry = 6
m0 = 1
wl = 1
Nx = 300,50
sw = 0.4 #Wall width
s1 = 7.4 #Primary scaling parameter: the length of t... |
class SQLParseError(Exception):
pass
class UnclosedQuoteError(SQLParseError):
pass
_PG_IDENTIFIER_TO_DOT_LEVEL = dict(database=1, schema=2, table=3, column=4, role=1, tablespace=1, sequence=3)
_MYSQL_IDENTIFIER_TO_DOT_LEVEL = dict(database=1, table=2, column=3, role=1, vars=1)
def _find_end_quote(identifier, qu... |
"""
:copyright: (c) 2015 by OpenCredo.
:license: GPLv3, see LICENSE for more details.
"""
import logging
log = logging.getLogger(__name__)
USER_EXIT_ENTRY_POINT = 'exits'
class UserExit(object):
"""UserExit API
Subclass PutStub and/or GetResponse to hook custom user code into the
stubo runtime.
... |
try:
import scipy
from scipy import fftpack
except ImportError:
print "Please install SciPy to run this script (http://www.scipy.org/)"
raise SystemExit, 1
try:
from pylab import *
except ImportError:
print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)"
r... |
from Products.CMFCore.utils import getToolByName
from bika.lims.browser import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims.utils import formatDateQuery, formatDateParms, logged_in_client
fr... |
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 field 'VideoCaptionVersion.notification_sent'
db.add_column('videos_videocaptionversion', 'notification_sent', self.gf('django... |
"""
Drivers for san-stored volumes.
The unique thing about a SAN is that we don't expect that we can run the volume
controller on the SAN hardware. We expect to access it over SSH or some API.
"""
import base64
import httplib
import json
import os
import paramiko
import random
import socket
import string
import uuid
f... |
from Child import Child
from Node import Node
DECL_NODES = [
# typealias-declaration -> attributes? access-level-modifier? 'typealias'
# typealias-name generic-parameter-clause?
# typealias-assignment
# typealias-name -> identifier
# typealias-as... |
"""
This file contains the main module code for buck python test programs.
By default, this is the main module for all python_test() rules. However,
rules can also specify their own custom main_module. If you write your own
main module, you can import this module as tools.test.stubs.fbpyunit, to access
any of its cod... |
"""The Extended Ips API extension."""
import itertools
from nova.api.openstack import common
from nova.api.openstack.compute import ips
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api.openstack import xmlutil
from nova.openstack.common import log as logging
LOG = logging.getL... |
from oslo_config import cfg
from rally.common import broker
from rally.common.i18n import _
from rally.common import logging
from rally import consts
from rally import exceptions
from rally import osclients
from rally.plugins.openstack.wrappers import keystone
from rally.task import context
LOG = logging.getLogger(__na... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.