code stringlengths 1 199k |
|---|
import numpy as np
from numpy import cos, sin, pi
from pele.potentials import LJ
from pele.angleaxis import RBTopology, RBSystem, RigidFragment, RBPotentialWrapper
def make_otp():
"""this constructs a single OTP molecule"""
otp = RigidFragment()
otp.add_atom("O", np.array([0.0, -2./3 * np.sin( 7.*pi/24.), 0... |
import urllib
import sickbeard
from sickbeard import logger
from sickbeard.exceptions import ex
try:
import lib.simplejson as json #@UnusedImport
except:
import json #@Reimport
API_URL = "https://%(username)s:%(secret)s@api.notifo.com/v1/send_notification"
class NotifoNotifier:
def test_notify(self, usernam... |
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
try:
import ibm_db_dbi
except ImportError:
pass
import logging
from lib.core.data import conf
from lib.core.data import logger
from lib.core.exception import SqlmapConnectionException
from pl... |
from steam import WebAPI as steamwebapi
from config import SteamAPI
from io import BytesIO
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
import time
import aiohttp
import os
import datetime
import discord
async def steam(cmd, message, args):
steamapi = steamwebapi(SteamAPI)
steam_in... |
default_app_config = "wiki.plugins.globalhistory.apps.GlobalHistoryConfig" |
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, cstr, flt
from frappe import _
from frappe.model.document import Document
from operator import itemgetter
class BOM(Document):
def autoname(self):
last_name = frappe.db.sql("""select max(name) from `tabBOM`
where name like "BOM/%... |
from flask import request
from apps.content import push_content_notification
from apps.tasks import send_to
from superdesk import get_resource_service
import superdesk
from superdesk.errors import SuperdeskApiError, InvalidStateTransitionError
from superdesk.metadata.item import CONTENT_STATE, ITEM_STATE
from superdesk... |
from freeswitch import *
import sys
import re
import random
import messaging.sms.submit
from datetime import datetime, timedelta
RP_GENERIC_HEADER = '00GG0003919999'
TP_GENERIC_HEADER = '11GG'
MAX_GSM_TIME = 63 * 7
def gen_header(reference, header):
return re.sub('GG', reference, header)
def gen_hex(i):
tmp = h... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('judge', '0003_license_key'),
]
operations = [
migrations.CreateModel(
name='LanguageLimit',
fields=[
('id', model... |
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, Session
class SQLAlchemyDatabaseConnector:
"""
Database connector for use with SQLAlchemy.
"""
def __init__(self, database_location: str):
"""
Default constructor.
:param database_location: the url of t... |
import unittest2
from lxml import etree
from openerp.tests import test_mail_examples
from openerp.tools import html_sanitize, html_email_clean, append_content_to_html, plaintext2html, email_split
class TestSanitizer(unittest2.TestCase):
""" Test the html sanitizer that filters html to remove unwanted attributes """... |
from spack import *
import os
import shutil
class Gaussian(Package):
"""Gaussian is a computer program for computational chemistry"""
homepage = "http://www.gaussian.com/"
url = "file://{0}/g09.tgz".format(os.getcwd())
version('09', '7d4c95b535e68e48af183920df427e4e')
def install(self, spec, prefix... |
import os
import sys
import re
import datetime
import subprocess
source_exts = [ '.py', '.c', '.h', '.cpp' ]
def is_source(path):
for ext in source_exts:
if path.endswith(ext):
return True
def get_name_and_version():
f = open('configure.ac', 'r')
config = f.read()
f.close()
exp =... |
try:
from maxent import *
except ImportError:
import sys
print >> sys.stderr, 'maxent module not found, get it from homepages.inf.ed.ac.uk/s0450736/maxent_toolkit.html'
sys.exit(-1)
import orange
def extract_features(ex):
f = []
for i, a in enumerate(ex.domain.attributes):
f.append('%s=%... |
"""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... |
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.or... |
from __future__ import print_function
import pyxb.utils.domutils
import xml.dom.minidom
import cablelabs.core as core
import cablelabs.offer as offer
import cablelabs.title as title
import cablelabs.vod30 as vod30
import custom
pyxb.utils.domutils.BindingDOMSupport.DeclareNamespace(core.Namespace, 'core')
pyxb.utils.do... |
import json
from magnum.tests.functional.common import models
class BayModelPatchData(models.BaseModel):
"""Data that encapsulates baymodelpatch attributes"""
pass
class BayModelPatchEntity(models.EntityModel):
"""Entity Model that represents a single instance of BayModelPatchData"""
ENTITY_NAME = 'bay... |
from flask.ext.wtf import Form
from wtforms import StringField, BooleanField, PasswordField
from wtforms.validators import DataRequired
class RegistrationForm(Form):
email = StringField('email', validators=[DataRequired()])
password = PasswordField('password', validators=[DataRequired()]) |
import sys
import os
project = 'python-neutronclient'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
copyright = u'OpenStack LLC'
add_function_parentheses = True
add_module_names = True
pygments_style = 'sphinx'
html_theme = 'nat... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... |
from oslo_log import log as logging
from oslo_utils import encodeutils
import stevedore
from trove.common import base_exception as exception
from trove.common import cfg
from trove.common.i18n import _
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
class ModuleDriverManager(object):
MODULE_DRIVER_NAMESPACE = 'tr... |
import scalaris
from datetime import datetime
from threading import Thread
import time, threading
import random, string
import os, sys, traceback
_BENCH_DATA_SIZE = 1000
"""The size of a single data item that is send to scalaris."""
_benchTime = 0
"""This is used to create different erlang keys for each run."""
_PERCEN... |
'''
Copyright (C) 2013 TopCoder Inc., All Rights Reserved.
'''
'''
This is the module that defines all the views which will respond to client requests.
Thread Safety:
The implementation is not thread safe but it will be used in a thread-safe manner.
v1.1 - Healthcare Fraud Prevention Release Assembly v1.0
- update... |
from __future__ import absolute_import
import re
import six
__author__ = 'ross'
import unittest
name_re=re.compile(r'''name\s*=\s*["']+\w+["']''')
desc_re=re.compile(r'''description\s*=\s*["']+[\w\s]+["']''')
attr_re=re.compile(r'''["']+[\w\s]+["']''')
vd={'A':'Foo Bar'}
class ValveCommand(object):
valve=None
d... |
from __future__ import absolute_import
import eventlet
from integration.orquesta import base
from st2common.constants import action as ac_const
class InquiryWiringTest(base.TestWorkflowExecution):
def test_basic_inquiry(self):
# Launch the workflow. The workflow will paused at the pending task.
ex =... |
from __future__ import absolute_import
from behave.tag_expression.model import Expression, Literal
from behave.tag_expression.model_ext import Matcher
import pytest
class TestExpression(object):
def test_check__can_be_used(self):
tag_expression = Literal("foo")
assert tag_expression.check(["foo"]) i... |
from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSTokenFieldHelper (NSObject):
def tokenField_completionsForSubstring_indexOfToken_indexOfSelectedItem_(self, a, b, c, d): return 1
def tokenField_shouldAddObjects_atIndex_(self, a, b, c): return 1
def tokenField_writeRepresentedObjects_to... |
"""SCons.Platform.posix
Platform-specific initialization for POSIX (Linux, UNIX, etc.) systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
__revision__ = "src/engine/SCons/Platform/posix.py 3897 20... |
import pytest
import sqlalchemy as sa
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy_utils import generic_relationship
from . import GenericRelationshipTestCase
@pytest.fixture
def Building(Base):
class Building(Base):
__tablename__ = 'building'
id = sa.Column(sa.Integer, prima... |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from social_auth.models import UserSocialAuth
from sentry.testutils import APITestCase
class UserSocialIdentityDetailsEndpointTest(APITestCase):
def setUp(self):
self.login_as(self.user)
def test_can_disconnect(self):
... |
"""Declarative container provider override example."""
import sqlite3
from unittest import mock
from dependency_injector import containers, providers
class Container(containers.DeclarativeContainer):
database = providers.Singleton(sqlite3.connect, ":memory:")
if __name__ == "__main__":
container = Container(dat... |
"""A test to verify an implementation of the Face layer of RPC Framework."""
import abc
import unittest
from grpc.framework.face import interfaces
from grpc.framework.face.testing import callback as testing_callback
from grpc.framework.face.testing import control
from grpc.framework.face.testing import coverage
from gr... |
import urllib
import urllib2
import pprint
from utils import transform_datetime
from utils import flatten
from warnings import warn
from django.utils import simplejson
_debug = 1
class ChimpyException(Exception):
pass
class ChimpyWarning(Warning):
pass
class Connection(object):
"""mailchimp api connection""... |
import unittest
from django.conf import settings
from django.core.checks import Error
from django.core.checks.model_checks import _check_lazy_references
from django.core.exceptions import ImproperlyConfigured
from django.db import connections, models
from django.db.models.signals import post_init
from django.test impor... |
from cumulusci.core.exceptions import CumulusCIException
class MetadataApiError(CumulusCIException):
def __init__(self, message, response):
super(MetadataApiError, self).__init__(message)
self.response = response
class MetadataComponentFailure(MetadataApiError):
pass
class MissingOAuthError(Cumu... |
DATE_FORMAT = 'j בF Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j בF Y H:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j בF'
SHORT_DATE_FORMAT = 'd/m/Y'
SHORT_DATETIME_FORMAT = 'd/m/Y H:i:s'
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ',' |
"""
This test basically just plays around with image.rollimg.
It has three examples
* image_reduce: this takes an Image having, say, an axis 't' and returns another
Image having reduced over 't'
* need_specific_axis_reduce: this takes an Image and a specific
axis name, like 't' and produces an Image reduced over '... |
"""
Generic helpers for RQ task execution
"""
from __future__ import absolute_import
import rq
from django.conf import settings
from .utils import get_redis_connection
def enqueue(function, args=None, kwargs=None, timeout=None, queue='default'):
async = not settings.RQ_EAGER
if args is None:
args = ()
... |
from TestCase import TestCase
from WidgetTest import WidgetTest
from MenuTest import MenuTest
from SplitContainerTest import SplitContainerTest
from WindowTest import WindowTest
from ListContainerTest import ListContainerTest
from EventSignalCombinerTest import EventSignalCombinerTest
from FrameTest import FrameTest
fr... |
from django.contrib.gis import admin
from lingcod.spacing.models import *
from lingcod.spacing.views import create_pickled_graph_from_all_land as create_graph
from django.conf.urls.defaults import patterns, url
class SpacingPointAdmin(admin.GeoModelAdmin):
pass
admin.site.register(SpacingPoint,SpacingPointAdmin)
cl... |
""" basic inference routines """
from collections import abc
from numbers import Number
import re
from typing import Pattern
import numpy as np
from pandas._libs import lib
from pandas._typing import ArrayLike
is_bool = lib.is_bool
is_integer = lib.is_integer
is_float = lib.is_float
is_complex = lib.is_complex
is_scala... |
import sys
import recipe_util # pylint: disable=F0401
class Infra(recipe_util.Recipe):
"""Basic Recipe class for the Infrastructure repositories."""
@staticmethod
def fetch_spec(_props):
solution = lambda name, path_infix = None: {
'name' : name,
'url' : 'https://chromium.googlesource.co... |
import tensorflow as tf
import common
from collections import OrderedDict
class TRANSITION(object):
def __init__(self, in_dim, out_dim, size, lr, do_keep_prob, weight_decay):
self.arch_params = {
'in_dim': in_dim,
'out_dim': out_dim,
'n_hidden_0': size[0],
'n_... |
"""
.. NOTE::
Added `imdb_original_name` recently, so in case the title lookup translations cause problems
switch to find_entry to use that instead!
"""
from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase, use_vcr
class TestImdb(FlexGetBase):
__yaml__ = """
... |
from __future__ import print_function, unicode_literals
import re
import stat
from _emerge.Package import Package
from _emerge.RootConfig import RootConfig
from repoman.modules.scan.scanbase import ScanBase
from repoman.qa_data import no_exec, allvars
from repoman._portage import portage
from portage import os
from por... |
from twisted.trial import unittest
from buildbot.test.util import www
from buildbot.test.util.misc import TestReactorMixin
from buildbot.www import resource
class ResourceSubclass(resource.Resource):
needsReconfig = True
class Resource(TestReactorMixin, www.WwwTestMixin, unittest.TestCase):
def setUp(self):
... |
import os
import os.path
import sys
import time
import gzip
import shutil
import gettext
try:
# python 2
import cStringIO
except ImportError:
# python3
import io as cStringIO
import dumper
from spacewalk.common.usix import raise_with_tb
from spacewalk.common import rhnMail
from spacewalk.common.rhnCon... |
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class perl_IO_Compress(test.test):
"""
Autotest module for testing basic functionality
of perl_IO_Compress
@author Madhuri Appana <maappana@in.ibm.com> ##
"""
v... |
import os, sys
dirname = os.path.dirname(sys.modules[__name__].__file__)
autotest_dir = os.path.abspath(os.path.join(dirname, "../../../"))
client_dir = os.path.join(autotest_dir, "client")
sys.path.insert(0, client_dir)
import setup_modules
sys.path.pop(0)
setup_modules.setup(base_path=autotest_dir, root_module_name="... |
XS_INST_NONE = 0
XS_INST_BOOT = (1 << 0)
XS_INST_LOAD = (1 << 1)
XS_POLICY_NONE = 0
XS_POLICY_ACM = (1 << 0)
ACM_LABEL_VM = (1 << 0)
ACM_LABEL_RES = (1 << 1)
XSERR_BASE = 0x1000
XSERR_SUCCESS = 0
XSERR_GENERAL_FAILURE = 1 + XSERR_BASE
XSERR_BAD_XML = 2 + XSERR_BASE # XML... |
import wadis.node.model.saga as saga
from wadis.node.model.fake import categoryTypeDict
from django.db.models import Q
defaultList = {'id_substance':('exact','1000021')}
def makeQ(q, tuple):
defaultFlag = formatQ(q, tuple, True)
q &= Q(**{'id_%s_ds__status__exact' % tuple[0]:'public'})
if defaultFlag:
for field in... |
"""
Cooperative multitasking and asynchronous I/O using generators
multitask allows Python programs to use generators (a.k.a. coroutines)
to perform cooperative multitasking and asynchronous I/O.
Applications written using multitask consist of a set of cooperating
tasks that yield to a shared task manager whenever they... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "todolist.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is rea... |
import k8s
import os
import re
import socket
import subprocess
import sys
import tempfile
def get_service_endpoint(url):
s = api.get(url)
return "%s:%u" % (s.spec.portalIP, s.spec.ports[0].port)
def resolve_values(t, x):
parameters = {p.name: p.get("value", None) for p in t.parameters}
return re.sub("\$... |
DOCUMENTATION = '''
---
module: nxos_vrf
version_added: "2.1"
short_description: Manages global VRF configuration.
description:
- Manages global VRF configuration.
extends_documentation_fragment: nxos
author:
- Jason Edelman (@jedelman8)
- Gabriele Gerbino (@GGabriele)
notes:
- Cisco NX-OS creates the d... |
"""
This is a web-server which integrates with the twisted.internet
infrastructure.
"""
from __future__ import division, absolute_import
import copy
import os
try:
from urllib import quote
except ImportError:
from urllib.parse import quote as _quote
def quote(string, *args, **kwargs):
return _quote(... |
"""
Tests for course wiki
"""
from django.urls import reverse
from mock import patch
from six import text_type
from courseware.tests.tests import LoginEnrollmentTestCase
from openedx.features.enterprise_support.tests.mixins.enterprise import EnterpriseTestConsentRequired
from xmodule.modulestore.tests.django_utils impo... |
"""Python 'zlib_codec' Codec - zlib compression encoding.
This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import zlib # this codec needs the optional zlib module !
def zlib_encode(input, ... |
import random
import string
import unittest
import pytest
from airflow import models
from airflow.api.common.experimental import pool as pool_api
from airflow.exceptions import AirflowBadRequest, PoolNotFound
from airflow.models.pool import Pool
from airflow.utils.session import create_session
from tests.test_utils.db ... |
from proton import Message
from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, unittest, TestTimeout, PollTimeout, Logger
from proton.handlers import MessagingHandler
from proton.reactor import Container, DynamicNodeProperties
from qpid_dispatch_internal.compat import UNICODE
class RouterMultitenantPolic... |
LOCAL_VLAN_ID = -2
FLAT_VLAN_ID = -1
TYPE_IB = 'ib'
VIF_TYPE_DIRECT = 'mlnx_direct'
VIF_TYPE_HOSTDEV = 'hostdev'
VNIC_TYPE = 'vnic_type' |
"""Constants for the Fronius integration."""
from typing import Final, NamedTuple, TypedDict
from homeassistant.helpers.entity import DeviceInfo
DOMAIN: Final = "fronius"
SolarNetId = str
SOLAR_NET_ID_POWER_FLOW: SolarNetId = "power_flow"
SOLAR_NET_ID_SYSTEM: SolarNetId = "system"
class FroniusConfigEntryData(TypedDict... |
import requests
import responses
from zerver.lib.cache import cache_delete
from zerver.lib.github import InvalidPlatform, get_latest_github_release_download_link_for_platform
from zerver.lib.test_classes import ZulipTestCase
logger_string = "zerver.lib.github"
class GitHubTestCase(ZulipTestCase):
@responses.activat... |
import multiprocessing
import os
import time
import unittest
import pytest
from mock import patch
from airflow import AirflowException, models, settings
from airflow.executors.sequential_executor import SequentialExecutor
from airflow.jobs import LocalTaskJob
from airflow.models import DAG, TaskInstance as TI
from airf... |
"""
Support for tracking MQTT enabled devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.mqtt/
"""
import logging
import voluptuous as vol
from homeassistant.components import mqtt
from homeassistant.core import callback
from homeassis... |
from pywin.mfc import dialog
import win32ui
import win32con
def MakeDlgTemplate():
style = (win32con.DS_MODALFRAME |
win32con.WS_POPUP |
win32con.WS_VISIBLE |
win32con.WS_CAPTION |
win32con.WS_SYSMENU |
win32con.DS_SETFONT)
cs = (win32con.WS_CHILD |
win32con.WS_VISIBLE)
w = 215
h = 36
dlg = [["Progress... |
"""
Support for Unifi WAP controllers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.unifi/
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.device_tracker impor... |
from twisted.internet import reactor
from twisted.spread import pb
from twisted.cred.credentials import UsernamePassword
from pbecho import DefinedError
def success(message):
print "Message received:",message
# reactor.stop()
def failure(error):
t = error.trap(DefinedError)
print "error received:", t
... |
"""Tests for Python ops defined in math_grad.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.eager import backprop
from tensorflow.python.eager import context
from tensorflow.python.eager import execution_callb... |
from django.contrib import admin
from django.contrib.auth import logout
from django.contrib.redirects.models import Redirect
from django.core.exceptions import MiddlewareNotUsed
from django.core.urlresolvers import reverse
from django.http import (HttpResponse, HttpResponseRedirect,
HttpRespons... |
from __future__ import unicode_literals
import decimal
from django.forms import DecimalField, NumberInput, ValidationError, Widget
from django.test import SimpleTestCase
from django.utils import formats, translation
from . import FormFieldAssertionsMixin
class DecimalFieldTest(FormFieldAssertionsMixin, SimpleTestCase):... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('tax', '0001_initial'),
]
operations = [
migrations.Cr... |
import datetime
import distutils.version
import os
import re
from collections import OrderedDict
class NlxHeader(OrderedDict):
"""
Representation of basic information in all 16 kbytes Neuralynx file headers,
including dates opened and closed if given.
"""
HEADER_SIZE = 2 ** 14 # Neuralynx files hav... |
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class WagtailSearchPromotionsAppConfig(AppConfig):
name = 'wagtail.contrib.search_promotions'
label = 'wagtailsearchpromotions'
verbose_name = _("Wagtail search promotions") |
from __future__ import absolute_import, unicode_literals
import pytest
from case import Mock
from kombu.utils.scheduling import FairCycle, cycle_by_name
class MyEmpty(Exception):
pass
def consume(fun, n):
r = []
for i in range(n):
r.append(fun(Mock(name='callback')))
return r
class test_FairCycl... |
from __future__ import unicode_literals
from django.db import migrations, models
import autoslug.fields
import mozillians.groups.templatetags.helpers
class Migration(migrations.Migration):
dependencies = [
('groups', '0015_groupmembership_needs_renewal'),
]
operations = [
migrations.AlterFie... |
from __future__ import unicode_literals
from unittest import expectedFailure
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django import forms
from django.test import TestCase, override_settings
from django.test.client import RequestFactory
fro... |
import warnings
import random
import json
import jinja2
import numpy
import re
import os
from ._server import serve
from .utils import deprecated, get_id, write_ipynb_local_js
from .mplexporter import Exporter
from .mpld3renderer import MPLD3Renderer
from . import urls
__all__ = ["fig_to_html", "fig_to_dict", "fig_to_d... |
"""This test covers the workflow for a sharding merge.
We start with 3 shards: -40, 40-80, and 80-. We then merge -40 and 40-80
into -80.
Note this test is just testing the full workflow, not corner cases or error
cases. These are mostly done by the other resharding tests.
"""
import logging
import unittest
from vtdb i... |
__version__ = "0.0.6" |
"""Reset connections on a certain service group."""
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import loadbal
@click.command()
@click.argument('identifier')
@environment.pass_env
def cli(env, identifier):
"""Reset connections on a certain service group."""
mgr = SoftL... |
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002'),
('regions', '0001_initial'),
('workshops', '0001_initial'),
]
operatio... |
import logging
from django.core.urlresolvers import reverse
from rest_framework import decorators, permissions
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
from redis import ConnectionError
from readthedocs.core.utils.tasks import TaskNoPermission
from readthedocs.core.... |
'''
This decoder stacks on top of the 'spi' PD and decodes the
Analog Devices AD5626 protocol.
'''
from .pd import Decoder |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from ansible.compat.tests.mock import patch
from ansible.modules.network.cnos import cnos_interface
from units.modules.utils import set_module_args
from .cnos_module import TestCnosModule, load_fixture
class TestCnosEthe... |
"""Send the results of a query to the configured music player as a playlist.
"""
from __future__ import division, absolute_import, print_function
from beets.plugins import BeetsPlugin
from beets.ui import Subcommand
from beets import config
from beets import ui
from beets import util
from os.path import relpath
from te... |
import ConfigParser
import os
from .kernel import core
DEBUG_MODE = os.environ.get('DRD_DEBUG','0') == '1'
PROJECT_NAME = os.environ.get('DRD_JOB','hf2')
USER_NAME = os.environ.get('USER','general')
SHOT_AUDIO_CONTAINER = os.environ.get('SHOT_AUDIO_CONTAINER','ShotAudio_v2')
... |
import copy
from fs.errors import ResourceNotFoundError
import logging
import os
import sys
from lxml import etree
from path import path
from pkg_resources import resource_string
from xblock.fields import Scope, String, Boolean, List
from xmodule.editing_module import EditingDescriptor
from xmodule.html_checker import ... |
from spack import *
class RNetwork(RPackage):
"""Tools to create and modify network objects. The network class can
represent a range of relational data types, and supports
arbitrary vertex/edge/graph attributes."""
homepage = "https://statnet.org"
url = "https://cran.r-project.org/src/con... |
#
"""
Function action
============================================================================
The :class:`Function` action wraps a callable, optionally with some
default keyword argument values. On execution, the execution data
(commonly containing the recognition extras) are combined with the
default argument v... |
import glob
import os
import subprocess
import sys
def RunCommand(commandLine):
#print ' '.join(commandLine)
return subprocess.call(commandLine)
for filename in glob.glob(os.path.join('Bin', '*.raw')):
os.remove(filename)
for arch in ('ia32', 'x64'):
for debugType in (None, 'port80', 'serial'):
... |
"""Support for Zigbee sensors."""
from binascii import hexlify
import logging
import voluptuous as vol
from homeassistant.components import zigbee
from homeassistant.const import TEMP_CELSIUS
from homeassistant.helpers.entity import Entity
from . import PLATFORM_SCHEMA
_LOGGER = logging.getLogger(__name__)
CONF_TYPE = ... |
import os
import sys
import re
DEFAULT_DOMAIN = 'vsphere.local'
DEFAULT_USER = 'administrator'
DEFAULT_PASSWORD = 'vmware'
DEFAULT_PORT = '389'
print 'running on %s' % (os.name)
if(os.name == 'nt'):
build = 'c:\\PROGRA~1\\vmware\\cis\\vmdird\\'
vdcpromo = build+'vdcpromo.exe'
vdcmerge = build+ 'vdcmerge.exe... |
from suds import *
from suds.client import Client
from sys import exit
from optparse import OptionParser
from aviary.util import *
wsdl = 'file:/var/lib/condor/aviary/services/job/aviary-job.wsdl'
cmds = ['holdJob', 'releaseJob', 'removeJob', 'suspendJob', 'continueJob']
parser = build_basic_parser('Control job state r... |
import six
from st2common.runners.base_action import Action
class PacksTransformationAction(Action):
def run(self, packs_status):
"""
:param packs_status: Result from packs.download action.
:type: packs_status: ``dict``
"""
packs = []
for pack_name, status in six.iter... |
"""This module is deprecated. Please use `airflow.providers.amazon.aws.operators.sagemaker_tuning`."""
import warnings
from airflow.providers.amazon.aws.operators.sagemaker_tuning import SageMakerTuningOperator # noqa
warnings.warn(
"This module is deprecated. Please use `airflow.providers.amazon.aws.operators.sag... |
from AlgorithmImports import *
class CustomConsolidatorRegressionAlgorithm(QCAlgorithm):
'''Custom Consolidator Regression Algorithm shows some examples of how to build custom
consolidators in Python.'''
def Initialize(self):
self.SetStartDate(2013,10,4)
self.SetEndDate(2013,10,11)
s... |
from collections import OrderedDict
from typing import Dict, Generic, Optional, TypeVar
TCacheKey = TypeVar("TCacheKey")
TCacheValue = TypeVar("TCacheValue")
class LRUCache(Generic[TCacheKey, TCacheValue]):
def __init__(self, num: int):
# TODO: fix type after dropping py36
self.cache: Dict[TCacheKey... |
import config
from install_package import InstallPackage
import os
import re
import shutil
import sys
import utils
BASENAME = "ExposureRender"
GIT_REPO = "http://code.google.com/p/exposure-render"
dependencies = ['CMake', 'Qt', 'VTK_QT_58']
class ExposureRender(InstallPackage):
def __init__(self):
self.sour... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.