code stringlengths 1 199k |
|---|
"""Sending notifications."""
from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
'send_admin_subscription_notice',
'send_goodbye_message',
'send_welcome_message',
]
import logging
from email.utils import formataddr
from lazr.config import as_boolean
... |
import os
import numpy
import anvio
import anvio.db as db
import anvio.tables as t
import anvio.fastalib as u
import anvio.utils as utils
import anvio.terminal as terminal
import anvio.constants as constants
import anvio.filesnpaths as filesnpaths
import anvio.genecalling as genecalling
from anvio.tables.tableops impor... |
import csv
def read_txt_file_to_list(filename):
with open(filename, 'r', encoding='utf-8') as txtfile:
lines = []
for line in txtfile.readlines():
lines.append(line)
print("Succesfully read: " + filename)
return lines
def read_txt_file_to_string(filename):
with open(filename,... |
"""Tests for samba.dcerpc.registry."""
from samba.dcerpc import winreg
from samba.tests import RpcInterfaceTestCase
class WinregTests(RpcInterfaceTestCase):
def setUp(self):
super(WinregTests, self).setUp()
self.conn = winreg.winreg("ncalrpc:", self.get_loadparm(),
... |
docs = []
class Doctor: # создаём класс доктор
available_time = ['08:00 - 08:30', '08:30 - 09:00', '09:00 - 09:30', '09:30 - 10:00', '10:00 - 10:30', '10:30 - 11:00',
'11:00 - 11:30', '11:30 - 12:00', '12:00 - 12:30', '12:30 - 13:00', '13:00 - 13:30', '13:30 - 14:00',
'15:00 - 1... |
from numpy import *
from scipy.io import mmread
mtx=mmread('../../../data/logdet/west0479.mtx.gz')
parameter_list=[[mtx,100,60,1]]
def mathematics_logdet (matrix=mtx,max_iter_eig=1000,max_iter_lin=1000,num_samples=1):
from scipy.sparse import eye
# Create a Hermitian sparse matrix
rows=matrix.shape[0]
cols=matrix.s... |
from __future__ import division, print_function, absolute_import
from os.path import join
from scipy._build_utils import numpy_nodepr_api
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configur... |
from django.apps import apps as django_apps
def importpath(path, error_text=None):
app_label, model_name = tuple(path.split('.'))
return django_apps.get_model(app_label, model_name) |
import importlib
import logging
import threading
from telegram.conf.settings import SETTINGS
from telegram.core.bot import BOT
from telegram.core.message import RequestMessage, ResponseMessage
class RequestQueue(object):
def __init__(self):
self.requests_list = []
self.requests_list_condition = thre... |
a = input().split()
s = ""
if a[1] == "a.m.":
a = a[0].split(':')
if int(a[0]) < 10:
s += "0" + a[0]
else:
s += a[0]
s += ":"
if len(a[1]) > 1:
s += a[1]
else:
s += "0" + a[1]
elif a[1] == "p.m.":
a = a[0].split(':')
if int(a[0]) == 12:
s += a[0] +... |
"""
Copyright (C) 2019 Numix Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License (version 3+) as
published by the Free Software Foundation. You should have received
a copy of the GNU General Public License along with this program.
If not, see... |
"""SCons.Tool.ilink
Tool-specific initialization for the OS/2 ilink linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
__revision__ = "src/engine/SCons/Tool/ilink.py 4577 2009/12/27 19:43:56 scons"
import S... |
"""
Tests for grid-based shape features.
"""
import unittest
from rdkit import Chem
from vs_utils.features.shape_grid import ShapeGrid
from vs_utils.utils.rdkit_utils import conformers
class TestShapeGrid(unittest.TestCase):
"""
Tests for ShapeGrid featurizer.
"""
def setUp(self):
"""
Se... |
import bpy
from math import cos, sin, radians
from random import randint
from copy import copy
from colorsys import rgb_to_hsv, hsv_to_rgb
from bpy.types import Operator
from bpy.props import BoolProperty, IntProperty, FloatProperty, FloatVectorProperty
from .achm_tools import *
class AchmBooks(Operator):
bl_idname... |
from PyQt4 import QtGui
from configuration.Appconfig import Appconfig
from projManagement.Worker import WorkerThread
import os
class openSub(QtGui.QWidget):
"""
This class is called when User click on Open Project Button
"""
def __init__(self):
super(openSub, self).__init__()
self.obj_ap... |
import os
import settings
import urlparse
import select
import zlib
import BaseHTTPServer
from servers.HTTP import RespondWithFile
from utils import *
IgnoredDomains = [ 'crl.comodoca.com', 'crl.usertrust.com', 'ocsp.comodoca.com', 'ocsp.usertrust.com', 'www.download.windowsupdate.com', 'crl.microsoft.com' ]
def Inject... |
from django.db import models
from django.contrib.auth.models import User
from shared.helpers import current_time, current_date
from apps.invoice.models import Invoice
class Project(models.Model):
user = models.ForeignKey(User)
invoice = models.ForeignKey(Invoice, null=True, on_delete=models.SET_NULL)
name... |
from datetime import date
from hscommon.testutil import eq_
from ..base import TestApp, with_app, testdata
from ...model.date import YearRange
def app_import_checkbook_qif():
app = TestApp()
app.doc.date_range = YearRange(date(2007, 1, 1))
app.mw.parse_file_for_import(testdata.filepath('qif', 'checkbook.qif... |
from droidcontroller.convert import Convert
class ConvertDS18B20(Convert):
''' Implementation of DS1820 temperature converter
'''
def convert(self, name, indata):
outdata = [1]
if indata[0] & 0b1000000000000000:
indata[0] = ((~indata[0] & 0b1111111111111111) + 1) * -1
out... |
import logging
import pytz
from datetime import datetime
from dateutil.relativedelta import *
import openerp
import werkzeug.contrib.sessions
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
from openerp.osv import fields
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT... |
from django.core.management.base import BaseCommand
from seqr.models import Project, Family, VariantTag, VariantTagType
import logging
logger = logging.getLogger(__name__)
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('--from-project', required=True)
parser.add_arg... |
import re
import uuid
XASSET_LOCATION_TAG = 'c4x'
XASSET_SRCREF_PREFIX = 'xasset:'
XASSET_THUMBNAIL_TAIL_NAME = '.jpg'
import os
import logging
import StringIO
from urlparse import urlparse, urlunparse, parse_qsl
from urllib import urlencode
from opaque_keys.edx.locator import AssetLocator
from opaque_keys.edx.keys imp... |
from __future__ import absolute_import
"""
A strings utility module for helper functions.
"""
import re
def hex2int(hex):
return int(hex, 16)
def int2hex(n):
return "%X" % n
def ord2HHHH(n):
digits = int2hex(n)
length = min(len(digits), 8)
return ord2HHHH.prefixes[length] + digits
ord2HHHH.prefixes ... |
import pika
import json
from cloudbrain.subscribers.SubscriberInterface import Subscriber
from cloudbrain.utils.metadata_info import get_metrics_names
from cloudbrain.settings import RABBITMQ_ADDRESS
class PikaSubscriber(Subscriber):
def __init__(self, device_name, device_id, rabbitmq_address, metric_name):
super... |
from shinken_test import *
class TestComplexHostgroups(ShinkenTest):
def setUp(self):
self.setup_with_file('etc/nagios_complex_hostgroups.cfg')
def get_svc(self):
return self.sched.services.find_srv_by_name_and_hostname("test_host_0", "test_ok_0")
def find_service(self, name, desc):
... |
import os
import sys
from shinken_test import *
class TestConfigWithSymlinks(ShinkenTest):
def setUp(self):
if os.name == 'nt':
return
self.setup_with_file('etc/nagios_conf_in_symlinks.cfg')
def test_symlinks(self):
if os.name == 'nt':
return
if sys.versio... |
'''
Created on June 14, 2012
@package: Livedesk
@copyright: 2012 Sourcefabric o.p.s.
@license: http://www.gnu.org/licenses/gpl-3.0.txt
@author: Mugur Rus
'''
from setuptools import setup, find_packages
setup(
name="embed",
version="1.0",
packages=find_packages(),
install_requires=['ally_api >= 1.0', 'al... |
"""
Tests for utils.price_display and the price filters.
"""
import pytest
import pytz
from datetime import datetime, timedelta
from mock import patch
from shuup.core.utils.price_cache import cache_price_info, get_cached_price_info
from shuup.discounts.exceptions import DiscountM2MChangeError
from shuup.discounts.model... |
"""
Models for new Content Libraries
"""
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from opaque_keys.edx.locator import LibraryLocatorV... |
from base.models.academic_year import AcademicYear, LEARNING_UNIT_CREATION_SPAN_YEARS
from features.pages.education_group import pages
def fill_end_year(page: pages.UpdateTrainingPage, current_academic_year: AcademicYear):
end_year_chosen = AcademicYear.objects.filter(
year__gt=current_academic_year.year,
... |
import json
import os
from unnaturalcode.http import make_app
import shutil
import unittest
from sh import pgrep, touch
UC_HOME = os.path.expanduser('~/.unnaturalCode')
UC_HOME_BACKUP = os.path.expanduser('~/.unnaturalCode.bak')
def fromUCHome(*args):
"Returns a path with UnnaturalCode home as the prefix."
retu... |
"Module called for configuring, compiling and installing targets"
import os, sys, shutil, traceback, datetime, inspect, errno
import Utils, Configure, Build, Logs, Options, Environment, Task
from Logs import error, warn, info
from Constants import *
g_gz = 'bz2'
commands = []
def prepare_impl(t, cwd, ver, wafdir):
Opt... |
"""
Test the query while running BatchSparqlUpdate at the same time. This was raising
some SQLITE_MISUSED errors before.
"""
import os, dbus
from gi.repository import GObject
from dbus.mainloop.glib import DBusGMainLoop
from common.utils import configuration as cfg
import unittest2 as ut
from common.utils.storetest imp... |
__author__ = 'zeus'
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from django.db import models
class Command(BaseCommand):
args = ''
help = 'Migrate pybb profiles to loca... |
encodings = [
'windows-1250', 'windows-1251', 'windows-1252',
'windows-1253', 'windows-1254', 'windows-1255',
'windows-1256', 'windows-1257', 'windows-1258',
'iso-8859-1', 'iso-8859-2', 'iso-8859-3', 'iso-8859-4',
'iso-8859-5', 'iso-8859-6', 'iso-8859-7', 'iso-8859-8',
'iso-8859-9', 'iso-8859-10', 'iso-... |
__author__ = "Simone Campagna"
import pytest
from zirkon.config import Config
from zirkon.errors import EvaluationError
from zirkon.times import DateTime, Date, Time, TimeDelta
@pytest.fixture(params=[DateTime(), Date(), Time(), TimeDelta()])
def ztinstance(request):
return request.param
def test_Config_set_standar... |
import sys
from setuptools import setup, find_packages
from subprocess import check_output, CalledProcessError
install_requires = [
"argparse>=1.2.1",
"texttable>=0.8.1",
"lxml"
]
with open('README.md') as f:
long_description = f.read()
try:
tag = check_output(["git", "describe", "--tags"]).strip()
... |
from oslo_log import log as logging
from tacker.sol_refactored.common import config
from tacker.sol_refactored.common import http_client
from tacker.sol_refactored.common import lcm_op_occ_utils as lcmocc_utils
from tacker.sol_refactored.common import subscription_utils as subsc_utils
from tacker.sol_refactored.common ... |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from pants.backend.core.tasks.console_task import ConsoleTask
class MinimalCover(ConsoleTask):
"""Outputs a minimal covering set of targets.
For a given set of inpu... |
"""TcEx Framework Threat Intel module init file."""
from .threat_intelligence import ThreatIntelligence # noqa: F401 |
"""Tests for the Linky config flow."""
from unittest.mock import Mock, patch
from pylinky.exceptions import (
PyLinkyAccessException,
PyLinkyEnedisException,
PyLinkyException,
PyLinkyWrongLoginException,
)
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.linky.const ... |
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.url import urljoin_rfc
from product_spiders.items import Product, ProductLoaderWithNameStrip as ProductLoader
class ProductionRoomSpider(BaseSpider):
name = 'production-... |
import argparse
import json
import os
import pprint
import re
import string
def parse_log(file):
re_files = re.compile('^\[.*?\] ')
re_offset = re.compile("\+0x[0-9a-fA-F]+")
file = open(file, "rb")
in_dbg = 0
stacks = []
cur_stack = []
stack_num = 0
in_stacks = 0
print("Staring Anal... |
"""Schedule for composition of injective operator"""
import tvm
from tvm import te
from .. import util
def schedule_injective_from_existing(sch, out):
"""Schedule for injective op from existing schedule.
Parameters
----------
sch: Schedule
The schedule to update.
out: Tensor
The te... |
"""
CellState Manager
"""
import copy
import datetime
import functools
import time
from oslo_config import cfg
from oslo_db import exception as db_exc
from oslo_serialization import jsonutils
from oslo_utils import timeutils
from oslo_utils import units
from nova.cells import rpc_driver
from nova import context
from no... |
import yaml
stream = open("meru.yaml", 'r')
print yaml.load(stream) |
from external.bottle import Bottle, route, run, request
from managers.weibomanager import weibofollowmanager
from managers.weibomanager import weibominiblogmanager
from supports.memdb import memdb
def start_server():
try:
run(host="127.0.0.1", port=50050)
pass
except Exception, e:
print e
raise e
@route('/wei... |
import google.api_core.grpc_helpers
from google.cloud.texttospeech_v1beta1.proto import cloud_tts_pb2_grpc
class TextToSpeechGrpcTransport(object):
"""gRPC transport class providing stubs for
google.cloud.texttospeech.v1beta1 TextToSpeech API.
The transport provides access to the raw gRPC stubs,
which c... |
"""Treadmill trace.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import socket
import time
import six
from treadmill import fs
from treadmill import osnoop
from treadmill import yamlwrapp... |
"""
Test suite for VMWareAPI.
"""
import stubout
from nova import context
from nova import db
from nova import flags
from nova import test
from nova import utils
from nova.auth import manager
from nova.compute import power_state
from nova.tests.glance import stubs as glance_stubs
from nova.tests.vmwareapi import db_fak... |
import contextlib
import StringIO
import mock
import mox
from cinder.db import api as db_api
from cinder import exception
from cinder import test
from cinder.volume import configuration as conf
from cinder.volume.drivers.xenapi import lib
from cinder.volume.drivers.xenapi import sm as driver
from cinder.volume.drivers.... |
import datetime
from django.core import mail
from django.utils.timezone import now
from confirmation.models import Confirmation, confirmation_url, generate_key
from zerver.lib.actions import do_set_realm_property, do_start_email_change_process
from zerver.lib.test_classes import ZulipTestCase
from zerver.models import ... |
from abc import ABC, abstractmethod
from functools import partial
from typing import Callable, Any, Dict, Type, Optional, Iterable, Tuple, List
from sortedcontainers import SortedListWithKey
from common.exceptions import LogicError
from plenum.common.router import Router, Subscription
from stp_core.common.log import ge... |
from __future__ import absolute_import, division, with_statement |
from case import Case
class Case3_4(Case):
DESCRIPTION = """Send small text message, then send again with <b>RSV = 4</b>, then send Ping. Octets are sent in octet-wise chops."""
EXPECTATION = """Echo for first message is received, but then connection is failed immediately, since RSV must be 0, when no extension d... |
import struct
import socket
from . import packet_base
from . import packet_utils
from . import icmpv6
from . import tcp
from ryu.ofproto import inet
class ipv6(packet_base.PacketBase):
_PACK_STR = '!IHBB16s16s'
_MIN_LEN = struct.calcsize(_PACK_STR)
def __init__(self, version, traffic_class, flow_label, payl... |
from neutron_lib.api.definitions import extraroute_atomic
from neutron_lib.api import extensions as api_extensions
from neutron_lib.plugins import constants
from neutron.api.v2 import resource_helper
class Extraroute_atomic(api_extensions.APIExtensionDescriptor):
api_definition = extraroute_atomic
@classmethod
... |
import ast
import fixtures
import mock
from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_config import fixture as config_fixture
import oslo_messaging as messaging
from oslo_serialization import jsonutils
from oslo_utils import timeutils
import webob
from webob import exc
from cinder.api.cont... |
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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/L... |
"""Deletes all certificates and generates a new server SSL certificate."""
from googlecloudsdk.api_lib.sql import operations
from googlecloudsdk.api_lib.sql import validate
from googlecloudsdk.calliope import base
from googlecloudsdk.core import log
class _BaseResetSslConfig(object):
"""Deletes all client certificate... |
import yaml
import yaml.composer
import yaml.constructor
from murano.dsl import dsl_types
from murano.dsl import helpers
from murano.dsl import yaql_expression
@helpers.memoize
def get_loader(version):
version = helpers.parse_version(version)
class MuranoPlDict(dict):
pass
class YaqlExpression(yaql_... |
"""Test invoking the command line tool.
These tests expect any already running HIL api server; in our CI this is
run as part of the 'apache' integration tests.
"""
import logging
import subprocess
import json
import requests
import pytest
import time
from hil.test_common import fail_on_log_warnings, obmd_cfg
logger = l... |
from unittest import mock
import google.cloud.bigquery
import google.cloud.storage
import google.cloud.kms_v1
import pytest
@pytest.fixture(autouse=True)
def mock_bigquery_client(monkeypatch):
mock_client = mock.create_autospec(google.cloud.bigquery.Client)
monkeypatch.setattr(google.cloud.bigquery, "Client", m... |
from six import string_types
from pypif.obj.common.name import Name
from pypif.obj.common.pio import Pio
class Person(Pio):
"""
Information about a person.
"""
def __init__(self, name=None, email=None, orcid=None, tags=None, **kwargs):
"""
Constructor.
:param name: :class: Dictio... |
"""Dynamic collection API.
Dynamic collections act like Query() objects for read operations and support
basic add/delete mutation.
"""
from . import attributes
from . import exc as orm_exc
from . import interfaces
from . import object_mapper
from . import object_session
from . import properties
from . import strategies... |
import re
import sublime
import sublime_plugin
try: # Python 3
from .haxe_helper import cache
except (ValueError): # Python 2
from haxe_helper import cache
header = '''
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Globals</string>
<key>scope</key>
... |
from flask import render_template
from . import main
@main.app_errorhandler(404)
def page_not_found(error):
return render_template('404.html'), 404 |
import contextlib
import sys
import time
import mock
import netaddr
from oslo_config import cfg
from oslo_log import log
import oslo_messaging
import testtools
from neutron.agent.common import ovs_lib
from neutron.agent.common import utils
from neutron.agent.linux import async_process
from neutron.agent.linux import ip... |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import os
import unittest2 as unittest
from pants.util.contextutil import temporary_dir
from pants.util.dirutil import safe_open
from pants.thrift_util import find_incl... |
from __future__ import absolute_import
from chaco.abstract_overlay import AbstractOverlay
from traits.api import Bool, Dict
from kiva.fonttools import str_to_font
from numpy import linspace, hstack, vstack, array
from six.moves import zip
class IrradiationTrayOverlay(AbstractOverlay):
_cached_pts = None
show_la... |
"""This module is deprecated. Please use :mod:`airflow.providers.google.cloud.operators.vision`."""
import warnings
from airflow.providers.google.cloud.operators.vision import ( # noqa # pylint: disable=unused-import
CloudVisionAddProductToProductSetOperator,
CloudVisionCreateProductOperator,
CloudVisionCr... |
import uuid
import mock
from oslo_utils import timeutils
import six
import webob
from cinder.api.v2 import types
from cinder.api.v2.views import types as views_types
from cinder import context
from cinder import exception
from cinder import test
from cinder.tests.unit.api import fakes
from cinder.tests.unit import fake... |
from skimage.draw import polygon
import numpy as np
def segToMask( S, h, w ):
"""
Convert polygon segmentation to binary mask.
:param S (float array) : polygon segmentation mask
:param h (int) : target mask height
:param w (int) : target mask width
:return: M (bool 2D... |
"""Tests the tdb data store - in memory implementation."""
import shutil
from grr.lib import server_plugins
from grr.lib import access_control
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import data_store_test
from grr.lib import flags
from grr.lib import test_lib
from grr.lib.data_stores... |
"""Scanner for source files, directories and devices.
The source scanner tries to determine what input we are dealing with:
* a file that contains a storage media image;
* a device file of a storage media image device;
* a regular file or directory.
The source scanner scans for different types of elements:
* supported ... |
import os
import subprocess
import sqlite3
import pytest
from django.conf import settings
from django.utils.encoding import force_str
_settings = settings.DATABASES["default"]
DB_NAME = _settings["NAME"]
TEST_DB_NAME = _settings["TEST"]["NAME"]
if _settings["ENGINE"] == "django.db.backends.sqlite3" and TEST_DB_NAME is ... |
"""Tests for object_detection.core.box_list_ops."""
import numpy as np
import tensorflow as tf
from object_detection.core import box_list
from object_detection.core import box_list_ops
from object_detection.utils import test_case
class BoxListOpsTest(test_case.TestCase):
"""Tests for common bounding box operations.""... |
"""Support for switch sensor using I2C MCP23017 chip."""
import logging
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA
from homeassistant.const import DEVICE_DEFAULT_NAME
from homeassistant.helpers.entity import ToggleEntity
import homeassistant.helpers.config_validation as cv
_LOG... |
from logging import getLogger
from .merge import create_output_table
from .merge import merge_dicts
from .merge import output_row
from .rating import fix_judgment
from .target import select_groups_by_target
log = getLogger(__name__)
def build_claim_table(output_db, scratch_db):
log.info(' building claim table')
... |
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
setup(
name = "clamp",
version = "0.4",
packages = find_packages(),
entry_points = {
"distutils.commands": [
"build_jar = clamp.commands:build_jar_command",
"clamp = clamp.commands:clamp... |
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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/L... |
"""Contains the TFExampleDecoder its associated helper classes.
The TFExampleDecode is a DataDecoder used to decode TensorFlow Example protos.
In order to do so each requested item must be paired with one or more Example
features that are parsed to produce the Tensor-based manifestation of the item.
"""
from __future__... |
"""ISY Services and Commands."""
from typing import Any
from pyisy.constants import COMMAND_FRIENDLY_NAME
import voluptuous as vol
from homeassistant.const import (
CONF_ADDRESS,
CONF_COMMAND,
CONF_NAME,
CONF_TYPE,
CONF_UNIT_OF_MEASUREMENT,
SERVICE_RELOAD,
)
from homeassistant.core import Servic... |
"""
Tests for Glance Registry's client.
This tests are temporary and will be removed once
the registry's driver tests will be added.
"""
import copy
import datetime
import os
import uuid
from mock import patch
from oslo_utils import timeutils
from glance.common import config
from glance.common import exception
from gla... |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import glob
import itertools
import os
import sys
from pants.backend.jvm.tasks.jvm_compile.anonymizer import Anonymizer
from pants.backend.jvm.tasks.jvm_compile.scala.z... |
__author__ = 'Shamal Faily'
class DocumentReference:
def __init__(self,refId,refName,docName,cName,docExc):
self.theId = refId
self.theName = refName
self.theDocName = docName
self.theContributor = cName
self.theExcerpt = docExc
def id(self): return self.theId
def name(self): return self.theNa... |
"""
Contains Catalyst DAO implementations.
"""
from django.conf import settings
from restclients.mock_http import MockHTTP
from restclients.dao_implementation.live import get_con_pool, get_live_url
from restclients.dao_implementation.mock import get_mockdata_url
import datetime
import hashlib
import pytz
class File(obj... |
from __future__ import absolute_import
import threading
import uuid
import google.api_core.future
from google.cloud.pubsub_v1.publisher import exceptions
class Future(google.api_core.future.Future):
"""Encapsulation of the asynchronous execution of an action.
This object is returned from asychronous Pub/Sub cal... |
import sys, os
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('..'))
sys.path.append(os.path.abspath('../tests'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django
django.setup()
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
templates_path = ['_templates']
source_suf... |
import time
from inspect import isclass
from flask import Blueprint, current_app, request
from flask_login import current_user, login_required
from flask_restful import Resource, abort
from redash import settings
from redash.authentication import current_org
from redash.models import db
from redash.tasks import record_... |
from __future__ import absolute_import
from __future__ import unicode_literals
from ..util_tests import TestLogin
import evesrp
from evesrp import db
from evesrp.auth import PermissionType
from evesrp.auth.models import User, Group, Division, Permission
from evesrp.transformers import Transformer
class TestAddDivision(... |
"""
Mixing matrices and assortativity coefficients.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
__all__ = ['degree_assortativity',
'attribute_assortativity',
'numeric_assortativity',
'neighbor_connectivity',
'attribute_mixing_matrix',
'degree_mixing_matr... |
class RiggedModelFactory(object):
"""Generates rigged models from vertices.
The factory is initialized with the static data for the model rig: the mesh
topology and texture map, the joint hierarchy, and the vertex weight map.
The RiggedModelFactory can then be used to generate FbxScene objects
bindi... |
from django.core.validators import ValidationError
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from rest_framework import serializers
from onadata.libs.models.share_project import ShareProject
from onadata.libs.permissions import ROLES
from onadata.libs.serializers.fie... |
"""Tests of mock Kwik file creation."""
from ...h5 import open_h5
from ..mock import create_mock_kwik
def test_create_kwik(tempdir):
n_clusters = 10
n_spikes = 50
n_channels = 28
n_fets = 2
n_samples_traces = 3000
# Create the test HDF5 file in the temporary directory.
filename = create_mock... |
from __future__ import absolute_import, division, print_function
import six
from collections import namedtuple
import functools
import os
import logging
logger = logging.getLogger(__name__)
data_dir = os.path.join(os.path.dirname(__file__), 'data')
element = namedtuple('element',
['Z', 'sym', 'name... |
from nose.tools import ok_
from mkt.api.tests.test_oauth import BaseOAuth
from mkt.constants import APP_FEATURES
from mkt.site.fixtures import fixture
from mkt.webapps.api import AppFeaturesSerializer
from mkt.webapps.models import Webapp
from test_utils import RequestFactory
class TestAppFeaturesSerializer(BaseOAuth):... |
from bambou import NURESTFetcher
class NURateLimitersFetcher(NURESTFetcher):
""" Represents a NURateLimiters fetcher
Notes:
This fetcher enables to fetch NURateLimiter objects.
See:
bambou.NURESTFetcher
"""
@classmethod
def managed_class(cls):
""" Return N... |
"""Tests for the engine module
"""
import numpy as np
import scipy.sparse as ssp
import re
import mock
from nipype.testing import (assert_raises, assert_equal, assert_true,
assert_false, skipif, assert_regexp_matches)
import nipype.pipeline.plugins.base as pb
def test_scipy_sparse():
foo... |
"""Download handlers for http and https schemes"""
import re
import logging
from io import BytesIO
from time import time
import warnings
from six.moves.urllib.parse import urldefrag
from zope.interface import implementer
from twisted.internet import defer, reactor, protocol
from twisted.web.http_headers import Headers ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.