content string |
|---|
from oslo.config import cfg
#NOTE this import loads tests required options
from neutron.plugins.mlnx.common import config # noqa
from neutron.tests import base
class ConfigurationTest(base.BaseTestCase):
def test_defaults(self):
self.assertEqual(2,
cfg.CONF.AGENT.polling_interv... |
import socket
import re
socket.setdefaulttimeout(5)
class Ec2Metadata(object):
ec2_metadata_uri = 'http://169.254.169.254/latest/meta-data/'
ec2_sshdata_uri = 'http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key'
ec2_userdata_uri = 'http://169.254.169.254/latest/user-data/'
AWS_REGION... |
from datetime import datetime, time
from django.template.defaultfilters import date
from django.test import SimpleTestCase, override_settings
from django.utils import timezone, translation
from ..utils import setup
from .timezone_utils import TimezoneTestCase
class DateTests(TimezoneTestCase):
@setup({'date01'... |
import logging
import pylib.android_commands
import pylib.device.device_utils
class FlagChanger(object):
"""Changes the flags Chrome runs with.
There are two different use cases for this file:
* Flags are permanently set by calling Set().
* Flags can be temporarily set for a particular set of unit tests. T... |
'''
Consul.io inventory script (http://consul.io)
======================================
Generates Ansible inventory from nodes in a Consul cluster. This script will
group nodes by:
- datacenter,
- registered service
- service tags
- service status
- values from the k/v store
This script can be run with the swit... |
from . import ir_attachment
from . import knowledge_config_settings |
#=======================================================================================================================
# getopt code copied since gnu_getopt is not available on jython 2.1
#=======================================================================================================================
class Get... |
import calendar
import datetime
import re
import sys
import urllib
import urlparse
from email.utils import formatdate
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import smart_str, force_unicode
from django.utils.functional import allow_lazy
ETAG_MATCH = re.compile(r'(?:W/)?"((?:\... |
# -*- coding:utf-8 -*-
# Cyril Fournier
# 20/01/2016
import os,sys
import wx
import threading
import Queue
import time
import UtilsAndGlobal as UAG
from Cell import Cell
from Map import Map
from UI import UI, UICatcher
from GhostAI import GhostAI
from Graphical import Graphical
from Pacman import Pacman, PacmanGame
... |
import logging
_logger = logging.getLogger(__name__)
from openerp.osv import fields, osv
from openerp.tools.translate import _
import time
from datetime import date, datetime, timedelta
class doctor_room(osv.osv):
_name = "doctor.room"
_description = "It allows you to create multiple doctor rooms."
_columns = {
... |
"""Interface to the compiler's internal symbol tables"""
import _symtable
from _symtable import (USE, DEF_GLOBAL, DEF_NONLOCAL, DEF_LOCAL, DEF_PARAM,
DEF_IMPORT, DEF_BOUND, DEF_ANNOT, SCOPE_OFF, SCOPE_MASK, FREE,
LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL)
import weakref
__all__ = ["symtable", "SymbolTa... |
"""GATK variant calling -- HaplotypeCaller and UnifiedGenotyper.
"""
from distutils.version import LooseVersion
import toolz as tz
from bcbio import bam, broad, utils
from bcbio.distributed.transaction import file_transaction
from bcbio.pipeline import config_utils
from bcbio.pipeline.shared import subset_variant_reg... |
from django.http import HttpResponse
import simplejson as json
def idx(a, id, default = None):
if a.has_key(id):
return a[id]
return default
def printItems(dictObj, indent):
ret = ""
ret = ret + ' '*indent + '<ul>\n'
for k,v in dictObj.iteritems():
if isinstance(v, dict):
... |
"""The tests the Graph component."""
import unittest
from homeassistant.setup import setup_component
from tests.common import init_recorder_component, get_test_home_assistant
class TestGraph(unittest.TestCase):
"""Test the Google component."""
def setUp(self): # pylint: disable=invalid-name
"""Set... |
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 ReadBikes(Choreography):
def __init__(self, temboo_session):
"""
Create a new... |
import os
from optparse import OptionParser, SUPPRESS_HELP
import ase.gui.i18n
from gettext import gettext as _
# Grrr, older versions (pre-python2.7) of optparse have a bug
# which prevents non-ascii descriptions. How do we circumvent this?
# For now, we'll have to use English in the command line options then.
def... |
from __future__ import unicode_literals
import datetime
from django.test import TestCase
from .models import Article, Comment, Category
class DatesTests(TestCase):
def test_related_model_traverse(self):
a1 = Article.objects.create(
title="First one",
pub_date=datetime.date(2005,... |
"""Basic checks for HomeKit sensor."""
from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import ServicesTypes
from homeassistant.const import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_TEMPERATURE,
)
from tests.c... |
# -*- coding: utf-8 -*-
"""
pygments.styles.vs
~~~~~~~~~~~~~~~~~~
Simple style with MS Visual Studio colors.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keywo... |
import threading
import traceback
from kombu import Connection
from kombu.mixins import ConsumerMixin
from nailgun.db import db
from nailgun.errors import errors
from nailgun.logger import logger
import nailgun.rpc as rpc
from nailgun.rpc.receiver import NailgunReceiver
class RPCConsumer(ConsumerMixin):
def __... |
import functools
try:
import json
except ImportError:
import simplejson as json
import pytest
from fabric.api import cd, run
from fabtools.files import is_file
from fabtools.require import directory as require_directory
from fabtools.require import file as require_file
pytestmark = pytest.mark.network
@p... |
from ctypes import *
import unittest
import os
import ctypes
import _ctypes_test
class BITS(Structure):
_fields_ = [("A", c_int, 1),
("B", c_int, 2),
("C", c_int, 3),
("D", c_int, 4),
("E", c_int, 5),
("F", c_int, 6),
... |
import gtk
import gobject
import sys
import traceback
from cStringIO import StringIO
from HIGDialog import HIGDialog
from LogView import LogView
# define some Dialog icons
_ERROR = gtk.STOCK_DIALOG_ERROR
_INFO = gtk.STOCK_DIALOG_INFO
_QUESTION = gtk.STOCK_DIALOG_QUESTION
_WARNING = gtk.STOCK_DIALOG_WARNING
# we onl... |
DATA_SOURCE = 'data/dialog-bAbI-tasks/dialog-babi-candidates.txt'
DATA_SOURCE_TASK6 = 'data/dialog-bAbI-tasks/dialog-babi-task6-dstc2-candidates.txt'
DATA_DIR = 'dialog-bAbI-tasks/dialog-babi-candidates.txt'
STOP_WORDS=set(["a","an","the"])
import re
import os
from itertools import chain
from six.moves import range,... |
# Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... |
from Kamaelia.Device.DVB.Core import DVB_Multiplex, DVB_Demuxer
from Axon.Component import component
import struct
from Axon.Ipc import shutdownMicroprocess,producerFinished
class PSIPacketReconstructor(component):
"""\
Takes DVB Transport stream packets for a given PID and reconstructs the
PSI packets fro... |
#!/usr/bin/python3
from amazonia.classes.elb import Elb
from amazonia.classes.elb_config import ElbConfig, ElbListenersConfig
from network_setup import get_network_config
def main():
network_config, template = get_network_config()
elb_listeners_config = [
ElbListenersConfig(
instance_por... |
"""
Test cases for image processing functions in the profile image package.
"""
from contextlib import closing
from itertools import product
import os
from tempfile import NamedTemporaryFile
import unittest
from django.conf import settings
from django.core.files.uploadedfile import UploadedFile
from django.test import... |
from __future__ import unicode_literals
import imp
import os
import sys
from mach.base import MachError
from mach.test.common import TestBase
from mock import patch
from mozunit import main
here = os.path.abspath(os.path.dirname(__file__))
class Entry():
"""Stub replacement for pkg_resources.EntryPoint"""
... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class YourUploadIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:yourupload\.com/watch|
embed\.yourupload\.com|
embed\.yucache\.net
)/(?P<id>[A-Za-z0-9]+)
'''
... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2013-2016 Alex Forencich
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... |
import socket
import threading
import json
class EnablerConnection():
def __init__(self):
self.connections = []
self.stopped = False
self.enabler_listening_port = 50001
self.local_ip = socket.gethostbyname(socket.gethostname())
t = threading.Thread(target=self.listen_loop,... |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import re
class Keyworder(object):
TOKEN_MAP = [
("slug", "([a-z0-9\-]+)"),
("letters", "([a-z]+)"),
("numbers", "(\d+)"),
("whatever", "(.+)")]
def __init__(self):
self.regexen = []
self.prefix = ""
... |
"""
Desired syntax:
gaurdian = MaxDepth(10) & HasAttr('__dict__')
if gaurdian(current, path):
# ....
walker(obj, gaurd=MaxDepth(10) & HasAttr('__dict__'))
@note: I put example wrapper decorators at the bottom.
@todo: Come up with simple-ish logical structure alternative to the wrapper decora... |
from __future__ import absolute_import
import logging
import gensim
import pandas as pd
# imports used only for doctests
from topik.readers import read_input
from topik.tests import test_data_path
from topik.preprocessing import preprocess
class LDA(object):
"""A high interface for an LDA (Latent Dirichlet All... |
# -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CourseEmail'
db.create_table('bulk_email_courseemail', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True... |
import m5
from m5.objects import *
# both traffic generator and communication monitor are only available
# if we have protobuf support, so potentially skip this test
require_sim_object("TrafficGen")
require_sim_object("CommMonitor")
# even if this is only a traffic generator, call it cpu to make sure
# the scripts ar... |
import os
import sys
import linecache
from TreeWidget import TreeNode, TreeItem, ScrolledCanvas
from ObjectBrowser import ObjectTreeItem, make_objecttreeitem
def StackBrowser(root, flist=None, tb=None, top=None):
if top is None:
from Tkinter import Toplevel
top = Toplevel(root)
sc = ScrolledCa... |
from __future__ import division
import locale
import logging
import time
from portage import os, _unicode_decode
from portage.exception import PortageException
from portage.localization import _
from portage.output import EOutput
from portage.util import grabfile, writemsg_level
def have_english_locale():
lang, enc... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class Canal13clIE(InfoExtractor):
_VALID_URL = r'^http://(?:www\.)?13\.cl/(?:[^/?#]+/)*(?P<id>[^/?#]+)'
_TEST = {
'url': 'http://www.13.cl/t13/nacional/el-circulo-de-hierro-de-michelle-bachelet-en-su-... |
import unittest
from ctypes import *
from ctypes.test import need_symbol
from struct import calcsize
import _testcapi
class SubclassesTest(unittest.TestCase):
def test_subclass(self):
class X(Structure):
_fields_ = [("a", c_int)]
class Y(X):
_fields_ = [("b", c_... |
from __future__ import unicode_literals
import webnotes, unittest
from webnotes.utils import flt
import json
from accounts.utils import get_fiscal_year, get_stock_and_account_difference, get_balance_on
class TestStockReconciliation(unittest.TestCase):
def test_reco_for_fifo(self):
webnotes.defaults.set_global_defa... |
import os
from sets import Set
from get_lineStroke import getLineStroke
from get_targetStrings import getTargetString
from get_xmlFileName import getXmlNames
import netcdf_helpers
import numpy as np
targetStrings = []
wordTargetStrings = []
charSet = Set()
inputs = []
labels = []
seqDims = []
seqLengths = []
seqTag... |
from __future__ import print_function, unicode_literals
import frappe
from frappe.email import sendmail_to_system_managers
from frappe.utils import get_link_to_form
def execute():
wrong_records = []
for dt in ("Quotation", "Sales Order", "Delivery Note", "Sales Invoice",
"Purchase Order", "Purchase Receipt", "Pur... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from skimage.transform import PiecewiseAffineTransform, warp
from skimage import data
#---------------------------------------------------------------------
# REF [site] >> http://scikit-image.org/docs/stable/auto_exampl... |
# -*- coding:utf-8 -*-
"""
/***************************************************************************
qgsplugininstallerinstallingdialog.py
Plugin Installer module
-------------------
Date : June 2013
Copyright ... |
from itertools import cycle
from PIL import Image
from PIL import ImageTk
try:
# Python2
import Tkinter as tk
except ImportError:
# Python3
import tkinter as tk
class App(tk.Tk):
def __init__(self, image_files, x, y, delay):
tk.Tk.__init__(self)
self.geometry('+{}+{}'.format(x, y))... |
"""cases
Revision ID: 9474324542c6
Revises:
Create Date: 2017-06-08 09:02:37.384472
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9474324542c6'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by... |
"""Drop-in replacement for collections.OrderedDict by Raymond Hettinger
http://code.activestate.com/recipes/576693/
"""
from UserDict import DictMixin
# Modified from original to support Python 2.4, see
# http://code.google.com/p/simplejson/issues/detail?id=53
try:
all
except NameError:
def all(seq):
... |
"""Execution Callbacks for Eager Mode."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import functools
import enum # pylint: disable=g-bad-import-order
import numpy as np
from tensorflow.python import pywrap_tensorflow
from tensorfl... |
import urllib
from lxml import etree
from tempest.common.rest_client import RestClientXML
from tempest.services.compute.xml.common import xml_to_json
class TenantUsagesV3ClientXML(RestClientXML):
def __init__(self, config, username, password, auth_url, tenant_name=None):
super(TenantUsagesV3ClientXML, ... |
from spack import *
class FontBitstreamType1(Package):
"""X.org bitstream-type1 font."""
homepage = "http://cgit.freedesktop.org/xorg/font/bitstream-type1"
url = "https://www.x.org/archive/individual/font/font-bitstream-type1-1.0.3.tar.gz"
version('1.0.3', 'ff91738c4d3646d7999e00aa9923f2a0')
... |
"""
Tests for SplitTestTransformer.
"""
import ddt
import openedx.core.djangoapps.user_api.course_tag.api as course_tag_api
from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme
from student.tests.factories import CourseEnrollmentFactory
from xmodule.partitions.partitions import Grou... |
from PIL import Image
from PIL._util import isPath
import sys
if 'PyQt4.QtGui' not in sys.modules:
try:
from PyQt5.QtGui import QImage, qRgba
except:
try:
from PyQt4.QtGui import QImage, qRgba
except:
from PySide.QtGui import QImage, qRgba
else: #PyQt4 is used
... |
#-*- coding: utf-8 -*-
from django.forms.models import modelform_factory
from django.contrib import admin
from django.http import HttpResponse
from django.utils import simplejson
from django.views.decorators.csrf import csrf_exempt
from filer import settings as filer_settings
from filer.models import Clipboard, Clipboa... |
import win32api, win32security
import win32con, ntsecuritycon, winnt
import os
temp_dir=win32api.GetTempPath()
fname=win32api.GetTempFileName(temp_dir,'rsk')[0]
print fname
## file can't exist
os.remove(fname)
## enable backup and restore privs
required_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE... |
from code import Code
from model import PropertyType
import cpp_util
import model
import os
class HGenerator(object):
"""A .h generator for a namespace.
"""
def __init__(self, namespace, cpp_type_generator):
self._cpp_type_generator = cpp_type_generator
self._namespace = namespace
self._target_namesp... |
"""SCons.Tool.RCS.py
Tool-specific initialization for RCS.
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.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Perm... |
from nose.tools import assert_raises
import gevent
import sys
from zerorpc import zmq
import zerorpc
from testutils import teardown, random_ipc_endpoint
def test_client_server_client_timeout_with_async():
endpoint = random_ipc_endpoint()
class MySrv(zerorpc.Server):
def lolita(self):
re... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
from mock import ANY
from ansible.module_utils.network.fortios.fortios import FortiOSHandler
try:
from ansible.modules.network.fortios import fortios_system_auto_install
except ImportError:
... |
#!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-fix-ld-lib
########################################################################
__RCSID__ = "$Id$"
""" This is a script to fix oversized LD_LIBRARY_PATH variables.
"""
import sys, os, shutil,... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import parse_duration
class Canalc2IE(InfoExtractor):
IE_NAME = 'canalc2.tv'
_VALID_URL = r'https?://(?:(?:www\.)?canalc2\.tv/video/|archives-canalc2\.u-strasbg\.fr/video\.asp\?.*\bidVideo=)(?P<i... |
#! /usr/bin/env python
import argparse
import time
import subprocess
import sys
import re
from subprocess import CalledProcessError
"""
A script to push releases to Google Play
See samples: https://github.com/googlesamples/android-play-publisher-api
Requires Google API python client
Insall with: pip install google-... |
import binascii
import codecs
import getopt
import hashlib
import json
import random
import sys
import time
def usage():
print "usage:"
print "generate_site_sql.py sitename"
print "reads sitename.json outputs sitename.sql"
def is_number(s):
try:
float(s)
return True
except ValueErr... |
"""
Tcpdump parser
Source:
* libpcap source code (file savefile.c)
* RFC 791 (IPv4)
* RFC 792 (ICMP)
* RFC 793 (TCP)
* RFC 1122 (Requirements for Internet Hosts)
Author: Victor Stinner
Creation: 23 march 2006
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, ParserError,
Enum, ... |
import os
import sys
import datetime, time
import re
import ftplib
import shutil
from constants import ServerType
from utils import get_file_list
from utils import import_module
from utils import concatenate_dirs
from models import logger
def get_server_impl(server):
if server.server_type == Serve... |
from Screens.Wizard import wizardManager, WizardSummary
from Screens.WizardLanguage import WizardLanguage
from Screens.Rc import Rc
from Screens.MessageBox import MessageBox
from Components.Pixmap import Pixmap, MovingPixmap, MultiPixmap
from Components.Sources.Boolean import Boolean
from Components.Network import iNet... |
"""Tests for the Policy."""
from absl.testing import absltest
from absl.testing import parameterized
import jax
import jax.numpy as jnp
import jax.test_util
from ott.core import sinkhorn
from ott.geometry import pointcloud
class SinkhornUnbalancedTest(jax.test_util.JaxTestCase):
def setUp(self):
super().setU... |
from sparktk.loggers import log_load; log_load(__name__); del log_load
from sparktk.propobj import PropertiesObject
from sparktk.frame.ops.classification_metrics_value import ClassificationMetricsValue
import os
def train(frame,
label_column,
observation_columns,
num_classes = 2,
... |
from openerp import api
from openerp.osv import fields,osv
from openerp.tools.translate import _
WARNING_MESSAGE = [
('no-message','No Message'),
('warning','Warning'),
('block','Blocking Message')
]
WARNING_HELP = _('Selecting the "Warning" ... |
from setuptools import setup, find_packages
from hueversion import VERSION
setup(
name = "rdbms",
version = VERSION,
author = "Hue",
url = 'http://github.com/cloudera/hue',
description = "Queries against an RDBMS.",
packages = find_packages('src'),
package_dir = {'': 'src'},
... |
#! /usr/bin/env python
from __future__ import division, absolute_import, print_function
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = TypeE... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
sanitized_Request,
urlencode_postdata,
xpath_text,
xpath_with_ns,
)
_x = lambda p: xpath_with_ns(p, {'xspf': 'http://xspf.org/ns/0/'})
class NosVideoIE(InfoE... |
# Since this package contains a "jinja2" directory, this is required to
# silence an ImportWarning warning on Python 2.
from __future__ import absolute_import
from unittest import skipIf
from django.template import TemplateSyntaxError
from .test_dummy import TemplateStringsTests
try:
import jinja2
except Import... |
from boto.exception import JSONResponseError
class ClusterNotFoundFault(JSONResponseError):
pass
class InvalidClusterSnapshotStateFault(JSONResponseError):
pass
class ClusterSnapshotNotFoundFault(JSONResponseError):
pass
class ClusterSecurityGroupQuotaExceededFault(JSONResponseError):
pass
cla... |
import collections
from measurements import startup
from metrics import cpu
from metrics import startup_metric
from telemetry.core import util
from telemetry.value import histogram_util
class SessionRestore(startup.Startup):
"""Performs a measurement of Chromium's Session restore performance.
This test is meant... |
try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.core import signing
from django.contrib.sessions.backends.base import SessionBase
class PickleSerializer(object):
"""
Simple wrapper around pickle to be used in signing.dumps and
signing.... |
from __future__ import division, print_function
import logging
from gettext import gettext as _
from gi.repository import Gtk
from gi.repository import GLib
import tileddrawwidget
import windowing
import lib.document
from document import CanvasController
from freehand import FreehandMode
import brushmanager
from lib... |
#!/usr/bin/env python
__author__ = 'rolandh'
import copy
import sys
import os
import re
import logging
import logging.handlers
from importlib import import_module
from saml2 import root_logger, BINDING_URI, SAMLError
from saml2 import BINDING_SOAP
from saml2 import BINDING_HTTP_REDIRECT
from saml2 import BINDING_HT... |
import tests
import gtk
import pango
from zim.index import Index, IndexPath, IndexTag
from zim.notebook import Path
from zim.gui.pageindex import FGCOLOR_COL, \
EMPTY_COL, NAME_COL, PATH_COL, STYLE_COL
# Explicitly don't import * from pageindex, make clear what we re-use
from zim.config import ConfigDict
from zim.p... |
"""Global database feature support policy.
Provides decorators to mark tests requiring specific feature support from the
target database.
"""
from testing import \
_block_unconditionally as no_support, \
_chain_decorators_on, \
exclude, \
emits_warning_on,\
skip_if,\
fails_on,\
fai... |
import sys
from test import support, list_tests
class ListTest(list_tests.CommonTest):
type2test = list
def test_basic(self):
self.assertEqual(list([]), [])
l0_3 = [0, 1, 2, 3]
l0_3_bis = list(l0_3)
self.assertEqual(l0_3, l0_3_bis)
self.assertTrue(l0_3 is not l0_3_bis)
... |
#!/usr/bin/env python
"""This is the GRR class registry.
A central place responsible for registering plugins. Any class can have plugins
if it defines __metaclass__ = MetaclassRegistry. Any derived class from this
baseclass will have the member classes as a dict containing class name by key
and class as value.
"""
#... |
import unittest
from scrapy.settings import BaseSettings
from scrapy.utils.conf import build_component_list, arglist_to_dict
class BuildComponentListTest(unittest.TestCase):
def test_build_dict(self):
d = {'one': 1, 'two': None, 'three': 8, 'four': 4}
self.assertEqual(build_component_list(d, con... |
"""Tests for cross-domain request views. """
import json
from django.test import TestCase
from django.core.urlresolvers import reverse, NoReverseMatch
import ddt
from config_models.models import cache
from cors_csrf.models import XDomainProxyConfiguration
@ddt.ddt
class XDomainProxyTest(TestCase):
"""Tests for... |
# import cloudstack common
from ansible.module_utils.cloudstack import *
class AnsibleCloudStackIPAddress(AnsibleCloudStack):
def __init__(self, module):
super(AnsibleCloudStackIPAddress, self).__init__(module)
self.returns = {
'ipaddress': 'ip_address',
}
#TODO: Add to ... |
"""
Cryptarithmetic puzzle in Google CP Solver.
Prolog benchmark problem GNU Prolog (crypta.pl)
'''
Name : crypta.pl
Title : crypt-arithmetic
Original Source: P. Van Hentenryck's book
Adapted by : Daniel Diaz - INRIA France
Date : September 1992
Solve the operation:... |
from __future__ import unicode_literals
import frappe
import random
from frappe.utils import random_string
from frappe.desk import query_report
from erpnext.accounts.doctype.journal_entry.journal_entry import get_payment_entry_against_invoice
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment... |
# -*- coding: utf-8-*-
import os
import re
from getpass import getpass
import yaml
from pytz import timezone
import feedparser
import jasperpath
def run():
profile = {}
print("Welcome to the profile populator. If, at any step, you'd prefer " +
"not to enter the requested information, just hit 'Ente... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleError
#from ansible.inventory.host import Host
from ansible.playbook.task import Task
class Handler(Task):
def __init__(self, block=None, role=None, task_include=None):
self._flagged_... |
"""
* Copyright (c) 2012-2017, Adriana Flores
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of co... |
from __future__ import unicode_literals
import os
import re
import subprocess
import time
from .common import FileDownloader
from ..compat import compat_str
from ..utils import (
check_executable,
encodeFilename,
encodeArgument,
get_exe_version,
)
def rtmpdump_version():
return get_exe_version(
... |
# -*- coding: utf-8 -*-
"""
flask.signals
~~~~~~~~~~~~~
Implements signals based on blinker if available, otherwise
falls silently back to a noop
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
signals_available = False
try:
from blinker import Name... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QAD Quantum Aided Design plugin
funzioni per comando SPEZZA per tagliare un oggetto
-------------------
begin : 2019-08-08
copyright ... |
"""
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
from django.template import loader, RequestContext
from django.http import HttpResponse, Http404
from django.http import HttpRespons... |
"""
Artificial Intelligence for Humans
Volume 2: Nature-Inspired Algorithms
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2013 by Jeff Heaton
Licensed under the Apache License, Version 2.0 (the "License")... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import cProfile
import pstats
from npyscreen import NPSApp
from npyscreen import Form
from npyscreen import TextTokens, TitleTextTokens
class TextBoxForm(Form):
def create(self):
tb = self.add(TextTokens, name="TokenField", )#max_width=25)
tb.value = [... |
import unittest2
from oslo_config import cfg
from st2common.constants.api import DEFAULT_API_VERSION
from st2common.util.api import get_base_public_api_url
from st2common.util.api import get_full_public_api_url
from st2common.util.api import get_mistral_api_url
from st2tests.config import parse_args
parse_args()
cl... |
import random
import threading
import time
import unittest
import grpc_testing
_QUANTUM = 0.3
_MANY = 10000
# Tests that run in real time can either wait for the scheduler to
# eventually run what needs to be run (and risk timing out) or declare
# that the scheduler didn't schedule work reasonably fast enough. We
# c... |
"""Tests for nitroml.suites.openml_cc18."""
import os
from absl.testing import absltest
from absl.testing import parameterized
from nitroml.benchmark.suites import openml_cc18
from nitroml.benchmark.suites import testing_utils
import requests_mock
class OpenMLCC18Test(parameterized.TestCase, absltest.TestCase):
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.