code stringlengths 1 199k |
|---|
import copy
from collections import OrderedDict
from collections.abc import Mapping
class OrderedSet:
"""
A set which keeps the ordering of the inserted items.
Currently backs onto OrderedDict.
"""
def __init__(self, iterable=None):
self.dict = OrderedDict.fromkeys(iterable or ())
def ad... |
"""SCons.Tool.sgicc
Tool-specific initialization for MIPSPro cc on SGI.
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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
from . import cc
def generate... |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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 3 of the License, or
(at your option) any later version.
Thi... |
from pyjsparserdata import *
class BaseNode:
def finish(self):
pass
def finishArrayExpression(self, elements):
self.type = Syntax.ArrayExpression
self.elements = elements
self.finish()
return self
def finishArrayPattern(self, elements):... |
import logging
from ..util import properties
from ..util import XDG
from ..backend import KeyringBackend
from ..errors import (InitError, PasswordDeleteError,
ExceptionRaisedContext)
try:
import secretstorage
import secretstorage.exceptions as exceptions
except ImportError:
pass
log = logging.getLogger(... |
import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'GObject-Introspection'
copyright = u'2013, Dieter Verfaillie... |
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or... |
import os
import sys
import re
havecolor = 1
dotitles = 1
spinpos = 0
spinner = "/-\\|/-\\|/-\\|/-\\|\\-/|\\-/|\\-/|\\-/|"
esc_seq = "\x1b["
g_attr = {}
g_attr["normal"] = 0
g_attr["bold"] = 1
g_attr["faint"] = 2
g_attr["standout"] = 3
g_attr["underline"] = 4
g_attr["blink"] = 5
g_attr["overline"] = 6 # Why is overlin... |
"""Utilities for managing GeoNode resource metadata
"""
import logging
import datetime
from lxml import etree
from geonode import GeoNodeException
from owslib.csw import CswRecord
from owslib.iso import MD_Metadata
from owslib.fgdc import Metadata
from django.utils import timezone
LOGGER = logging.getLogger(__name__)
d... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'core'}
DOCUMENTATION = '''
---
module: git
author:
- "Ansible Core Team"
- "Michael DeHaan"
version_added: "0.0.1"
short_description: Deploy software (or files) from git checkouts
descr... |
from odoo.addons.account_edi.tests.common import AccountEdiTestCommon
from odoo.tests import tagged
from odoo import Command
@tagged('post_install_l10n', 'post_install', '-at_install')
class TestL10nBeEdi(AccountEdiTestCommon):
@classmethod
def setUpClass(cls, chart_template_ref='l10n_be.l10nbe_chart_template',... |
import os
import azure
import json
from requests import Request
try:
from urllib import quote
except:
from urllib.parse import quote
from nixops.util import attr_property
from nixops.azure_common import ResourceDefinition, ResourceState, ResId
from azure.common import AzureHttpError
from azure.mgmt.network impo... |
"""
The ActionChains implementation,
"""
import time
from selenium.webdriver.remote.command import Command
from .utils import keys_to_typing
from .actions.action_builder import ActionBuilder
class ActionChains(object):
"""
ActionChains are a way to automate low level interactions such as
mouse movements, mo... |
import datetime
import json
from lxml import etree
import webob
from nova.api.openstack.compute.contrib import volumes
from nova import context
from nova import exception
from nova import flags
from nova import log as logging
from nova import test
from nova import volume
from nova.tests.api.openstack import fakes
FLAGS... |
import mock
from cinder import context
from cinder import exception
from cinder import quota_utils
from cinder import test
from keystoneclient import exceptions
from oslo_config import cfg
from oslo_config import fixture as config_fixture
CONF = cfg.CONF
class QuotaUtilsTest(test.TestCase):
class FakeProject(object... |
import os
from os.path import join
import random
import time
import itertools
from collections import defaultdict
import six.moves.cPickle as pickle
import shutil
from eventlet import (GreenPile, GreenPool, Timeout, sleep, hubs, tpool,
spawn)
from eventlet.support.greenlets import GreenletExit
fro... |
import sys
from neutronclient.neutron.v2_0 import floatingip as fip
from neutronclient.tests.unit import test_cli20
class CLITestV20FloatingIpsJSON(test_cli20.CLITestV20Base):
non_admin_status_resources = ['floatingip']
def test_create_floatingip(self):
# Create floatingip: fip1.
resource = 'flo... |
from alembic import context
from sqlalchemy import create_engine, pool
from warehouse import db
def run_migrations_offline():
"""
Run migrations in 'offline' mode.
This configures the context with just a URL
and not an Engine, though an Engine is acceptable
here as well. By skipping the Engine crea... |
"""Tests for the Linky config flow."""
from pylinky.exceptions import (
PyLinkyAccessException,
PyLinkyEnedisException,
PyLinkyException,
PyLinkyWrongLoginException,
)
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.linky.const import DEFAULT_TIMEOUT, DOMAIN
from ho... |
import logging
import os
import subprocess
import threading
import util
logger = logging.getLogger('rt.decoder')
class Decoder:
def close(self, force=False):
if not force:
self.lock.acquire()
self.decoder.stdin.close()
self.decoder.wait()
if not force:
self.lo... |
import datetime
import time
from oslo.config import cfg
from cinder.openstack.common.gettextutils import _
from cinder.openstack.common import log as logging
from cinder.openstack.common import timeutils
periodic_opts = [
cfg.BoolOpt('run_external_periodic_tasks',
default=True,
help=... |
"""Tests for local response normalization."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework im... |
from __future__ import unicode_literals
import unittest
from io import BytesIO, StringIO
from decimal import Decimal
import threading
from importlib import import_module
from ijson import common
from ijson.backends.python import basic_parse, Lexer
from ijson.compat import IS_PY2
JSON = b'''
{
"docs": [
{
"n... |
import unittest
import xml.etree.ElementTree as ElementTree
from king_phisher import find
from king_phisher import testing
GOBJECT_TOP_REGEX = r'^[A-Z][a-zA-Z0-9]+$'
class ClientGtkBuilderLint(testing.KingPhisherTestCase):
def setUp(self):
find.data_path_append('data/client')
builder_xml = find.data_file('king-phi... |
"""
====================================================
Compute envelope correlations in volume source space
====================================================
Compute envelope correlations of orthogonalized activity
:footcite:`HippEtAl2012,KhanEtAl2018` in source
space using resting state CTF data in a volume sourc... |
import sys
import re
import codecs
import snowballstemmer
def usage():
print('''usage: %s [-l <language>] [-i <input file>] [-o <output file>] [-c <character encoding>] [-p[2]] [-h]
The input file consists of a list of words to be stemmed, one per
line. Words should be in lower case, but (for English) A-Z letters
a... |
''' Fvtk module implements simple visualization functions using VTK.
The main idea is the following:
A window can have one or more renderers. A renderer can have none, one or more actors. Examples of actors are a sphere, line, point etc.
You basically add actors in a renderer and in that way you can visualize the forem... |
__version__='''$Id: test_geomutils.py 3355 2009-01-08 14:58:44Z jonas $'''
__doc__="""Tests for geometry utility functions."""
import unittest
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses
setOutDir(__name__)
class GeomTestCase(unittest.TestCase):
def test_padding(self):
"Test reportlab.... |
"""PID minters for drafts."""
from __future__ import absolute_import, print_function
import uuid
from invenio_pidstore.models import PersistentIdentifier, PIDStatus
def cap_deposit_minter(record_uuid, data):
"""Mint deposit's identifier."""
try:
pid_value = data['_deposit']['id']
except KeyError:
... |
"""Tests for producing IPMI sample messages from notification events.
"""
import mock
from oslotest import base
from ceilometer.ipmi.notifications import ironic as ipmi
from ceilometer import sample
from ceilometer.tests.ipmi.notifications import ipmi_test_data
class TestNotifications(base.BaseTestCase):
def test_i... |
import config, sys
hooks = {}
loaded_with_language = False
def load_plugins():
global loaded_with_language
if loaded_with_language == current_language:
return
# Cleanup all registered hooks. They need to be renewed by load_plugins()
# of the other modules
unregister()
# This must be set ... |
print ("Hello World!") |
""" Extract and tag References from a PDF.
Created on Mar 1, 2010
@author: John Harrison
Usage: headings.py OPTIONS FILEPATH
OPTIONS:
--help, -h Print help and exit
--noxml Do not tag individual headings with XML tags.
Default is to include tagging.
--title Only print title then exit
-... |
test_records = [
[{
"doctype": "Country",
"country_name": "_Test Country"
}]
] |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('programs', '0012_auto_20170419_0018'),
]
operations = [
migr... |
"""
This program checks C code for compliance to coding standards used in
libsndfile and other projects I run.
"""
import re
import sys
class Preprocessor:
"""
Preprocess lines of C code to make it easier for the CStyleChecker class to
test for correctness. Preprocessing works on a single line at a time but
maintai... |
import avango.osg
import avango.osg.simpleviewer
import avango.script
from elasticnodes import *
import sys
import random
from PySide import QtCore, QtGui
class TreeItem:
def __init__(self, data, parent=None):
self.parentItem = parent
self.itemData = data
self.childItems = []
def appendC... |
"""Represents a lexographic range of namespaces."""
__all__ = [
'NAMESPACE_CHARACTERS',
'MAX_NAMESPACE_LENGTH',
'MAX_NAMESPACE',
'MIN_NAMESPACE',
'NAMESPACE_BATCH_SIZE',
'NamespaceRange',
'get_namespace_keys',
]
import itertools
import string
from google.appengine.api import datastore
from g... |
"""Functional tests for ops used with embeddings."""
import itertools
import math
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import sparse_tensor
from tensorflow.python... |
"""Support for Matrix notifications."""
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
ATTR_MESSAGE,
ATTR_TARGET,
PLATFORM_SCHEMA,
BaseNotificationService,
)
import homeassistant.helpers.config_validation as cv
from .const import DOMAIN, SERVICE_SEND_MESSAGE
CONF_D... |
from zerver.lib.test_classes import WebhookTestCase
class LidarrHookTests(WebhookTestCase):
STREAM_NAME = "lidarr"
URL_TEMPLATE = "/api/v1/external/lidarr?api_key={api_key}&stream={stream}"
WEBHOOK_DIR_NAME = "lidarr"
def test_lidarr_test(self) -> None:
"""
Tests if lidarr test payload i... |
"""Translate generators test."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import shutil
import tarfile
import tensorflow as tf
from data_generators import text_problems
from data_generators import translate
class TranslateTest(tf.test.TestCas... |
"""
Upload handlers to test the upload API.
"""
from django.core.files.uploadhandler import (
FileUploadHandler, StopUpload, TemporaryFileUploadHandler,
)
class QuotaUploadHandler(FileUploadHandler):
"""
This test upload handler terminates the connection if more than a quota
(5MB) is uploaded.
"""
... |
from __future__ import absolute_import
import logging
import requests
from six.moves.urllib.parse import quote
from sentry import options
logger = logging.getLogger(__name__)
def sms_available():
return bool(options.get('sms.twilio-account'))
def send_sms(body, to, from_=None):
account = options.get('sms.twilio... |
"""Translates gRPC's client-side API into gRPC's client-side Beta API."""
import grpc
from grpc import _common
from grpc._cython import cygrpc
from grpc.beta import interfaces
from grpc.framework.common import cardinality
from grpc.framework.foundation import future
from grpc.framework.interfaces.face import face
_STAT... |
from __future__ import absolute_import
from qinfer.tomography.distributions import *
from qinfer.tomography.models import *
from qinfer.tomography.plotting_tools import *
from qinfer.tomography.bases import *
from qinfer.tomography.expdesign import * |
from __future__ import absolute_import
from future.standard_library import suspend_hooks
from future.utils import PY3
if PY3:
from urllib.request import *
# This aren't in __all__:
from urllib.request import (getproxies,
pathname2url,
proxy_byp... |
import GithubObject
import Commit
import File
class Comparison(GithubObject.GithubObject):
@property
def ahead_by(self):
self._completeIfNotSet(self._ahead_by)
return self._NoneIfNotSet(self._ahead_by)
@property
def base_commit(self):
self._completeIfNotSet(self._base_commit)
... |
import os
import opk, cfg, opkgcl
opk.regress_init()
o = opk.OpkGroup()
o.add(Package="a", Version="1.0", Depends="b")
o.add(Package="b", Version="1.0")
o.add(Package="c", Version="1.0", Depends="b")
o.write_opk()
o.write_list()
opkgcl.update()
opkgcl.install("a")
opkgcl.install("c")
opkgcl.flag_unpacked("a")
o = opk.O... |
from couchpotato.core.event import addEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
log = CPLog(__name__)
class ClientScript(Plugin):
urls = {
'style': {},
'script': {},
}
html = {
'style': '<link rel="stylesheet" href="%s" type="tex... |
from _test_lbfgs_cpp import *
from _test_lj_cpp import *
from _test_lj_interaction_list import *
from _test_frozen_atoms import *
from _test_bljcut import *
if __name__ == "__main__":
unittest.main() |
import time
import threading
import psycopg2
import psycopg2.extensions
from psycopg2 import extras
from testconfig import dsn
from testutils import unittest, ConnectingTestCase, skip_before_postgres, slow
class CancelTests(ConnectingTestCase):
def setUp(self):
ConnectingTestCase.setUp(self)
cur = s... |
from datetime import date
from weboob.deprecated.browser import Page
from weboob.capabilities.bill import Subscription
class LoginPage(Page):
def login(self, login, password):
self.browser.select_form('symConnexionForm')
self.browser["portlet_login_plein_page_3{pageFlow.mForm.login}"] = unicode(logi... |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
from OpenGL.raw.GL import _types as _cs
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'GL_EXT_vertex_shader'
def _f( functi... |
import pilas
def test_todos_los_objetos_de_interfaz_se_pueden_crear():
pilas.iniciar()
deslizador = pilas.interfaz.Deslizador()
assert deslizador
assert deslizador.progreso == 0
boton = pilas.interfaz.Boton()
assert boton
ingreso = pilas.interfaz.IngresoDeTexto()
assert ingreso
try:
... |
"""Tests for training.input."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import itertools
import tensorflow.python.platform
import numpy as np
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
class Mat... |
FORMAT = """%(asctime)s
:%(name)s:
%(levelname)s
:%(module)s
:%(funcName)
:%(lineno)s
:%(message)s"""
SELENIUM_REMOTE_CONNECTION = "selenium.webdriver.remote.remote_connection" |
import logging
from itertools import count
from threading import Event
from base import benchmark, BenchmarkThread
from six.moves import range
log = logging.getLogger(__name__)
sentinel = object()
class Runner(BenchmarkThread):
def __init__(self, *args, **kwargs):
BenchmarkThread.__init__(self, *args, **kwa... |
from types import *
from robot import utils
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.common.exceptions import NoSuchWindowException
class WindowManager(object):
def __init__(self):
self._strategies = {
'title': self._select_by_title,
'name': self._selec... |
import pytest
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from osf.models import AbstractNode, NodeLog
from osf.utils import permissions
from osf.utils.sanitize import strip_html
from osf_tests.factories import (
NodeFactory,
ProjectFactory,
OSFGroupFactory,
Regi... |
import md5
import api.resources.impala_engine as ImpalaEngine
import api.resources.hdfs_client as HDFSClient
from hdfs.util import HdfsError
import api.resources.configurator as Configuration
from collections import defaultdict
import json
import os
"""
------------------------------------------------------------------... |
from nova import db
from nova import exception
from nova import objects
from nova.objects import base
from nova.objects import fields
class Migration(base.NovaPersistentObject, base.NovaObject,
base.NovaObjectDictCompat):
# Version 1.0: Initial version
# Version 1.1: String attributes updated to... |
import os
import sys
from barf.barf import BARF
if __name__ == "__main__":
#
# Open file
#
try:
filename = os.path.abspath("../../samples/toy/arm/branch4")
barf = BARF(filename)
except Exception as err:
print err
print "[-] Error opening file : %s" % filename
... |
import logging
import posixpath
import traceback
from app_yaml_helper import AppYamlHelper
from appengine_wrappers import IsDeadlineExceededError, logservice
from branch_utility import BranchUtility
from compiled_file_system import CompiledFileSystem
from data_source_registry import CreateDataSources
from environment i... |
"""Convert Wavefront OBJ / MTL files into Three.js (JSON model version, to be used with ascii / binary loader)
-------------------------
How to use this converter
-------------------------
python convert_obj_three.py -i infile.obj -o outfile.js [-m "morphfiles*.obj"] [-c "morphcolors*.obj"] [-a center|centerxz|top|bott... |
from ui_playground_panel_wdg import *
from font_palettes_example_wdg import *
from panning_scroll_example_wdg import *
from menu_examples_wdg import *
from event_examples_wdg import *
from misc_examples_wdg import *
from fx_anim_examples_wdg import *
from keyboard_handler_examples_wdg import *
from search_class_tag_exa... |
"""SCons.Environment
Base class for construction Environments. These are
the primary objects used to communicate dependency and
construction information to the build engine.
Keyword arguments supplied when the construction Environment
is created are construction variables used to initialize the
Environment
"""
__revis... |
"""SCons.Tool.Perforce.py
Tool-specific initialization for Perforce Source Code Management system.
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/Perforce.py 2014/03/02 14... |
callback_classes = [
['ns3::ObjectBase *', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['... |
"""Unit tests for nacl_utils.py."""
import fileinput
import mox
import nacl_utils
import os
import sys
import unittest
def TestMock(file_path, open_func):
temp_file = open_func(file_path)
temp_file.close()
class TestNaClUtils(unittest.TestCase):
"""Class for test cases to cover globally declared helper functions.... |
'''tzinfo timezone information for Africa/Asmera.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Asmera(DstTzInfo):
'''Africa/Asmera timezone definition. See datetime.tzinfo for details'''
zone = 'Africa/Asmera'
_utc_t... |
from django.db import models
class Foo(models.Model):
name = models.CharField(max_length=100)
bar = models.ForeignKey('Bar', related_name='bar_fk')
def __unicode__(self):
return self.name
class Bar(models.Model):
name = models.CharField(max_length=100)
def __unicode__(self):
return s... |
"""This module provides the SublimeLinter plugin class and supporting methods."""
import os
import re
import sublime
import sublime_plugin
from .lint.linter import Linter
from .lint.highlight import HighlightSet
from .lint.queue import queue
from .lint import persist, util
def plugin_loaded():
"""The ST3 entry poin... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: lambda
short_description: Manage AWS Lambda functions
description:
- Allows for the management of Lambda functions.
version_added: '2.2'
require... |
import random
import math
DEFAULT_MONTE_CARLO_STEPS = 100
DEFAULT_OUTPUT_PATH = '.'
DEFAULT_MDSTEPS = 10000
DEFAULT_BOUNDARY_CONDITIONS = "Vacuum"
DEFAULT_OUTPUT_FREQ = 10000
DEFAULT_PHYSICAL_TEMP = 300
EXECUTABLE = "ProtoMol"
pdb_file = ""
psf_file = ""
par_file = ""
xyz_file_name = ""
dcd_file_name = ""
boundary_cond... |
"""Module containing tools that are useful when benchmarking algorithms
"""
from math import hypot, sqrt
from functools import wraps
from itertools import repeat
try:
import numpy
except ImportError:
numpy = False
class translate(object):
"""Decorator for evaluation functions, it translates the objective
... |
from setuptools import setup
with open('README.txt') as f:
readme = f.read()
setup(
name="cppcheck",
description='Python script to parse the XML (version 2) output of ' +
'cppcheck and generate an HTML report using Pygments for syntax ' +
'highlighting.',
long_description... |
""" Helper functions for reports testing.
Please /do not/ import this file by default, but only explicitly call it
through the code of yaml tests.
"""
import openerp.netsvc as netsvc
import openerp.tools as tools
import logging
import openerp.pooler as pooler
from openerp.tools.safe_eval import safe_eval
from s... |
def convert_catalog(from_file, to_file, size=220) :
return __convert(from_file, to_file, size)
def convert(from_file, to_file):
size = 95
__convert(from_file, to_file, size=95)
def __convert(from_file, to_file, size=95):
from PIL import Image, ImageDraw, ImageFilter
im = Image.open(from_file)
if... |
import mock
from oslo_utils import timeutils
from nova import db
from nova import exception
from nova.objects import aggregate
from nova.tests.unit import fake_notifier
from nova.tests.unit.objects import test_objects
from nova.tests import uuidsentinel
NOW = timeutils.utcnow().replace(microsecond=0)
fake_aggregate = {... |
import pyjd
from pyjamas import DOM
from pyjamas import Window
from pyjamas import Factory
from __pyjamas__ import JS, doc
from pyjamas.ui.SimplePanel import SimplePanel
from pyjamas.ui.Widget import Widget
from pyjamas.ui.MouseListener import MouseHandler
from pyjamas.ui.RootPanel import RootPanel
mousecapturer = None... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v2 as tf
from tensorflow.compiler.mlir.tensorflow.tests.tf_saved_model import common
class TestModule(tf.Module):
# The fNNNN name prefixes in this file are such that the sorted order ... |
import time, tempfile, os, os.path, subprocess, re
from api import *
from nltk.probability import *
from nltk.internals import java, config_java
"""
Classifiers that make use of the external 'Weka' package.
"""
_weka_classpath = None
_weka_search = ['.',
'/usr/share/weka',
'/usr/local/sh... |
"""PipelineRunner, an abstract base runner object."""
from __future__ import absolute_import
import logging
import os
import shelve
import shutil
import tempfile
__all__ = ['PipelineRunner', 'PipelineState', 'PipelineResult']
def _get_runner_map(runner_names, module_path):
"""Create a map of runner name in lower case... |
from collections import namedtuple
TableInfo = namedtuple('TableInfo', ['name', 'type'])
FieldInfo = namedtuple('FieldInfo', 'name type_code display_size internal_size precision scale null_ok default')
class BaseDatabaseIntrospection:
"""
This class encapsulates all backend-specific introspection utilities
... |
"""
GravMag: Use the DipoleMagDir class to estimate the magnetization direction
of dipoles with known centers
"""
import numpy
from fatiando import mesher, gridder
from fatiando.utils import ang2vec, vec2ang, contaminate
from fatiando.gravmag import sphere
from fatiando.vis import mpl
from fatiando.gravmag.magdir impor... |
import junitparser as jp
import glob
import os
import sys
import xml
assert int(jp.version.split('.')[0]) >= 2, 'junitparser version must be >= 2'
def parse_result_file(fname):
results = jp.JUnitXml.fromfile(fname)
if isinstance(results, jp.junitparser.JUnitXml):
# special case for pytest, which wraps a... |
"""Graph actions tests."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import tempfile
from tensorflow.contrib import testing
from tensorflow.contrib.framework.python.framework import checkpoint_utils
from tensorflow.contrib.framework.python... |
import mock
import os.path
from neutron.agent.linux import external_process as ep
from neutron.common import utils as common_utils
from neutron.tests import base
from neutron.tests import tools
TEST_UUID = 'test-uuid'
TEST_SERVICE = 'testsvc'
TEST_PID = 1234
class BaseTestProcessMonitor(base.BaseTestCase):
def setU... |
"""
github3.gists.comment
---------------------
Module containing the logic for a GistComment
"""
from __future__ import unicode_literals
from ..models import BaseComment
from ..users import User
class GistComment(BaseComment):
"""This object represents a comment on a gist.
Two comment instances can be checked ... |
import time
import os
import sys
import hashlib
import gc
import shutil
import platform
import errno
import logging
try:
import cPickle as pickle
except:
import pickle
from parso._compatibility import FileNotFoundError
LOG = logging.getLogger(__name__)
_PICKLE_VERSION = 30
"""
Version number (integer) for file ... |
from os.path import splitext
from thumbor.ext.filters import _alpha
from thumbor.filters import BaseFilter, filter_method
import tornado.gen
class Filter(BaseFilter):
regex = r'(?:watermark\((?P<url>.*?),(?P<x>-?[\d]*?),(?P<y>-?[\d]*?),(?P<alpha>[\d]*?)\))'
def on_image_ready(self, buffer):
self.waterma... |
class NotFound(object):
pass |
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
transaction_ids = fields.Many2many('payment.transaction', 'account_invoice_transaction_rel', 'invoice_id', 'transaction_id',
... |
import unittest
from argparse import Namespace
from swift_build_support.host_specific_configuration import \
HostSpecificConfiguration
class ToolchainTestCase(unittest.TestCase):
def test_should_configure_and_build_when_deployment_is_all(self):
host_target = 'macosx-x86_64'
args = self.default_a... |
"""Auto-generated file, do not edit by hand. IO metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_IO = PhoneMetadata(id='IO', country_code=246, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='3\\d{6}', possible_number_pattern='\\d{7}... |
def check_c_count(expected_count):
test.assertEqual(expected_count,
len(reality.resources_by_logical_name('C')))
example_template = Template({
'A': RsrcDef({'a': 'initial'}, []),
'B': RsrcDef({}, []),
'C': RsrcDef({'!a': GetAtt('A', 'a')}, ['B']),
'D': RsrcDef({'c': GetRes('C')}... |
"""Tests for return_statements module."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.autograph.converters import functions
from tensorflow.python.autograph.converters import return_statements
from tensorflow.python.autograph.core i... |
"""FeatureColumns: tools for ingesting and representing features."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.feature_column.feature_column import *
from tensorflow.python.feature_column.feature_column_v2 import *
from tensorflow... |
from . import fontinfo
from . import latin1MetricsCache
_stdenc_widths = {
'courier':
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
600, 600, 600, 600, 600, 600, 60... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.