content string |
|---|
import numpy as np
from math import sqrt
import subprocess
import operator
import dnacc
from dnacc.units import nm
# Set up basic system
plates = dnacc.PlatesMeanField()
L = 20 * nm
plates.set_tether_type_prototype(L=L, sigma=0.0)
ALPHA = plates.add_tether_type(plate='lower', sticky_end='alpha')
BETA = plates.add_tet... |
from neutron_lib import constants as const
from neutron_lib import exceptions
from oslo_config import cfg
from oslo_log import log as logging
from neutron._i18n import _, _LW
from neutron import context as n_context
from neutron.db import api as db_api
from neutron.db import l3_hamode_db
from neutron import manager
fr... |
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... |
# Testing sha module (NIST's Secure Hash Algorithm)
# use the three examples from Federal Information Processing Standards
# Publication 180-1, Secure Hash Standard, 1995 April 17
# http://www.itl.nist.gov/div897/pubs/fip180-1.htm
import warnings
warnings.filterwarnings("ignore", "the sha module is deprecated.*",
... |
import os
import time
import errno
class FileLockException(Exception):
pass
class FileLock(object):
""" A file locking mechanism that has context-manager support so
you can use it in a with statement. This should be relatively cross
compatible as it doesn't rely on msvcrt or fcntl for the lo... |
# -*- coding: utf-8 -*-
"""
This is part of WebScout software
Docs EN: http://hack4sec.pro/wiki/index.php/WebScout_en
Docs RU: http://hack4sec.pro/wiki/index.php/WebScout
License: MIT
Copyright (c) Anton Kuzmin <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en)
Common class for jobs works with MongoDB
"""
i... |
from django import forms
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext, ugettext_lazy as _
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$',
help_text=_("E... |
"""
Testing of admin inline formsets.
"""
import random
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Parent(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
retur... |
from functools import wraps
from flask import (Blueprint, abort, current_app, escape, flash, make_response,
redirect, render_template, request, session, url_for)
from sqlalchemy.orm.exc import NoResultFound
from passzero.api_utils import check_auth
from passzero.backend import (activate_account, de... |
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import network
authorize = extensions.soft_extension_authorizer('compute', 'extended_vif_net')
class ExtendedServerVIFNetController(wsgi.Controller):
def __init__(self):
super(ExtendedServerVIFNetController, self).__i... |
__all__ = [ 'attrdict', 'multiattrdict', 'optiondict' ]
class attrdict(dict):
"""Wrap dict, so you can use attribute access to get/set elements"""
def __getattr__(self, attr):
if attr in self:
return self.__getitem__(attr)
return super(attrdict, self).__getattribute__(attr)
def... |
"""distutils.dep_util
Utility functions for simple, timestamp-based dependency of files
and groups of files; also, function based entirely on such
timestamp dependency analysis."""
__revision__ = "$Id$"
import os
from stat import ST_MTIME
from distutils.errors import DistutilsFileError
def newer(source, target):
... |
import logging
import math
import random
import string
from ..core import compat
from ..core import driver
from ..core import exceptions
from nose import SkipTest # noqa
from nose import tools
logger = logging.getLogger(__name__)
class Driver(object):
def __init__(self, scheme=None, path=None, config=None):
... |
import sys
from ansible.module_utils.basic import *
from ansible.module_utils.ec2 import *
try:
import boto.ec2.cloudwatch
from boto.ec2.cloudwatch import CloudWatchConnection, MetricAlarm
from boto.exception import BotoServerError
HAS_BOTO = True
except ImportError:
HAS_BOTO = False
def create_... |
import contextlib
import weakref
from oslo_log import log as logging
from oslo_utils import excutils
import six
from sqlalchemy import and_
from sqlalchemy.ext import associationproxy
from sqlalchemy import or_
from sqlalchemy import sql
from neutron._i18n import _LE
from neutron.db import sqlalchemyutils
LOG = logg... |
# -*- coding: utf-8 -*-
from gluon import *
from s3 import *
from eden.layouts import *
try:
from .layouts import *
except ImportError:
pass
import eden.menus as default
# Below is an example which you can base your own template's menus.py on
# - there are also other examples in the other templates folders
#... |
"""Tests for hook customization."""
import stevedore
from nova import hooks
from nova import test
class SampleHookA(object):
name = "a"
def _add_called(self, op, kwargs):
called = kwargs.get('called', None)
if called is not None:
called.append(op + self.name)
def pre(self, ... |
#############################################################################
#############################################################################
import os,xbmc,xbmcgui,xbmcaddon,sys,logging,re,urllib,urllib2
#############################################################################
#################... |
from __future__ import unicode_literals, print_function
import shlex
import sys
import traceback
from codeop import compile_command
from pathlib import Path
from shutil import which
from awsh.commands import *
from awsh.providers import Provider, PosixProvider
from awsh.util import lazy_property
from prompt_toolkit i... |
"""Test for Nest binary sensor platform for the Smart Device Management API.
These tests fake out the subscriber/devicemanager, and are not using a real
pubsub subscriber.
"""
from google_nest_sdm.device import Device
from google_nest_sdm.event import EventMessage
from homeassistant.util.dt import utcnow
from .comm... |
import networkx as nx
from nose.tools import *
from networkx.algorithms.bipartite.cluster import cc_dot,cc_min,cc_max
import networkx.algorithms.bipartite as bipartite
def test_pairwise_bipartite_cc_functions():
# Test functions for different kinds of bipartite clustering coefficients
# between pairs of nodes ... |
import os, shutil, re
from . import Command, CommandException
from arm.conf import settings
from arm.odict import odict
from arm.util import retrieve_role, retrieve_all_roles, get_playbook_root
from arm import Role, Module
class install(Command):
help = "install playbook role"
def __init__(self... |
import os
import unittest
from setuptools.tests.py26compat import skipIf
try:
import ast
except ImportError:
pass
class TestMarkerlib(unittest.TestCase):
@skipIf('ast' not in globals(),
"ast not available (Python < 2.6?)")
def test_markers(self):
from _markerlib import interpret, defa... |
from ctypes import *
import unittest
# IMPORTANT INFO:
#
# Consider this call:
# func.restype = c_char_p
# func(c_char_p("123"))
# It returns
# "123"
#
# WHY IS THIS SO?
#
# argument tuple (c_char_p("123"), ) is destroyed after the function
# func is called, but NOT before the result is actually built.
#
# If... |
import __main__
import argparse
import code
import os
import sys
def add_config_parameter(parser):
parser.add_argument(
'-c', '--config', dest='config_file', action='store', type=str,
help='custom config file', default=None
)
def load_run_parsers(subparsers):
run_parser = subparsers.add_... |
"""Tests for `tf.data.Dataset.numpy()`."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from absl.testing import parameterized
import numpy as np
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.data.op... |
"""
###############################################################################
An extended Frame that makes window menus and toolbars automatically.
Use GuiMakerFrameMenu for embedded components (makes frame-based menus).
Use GuiMakerWindowMenu for top-level windows (makes Tk8.0 window menus).
See the self-te... |
# A sample of using Vista's IExplorerBrowser interfaces...
# Currently doesn't quite work:
# * CPU sits at 100% while running.
import sys
import pythoncom
from win32com.shell import shell, shellcon
import win32gui, win32con, win32api
from win32com.server.util import wrap, unwrap
# event handler for the browser.
IExpl... |
from cStringIO import StringIO
from struct import pack,unpack
from thrift.Thrift import TException
class TTransportException(TException):
"""Custom Transport Exception class"""
UNKNOWN = 0
NOT_OPEN = 1
ALREADY_OPEN = 2
TIMED_OUT = 3
END_OF_FILE = 4
def __init__(self, type=UNKNOWN, message=None):
T... |
# pylint: disable=missing-docstring,maybe-no-member
from mock import patch, sentinel
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from django.test.utils import override_settings
from track import views
from track.middleware import TrackMiddleware
from track.tests import E... |
import csv
import matplotlib.pyplot as plt
from numpy import *
import scipy.interpolate
import math
from pylab import *
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import matplotlib.patches as patches
from matplotlib.path import Path
import os
# --------------------------------------------------... |
from django.shortcuts import get_object_or_404, render
from django.views import generic
from chet.models import Album, Photo
def visible_albums(user):
if user.is_staff:
return Album.objects.active()
else:
return Album.objects.public()
def visible_photos(user):
if user.is_staff:
... |
ANSIBLE_METADATA = {'status': ['stableinterface'],
'supported_by': 'core',
'version': '1.0'}
def split_entry(entry):
''' splits entry and ensures normalized return'''
a = entry.split(':')
d = None
if entry.lower().startswith("d"):
d = True
a.pop... |
"""MockService provides CRUD ops. for mocking calls to AtomPub services.
MockService: Exposes the publicly used methods of AtomService to provide
a mock interface which can be used in unit tests.
"""
import atom.service
import pickle
__author__ = 'api.jscudder (Jeffrey Scudder)'
# Recordings contains pair... |
from libcloud.container.base import ContainerDriver
class DummyContainerDriver(ContainerDriver):
"""
Dummy Container driver.
>>> from libcloud.container.drivers.dummy import DummyContainerDriver
>>> driver = DummyContainerDriver('key', 'secret')
>>> driver.name
'Dummy Container Provider'
... |
'''
C3D CNN architecture
Webpage for original:
http://vlg.cs.dartmouth.edu/c3d/
Paper for original:
D. Tran, L. Bourdev, R. Fergus, L. Torresani, and M. Paluri
Learning Spatiotemporal Features with 3D Convolutional Networks
ICCV 2015
http://vlg.cs.dartmouth.edu/c3d/c3d_video.pdf
Designed for Sports-1M Dataset
'''
f... |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for zip functions.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__a... |
try:
# Available in Python 3
from tokenize import open as open_py_source
except ImportError:
# Copied from python3 tokenize
from codecs import lookup, BOM_UTF8
import re
from io import TextIOWrapper, open
cookie_re = re.compile("coding[:=]\s*([-\w.]+)")
def _get_normal_name(orig_enc):
... |
"""
Module for factory class for BlockStructure objects.
"""
from .block_structure import BlockStructureModulestoreData, BlockStructureBlockData
class BlockStructureFactory(object):
"""
Factory class for BlockStructure objects.
"""
@classmethod
def create_from_modulestore(cls, root_block_usage_key... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import StringIO
import os
import codecs
import ConfigParser
import re
from ansible.errors import *
from ansible.plugins.lookup import LookupBase
class LookupModule(LookupBase):
def read_properties(self, filename, key, dflt, ... |
#!/usr/bin/env python
from PySide import QtCore, QtGui
class QActorWidget(QtGui.QWidget):
def __init__(self, cb, parent=None):
self.cb = cb
self.parent = parent
QtGui.QWidget.__init__(self, parent)
self.groupLayout = QtGui.QVBoxLayout(self)
self.groupTabs = QtGui.QTabWidget()
self.groupLayout.addWidget(s... |
from hachoir_core.field import (FieldSet,
UInt16, UInt32, Enum, String, Bytes, Bits, TimestampUUID60)
from hachoir_parser.video.fourcc import video_fourcc_name
from hachoir_core.bits import str2hex
from hachoir_core.text_handler import textHandler, hexadecimal
from hachoir_parser.network.common import MAC48_Address... |
"""Define names for all type symbols known in the standard interpreter.
Types that are part of optional modules (e.g. array) are not listed.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import glob
import os
import sys
from . import Command
from .server import main
from openerp.modules.module import get_module_root, MANIFEST
from openerp.service.db import _create_empty_database, DatabaseExists
class Start(Command):
"""Quick start the... |
import io
import yaml
from ansible.module_utils.six import PY3
from ansible.parsing.yaml.loader import AnsibleLoader
from ansible.parsing.yaml.dumper import AnsibleDumper
class YamlTestUtils(object):
"""Mixin class to combine with a unittest.TestCase subclass."""
def _loader(self, stream):
"""Vault r... |
import psycopg2
import psycopg2.extensions
import unittest
import gc
from testutils import ConnectingTestCase, skip_if_no_uuid
class StolenReferenceTestCase(ConnectingTestCase):
@skip_if_no_uuid
def test_stolen_reference_bug(self):
def fish(val, cur):
gc.collect()
return 42
... |
#!/usr/bin/env python
# encoding: utf-8
"""
process.py
Copyright (c) 2011 Adam Cohen
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights t... |
from PyQt5.QtCore import QTimer, pyqtSignal, pyqtProperty
from UM.Application import Application
from UM.Scene.Camera import Camera
from UM.Scene.Selection import Selection
from UM.Qt.ListModel import ListModel
#
# This is the model for multi build plate feature.
# This has nothing to do with the build plate types y... |
from openerp import fields, models, api
class product_pack(models.Model):
_name = 'product.pack.line'
_rec_name = 'product_id'
parent_product_id = fields.Many2one(
'product.product',
'Parent Product',
ondelete='cascade',
required=True
)
quantity = fields.Float(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the DATO-PYTHON-LICENSE file for details.
'''
import sys
import parser
import symbol
import token
import ast
import inspect
import ... |
from types import GeneratorType
from django.utils.copycompat import copy, deepcopy
class MergeDict(object):
"""
A simple class for creating new "virtual" dictionaries that actually look
up values in more than one dictionary, passed in the constructor.
If a key appears in more than one of the given d... |
import re
from copy import deepcopy
from os import path
from random import choice
from string import ascii_letters
from string import digits
import pytest
from manageiq_client.api import APIException
from cfme import test_requirements
from cfme.containers.provider import ContainersProvider
from cfme.containers.provid... |
"""SCons.Tool.rpcgen
Tool-specific initialization for RPCGEN tools.
Three normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of... |
"""Library of Cloud TPU helper functions for data loading."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.data.experimental.ops import batching
from tensorflow.python.data.experimental.ops import interleave_ops
from tensorflow.pyt... |
# -----------------------------------------------------------------------------
# yacc_badprec2.py
#
# Bad precedence
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import tokens
# Parsin... |
from . import constants
import sys
from .charsetprober import CharSetProber
class CharSetGroupProber(CharSetProber):
def __init__(self):
CharSetProber.__init__(self)
self._mActiveNum = 0
self._mProbers = []
self._mBestGuessProber = None
def reset(self):
CharSetProber.r... |
import re
from django.template.loader import get_template
from django.template import Context
from django.templatetags.static import static
from .base import MediaContentHandlerBase
class PreziMediaContentHandler(MediaContentHandlerBase):
def get_iframe_template(self, content_id, **kwargs):
template = g... |
import os
import sys
from alize.log import Log
from alize.exception import *
try :
from slacker import Slacker
except Exception as e:
print(str(e))
L = Log("Slack.Library.ALIZE")
class Slack(object):
def __init__(self, token):
try:
self.slack = Slacker(token)
except Exception... |
# downscale the prepped cmip5 data downloaded using SYNDA for EPSCoR SC project
if __name__ == '__main__':
import glob, os, rasterio, itertools
from functools import partial
import downscale
from downscale import preprocess, Mask, utils
import argparse
import numpy as np
# # parse the commandline arguments
par... |
# Posix-only benchmark
from __future__ import division, absolute_import, print_function
import os
import sys
import re
import subprocess
import time
import textwrap
from numpy.testing import dec
from scipy.stats import spearmanr
import numpy as np
@dec.skipif(not sys.platform.startswith('linux'), "Memory benchmark... |
import bpy
from io_scs_tools import bl_info
def __get_bl_info_version__(key):
"""Gets version string from bl_info dictonary for given key.
:param key: key in bl_info contaning version tuple (X, X, X, ..) where X is int number
:type key: str
:return: string representation of bl_info dictionary value f... |
#!/usr/bin/python
from __future__ import division
from pprint import pprint
import cPickle
import os
import warnings
from zcov import GCovParser
class GCovGroup:
@staticmethod
def fromfile(path):
f = open(path)
try:
res = cPickle.load(f)
header,version = res[0],res[1... |
import yaml
import pprint
import datetime
import yaml.tokens
def execute(code):
global value
exec(code)
return value
def _make_objects():
global MyLoader, MyDumper, MyTestClass1, MyTestClass2, MyTestClass3, YAMLObject1, YAMLObject2, \
AnObject, AnInstance, AState, ACustomState, InitArgs,... |
"""Contains the definition of a Dataset.
A Dataset is a collection of several components: (1) a list of data sources
(2) a Reader class that can read those sources and returns possibly encoded
samples of data (3) a decoder that decodes each sample of data provided by the
reader (4) the total number of samples and (5) ... |
"""Wrapper script to help run clang tools across Chromium code.
How to use this tool:
If you want to run the tool across all Chromium code:
run_tool.py <tool> <path/to/compiledb>
If you want to include all files mentioned in the compilation database:
run_tool.py <tool> <path/to/compiledb> --all
If you only want to r... |
"""
Control flow utilities.
"""
from warnings import (
catch_warnings,
filterwarnings,
)
class nullctx(object):
"""
Null context manager. Useful for conditionally adding a contextmanager in
a single line, e.g.:
with SomeContextManager() if some_expr else nullctx():
do_stuff()
"""... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils._text import to_native
from ansible.module_utils.aws.batch import AWSConnection
from ansible.module_utils.basic import AnsibleModule
from ansible.module_u... |
from __future__ import unicode_literals
import datetime
from django.contrib.localflavor.generic.forms import DateField, DateTimeField
from django.test import SimpleTestCase
class GenericLocalFlavorTests(SimpleTestCase):
def test_GenericDateField(self):
error_invalid = ['Enter a valid date.']
va... |
import sys
import subprocess
def execute_format_command(cmd='scons -C firmware format'):
"""Execute the format command and return the result."""
output = subprocess.check_output(cmd, shell=True)
return output.decode('utf-8')
def check_command_output(output):
"""Check if the output contains 'Formatt... |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import DataRequired, Length, Email, Regexp, EqualTo
from wtforms.widgets import PasswordInput
from wtforms import ValidationError
import safe
from ..models import User
class PasswordWidget... |
import os
import re
# ----------------------- MAIN -------------------------
java_header = open("org_openni_NativeMethods.h")
cont = java_header.read()
java_header.close()
result = open("methods.inl", "w")
result.write("static JNINativeMethod methods[] = {\n")
while True:
match = re.search("Method:\s*(\w*)", cont... |
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy import sql
from neutron.db import model_base
from neutron.db import models_v2
class ResourceDelta(model_base.BASEV2):
resource = sa.Column(sa.String(255), primary_key=True)
reservation_id = sa.Column(sa.String(36),
... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
from ansible.module_utils.aws.core import AnsibleAWSModule
from ansible.module_utils.ec2 import boto3_conn, get_aws_connection_info
try:
from botocore.exceptions import Client... |
'''
"jscompile" plugin for cocos2d command line tool
'''
__docformat__ = 'restructuredtext'
import sys
import subprocess
import os
import json
import inspect
import cocos2d
class CCPluginJSCompile(cocos2d.CCPlugin):
"""
compiles (encodes) and minifies JS files
"""
@staticmethod
def brief_descri... |
{
'name': 'OeMedical : Module Data',
'version': '1.0',
'author': "OeMEdical Team",
'category': 'Generic Modules/Others',
'depends': ['oemedical'],
'application': True,
'description': """
About OeMedical Data
---------------------
Core Data for oemedical, is kept as a separate module to ov... |
import multiprocessing
import os
import signal
import time
from six import moves
from tempest import auth
from tempest import clients
from tempest.common import ssh
from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
from tempest.openstack.common import importutils
fr... |
"""Utility functions for the pyxmpp package."""
__docformat__ = "restructuredtext en"
def xml_elements_equal(element1, element2, ignore_level1_cdata = False):
"""Check if two XML elements are equal.
:Parameters:
- `element1`: the first element to compare
- `element2`: the other element to c... |
from django.core.urlresolvers import reverse
from tastypie import authorization
from tastypie.authentication import MultiAuthentication
from crits.raw_data.raw_data import RawData
from crits.raw_data.handlers import handle_raw_data_file
from crits.core.api import CRITsApiKeyAuthentication, CRITsSessionAuthentication
f... |
"""Functions to support building models for StreetView text transcription."""
import tensorflow as tf
from tensorflow.contrib import slim
def logits_to_log_prob(logits):
"""Computes log probabilities using numerically stable trick.
This uses two numerical stability tricks:
1) softmax(x) = softmax(x - c) where... |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... |
import testtools
import webob
from glance.api import cached_images
from glance.api import policy
from glance.common import exception
from glance import image_cache
class FakePolicyEnforcer(policy.Enforcer):
def __init__(self):
self.default_rule = ''
self.policy_path = ''
self.policy_file_... |
"""
Verifies actions with multiple outputs & dependncies will correctly rebuild.
This is a regression test for crrev.com/1177163002.
"""
import TestGyp
import os
import sys
import time
if sys.platform in ('darwin', 'win32'):
print "This test is currently disabled: https://crbug.com/483696."
sys.exit(0)
test = T... |
#
# test_codecencodings_jp.py
# Codec encoding tests for Japanese encodings.
#
from test import support
from test import multibytecodec_support
import unittest
class Test_CP932(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'cp932'
tstring = multibytecodec_support.load_teststring('shift_jis... |
from django.shortcuts import get_object_or_404
from django.views.generic.detail import DetailView
from django.views import View
from django.utils.translation import (
get_language,
gettext_lazy as _
)
from django.contrib.auth.mixins import (
LoginRequiredMixin,
UserPassesTestMixin
)
from django.http im... |
import re
import uuid
import six
from django_extensions.db.fields import PostgreSQLUUIDField
from django_extensions.tests.fields import FieldTestCase
from django_extensions.tests.testapp.models import UUIDTestModel_field, UUIDTestModel_pk, UUIDTestAgregateModel, UUIDTestManyToManyModel
class UUIDFieldTest(FieldTest... |
import unittest
class TestEquality(object):
"""Used as a mixin for TestCase"""
# Check for a valid __eq__ implementation
def test_eq(self):
for obj_1, obj_2 in self.eq_pairs:
self.assertEqual(obj_1, obj_2)
self.assertEqual(obj_2, obj_1)
# Check for a valid __ne__ impl... |
import functools
import random
import re
import string
import time
import types
import uuid
from glanceclient import exc as glance_exc
from oslo_log import log as logging
from oslo_utils import importutils
from cinder import context
from cinder import exception
from cinder.i18n import _
from cinder.image import glanc... |
import logging
from datetime import datetime
from sqlalchemy.ext.hybrid import hybrid_property
from normality import normalize
from aleph.core import db
log = logging.getLogger(__name__)
class Selector(db.Model):
id = db.Column(db.Integer, primary_key=True)
_text = db.Column('text', db.Unicode, index=True)... |
import logging
from collections import OrderedDict
from synnefo.logic.networks import validate_network_action
from synnefo.logic import networks
from synnefo_admin.admin.actions import AdminAction, noop
from synnefo_admin.admin.utils import update_actions_rbac, send_admin_email
class NetworkAction(AdminAction):
... |
from __future__ import print_function, unicode_literals
import unittest
import time
import datetime
from voodoo.override import Override
from voodoo.gen import CoordAddress
from weblab.data.experiments import ExperimentId
from weblab.data.command import Command
import weblab.core.data_retriever as TemporalInformat... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
try:
from ansible.module_utils.avi import (
avi_common_argument_spec, HAS_AVI, avi_ansible_api)
except ImportError:... |
from .common import *
class TestBucketWorm(OssTestCase):
def test_bucke_worm_normal(self):
init_result = self.bucket.init_bucket_worm(1)
worm_id = init_result.worm_id
self.assertIsNotNone(init_result.request_id)
get_result = self.bucket.get_bucket_worm()
self.assertIsNotNon... |
# -*- coding: utf-8 -*-
"""
This module has implementation of executors wrapped by
:py:class:`streams.executors.mixins.PoolOfPoolsMixin` and applicable to work
with :py:class:`streams.poolofpools.PoolOfPools`.
Basically all of them are thin extensions of classes from
:py:mod:`concurrent.futures`.
"""
###############... |
from base64 import b64encode
import httplib
import xmlrpclib
class BasicAuthTransport(xmlrpclib.Transport):
def __init__(self, secure=False, username=None, password=None):
xmlrpclib.Transport.__init__(self)
self.secure = secure
self.username = username
self.password = password
... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Polygonize.py
---------------------
Date : March 2013
Copyright : (C) 2013 by Piotr Pociask
Email : ppociask at o2 dot pl
*******************************... |
import unittest2 as unittest
from webkitpy.common.system.platforminfo_mock import MockPlatformInfo
from webkitpy.common.system.systemhost_mock import MockSystemHost
from .profiler import ProfilerFactory, GooglePProf
class ProfilerFactoryTest(unittest.TestCase):
def _assert_default_profiler_name(self, os_name, e... |
import logging
import re
from django import http
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.core.mail import mail_managers
from django.urls import is_valid_path
from django.utils.cache import get_conditional_response, set_response_etag
from django.utils.deprecation... |
{
"name": "Bolivia Localization Chart Account",
"version": "1.0",
"description": """
Bolivian accounting chart and tax localization.
Plan contable boliviano e impuestos de acuerdo a disposiciones vigentes
""",
"author": "Cubic ERP",
"website": "http://cubicERP.com",
"category": "Localizati... |
import unittest
from airflow.ti_deps.deps.dag_ti_slots_available_dep import DagTISlotsAvailableDep
from fake_models import FakeDag, FakeTask, FakeTI
class DagTISlotsAvailableDepTest(unittest.TestCase):
def test_concurrency_reached(self):
"""
Test concurrency reached should fail dep
"""
... |
from netforce.model import Model, fields, get_model
class Department(Model):
_name = "hr.department"
_string = "Department"
_key = ["name"]
_fields = {
"name": fields.Char("Name", required=True, search=True),
"code": fields.Char("Code"),
"comments": fields.One2Many("message", "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.