content string |
|---|
#!/usr/bin/python
# ex:set fileencoding=utf-8:
from __future__ import unicode_literals
from django.utils.text import get_valid_filename
from django.utils.timezone import now
from django.utils.encoding import force_text
from django.utils.encoding import smart_str
from djangobmf.conf import settings
import uuid
impor... |
import logging
from .object import ObjectStore
from openpathsampling.netcdfplus.cache import LRUChunkLoadingCache
logger = logging.getLogger(__name__)
init_log = logging.getLogger('openpathsampling.initialization')
class ValueStore(ObjectStore):
"""
Store that stores a value by integer index
Usually us... |
import abc
import ast
import base64
import csv
import json
import re
import six
from six.moves.configparser import SafeConfigParser
import yaml
from trove.common import utils as trove_utils
class StringConverter(object):
"""A passthrough string-to-object converter.
"""
def __init__(self, object_mapping... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class InitializeOAuth(Choreography):
def __init__(self, temboo_session):
"""
Create... |
"""A client for OWL-sourced identifier mappings."""
import json
import os
import pickle
from collections import defaultdict
from operator import itemgetter
from typing import Any, Collection, Mapping, TYPE_CHECKING
from tqdm import tqdm
from indra.databases.obo_client import OntologyClient, prune_empty_entries
from ... |
import argparse
import logging
from cliff import lister
from cliff import show
from quantumclient.common import exceptions
from quantumclient.common import utils
from quantumclient.quantum import v2_0 as quantumv20
from quantumclient.quantum.v2_0 import QuantumCommand
def get_tenant_id(tenant_id, client):
retur... |
"""
Created on 30 Apr 2018
@author: Bruno Beloff (<EMAIL>)
"""
import time
from collections import OrderedDict
from multiprocessing import Manager
from scs_core.sync.interval_timer import IntervalTimer
from scs_core.sync.synchronised_process import SynchronisedProcess
from scs_dfe.led.led_state import LEDState
#... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import functools
import os
import unittest
from contextlib import contextmanager
from pants.backend.jvm.targets.jar_library import JarLibrary
from pants.backend.jvm.t... |
"""The tests for the Weather component."""
import unittest
from homeassistant.components import weather
from homeassistant.components.weather import (
ATTR_WEATHER_ATTRIBUTION, ATTR_WEATHER_HUMIDITY, ATTR_WEATHER_OZONE,
ATTR_WEATHER_PRESSURE, ATTR_WEATHER_TEMPERATURE, ATTR_WEATHER_WIND_BEARING,
ATTR_WEATHE... |
"""Select2 field implementation module."""
from django.forms import ChoiceField
class Select2ListChoiceField(ChoiceField):
"""Allows a list of values to be used with a ChoiceField.
Avoids unusual things that can happen if Select2ListView is used for
a form where the text and value for choices are not th... |
import warnings
from django.conf.urls import include, patterns, url
from django.utils.deprecation import RemovedInDjango110Warning
from .views import (
absolute_kwargs_view, defaults_view, empty_view, empty_view_partial,
empty_view_wrapped, nested_view,
)
other_patterns = [
url(r'non_path_include/$', emp... |
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.contrib.contenttypes.admin import GenericStackedInline
from django.forms.models import ModelForm
from reversion.admin import VersionAdmin
from apps.feedback.models import (Choice, Feedback, FeedbackRelation, MultipleChoiceQuestion,
... |
# -*- coding: utf-8 -*-
"""
Defines the unit tests for the :mod:`colour.models.rgb.ycocg` module.
"""
import numpy as np
import unittest
from itertools import permutations
from colour.models.rgb import RGB_to_YCoCg, YCoCg_to_RGB
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
__copy... |
#! /usr/bin/python
#
# Import Packages
#
import pandas as pd
import twython as tw
working_dir = "/Users/tim/data/"
authKeys = pd.read_csv( "/Users/tim/data/auth/twitter-HRP.csv", header=0)
authKeys = pd.read_csv( "/Users/tim/data/auth/rtweet-HRP.csv", header=0)
conkey = authKeys.iloc[0,0]
consec = authKeys.iloc[0,1]
... |
# -*- coding: utf-8 -*-
from openerp import http
from openerp.tools.translate import _
class UITranslationControler(http.Controller):
@http.route('/web/ui_translation/get_translate_wizard', type='json', auth='user')
def get_translate_wizard(self, request, **context):
model = context.get('model', Fals... |
import os
import subprocess
from nose.tools import with_setup, raises
from sumoSNMP.sumo import Sumo
DEVNULL = open(os.devnull, 'wb')
def setup_sumo():
subprocess.Popen(["sumo", "-c", "tests/fixtures/hello.sumo.cfg"],
stderr=DEVNULL, stdout=DEVNULL)
@with_setup(setup_sumo)
def test_get_vehicles():
... |
# -*- coding: utf-8 -*-
"""Easily use fixtures in Django 1.7+ data migrations."""
# :copyright: (c) 2015 Alex Hayes and individual contributors,
# All rights reserved.
# :license: MIT License, see LICENSE for more details.
from collections import namedtuple
version_info_t = namedtuple(
'version_... |
from xodb import geoprint
portland = (7.0625, -95.677068) # near the rain
london = (51.500152, -0.126236) # near the prime meridian
quito = (-0.220862, -78.510439) # near the equator
barrow = (74.295556, -156.766389) # high lattitude
mcmurdo = (-75.85, 166.666667) # near the penguins
phash = geoprint.en... |
from __future__ import unicode_literals, absolute_import
from operator import attrgetter
from flask import render_template
from markupsafe import Markup
from indico.core import signals
from indico.util.signals import named_objects_from_signal
from indico.util.struct.iterables import group_list
from indico.util.strin... |
from traits.api import Int, Bool
from traitsui.api import View, Item, ListEditor, InstanceEditor
# ============= standard library imports ========================
import time
# ============= local library imports ==========================
from pychron.managers.manager import Manager
class GaugeManager(Manager):
... |
__license__ = 'GPL v3'
__copyright__ = '2010, Timothy Legge <timlegge at gmail.com>'
'''
'''
import os
import time
from calibre.devices.usbms.books import Book as Book_
class Book(Book_):
def __init__(self, prefix, lpath, title, authors, mime, date, ContentType,
thumbnail_name, size=None, oth... |
from os.path import join
import os
import numpy as n
import glob
import sys
import time
import astropy.io.fits as fits
env = os.environ['SDSSDR12_DIR']
path_2_file = join(env, "catalogs", "specObj-dr12.fits")
data = fits.open(path_2_file)[1].data
selection = (data['ZWARNING']==0) & (data['CLASS']=="GALAXY") & (data... |
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])
from clang.cindex import LinkageKind
from clang.cindex import Cursor
from clang.cindex import TranslationUnit
from .util import get_cursor
from .util import get_tu
import uni... |
#!/usr/bin/env python
import os
import glob
import subprocess as sp
import argparse
import sys
from collections import defaultdict
from itertools import chain
import nose
from conda_build.metadata import MetaData
from toposort import toposort_flatten
PYTHON_VERSIONS = ["27", "34", "35"]
CONDA_NPY = "110"
CONDA_PERL ... |
# -*- coding: utf-8 -*-
"""
Python-Deprecated
=================
Python ``@deprecated`` decorator to deprecate old python classes, functions or methods.
"""
import functools
import inspect
import warnings
#: Module Version Number, see `PEP 396 <https://www.python.org/dev/peps/pep-0396/>`_.
__version__ = "1.1.0"
stri... |
import numpy as np
class Layer(object):
"""Interface defining a layer."""
def getSize(self):
"""Returns the length of the output (ie. quantity of neurons)"""
raise NotImplementedError()
def getShape(self):
"""Returns the shape of the output. For a fully connected layer,
t... |
import argparse
import cv2
import numpy as np
class FilterValue(object):
def __init__(self, x, y, z):
super(FilterValue, self).__init__()
self.x = x
self.y = y
self.z = z
def set_x(self, x):
self.x = x
def set_y(self, y):
self.y = y
def set_z(self, z)... |
"""Tests for v1 of the Timesketch API."""
import mock
import json
from timesketch.lib.definitions import HTTP_STATUS_CODE_CREATED
from timesketch.lib.definitions import HTTP_STATUS_CODE_BAD_REQUEST
from timesketch.lib.testlib import BaseTest
from timesketch.lib.testlib import MockDataStore
class SketchListResource... |
# -*- coding: utf-8 -*-
import json
import unittest
from django import VERSION as DJANGO_VERSION
from django.conf import settings
from django.contrib.auth.models import Group, Permission
from django.core import mail
from django.core.management import call_command
from django.test import TestCase, override_settings
fr... |
from __future__ import unicode_literals
from __future__ import print_function
import unittest
import os
from moya import db
from moya.wsgi import WSGIApplication
from moya.console import Console
from moya.context import Context
from moya.context.tools import set_dynamic
class TestProject(unittest.TestCase):
def... |
import base64
import json
from django.test import TestCase
from django.core.urlresolvers import reverse
from lrs import views
from lrs.objects.ActivityManager import ActivityManager
class ActivityTests(TestCase):
@classmethod
def setUpClass(cls):
print "\n%s" % __name__
def setUp(self):
s... |
# Simple use case for connecting CArray API and Blaze
# Byte Providers.
from blaze import Array, dshape
#------------------------------------------------------------------------
# Case
#------------------------------------------------------------------------
# We use the Array object which is immediete in all operat... |
"""
An abstract plotter class which defines a simple format for plotters to conform
to. A plotter takes a dataframe and args dict and produces an image or html.
"""
from abc import ABCMeta, abstractmethod
import collections
from collections import defaultdict
from collections import OrderedDict as odict
import pandas a... |
# Constants for Tradier.com
API_ENDPOINT = {
'developer_sandbox': 'https://sandbox.tradier.com', # /v1/ paths
'brokerage_sandbox': 'https://sandbox.tradier.com', # /v1/ paths, paper trading (has full capabilities of brokerage)
'brokerage': 'https://api.tradier.com', # /v1/ paths
'stream': 'https://stream.tradie... |
#!/usr/bin/env python
"""
Run timing test (GPU) scaled over number of ports.
"""
import csv
import glob
import multiprocessing as mp
import os
import re
import subprocess
import sys
import numpy as np
from neurokernel.tools.misc import get_pids_open
try:
from subprocess import DEVNULL
except ImportError:
i... |
#! /usr/bin/env python
import sqlite3
import sys
import threading
from decimal import InvalidOperation, Decimal
from numbers import Integral
from jmdaemon.protocol import JM_VERSION
from jmbase.support import get_log, joinmarket_alert, DUST_THRESHOLD
log = get_log()
def dict_factory(cursor, row):
d = {}
for... |
"""Knowledge database models."""
import os
from invenio.base.globals import cfg
from invenio.ext.sqlalchemy import db
from invenio.ext.sqlalchemy.utils import session_manager
from invenio.modules.collections.models import Collection
from invenio.utils.text import slugify
from sqlalchemy.event import listens_for
from... |
"""Django-Tables2 config for Occurrence data."""
import django_tables2 as tables
from django_tables2.utils import A
from occurrence.models import CommunityAreaEncounter, TaxonAreaEncounter
class TaxonAreaEncounterTable(tables.Table):
"""TaxonAreaEncounterTable config."""
encounter = tables.LinkColumn(
... |
import os
import sys
import uuid, random
#PYTHON_DIR = join(dirname(__file__), '/opt/ofelia/vt_manager/src/python/')
PYTHON_DIR = os.path.join(os.path.dirname(__file__), "../../..")
# This is needed because wsgi disallows using stdout
sys.stdout = sys.stderr
os.environ['DJANGO_SETTINGS_MODULE'] = 'vt_manager.settin... |
import struct
import configparser
import glob
import os
import shutil
SPECS = {os.path.splitext(os.path.basename(spec_file))[0]: spec_file for spec_file in glob.glob(os.path.join(os.path.dirname(__file__), '*.cfg'))}
EVENT_FORMAT = '@llHHI'
EV_KEY = 0x01
KEY_ACTION = {
'up': 0x00,
'down': 0x01,
'repeat': ... |
##
import argparse
from plotWheels.helical_wheel import helical_wheel
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generate Helical Wheel")
parser.add_argument("--sequence",dest="sequence",type=str)
parser.add_argument("--seqRange",dest="seqRange",type=int,default=1)
parse... |
""" UsedDefChain build used-define chains analysis for each variable. """
from pythran.analyses.imported_ids import ImportedIds
from pythran.analyses.globals_analysis import Globals
from pythran.passmanager import FunctionAnalysis
from pythran.syntax import PythranSyntaxError
import pythran.metadata as md
from iterto... |
from __future__ import unicode_literals
from django import forms
from django.core.exceptions import ValidationError
from django.forms.fields import CharField, EmailField, MultiValueField
from django.utils.translation import ugettext_lazy as _
from .fieldsetup import VerifiedEmailFieldSetup, fieldsetups
from .utils im... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
VariableDistanceBuffer.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************... |
# Various uses of the Notification Originator (TRAP/INFORM)
from pysnmp.entity.rfc3413.oneliner import ntforg
from pysnmp.proto import rfc1902
ntfOrg = ntforg.NotificationOriginator()
# Using
# SNMPv2c
# over IPv4/UDP
# send TRAP notification
# with TRAP ID 'coldStart' specified as a MIB symbol
# ... |
from test_framework.test_framework import BitsendTestFramework
from test_framework.util import *
import threading
class LongpollThread(threading.Thread):
def __init__(self, node):
threading.Thread.__init__(self)
# query current longpollid
templat = node.getblocktemplate()
self.long... |
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from autobahn import wamp
from autobahn.twisted.wamp import ApplicationSession
class Component(ApplicationSession):
"""
An application component that subscribes and receives events,
and stop after having received 5 even... |
import logging
import distbuild
class HelperRequest(object):
def __init__(self, msg):
self.msg = msg
class HelperOutput(object):
def __init__(self, msg):
self.msg = msg
class HelperResult(object):
def __init__(self, msg):
self.msg = msg
class HelperRouter(distbuild.StateM... |
import argparse
import os
import shutil
import sys
import tempfile
import traceback
import textwrap
SUPPORTED_OS = ('linux', 'windows',)
SUPPORTED_ARCH = ('x86', 'amd64',)
def main(args=None):
arg_parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=textwrap.dedent... |
## index for labels
import os
path = os.path.dirname( __file__ ) + '/'
class LIWC:
meta_classes = [ 1, 2, 3, 30, 32, 40, 50, 60, 70, 80, 90, 120] ## per LIWC 2015
def __init__( self, clean_meta_class = True ):
self.__terms = {}
for line in open( path + 'liwcdic2015_terms.dic'):
... |
'''
The settings for OSMC are handled by the OSMC Settings Addon (OSA).
In order to more easily accomodate future changes and enhancements, each OSMC settings bundle (module) is a separate addon.
The module can take the form of an xbmc service, an xbmc script, or an xbmc module, but it must be installed into the u... |
from mock import Mock, patch
from cloudify_gcp.compute import route
from ...tests import TestGCP
@patch('cloudify_gcp.gcp.ServiceAccountCredentials.from_json_keyfile_dict')
@patch('cloudify_gcp.gcp.build')
class TestGCPRoute(TestGCP):
def test_create(self, mock_build, *args):
route.create(
... |
from __future__ import (unicode_literals, print_function,
absolute_import, division)
from sqlalchemy.orm import (
scoped_session,
sessionmaker,
attributes
)
from sqlalchemy.schema import MetaData
from sqlalchemy.orm.session import make_transient
from sqlalchemy.ext.declarative impor... |
from setuptools import setup, find_packages
import sys, os
version = '1.0.1'
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 2",
]
setup(name='trakio',
version=version,
description="Client library for accessing the tr... |
from m5.params import *
from m5.proxy import *
from MemObject import MemObject
class RubyController(MemObject):
type = 'RubyController'
cxx_class = 'AbstractController'
cxx_header = "mem/ruby/slicc_interface/AbstractController.hh"
abstract = True
version = Param.Int("")
addr_ranges = VectorPara... |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import print_function, absolute_import, unicode_literals
import json
import os
import logging
from requests.utils import gues... |
from flexx.util.testing import run_tests_if_main, raises, skip
import re
from flexx.util.logging import logger, capture_log, set_log_level
def test_debug():
logger.debug('test')
def test_info():
logger.info('test')
def test_warning():
logger.warning('test')
def test_set_log_level():
with ra... |
import morb
from morb import rbms, stats, updaters, trainers, monitors, objectives
import theano
import theano.tensor as T
import numpy as np
import gzip, cPickle
import matplotlib.pyplot as plt
plt.ion()
from utils import generate_data, get_context, visualise_filters
# DEBUGGING
from theano import ProfileMode
#... |
from ngs_python.variant import varscan
import pandas as pd
import os
import subprocess
import numpy as np
def geneAnno(
inFile, outPrefix, path, buildver, database
):
'''
Function perform gene annovar gene annotation on a valid
annovar input file. Function takes X arguments
'''
# B... |
from ._pylib import ffi, lib # pylint: disable=no-name-in-module
class Git:
commit = None
if lib.gitCommit and lib.gitCommit != "(unknown)":
commit = ffi.string(lib.gitCommit).decode('utf-8')
commitShort = None
if lib.gitCommitShort and lib.gitCommitShort != "(unknown)":
commitShort ... |
from django import template
register = template.Library()
@register.inclusion_tag('articles/article.html', takes_context=True)
def show_article(context, article):
context.update({'article':article})
return context |
"""Test synchronizer using DocManagerSimulator
"""
import os
import sys
import time
sys.path[0:0] = [""]
from mongo_connector.connector import Connector
from mongo_connector.namespace_config import NamespaceConfig
from mongo_connector.test_utils import (assert_soon,
connector_... |
import datetime
from django.test import TestCase
from haystack import connections
from haystack.inputs import Exact, AltParser
from haystack.models import SearchResult
from haystack.query import SQ
from core.models import MockModel, AnotherMockModel
class SolrSearchQueryTestCase(TestCase):
def setUp(self):
... |
from django import forms
from .models import *
#===============================================================================
# class UserForm(forms.ModelForm):
# password = forms.CharField(widget=forms.PasswordInput)
#
# class Meta:
# model = Registrado
# fields = ["email","password"... |
# -*- coding: UTF-8 -*-
"""
Copyright 2007--2009 Ulrik Sverdrup <<EMAIL>>
This file is a part of the program kupfer, which is
released under GNU General Public License v3 (or any later version),
see the main program file, and COPYING for details.
"""
import os
from os import path
import zlib
from gi.repository impo... |
# 301. Remove Invalid Parentheses Add to List
# DescriptionSubmissionsSolutions
# Total Accepted: 35227
# Total Submissions: 101043
# Difficulty: Hard
# Contributors: Admin
# Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.
#
# Note: The input strin... |
"""This example updates user team associations.
It updates a user team association by setting the overridden access type to read
only for all teams that the user belongs to. To determine which users exists,
run get_all_users.py.
Tags: UserTeamAssociationService.getUserTeamAssociationsByStatement
Tags: UserTeamAssocia... |
'''
Copyright (c) 2012, Tarek Galal <<EMAIL>>
This file is part of Wazapp, an IM application for Meego Harmattan platform that
allows communication with Whatsapp users
Wazapp 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... |
from __future__ import print_function
import gammu
import os
import sys
def main():
if len(sys.argv) != 3:
print('This requires two parameters: file to upload and path!')
sys.exit(1)
with open(sys.argv[1], 'rb') as handle:
data = handle.read()
state_machine = gammu.StateMachine()... |
from bricklayer.space.virtual_space import VirtualSpace
from bricklayer.pieces.bricks import *
from bricklayer.utils.commands import open_ldd_command
from tempfile import NamedTemporaryFile
import subprocess
vs = VirtualSpace((100, 100, 100))
put_2D_1x1_RED = lambda *point : put_2D((1, 1), point, RED_BRICK)
put_2D... |
import task
def quoteParse(path):
"""
Quote a path for use in gst.parse_launch.
"""
# Make sure double quotes and backslashes are escaped. See
# morituri.test.test_common_checksum.NormalPathTestCase
return path.replace('\\', '\\\\').replace('"', '\\"')
class GstException(Exception):
def... |
import json
from django.test.utils import override_settings
from avocado.models import DataField
from avocado.events.models import Log
from restlib2.http import codes
from .base import BaseTestCase
from tests.models import Title
class FieldResourceTestCase(BaseTestCase):
def test_get_all(self):
response =... |
from django.conf import settings
from django.db.models import Q
from django.http import Http404
from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.authentication import BaseAuthentication
from rest_framework.decorators import (api_view, authentication_classes,
... |
#!/usr/bin/env python
import fileinput
import os
import re
import shutil
import argparse
from argparse import RawTextHelpFormatter
import hashlib
parser = argparse.ArgumentParser(description="""
Copy HMM models with a Trusted Cutoff superior to a specified threshold (-t)
from a source folder (where models are split, ... |
import datetime
from nova.compute import migration_list
from nova import context
from nova import exception
from nova import objects
from nova import test
from nova.tests import uuidsentinel
class TestMigrationListObjects(test.TestCase):
NUMBER_OF_CELLS = 3
def setUp(self):
super(TestMigrationListOb... |
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
from .._regexpidbase import RegExpIdBase
#--------------------... |
__version__ = "$Revision: $"
# $Source$ |
from openerp.tests.common import TransactionCase
class TestMedicalPatientDisease(TransactionCase):
def setUp(self):
super(TestMedicalPatientDisease, self).setUp()
self.disease_2 = self.env.ref(
'medical_patient_disease.medical_patient_disease_disease_2'
)
self.disease_... |
'''harvestPRR: analyze Public Record Requests from CSV data provided by NextRequest
Created 27 Aug 20
@author: <EMAIL>
'''
from collections import defaultdict
import csv
import datetime
import json
import random
import re
import requests
import sys
import time
import urllib
import re
PRRDateFmt = '%Y-%m-%dT%H:%M:... |
import functools
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
palette = [
'#1f78b4',
'#33a02c',
'#e31a1c',
'#ff7f00',
'#6a3d9a',
'#b15928',
'#a6cee3',
'#b2df8a',
'#fb9a99',
'#fdbf6f',
'#... |
"""Hilbert spaces for quantum mechanics.
Authors:
* Brian Granger
* Matt Curry
"""
from sympy import Basic, Interval, oo, sympify
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.qexpr import QuantumError
from sympy.core.compatibility import reduce
__all__ = [
'HilbertSpaceErr... |
from .base import Base
class Kind(Base):
def __init__(self, vim):
super().__init__(vim)
self.name = 'file'
def action_default(self, context):
target = context['targets'][0]
path = target['action__path']
if self.vim.call('fnamemodify',
self.vi... |
'''
Created on Apr 12, 2015
@author: Akshat
'''
import pandas as pd
import matplotlib.pyplot as plt
class ResultCollator(object):
'''
classdocs
'''
distance_df = None
def __init__(self, worker_list, output_directory):
'''
Constructor
'''
sel... |
from constants import *
from scapy.all import *
from veripy.assertions import *
from veripy.models import ComplianceTestCase
class RedirectionHelper(ComplianceTestCase):
"""
We are going to pretend that TN2 is on Link B, using Redirect messages.
"""
restart_uut = True
def run(self):
self... |
from webob import exc
from nova.api.openstack import common
from nova.api.openstack.compute.schemas.v3 import admin_password
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api import validation
from nova import compute
from nova import exception
from nova.i18n import _
ALIAS ... |
import logging
from trove.backup.state import BackupState
from trove.common import cfg
from trove.common import context as trove_context
from trove.conductor import api as conductor_api
from trove.guestagent.common import timeutils
from trove.guestagent.dbaas import get_filesystem_volume_stats
from trove.guestagent.str... |
import abc
import re
from six import add_metaclass
from .. import errors
@add_metaclass(abc.ABCMeta)
class FSLabelApp(object):
"""An abstract class that represents actions associated with a
filesystem's labeling application.
"""
name = abc.abstractproperty(
doc="The name of the filesystem ... |
from __future__ import absolute_import, division, print_function
import pytest
from inspirehep.modules.workflows.tasks.merging import get_head_source
from inspirehep.modules.workflows.utils import insert_wf_record_source
@pytest.fixture
def simple_record():
return {
'$schema': 'http://localhost:5000/sch... |
# -*- coding: utf-8 -*-
"""
Tests the 'read_fwf' function in parsers.py. This
test suite is independent of the others because the
engine is set to 'python-fwf' internally.
"""
from datetime import datetime
import nose
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas import DataFra... |
import os
import platform
import logging
from subprocess import Popen, PIPE
from extension_connection import ExtensionConnection
from selenium.common.exceptions import WebDriverException
import time
import socket
import signal
class FirefoxBinary(object):
NO_FOCUS_LIBRARY_NAME = "x_ignore_nofocus.so"
def __... |
import acos_client.errors as acos_errors
import acos_client.v30.base as base
class Server(base.BaseV30):
url_prefix = '/slb/server/'
def get(self, name, **kwargs):
return self._get(self.url_prefix + name, **kwargs)
def create(self, name, ip_address, **kwargs):
params = {
"se... |
import socket
import unittest
from scapy.layers.ipsec import AH
from scapy.layers.inet import IP, UDP
from scapy.layers.inet6 import IPv6
from scapy.layers.l2 import Ether
from scapy.packet import Raw
from framework import VppTestRunner
from template_ipsec import TemplateIpsec, IpsecTra46Tests, IpsecTun46Tests, \
... |
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import sympy
s_a, s_b, s_x, s_y = sympy.var('a,b,x,y')
s_l = sympy.Matrix([(s_a * s_x + s_b - s_y)**2])
dl = s_l.jacobian([s_a, s_b])
sympy.pprint(dl)
X = tf.placeholder(tf.float32, [None])
Y_ = tf.placeholder(tf.float32, [None])
a = tf.Va... |
"""Sections API Tests for Version 1.0.
This is a testing template for the generated SectionsAPI Class.
"""
import unittest
import requests
import secrets
from pycanvas.apis.sections import SectionsAPI
from pycanvas.apis.sections import Section
class TestSectionsAPI(unittest.TestCase):
"""Tests for th... |
#!/usr/bin/env python2
'''
Read out the CO2-Monitor AIRCO2NTROL MINI https://www.tfa-dostmann.de/produkt/co2-monitor-airco2ntrol-mini-31-5006/
This is a minimalistic script to read out the data and write them to a rrd database
References
- Reverse Engineering done by Henry Ploetz https://hackaday.io/projec... |
# -*- coding:utf-8 -*-
'''
Author: Bu Kun
E-mail: <EMAIL>
CopyRight: http://www.yunsuan.org
'''
import peewee
from torlite.core.base_model import BaseModel
class CabCatalog(BaseModel):
uid = peewee.IntegerField(null=False, index=True, unique=True, primary_key=True, help_text='', )
slug = peewe... |
import socket, unittest, os, pickle, datetime
from testlib import testutil, PygrTestProgram, SkipTest
from pygr import seqdb, cnestedlist, metabase, mapping, logger, sqlgraph
from pygr.downloader import SourceURL, GenericBuilder, uncompress_file, \
do_unzip, do_gunzip
try:
set
except NameError:
from sets ... |
from tkinter import *
import sys
sys.path.append('Webserver/Software')
import JanelaInicial
class Tabs(Frame):
def __init__(self, parent):
super(Tabs, self).__init__()
self.parent = parent
self.columnconfigure(10, weight=1)
self.rowconfigure(3, weight=1)
#################... |
#!/usr/bin/env python
"""qpOASES python distutils setup script."""
#
# This file is part of qpOASES.
#
# qpOASES -- An Implementation of the Online Active Set Strategy.
# Copyright (C) 2007-2017 by Hans Joachim Ferreau, Andreas Potschka,
# Christian Kirches et al. All rights reserved.
#
# qpOASES is free software... |
import sublime
import sublime_plugin
# assume sidebar is visible by default on every window (there's no way to check, unfortunately)
DEFAULT_VISIBILITY = True
sidebarVisible = DEFAULT_VISIBILITY
# preference from plugin settings file
pluginPref = DEFAULT_VISIBILITY
# flag for alt-tab focus check
lastView = None
# K... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.