code stringlengths 1 199k |
|---|
from recommonmark.parser import CommonMarkParser
import sphinx_rtd_theme
_version = {}
with open('../../../bigchaindb/version.py') as fp:
exec(fp.read(), _version)
import os.path
import sys
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/..'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ex... |
"""Use a Windows event to interrupt a child process like SIGINT.
The child needs to explicitly listen for this - see
ipykernel.parentpoller.ParentPollerWindows for a Python implementation.
Copyright (c) IPython Development Team.
See documentation/BSDLicense_IPython.md for details.
Distributed under the terms of the Mod... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['stableinterface'],
'supported_by': 'core'}
DOCUMENTATION = '''
---
module: copy
version_added: "historical"
short_description: Copies files to remote locations.
description:
- The C(copy) module copies a file from the... |
import os
from ifaddr._shared import Adapter, IP
if os.name == "nt":
from ifaddr._win32 import get_adapters
elif os.name == "posix":
from ifaddr._posix import get_adapters
else:
raise RuntimeError("Unsupported Operating System: %s" % os.name)
__all__ = ['Adapter', 'IP', 'get_adapters'] |
{
'name': 'Theme Common',
'summary': 'Snippets Library',
'description': 'Snippets library containing snippets to be styled in Less Themes.',
'category': 'Hidden',
'version': '1.0',
'author': 'Odoo SA',
'depends': ['website_less'],
'data': [
# image placeholder
'data/image... |
from django.utils.translation import ugettext as _, ugettext_lazy
from django.contrib.auth.views import login as django_auth_login
from django.contrib.contenttypes.models import ContentType
from django.contrib.comments.models import Comment
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist, Multip... |
from nose import SkipTest
from kombu.tests.utils import redirect_stdouts
from funtests import transport
class test_django(transport.TransportCase):
transport = "django"
prefix = "django"
event_loop_max = 10
def before_connect(self):
@redirect_stdouts
def setup_django(stdout, stderr):
... |
from openerp import http |
'''
This allows the user to touch or keyboard input a number when it is the content of a popup
'''
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from kivy.properties import StringProperty
import... |
from file_transfer_helper import SendFileTest, ReceiveFileTest, \
exec_file_transfer_test, File
from config import JINGLE_FILE_TRANSFER_ENABLED
if not JINGLE_FILE_TRANSFER_ENABLED:
print "NOTE: built with --disable-file-transfer or --disable-voip"
raise SystemExit(77)
if __name__ == '__main__':
file = F... |
"""This file is part of the prometeo project.
This program 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 3 of the License, or (at your
option) any later version.
This program is distributed... |
"""
账号体系相关的基类Account.
"""
import time
from django.conf import settings
from django.contrib.auth import logout as auth_logout, get_user_model
from django.contrib.auth.views import redirect_to_login
from django.http import HttpResponse
from django.utils.six.moves.urllib.parse import urlparse
from common.log import logger... |
"""Conan recipe for zlib"""
from conans import ConanFile, CMake
class LibjpegConan(ConanFile):
name = "libjpeg"
version = "9d"
url = "https://github.com/mdaus/coda-oss/tree/master/modules/drivers/jpeg"
homepage = "https://ijg.org/"
license = "https://ijg.org/files/README"
description = "Libjpeg ... |
import mock
import unittest
from cloudify import exceptions as cfy_exc
from tests.unittests import test_mock_base
from network_plugin import port
class NetworkPluginPortMockTestCase(test_mock_base.TestBase):
def test_creation_validation(self):
fake_client = self.generate_client()
with mock.patch(
... |
"""Setup script for sample package (python3)."""
import distutils.core
import glob
import os
import setuptools
import sys
_NAME = 'salt_essentials_utils'
_PYTHON_PKG_NAME = 'salt_essentials'
_PKG_VERSION = '0.0.3'
_PKG_DESCRIPTION = 'Suite of utilities and scripts for Salt Essentials.'
_PKG_AUTHOR_NAME = 'Craig Sebenik... |
"""``tornado.web`` provides a simple web framework with asynchronous
features that allow it to scale to large numbers of open connections,
making it ideal for `long polling
<http://en.wikipedia.org/wiki/Push_technology#Long_polling>`_.
Here is a simple "Hello, world" example app::
import tornado.ioloop
import t... |
from datetime import timedelta
from . import types as command_types
from opentrons.broker import Broker
import functools
import inspect
from typing import Union, Sequence, List, Any, Optional, TYPE_CHECKING
from opentrons.legacy_api.containers import (Well as OldWell,
Contai... |
import pytest
import asyncio
import socket
import ipaddress
from aiohttp.resolver import AsyncResolver, DefaultResolver
from unittest.mock import patch
try:
import aiodns
except ImportError:
aiodns = None
class FakeResult:
def __init__(self, host):
self.host = host
@asyncio.coroutine
def fake_result... |
import logging
import unittest
class TestCloudLoggingHandler(unittest.TestCase):
PROJECT = 'PROJECT'
@staticmethod
def _get_target_class():
from google.cloud.logging.handlers.handlers import CloudLoggingHandler
return CloudLoggingHandler
def _make_one(self, *args, **kw):
return s... |
"""Tests for tf.contrib.lookup.lookup_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import six
import tensorflow as tf
class HashTableOpTest(tf.test.TestCase):
def testHashTable(self):
with self.test_session():
... |
from distutils.core import setup
setup(
name='xes',
version='1.2',
packages=['xes'],
url='http://pypi.python.org/pypi/xes/',
license='Apache License 2.0',
author='Jonathan Sumrall',
author_email='j.m.sumrall@student.tue.nl',
description='A simple tool for generating XES files for Process... |
import collections
import mock
import netaddr
from django.test.utils import override_settings
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
class NetworkApiNeutronTests(test.APIMockTestCase):
def setUp(self):
super(NetworkApiNeutronTests, self).setUp()
neut... |
"""Tests for monitored_session."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import glob
import os
import threading
import time
from tensorflow.contrib.framework.python.ops import variables as variables_lib
from tensorflow.contrib.tes... |
"""Add or check license header
Usuage:
- add the default license header to source files that do not contain a valid
license:
license_header.py add
- check if every files has a license header
license_header.py check
"""
import re
import os
import argparse
from itertools import chain
import logging
import sys
impor... |
import rtmidi
import Axon
from Axon.Ipc import producerFinished, shutdownMicroprocess
class Midi(Axon.Component.component):
def __init__(self, portNumber=0, **argd):
super(Midi, self).__init__(**argd)
self.output = rtmidi.RtMidiOut()
self.output.openPort(portNumber)
def main(self):
... |
"""Tests for layer wrappers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import numpy as np
from tensorflow.python import keras
from tensorflow.python.eager import context
from tensorflow.python.framework import constant_op
from tensorflow.... |
"""This example creates an agency paid regular placement in a given campaign.
Requires the DFA site ID and campaign ID in which the placement will be created
into. To create a campaign, run create_campaign.py. To get DFA site ID, run
get_site.py.
"""
import argparse
import sys
from apiclient import sample_tools
from oa... |
"""Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
CARRIER_DATA = {}
from .data0 import data
CARRIER_DATA.update(data)
from .data1 import data
CARRIER_DATA.update(data)
from .data2 import data
CARRIER_DATA.update(data)
del data
CARRIER_LO... |
from django import http
from django.core.urlresolvers import reverse
from mox import IsA
from horizon import api
from horizon import test
INDEX_URL = reverse('horizon:nova:images_and_snapshots:index')
class VolumeSnapshotsViewTests(test.TestCase):
def test_create_snapshot_get(self):
volume = self.volumes.fi... |
"""Setup.py entry point for package.
Configuration is handled by setuptools>30.3.0 through setup.cfg.
https://setuptools.readthedocs.io/en/latest/setuptools.html#metadata
https://setuptools.readthedocs.io/en/latest/setuptools.html#options
"""
import setuptools
setuptools.setup(
package_dir={'': 'src'},
) |
"""
1. Export singa model to onnx
2. Load onnx model and run it via singa backend
"""
from singa.tensor import Tensor
from singa import tensor
from singa import device
from singa import autograd
from singa import opt
from singa import sonnx
import numpy as np
f = lambda x: (5 * x + 1)
bd_x = np.linspace(-1.0, 1, 200)
b... |
import logging
import unittest
class TestCloudLoggingHandler(unittest.TestCase):
PROJECT = 'PROJECT'
@staticmethod
def _get_target_class():
from google.cloud.logging.handlers.handlers import CloudLoggingHandler
return CloudLoggingHandler
def _make_one(self, *args, **kw):
return s... |
from nova.tests.integrated.v3 import api_sample_base
class HostsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
extension_name = "os-hosts"
def test_host_startup(self):
response = self._do_get('os-hosts/%s/startup' % self.compute.host)
subs = self._get_regexes()
self._verify_respons... |
import benchexec.util as util
import benchexec.tools.smtlib2
class Tool(benchexec.tools.smtlib2.Smtlib2Tool):
"""
Tool info for MathSAT.
"""
def executable(self):
return util.find_executable("mathsat")
def version(self, executable):
line = self._version_from_tool(executable, "-versio... |
from modules.tools.record_analyzer.common.statistical_analyzer import PrintColors
from modules.tools.record_analyzer.common.statistical_analyzer import StatisticalAnalyzer
class LidarEndToEndAnalyzer(object):
"""
Control analyzer
"""
def __init__(self):
"""
Init
"""
self.... |
import re
from datetime import datetime, timedelta
def full_month_date_str(adate):
"""
Return a string value in the format of
"Month(full name) day, 4-digit-year" for the given date
"""
return "%s %d, %d" % (adate.strftime("%B"),
adate.day,
adate.y... |
import os
import sys
import datetime
from celery.schedules import crontab
from celery import Celery
from celery.utils.log import get_task_logger
cwd = os.getcwd()
path = os.path.join("appcomposer", "translator")
if cwd.endswith(path):
cwd = cwd[0:len(cwd) - len(path)]
os.chdir(cwd)
sys.path.insert(0, cwd)
from ... |
import os
import logging
from sqlalchemy.sql.expression import distinct
from oyProjectManager import conf
from oyProjectManager import db
from oyProjectManager.models.auth import Client
from oyProjectManager.models.project import Project
logger = logging.getLogger(__name__)
qt_module_key = "PREFERRED_QT_MODULE"
qt_modu... |
"""Metrics to assess performance on classification task given class prediction.
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better.
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better.
"""
import warnings
import numpy as np
from scipy.... |
from __future__ import unicode_literals
from datetime import datetime
import errno
import os
import re
import sys
import socket
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import run, get_internal_wsgi_application
from django.db import connections, DEFAULT_DB_ALIA... |
from django.contrib.auth.models import Group, User
from rest_framework import serializers
from remo.api.serializers import BaseKPISerializer
from remo.base.helpers import absolutify
from remo.profiles.models import FunctionalArea, UserProfile
class FunctionalAreaSerializer(serializers.ModelSerializer):
"""Serialize... |
from amazonia.classes.security_enabled_object import RemoteReferenceSecurityEnabledObject
from amazonia.classes.tree_config import TreeConfig
from troposphere import ImportValue
class Leaf(object):
def __init__(self):
"""
Create placeholders for leaf specific resources
"""
self.leaf_... |
"""
This module provides a label printing wrapper class for Unix-based
installations. By "Unix", we mean Linux, Mac OS, BSD, and various flavors
of Unix.
"""
import binascii
class DirectDevicePrinter(object):
"""
This class pipes the label data directly through a /dev/* entry.
Consequently, this is very Uni... |
__all__ = ['Word', 'Line', 'Code', 'FileSource', 'Flags']
from base import Component
class Word(Component):
template = '%(word)s'
def initialize(self, word):
if not word: return None
self.word = word
return self
def add(self, component, container_label=None):
raise ValueError... |
"""Test stepping and setting breakpoints in indirect and re-exported symbols."""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestIndirectFunctions(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
... |
import time
import unittest
import config
import command
import ipv6
import mle
import node
DUT_LEADER = 1
BR = 2
MED1 = 3
MED2 = 4
MTDS = [MED1, MED2]
class Cert_5_3_8_ChildAddressSet(unittest.TestCase):
def setUp(self):
self.simulator = config.create_default_simulator()
self.nodes = {}
for... |
test = {
'name': '',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> berkeley_markets.sort(0)
MarketName | city | State | y | x
Downtown Berkeley Farmers' Market | Berkeley | California | 37.8697 | -122.273
... |
"""Fetches album art.
"""
from __future__ import division, absolute_import, print_function
from contextlib import closing
import os
import re
from tempfile import NamedTemporaryFile
from collections import OrderedDict
import requests
from beets import plugins
from beets import importer
from beets import ui
from beets i... |
#静态类
class Lang:
"""语言包配置
>>Demo:
from lang import Lang
print Lang.getLang("ErrorCode")
"""
@staticmethod
def getLang(name):
"""获取语言包配置属性,参数name:属性名"""
return Lang.__langconfig[name]
__langconfig = {
"ErrorCode": 10000,
"ErrorInfo": "系统繁忙",
"LoadE... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
import TestSCons
_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
ranlib = test.detect('RANLIB', 'ranlib')
if not ranlib:
test.skip_test("Could not find 'ranlib', skipping test.\n")
test.write("wrapper.py",
"""... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('content', '0006_auto_20171128_1703'),
]
operations = [
migrations.AlterModelManagers(
name='contentnode',
managers=[
],
... |
import rb, rhythmdb
import gtk, gobject
import re, os
import cgi
import urllib
import xml.dom.minidom as dom
import LastFM
import webkit
from mako.template import Template
class ArtistTab (gobject.GObject):
__gsignals__ = {
'switch-tab' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE,
... |
"""
Dtella - Bridge Main Module
Copyright (C) 2008 Dtella Labs (http://www.dtella.org/)
Copyright (C) 2008 Paul Marks (http://www.pmarks.net/)
$Id$
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; ei... |
from jhbuild import monkeypatch
del monkeypatch |
"""
EasyBuild support for gobff compiler toolchain (includes GCC, OpenMPI, BLIS, libFLAME, ScaLAPACK and FFTW).
:author: Sebastian Achilles (Forschungszentrum Juelich GmbH)
"""
from easybuild.toolchains.gompi import Gompi
from easybuild.toolchains.linalg.blis import Blis
from easybuild.toolchains.linalg.flame import Fl... |
"""Default ProgressBar widgets."""
from __future__ import division
import datetime
import math
try:
from abc import ABCMeta, abstractmethod
except ImportError:
AbstractWidget = object
abstractmethod = lambda fn: fn
else:
AbstractWidget = ABCMeta('AbstractWidget', (object,), {})
def format_updatable(upda... |
from __future__ import unicode_literals
from resources.lib.modules import client,webutils,convert
import re,urlparse,json,urllib
from resources.lib.modules.log_utils import log
class info():
def __init__(self):
self.mode = 'fullmatchtv_rugby'
self.name = 'fullmatchtv.com Rugby'
self.icon = 'ful... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: vmware_datastore_facts
short_description: Gather facts about datastores available in give... |
import httplib2
import argparse
import logging
import os
import json
import pickle
import sys
from gi.repository import GObject
if "SOFTWARE_CENTER_DEBUG_HTTP" in os.environ:
httplib2.debuglevel = 1
import piston_mini_client.auth
import piston_mini_client.failhandlers
from piston_mini_client.failhandlers import API... |
from __future__ import absolute_import, division, print_function
from datetime import datetime
import os
import subprocess
import sys
import shutil
import sphinx.environment
SOURCEDIR = os.path.abspath('../inspirehep')
_warn_node_old = sphinx.environment.BuildEnvironment.warn_node
def _warn_node(self, msg, *args, **kwa... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import datetime
import glob
import optparse
import os
import re
import sys
import warnings
from collections import defaultdict
from copy import deepcopy
from distutils.version import LooseVersion
from functools import partial
from ppr... |
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import sys, os, shutil
from lxml import etree
from calibre import walk
from calibre.utils.zipfile import ZipFile
def dump(path... |
from django.conf.urls import patterns, url, include, handler404
from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect
from django.shortcuts import redirect
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
import mysite.account.forms
import django... |
"eduPersonAffiliation": {
"oid": "1.3.6.1.4.1.5923.1.1.1.1",
"display_name": _("eduPersonAffiliation"),
"type": "http://www.w3.org/2001/XMLSchema#string",
"syntax": "1.3.6.1.4.1.1466.115.121.1.15",
},
"eduPersonNickname": {
"oid": "1.3.6.1.4.1.5923.1.1.1.2",
"display_name": _("eduPersonNickname"... |
import logging
from datetime import datetime
from sqlalchemy import Table, Column, ForeignKey, or_
from sqlalchemy import DateTime, Integer, Unicode
from sqlalchemy.orm import reconstructor
import meta
import refs
log = logging.getLogger(__name__)
watch_table = Table(
'watch', meta.data,
Column('id', Integer, p... |
from spack import *
class Scrot(AutotoolsPackage):
"""scrot (SCReenshOT) is a simple command line screen
capture utility that uses imlib2 to grab and save images.
Multiple image formats are supported through imlib2's
dynamic saver modules."""
homepage = "https://github.com/resurrecting-open-source-p... |
"""
some unit tests to make sure sftp works well with large files.
a real actual sftp server is contacted, and a new folder is created there to
do test file operations in (so no existing files will be harmed).
"""
import logging
import os
import random
import struct
import sys
import threading
import time
import unitte... |
import codecs
from distutils.core import setup
from glob import glob
import os.path as path
try:
codecs.lookup('mbcs')
except LookupError:
ascii = codecs.lookup('ascii')
def wrapper(name, enc=ascii):
return {True: enc}.get(name == 'mbcs')
codecs.register(wrapper)
install_requires = ['nflgame>=1.... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import shutil
from pants.backend.jvm.targets.benchmark import Benchmark
from pants.backend.jvm.targets.jar_dependency import JarDependency
from pants.backend.... |
import os
import re
import fnmatch
import glob
import time
import logging
import mimetypes
import subprocess
import textwrap
from io import StringIO
from pathlib import Path
from datetime import date
import jinja2
from ruamel.yaml import YAML
try:
import github3
_have_github3 = True
except ImportError:
gith... |
class Solution:
# @param root, a tree node
# @return a boolean
def isBalanced(self, root):
if root is None:
return True
else:
if self.height(root) != -1:
return True
else:
return False
def height(self, root):
# R... |
import os.path as op
import numpy as np
from shutil import copyfile
from datetime import datetime, timezone
import pytest
from numpy.testing import assert_allclose, assert_array_equal
from mne.annotations import events_from_annotations
from mne.bem import _fit_sphere
from mne.datasets import testing
from mne.event impo... |
"""Sparse block 1-norm estimator.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.sparse.linalg import aslinearoperator
__all__ = ['onenormest']
def onenormest(A, t=2, itmax=5, compute_v=False, compute_w=False):
"""
Compute a lower bound of the 1-norm of a spar... |
import pytest
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_allclose)
from sklearn.datasets import load_linnerud
from sklearn.cross_decomposition._pls import (
_center_scale_xy,
_get_first_singular_vectors_power_method,
_get_fi... |
"""
An extension of scipy.stats.stats to support masked arrays
"""
from __future__ import division, print_function, absolute_import
__all__ = ['argstoarray',
'count_tied_groups',
'describe',
'f_oneway', 'find_repeats','friedmanchisquare',
'kendalltau','kendalltau_seasonal','k... |
import sys
import inspect
import heapq
import random
import cStringIO
class FixedRandom:
def __init__(self):
fixedState = (
3, (2147483648, 507801126, 683453281, 310439348, 2597246090,
2209084787, 2267831527, 979920060, 3098657677, 37650879, 807947081, 3974896263,
... |
class A:
def foo(self):
print('A.foo()')
class B(A):
def foo(self):
print('B.foo()')
class C(A):
def foo(self):
print('C.foo()')
class D(B, C):
def bar(self):
print('D.bar()')
x = D()
print(D.__mro__) # (D, B, C, A, object)
x.bar() # D.bar()
x.foo() # B.... |
from __future__ import print_function
from collections import defaultdict
from time import time
import numpy as np
from numpy import random as nr
from sklearn.cluster.k_means_ import KMeans, MiniBatchKMeans
def compute_bench(samples_range, features_range):
it = 0
results = defaultdict(lambda: [])
chunk = 10... |
from __future__ import unicode_literals
import copy
from django.conf import settings
from django.db import models
from django.db.models.loading import cache
from django.test import TestCase
from django.test.utils import override_settings
from .models import (
Child1,
Child2,
Child3,
Child4,
Child5,
... |
from __future__ import absolute_import, unicode_literals
import io
import pytest
import warnings
import socket
from case import MagicMock, Mock, patch
from kombu import Connection
from kombu.compression import compress
from kombu.exceptions import ResourceError, ChannelError
from kombu.transport import virtual
from kom... |
from __future__ import absolute_import
from __future__ import print_function
import pytest
from keras.models import Model
from keras.layers import Dense, Input
from keras.utils.test_utils import keras_test
from keras import backend as K
from keras.backend import theano_backend as KTH
from keras.backend import tensorflo... |
"""Test mempool limiting together/eviction with the wallet."""
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_greater_than, assert_raises_rpc_error, create_confirmed_utxos, create_lots_of_big_transactions, gen_return_txouts... |
"""
test_bfd_topo1.py: Test the FRR BFD daemon.
"""
import os
import sys
import json
from functools import partial
import pytest
CWD = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(CWD, "../"))
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog ... |
from __future__ import division, print_function
import logging
logger = logging.getLogger(__name__)
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GLib
class StateGroup (object):
"""Supervisor instance for GUI states.
This class mainly deals with the various ways how the u... |
import re
import subprocess
from waflib import TaskGen, Node, Task, Utils, Build, Options, Logs, Task
debug = Logs.debug
error = Logs.error
import shellcmd
shellcmd.debug = debug
arg_rx = re.compile(r"(?P<dollar>\$\$)|(?P<subst>\$\{(?P<var>\w+)(?P<code>.*?)\})", re.M)
class command_task(Task.Task):
color = "BLUE"
def... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.compat.tests.mock import patch
from ansible.modules.network.slxos import slxos_config
from units.modules.utils import set_module_args
from .slxos_module import TestSlxosModule, load_fixture
class TestSlxosConfigModule(T... |
from setuptools import setup, find_packages
import os
version = '0.1'
setup(name='ubify.smartview',
version=version,
description="intelligent views",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings fr... |
DOCUMENTATION = '''
---
module: ec2_group
version_added: "1.3"
short_description: maintain an ec2 VPC security group.
description:
- maintains ec2 security groups. This module has a dependency on python-boto >= 2.5
options:
name:
description:
- Name of the security group.
required: true
descriptio... |
from __future__ import absolute_import
import re
from ipalib import errors
record_name_format = '%srecord'
part_name_format = "%s_part_%s"
extra_name_format = "%s_extra_%s"
def get_record_rrtype(name):
match = re.match('([^_]+)record$', name)
if match is None:
return None
return match.group(1).upper... |
import collections, os, subprocess, sys, threading
def main(argv):
if len(argv[1:]) < 7:
print >> sys.stderr, 'Learn Meteor parameters efficiently with parallel Trainers'
print >> sys.stderr, 'Usage: {0} <meteor.jar> <lang> <n-mods> <task> <data_dir> <work_dir> <n-jobs> [other args like -a par.gz, -... |
import utils
import sys
import getpass
import os
import subprocess
import random
import fnmatch
import tempfile
import fcntl
import constants
import locale
from ansible.color import stringc
import logging
if constants.DEFAULT_LOG_PATH != '':
path = constants.DEFAULT_LOG_PATH
if (os.path.exists(path) and not os.... |
"""Benchmark output validator
Given a benchmark output file in json format and a benchmark schema file,
validate the output against the schema.
"""
from __future__ import print_function
import json
import sys
import os
try:
import import_bench as bench
except ImportError:
print('Import Error: Output will not be... |
from openerp import models, api
from .confirming_sabadell import ConfirmingSabadell
class BankingExportCsbWizard(models.TransientModel):
_inherit = 'banking.export.csb.wizard'
@api.model
def _check_company_bank_account(self, payment_order):
"""Don't make this check for Confirming Sabadell."""
... |
from __future__ import absolute_import
from __future__ import print_function
from aeneas.syncmap.smfbase import SyncMapFormatBase
import aeneas.globalfunctions as gf
class SyncMapFormatGenericSubtitles(SyncMapFormatBase):
"""
Base class for subtitles-like I/O format handlers.
"""
TAG = u"SyncMapFormatGe... |
from __future__ import unicode_literals
import webnotes
from webnotes import _
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
@webnotes.whitelist()
def get_doctypes():
return webnotes.conn.sql_list("""select name from tabDocType
where ifnull(allow_rename,0)=1 and module!='Core' order by ... |
from spack import *
class PyLockfile(PythonPackage):
"""The lockfile package exports a LockFile class which provides a
simple API for locking files. Unlike the Windows msvcrt.locking
function, the fcntl.lockf and flock functions, and the
deprecated posixfile module, the API is identical across ... |
from django.core.cache import cache
from django.http import HttpResponseRedirect, Http404
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.translation import ugettext as _
from django.conf import settings
from django.contrib import messages
from seahub.avatar.... |
from airflow.exceptions import AirflowException
from airflow.providers.discord.hooks.discord_webhook import DiscordWebhookHook
from airflow.providers.http.operators.http import SimpleHttpOperator
from airflow.utils.decorators import apply_defaults
class DiscordWebhookOperator(SimpleHttpOperator):
"""
This opera... |
"""Open-source TensorFlow Inception v3 Example."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from absl import app
from absl import flags
import tensorflow as tf
from tensorflow.contrib import slim
from tensorflow.contrib.slim.nets import incep... |
from AlgorithmImports import *
class BasicTemplateOptionsConsolidationAlgorithm(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2013, 10, 7)
self.SetEndDate(2013, 10, 11)
self.SetCash(1000000)
# Subscribe and set our filter for the options chain
option = self.AddOption(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.