code stringlengths 1 199k |
|---|
import sys
import os
from twisted.internet import defer, protocol
class ProcessTest:
command = None
prefix = [sys.executable, '-m', 'scrapy.cmdline']
cwd = os.getcwd() # trial chdirs to temp dir
def execute(self, args, check_code=True, settings=None):
from twisted.internet import reactor
... |
"""Utility functions to speed up linear algebraic operations.
In general, things like np.dot and linalg.svd should be used directly
because they are smart about checking for bad values. However, in cases where
things are done repeatedly (e.g., thousands of times on tiny matrices), the
overhead can become problematic fr... |
"""Module for handling Qt linguist (.ts) files.
This will eventually replace the older ts.py which only supports the older
format. While converters haven't been updated to use this module, we retain
both.
U{TS file format 4.3<http://doc.trolltech.com/4.3/linguist-ts-file-format.html>},
U{4.5<http://doc.trolltech.com/4.... |
from m5.defines import buildEnv
from m5.SimObject import SimObject
from m5.params import *
from m5.proxy import *
from PciDevice import PciDevice
class EtherObject(SimObject):
type = 'EtherObject'
abstract = True
cxx_header = "dev/net/etherobject.hh"
class EtherLink(EtherObject):
type = 'EtherLink'
... |
import urllib2
import os.path
import sys
import re
default_encoding = sys.getfilesystemencoding()
if default_encoding.lower() == 'ascii':
default_encoding = 'utf-8'
def to_native_string(s):
if type(s) == unicode:
return s.encode(default_encoding)
else:
return s
def r1(pattern, text):
m = re.search(pattern, text... |
"""
ForkedFunc provides a way to run a function in a forked process
and get at its return value, stdout and stderr output as well
as signals and exitstatusus.
XXX see if tempdir handling is sane
"""
import py
import os
import sys
import marshal
class ForkedFunc(object):
EXITSTATUS_EXCEPTION = 3
... |
from dbapi2 import * |
import sys
import asyncio
from aiohttp import web
from charfinder import UnicodeNameIndex
PAGE_TPL = '''
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Charserver</title>
</head>
<body>
<p>
<form action="/">
<input type="search" name="query" value="{query}">
... |
from unicorn import *
from unicorn.x86_const import *
import regress, struct
mu = 0
class Init(regress.RegressTest):
def init_unicorn(self, ip, sp, counter):
global mu
#print "[+] Emulating IP: %x SP: %x - Counter: %x" % (ip, sp, counter)
mu = Uc(UC_ARCH_X86, UC_MODE_64)
mu.mem_map(0... |
from Exscript.parselib.Lexer import Lexer
from Exscript.parselib.Token import Token
import inspect
__all__ = [name for name, obj in locals().items()
if not (name.startswith('_') or inspect.ismodule(obj))] |
"""
*********************
espressopp.Quaternion
*********************
This class provides quaternions with the associate methods.
Quaternions can be used as an efficient representation for the orientation
and rotation of 3D vector objects in 3D euclidean space. A Quaternion as
such has a real part and an imaginary part... |
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, traceback, cStringIO, re, shutil
from calibre.constants import DEBUG
from calibre.utils.config import Config, StringConfig, tweaks
from calibre.utils... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fortios_report_style
short_description: Report style configur... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.compat.six import string_types
import os
import shutil
import subprocess
import tempfile
from ansible.errors import AnsibleError
from ansible.playbook.role.definition import RoleDefinition
__all__ = ['RoleRequirement']
... |
from .module import FeedlyModule
__all__ = ['FeedlyModule'] |
from django.db import models
from django.test import TestCase
from django.conf import settings
settings.SEARCH_BACKEND = 'search.backends.immediate_update'
from search import register
from search.core import SearchManager, startswith
from search.utils import partial_match_search
class ExtraData(models.Model):
name ... |
from oslo_serialization import jsonutils as json
from tempest.api_schema.response.compute.v2_1 import keypairs as schema
from tempest.common import service_client
class KeyPairsClient(service_client.ServiceClient):
def list_keypairs(self):
resp, body = self.get("os-keypairs")
body = json.loads(body)... |
"""A setup module for the GRPC Python package."""
from distutils import core as _core
_EXTENSION_SOURCES = (
'grpc/_adapter/_c.c',
'grpc/_adapter/_call.c',
'grpc/_adapter/_channel.c',
'grpc/_adapter/_completion_queue.c',
'grpc/_adapter/_error.c',
'grpc/_adapter/_server.c',
'grpc/_adapter/_cl... |
"""Utilities and helper functions."""
import datetime
import json
import logging
import os
import sys
from neutronclient.common import exceptions
from neutronclient.openstack.common import strutils
def env(*vars, **kwargs):
"""Returns the first environment variable set.
if none are non-empty, defaults to '' or ... |
import socket
from time import sleep
import os
LOCAL_IP_ENV = "MY_IP"
def get_ip():
"""
Return a string of the IP of the hosts interface.
Try to get the local IP from the environment variables. This allows
testers to specify the IP address in cases where there is more than one
configured IP address... |
"""cmake output module
This module is under development and should be considered experimental.
This module produces cmake (2.8.8+) input as its output. One CMakeLists.txt is
created for each configuration.
This module's original purpose was to support editing in IDEs like KDevelop
which use CMake for project management... |
import unittest
import weakref
import GafferUI
import GafferUITest
class LabelTest( GafferUITest.TestCase ) :
def testAlignment( self ) :
l = GafferUI.Label()
self.assertEqual( l.getAlignment(), ( GafferUI.Label.HorizontalAlignment.Left, GafferUI.Label.VerticalAlignment.Center ) )
l = GafferUI.Label( horizontalA... |
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
all_event_list = []; # insert all tracepoint event related with this script
irq_dic = {}; # key is cpu and value is a list which... |
import docker
import os
from juliabox.srvr_jboxd import JBoxd
from juliabox.jbox_util import JBoxCfg
if __name__ == "__main__":
conf_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../conf'))
conf_file = os.path.join(conf_dir, 'tornado.conf')
user_conf_file = os.path.join(conf_dir, 'jbox.user... |
NUMERAL_MAPPINGS = (
(1000, 'M'),
(900, 'CM'),
(500, 'D'),
(400, 'CD'),
(100, 'C'),
(90, 'XC'),
(50, 'L'),
(40, 'XL'),
(10, 'X'),
(9, 'IX'),
(5, 'V'),
(4, 'IV'),
(1, 'I')
)
def numeral(number):
s = ''
for arabic, roman in NUMERAL_MAPPINGS:
while number... |
"""SCons.Tool.Packaging.targz
The targz SRC packager.
"""
__revision__ = "src/engine/SCons/Tool/packaging/targz.py 2014/03/02 14:18:15 garyo"
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot
def package(env, target, source, PACKAGEROOT, **kw):
bld = env['BUILDERS']['Tar']
bld.set_suffix... |
from django.conf.urls import patterns, url
urlpatterns = patterns('misago.legal.views',
url(r'^(?P<page>[\w\d-]+)/$', 'legal_page', name='legal_page'),
) |
import copy
import inspect
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.datastructures import SortedDict
from django.utils.module_loading import module_has_submodule
from haystack.constants import Indexable, DEFAULT_ALIAS
from haystack.exceptions import NotH... |
'''
useful extra functions for use by mavlink clients
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
import os, sys
from math import *
from .quaternion import Quaternion
try:
# rotmat doesn't work on Python3.2 yet
from .rotmat import Vector3, Matrix3
except Exception:
pass
def ... |
""" Daemon process behaviour.
"""
from __future__ import (absolute_import, unicode_literals)
import os
import sys
import resource
import errno
import signal
import socket
import atexit
import fcntl
import time
try:
# Python 2 has both ‘str’ (bytes) and ‘unicode’ (text).
basestring = basestring
unicode =... |
def _initialize() :
pass
def getConstructors(clas):
return clas.__javaclass__.getConstructors()
def getDeclaredConstructors(clas):
return clas.__javaclass__.getDeclaredConstructors()
def getDeclaredFields(clas) :
'''Returns an array of Field objects reflecting all the fields declared by the class or int... |
import os
from test_multiprocessing import MPTestBase
class TestMPTimeout(MPTestBase):
args = ['--process-timeout=1']
suitepath = os.path.join(os.path.dirname(__file__), 'support', 'timeout.py')
def runTest(self):
assert "TimedOutException: 'timeout.test_timeout'" in self.output
assert "Ran ... |
"""Attempt to check each interface in nipype
"""
from __future__ import print_function, unicode_literals
from builtins import object, str, bytes, open
import os
import re
import sys
import warnings
from nipype.interfaces.base import BaseInterface
class InterfaceChecker(object):
"""Class for checking all interface s... |
'''
Created on Jul 19, 2012
@author: Cam Moore
'''
from apps.widgets.badges.models import BadgeAward
from django.db.models.aggregates import Count
def supply(request, page_name):
"""supply the view objects for the badge status widget."""
_ = page_name
_ = request
"""
badgeAward = {}
for badge in... |
"""
Nodes provide the structure to the package hierarchy
"""
import logging
from copy import deepcopy
from exe.engine.persist import Persistable
from exe.engine.path import toUnicode
from exe import globals as G
from urllib import quote
from exe.webui import co... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'TLSCertificate'
db.create_table(u'storageadmin_tlscertificate', (
(u'id'... |
"""
Classes for encoding API documentation about Python programs.
These classes are used as a common representation for combining
information derived from introspection and from parsing.
The API documentation for a Python program is encoded using a graph of
L{APIDoc} objects, each of which encodes information about a s... |
"""Tests behavior around the compression mechanism."""
import asyncio
import logging
import platform
import random
import unittest
import grpc
from grpc.experimental import aio
from tests_aio.unit import _common
from tests_aio.unit._test_base import AioTestBase
_GZIP_CHANNEL_ARGUMENT = ('grpc.default_compression_algori... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.base.payload import Payload
from pants.base.payload_field import PayloadField, PrimitiveField, combine_hashes
from pants.base.target import Target
class Wiki... |
import mock
from cinder import context
from cinder import objects
from cinder.tests.unit import fake_volume
from cinder.tests.unit import objects as test_objects
class TestVolumeType(test_objects.BaseObjectsTestCase):
def setUp(self):
super(TestVolumeType, self).setUp()
# NOTE (e0ne): base tests con... |
import httplib as http
from dataverse import Connection
from dataverse.exceptions import ConnectionError, UnauthorizedError, OperationFailedError
from framework.exceptions import HTTPError
from addons.dataverse import settings
from osf.utils.sanitize import strip_html
def _connect(host, token):
try:
return ... |
from __future__ import absolute_import
import django
from django.db import models
from django.db.models.sql.query import LOOKUP_SEP
from django.db.models.deletion import Collector
from django.db.models.fields.related import ForeignObjectRel
from django.forms.forms import pretty_name
from django.utils import formats, si... |
from .production import * |
"""Computes partition function for RBM-like models using Annealed Importance Sampling."""
import numpy as np
from deepnet import dbm
from deepnet import util
from deepnet import trainer as tr
from choose_matrix_library import *
import sys
import numpy as np
import pdb
import time
import itertools
import matplotlib.pypl... |
import sys
import os
import shutil
import fnmatch
from distutils import dir_util
import subprocess
import platform
TARGET_X64 = 'X64'
TARGET_IA32 = 'IA32'
TARGET_I586 = 'i586'
TARGETS= [TARGET_X64 ,TARGET_IA32, TARGET_I586 ]
asmFiles = {TARGET_X64: 'cpu.asm',
TARGET_IA32: 'cpu_ia32.asm',
TARGET... |
"""
Generalized Recommender models amd utility classes.
This module contains basic memory recommender interfaces used throughout
the whole scikit-crab package as also utility classes.
The interfaces are realized as abstract base classes (ie., some optional
functionality is provided in the interface itself, so that the ... |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.testutils import APITestCase
class ProjectMemberIndexTest(APITestCase):
def test_simple(self):
user_1 = self.create_user('foo@localhost', username='foo')
user_2 = self.create_user('bar@localhost', usernam... |
import unittest
import logging
import grpc
from tests.unit import test_common
from tests.unit.framework.common import test_constants
_REQUEST = b''
_RESPONSE = b''
_UNARY_UNARY = '/test/UnaryUnary'
_UNARY_STREAM = '/test/UnaryStream'
_STREAM_UNARY = '/test/StreamUnary'
_STREAM_STREAM = '/test/StreamStream'
def handle_u... |
def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__,'umath.pyd')
del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__() |
from __future__ import absolute_import
from __future__ import print_function
from twisted.application import service
from twisted.internet import defer
from buildbot.util import service as util_service
class UserManagerManager(util_service.ReconfigurableServiceMixin,
service.MultiService):
... |
"""Test configs for add_n."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v1 as tf
from tensorflow.lite.testing.zip_test_utils import create_tensor_data
from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests
from ten... |
import main <caret> |
"""
Temporary module with functionaly used to migrate away from build-script-impl.
"""
from __future__ import absolute_import, unicode_literals
import itertools
import subprocess
import six
from six.moves import map
from swift_build_support.swift_build_support.targets import \
StdlibDeploymentTarget
__all__ = [
... |
"""
:mod:`disco.schemes` -- Default input streams for URL schemes
=============================================================
By default, Disco looks at an input URL and extracts its scheme in order to figure out which input stream to use.
When Disco determines the URL scheme, it tries to import the name `input_strea... |
r"""Writes ExtensionDepencencies.inc."""
from __future__ import print_function
import argparse
import os
import re
import sys
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('-o', '--output', required=True,
help='output file')
args = parser.parse... |
"""Base script for doing test setup."""
import logging
import os
from pylib import constants
from pylib import valgrind_tools
from pylib.constants import host_paths
from pylib.utils import isolator
def GenerateDepsDirUsingIsolate(suite_name, isolate_file_path,
isolate_file_paths, deps_ex... |
DOCUMENTATION = '''
---
module: bigip_monitor_http
short_description: "Manages F5 BIG-IP LTM http monitors"
description:
- "Manages F5 BIG-IP LTM monitors via iControl SOAP API"
version_added: "1.4"
author: "Serge van Ginderachter (@srvg)"
notes:
- "Requires BIG-IP software version >= 11"
- "F5 developed mo... |
"""
Utility Mixins for unit tests
"""
import json
import sys
from mock import patch
from django.conf import settings
from django.core.urlresolvers import clear_url_caches, resolve
from django.test import TestCase
from util.db import OuterAtomic, CommitOnSuccessManager
class UrlResetMixin(object):
"""Mixin to reset ... |
"""
Views for the verification flow
"""
import datetime
import decimal
import json
import logging
import urllib
from pytz import UTC
from ipware.ip import get_ip
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.mail import send_mail
from django.core.urlresolver... |
async def asyncgen():
yield 10
async def run():
{i for i in <warning descr="Expected type 'collections.Iterable', got 'AsyncGenerator[int, Any]' instead">asyncgen()</warning>}
[i for i in <warning descr="Expected type 'collections.Iterable', got 'AsyncGenerator[int, Any]' instead">asyncgen()</warning>]
... |
"""A LibraryPackage that creates a .tar.gz file.
This module aids in the construction of a .tar.gz file containing all the
components generated and required by a library.
"""
__author__ = 'sammccall@google.com (Sam McCall)'
from io import BytesIO
import StringIO
import tarfile
import time
from googleapis.codegen.filesy... |
import unittest
import random
from IECore import *
class TestVectorDataFilterOp( unittest.TestCase ) :
def test( self ) :
i = IntVectorData( [ 1, 2, 3, 4, 5, 6 ] )
f = BoolVectorData( [ 0, 1, 0, 1 ] )
ii = VectorDataFilterOp()( input = i, filter = f, invert = False, clip = True )
self.assertEqual( ii, IntVecto... |
import sys
from utils.dockerutil import get_client
_is_ecs = None
class Platform(object):
"""
Return information about the given platform.
"""
@staticmethod
def is_darwin(name=None):
name = name or sys.platform
return 'darwin' in name
@staticmethod
def is_mac(name=None):
... |
"""
As simple as it gets.
Launch the Telnet server on the default port and greet visitors using the
placeholder 'on_connect()' function. Does nothing else.
"""
from miniboa import TelnetServer
server = TelnetServer()
print "\n\nStarting server on port %d. CTRL-C to interrupt.\n" % server.port
while True:
server.p... |
{
"name": "Stock - Quant merge",
"version": "1.0",
"depends": [
"stock",
],
"author": "OdooMRP team,"
"AvanzOSC,"
"Serv. Tecnol. Avanzados - Pedro M. Baeza",
"website": "http://www.odoomrp.com",
"contributors": [
"Oihane Crucelaegui <oihanecrucelae... |
import os
from myhdl import Cosimulation
cmd = "cver -q +loadvpi=../myhdl_vpi:vpi_compat_bootstrap " + \
"../../test/verilog/dff.v " + \
"../../test/verilog/dut_dff.v "
def dff(q, d, clk, reset):
return Cosimulation(cmd, **locals()) |
"""
defines default declarations factory class
"""
from calldef import member_function_t
from calldef import constructor_t
from calldef import destructor_t
from calldef import member_operator_t
from calldef import casting_operator_t
from calldef import free_function_t
from calldef import free_operator_t
from enumeratio... |
from __future__ import unicode_literals
import time
import traceback
from datetime import date, datetime, timedelta
from threading import Thread
from django.core.exceptions import FieldError
from django.db import DatabaseError, IntegrityError, connection
from django.test import (
SimpleTestCase, TestCase, Transacti... |
from django.conf import settings
from django.core.urlresolvers import reverse
from geonode.geoserver.helpers import ogc_server_settings
def geoserver_urls(request):
"""Global values to pass to templates"""
defaults = dict(
GEOSERVER_BASE_URL=ogc_server_settings.public_url,
UPLOADER_URL=reverse('... |
'''
Graphics
========
This package assembles many low level functions used for drawing. The whole
graphics package is compatible with OpenGL ES 2.0 and has many rendering
optimizations.
The basics
----------
For drawing on a screen, you will need :
1. a :class:`~kivy.graphics.instructions.Canvas` object.
2. :cl... |
"""Tests for the 'zero' plugin"""
from __future__ import (division, absolute_import, print_function,
unicode_literals)
from test._common import unittest
from test.helper import TestHelper
from beets.library import Item
from beets import config
from beetsplug.zero import ZeroPlugin
from beets.med... |
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import time
import collections
from .compat import cookielib, urlparse, Morsel
try:
import threading
# grr, pyflakes: this fixes "redefinition of unused 'threading'"
... |
"""
Tests for L{twisted.web.twcgi}.
"""
import sys, os
from twisted.trial import unittest
from twisted.internet import reactor, interfaces, error
from twisted.python import util, failure
from twisted.web.http import NOT_FOUND, INTERNAL_SERVER_ERROR
from twisted.web import client, twcgi, server, resource
from twisted.we... |
"""Factory boy factories for the Google Drive addon."""
import datetime
from dateutil.relativedelta import relativedelta
from factory import SubFactory, Sequence
from tests.factories import (
ModularOdmFactory,
UserFactory,
ProjectFactory,
ExternalAccountFactory)
from website.addons.googledrive.model im... |
"""
/***************************************************************************
Name : Virtual layers plugin for DB Manager
Date : December 2015
copyright : (C) 2015 by Hugo Mercier
email : hugo dot mercier at oslandia dot com
*********************************... |
import account_chart_template
import account_invoice
import product
import stock
import stock_config_settings |
from Tkinter import *
import tkFileDialog, tkMessageBox
import sys, os
from scipy.io.wavfile import read
import spsModel_function
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/'))
import utilFunctions as UF
class SpsModel_frame:
def __init__(self, parent):
self.parent = parent... |
"""
sphinx.ext.refcounting
~~~~~~~~~~~~~~~~~~~~~~
Supports reference count annotations for C API functions. Based on
refcount.py and anno-api.py in the old Python documentation tools.
Usage: Set the `refcount_file` config value to the path to the reference
count data file.
:copyright: Copyr... |
import numpy as np
from numpy import linalg
from scipy.sparse import dok_matrix, csr_matrix, issparse
from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import... |
""" Sahana Eden Asset Module Automated Tests
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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
restr... |
import distutils.version
import os
import sys
import textwrap
import unittest
ROOT_PATH = os.path.abspath(os.path.join(
os.path.dirname(os.path.dirname(__file__))))
def native_error(msg, version):
print textwrap.dedent("""\
ERROR: Native python-coverage (version: %s) is required to be
installed on your PYTHON... |
"""
Support for Modbus Coil sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.modbus/
"""
import logging
import voluptuous as vol
import homeassistant.components.modbus as modbus
from homeassistant.const import CONF_NAME
from homeassis... |
import optparse
import os
import subprocess
def main():
p = optparse.OptionParser(
usage='%prog [options] [-x addon-1.0.xpi] [-c /path/to/addon-1.0/]')
p.add_option('-x', '--extract',
help='Extracts xpi into current directory',
action='store_true')
p.add_option('-c'... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming
from scipy.fftpack import fft, fftshift
plt.figure(1, figsize=(9.5, 6))
M= 64
N = 256
x = np.cos(2*np.pi*3/M*np.arange(M)) * np.hanning(M)
plt.subplot(3,1,1)
plt.plot(np.arange(-M/2.0,M/2), x, 'b', lw=1.5)
plt.axis([-M/2,M/2-1,-1,1])
pl... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
module: na_cdot_volume
short_description: Manage NetApp cDOT volumes
extends_documentation_fragment:
- netapp.ontap
version_added: '2.3'
author: Sumit Kumar ... |
"""Base proxy module used to create compatible consoles
for Openstack Nova."""
import os
import sys
from oslo_config import cfg
from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from nova.console import websocketproxy
from nova import version
CONF = cfg.CONF
CONF.import_opt('rec... |
from django.core.checks import Error
from django.core.checks.translation import (
check_language_settings_consistent, check_setting_language_code,
check_setting_languages, check_setting_languages_bidi,
)
from django.test import SimpleTestCase, override_settings
class TranslationCheckTests(SimpleTestCase):
d... |
"""
Utilities for tests within the django_comment_client module.
"""
from mock import patch
from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory
from django_comment_common.models import Role
from django_comment_common.utils import seed_permissions_roles
from student.tests.factories import Cours... |
import sys
import unittest
from libcloud.common.types import InvalidCredsError
from libcloud.common.digitalocean import DigitalOceanBaseDriver
from libcloud.test import LibcloudTestCase, MockHttpTestCase
from libcloud.test.file_fixtures import FileFixtures
from libcloud.test.secrets import DIGITALOCEAN_v1_PARAMS
from l... |
from sys import version_info
import numpy as np
from scipy import interpolate, sparse
from copy import deepcopy
from sklearn.datasets import load_boston
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_equal
from s... |
"""The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams; imple... |
ANSIBLE_METADATA = {'status': ['stableinterface'],
'supported_by': 'committer',
'version': '1.0'}
DOCUMENTATION = '''
---
module: ec2_vpc_subnet_facts
short_description: Gather facts about ec2 VPC subnets in AWS
description:
- Gather facts about ec2 VPC subnets in AWS
version... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
DOCUMENTATION = """
---
module: ec2_lc_find
short_description: Find AWS Autoscaling Launch Configurations
description:
- Returns list of matching Launch Configurations for a given name, al... |
'''
Blocks and utilities for analog modulation and demodulation.
'''
import os
try:
from analog_swig import *
except ImportError:
dirname, filename = os.path.split(os.path.abspath(__file__))
__path__.append(os.path.join(dirname, "..", "..", "swig"))
from analog_swig import *
from am_demod import *
from ... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'core'}
DOCUMENTATION = r'''
---
module: win_file
version_added: "1.9.2"
short_description: Creates, touches or removes files or directories.
description:
- Creates (empty) files, u... |
import BoostBuild
t = BoostBuild.Tester()
t.set_tree("test2")
file_list = 'bin/$toolset/debug/' * \
BoostBuild.List("foo foo.o")
t.run_build_system("-sBOOST_BUILD_PATH=" + t.original_workdir + "/..")
t.expect_addition(file_list)
t.write("foo.cpp", "int main() {}\n")
t.run_build_system("-d2 -sBOOST_BUILD_PATH=" + t.... |
ANSIBLE_METADATA = {'status': ['stableinterface'],
'supported_by': 'core',
'version': '1.0'}
DOCUMENTATION = '''
---
module: ping
version_added: historical
short_description: Try to connect to host, verify a usable python and return C(pong) on success.
description:
- A trivial... |
from openerp.tests import common
from openerp.addons.server_environment import serv_config
class TestEnv(common.TransactionCase):
def test_view(self):
model = self.env['server.config']
view = model.fields_view_get()
self.assertTrue(view)
def test_default(self):
model = self.env['... |
from .httpproxy import HttpProxy
from .warequest import WARequest
from .waresponseparser import JSONResponseParser |
from lib.hachoir_core.tools import humanDurationNanosec
from lib.hachoir_core.i18n import _
from math import floor
from time import time
class BenchmarkError(Exception):
"""
Error during benchmark, use str(err) to format it as string.
"""
def __init__(self, message):
Exception.__init__(self,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.