content
stringlengths
4
20k
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import sys from distutils.core import setup, Extension if sys.version_info[:2] < (2, 6): raise Exception('pykit requires Python 2.6 or greater.') import pykit from pykit.utils.setup import find_packages, run_2to3, setup_args...
"""Helper for building, testing, and linting coverage.py. To get portability, all these operations are written in Python here instead of in shell scripts, batch files, or Makefiles. """ import fnmatch import glob import inspect import os import platform import socket import sys import zipfile # Functions named do_...
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface Foo { [CEReactions(DOMString a)] void foo(boolean arg2); }; """) results = parser.finish() except: threw = True harness.ok(threw, "Should have thrown for...
import retinabot import numpy as np class RetinaDebugBot(retinabot.RetinaBot): def initialize(self): super(RetinaDebugBot, self).initialize() self.x = None self.y = None self.t = None self.p = None self.last_off = None self.delta = None def process_retin...
import collections from telemetry.timeline import memory_dump_event from telemetry.value import list_of_scalar_values from telemetry.web_perf.metrics import timeline_based_metric DEFAULT_METRICS = memory_dump_event.MMAPS_METRICS.keys() def _AggregateDicts(dicts): """Turn a sequence of dictionaries into a diction...
""" Initialize a basic broadcast slave channel for listening to an ANT+ Bicycle cadence and speed senser, using raw messages and event handlers. """ import sys import time from ant.core import driver from ant.core import event from ant.core.constants import * from ant.core.message import * from config import * NET...
""" Application: HealthNet File: appointment/views.py Authors: - Nathan Stevens - Phillip Bedward - Daniel Herzig - George Herde - Samuel Launt Description: - This file contains all the view for the appointment functionality """ from .forms import * from ...
# pylint: skip-file # flake8: noqa class Edit(OpenShiftCLI): ''' Class to wrap the oc command line tools ''' # pylint: disable=too-many-arguments def __init__(self, kind, namespace, resource_name=None, kubeconfig='/etc/origin/master/ad...
from django.core.files.storage import FileSystemStorage from django.utils.encoding import filepath_to_uri from storages.backends.gcloud import GoogleCloudStorage from future.moves.urllib.parse import urljoin from website.settings import DOMAIN class DevFileSystemStorage(FileSystemStorage): def url(self, name): ...
'''Base classes and helpers for building zone specific tzinfo classes''' from datetime import datetime, timedelta, tzinfo from bisect import bisect_right try: set except NameError: from sets import Set as set import pytz from pytz.exceptions import AmbiguousTimeError, NonExistentTimeError __all__ = [] _time...
""" Xapian utilities. """ from invenio.config import CFG_XAPIAN_ENABLED from invenio.intbitset import intbitset from invenio.xapianutils_config import XAPIAN_DIR if CFG_XAPIAN_ENABLED: import xapian DATABASES = dict() def xapian_get_bitset(index, query): """ Queries a Xapian index. Returns: an i...
"""Hard link support for Windows. This module is a SCons tool which should be include in the topmost windows environment. It is usually included by the target_platform_windows tool. """ import os import stat import sys import SCons if sys.platform == 'win32': # Only attempt to load pywin32 on Windows systems t...
from typing import TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any ...
import re import glob import math import logging import os from autotest.client import utils from autotest.client.shared import error # Returns total memory in kb def read_from_meminfo(key): cmd_result = utils.run('grep %s /proc/meminfo' % key, verbose=False) meminfo = cmd_result.stdout return int(re.sear...
from collections import OrderedDict from datetime import datetime, timedelta import Cookie import json import types import uuid import socket from constants import response_codes from logger import get_logger missing = object() class Response(object): """Object representing the response to a HTTP request :p...
from __future__ import unicode_literals import collections import os import pkgutil import sys from importlib import import_module import django from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import ( BaseComma...
import logging from ajenti.api import * from ajenti.plugins.mdadm import GetPluginVersion, GetAuthor, GetEmail, GetCopyright from ajenti.plugins.main.api import SectionPlugin from ajenti.ui import on, p, UIElement from ajenti.ui.binder import Binder from api import getMdadmStatus, RAID_Device, NewRaidDevice @plugin c...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} from subprocess import Popen, PIPE from ansible.module_utils.basic import AnsibleModule, BOOLEANS_TRUE from ansible.module_utils.pycompat24 import get_exception class GConf2Pre...
from typing import TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any ...
import pyrax from st2actions.runners.pythonrunner import Action __all__ = [ 'PyraxBaseAction', 'BaseVMsAction' ] class PyraxBaseAction(Action): def __init__(self, config): super(PyraxBaseAction, self).__init__(config) self.pyrax = self._get_client() def _get_client(self): us...
import bisect import os import re import subprocess import sys llvm_symbolizer = None symbolizers = {} filetypes = {} vmaddrs = {} DEBUG = False # FIXME: merge the code that calls fix_filename(). def fix_filename(file_name): for path_to_cut in sys.argv[1:]: file_name = re.sub('.*' + path_to_cut, '', file_name)...
from os import path as op import os from vispy.util import (config, sys_info, _TempDir, set_data_dir, save_config, load_data_file) from vispy.testing import (assert_in, requires_application, run_tests_if_main, assert_raises, assert_equal, assert_true) temp_dir = _Temp...
from __future__ import unicode_literals import boto import sure # noqa from moto import mock_ec2 @mock_ec2 def test_virtual_private_gateways(): conn = boto.connect_vpc('the_key', 'the_secret') vpn_gateway = conn.create_vpn_gateway('ipsec.1', 'us-east-1a') vpn_gateway.should_not.be.none vpn_gateway....
import time from openerp.report import report_sxw from openerp.tools.safe_eval import safe_eval as eval class base_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context=None): super(base_report, self).__init__(cr, uid, name, context=context) self.localcontext.update({ ...
"""Example gRPC server that gets/sets metadata (HTTP2 headers)""" from __future__ import print_function from concurrent import futures import time import logging import grpc import helloworld_pb2 import helloworld_pb2_grpc _ONE_DAY_IN_SECONDS = 60 * 60 * 24 class Greeter(helloworld_pb2_grpc.GreeterServicer): ...
from __future__ import with_statement import sys, types, re, subprocess, math def flatten(l): flat = [] for i in l: flat.extend(i) return flat def split_nvp(s): t = {} for (name, value) in re.findall(r"(\w+)=([-\w]+)", s): try: t[name] = int(value) except ValueError: t[name] = value r...
"""CLI for running the Spotnet slave server.""" import asyncio import sys from argparse import ArgumentParser, RawTextHelpFormatter from .server import SpotnetSlaveServer def get_parsed_args(args=None): """Get the parsed args. Args: args (List[str]): The list of command line args to parse; if left...
from django.contrib.auth import get_user_model from django.test import TestCase from allauth.account.forms import SignupForm User = get_user_model() class UsersFormsTestCase(TestCase): def test_signup_form(self): form = SignupForm({ 'username': 'username', 'email': '<EMAIL>', ...
""" An incremental approach to unzipping files. This allows you to unzip a little bit of a file at a time, which means you can report progress as a file unzips. """ import warnings import zipfile import os.path import zlib import struct _fileHeaderSize = struct.calcsize(zipfile.structFileHeader) class ChunkingZipFi...
import abc from abc import abstractmethod from six import with_metaclass from zipline.gens.sim_engine import SESSION_END class CancelPolicy(with_metaclass(abc.ABCMeta)): """Abstract cancellation policy interface. """ @abstractmethod def should_cancel(self, event): """Should all open orders ...
from Synopsis.Processor import Parameter from Synopsis.Formatters.HTML.Tags import * from Synopsis.Formatters.HTML.Markup import * from docutils.nodes import * from docutils.core import * from docutils.parsers.rst import roles import re, StringIO def span(name, rawtext, text, lineno, inliner, options={}, content=[]): ...
"""Show the label for a domain or resoruce. """ import sys, os, re import xen.util.xsm.xsm as security from xen.util import xsconstants, auxbin from xen.xm.opts import OptionError from xen.xm import main as xm_main from xen.xm.main import server def help(): return """ Usage: xm getlabel dom <configfile> ...
# #!/usr/bin/python # -*- coding: utf-8 -*- """ Модуль блока для удаления транзакта из модели """ # pylint: disable=line-too-long from pyss import pyssobject from pyss.pyss_const import * from pyss.block import Block from pyss import options from pyss import logger class Terminate(Block): """Блок для удаления т...
from praw.models import (Comment, Submission, Subreddit) import mock import pytest from ... import IntegrationTest class TestMultireddit(IntegrationTest): @mock.patch('time.sleep', return_value=None) def test_add(self, _): self.reddit.read_only = False with self.recorder.use_cassette('TestMul...
import ansible.utils as utils import ansible.errors as errors def check_list_of_one_list(term): # make sure term is not a list of one (list of one..) item # return the final non list item if so if isinstance(term,list) and len(term) == 1: term = term[0] if isinstance(term,list): ...
ANSIBLE_METADATA = { 'status': [ 'preview' ], 'supported_by': 'community', 'version': '1.0' } from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.pycompat24 import get_exception try: import ldap import ldap.sasl HAS_LDAP = True except ImportError: HA...
# -*- coding: utf-8 -*- from __future__ import division, absolute_import # Copyright (C) 2007 Samuel Abels # # 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 Li...
import telemetry.timeline.event as timeline_event class Slice(timeline_event.TimelineEvent): """A Slice represents an interval of time plus parameters associated with that interval. NOTE: The Sample class implements the same interface as Slice. These must be kept in sync. All time units are stored in mill...
from django.contrib.auth.models import User from django.core import mail from django.test import TestCase from django.urls import reverse from patchwork.models import EmailConfirmation from patchwork.models import Person from patchwork.models import UserProfile from patchwork.tests.utils import create_bundle from patc...
from __future__ import unicode_literals from django.conf.urls import patterns, url from account.views import SignupView, LoginView, LogoutView, DeleteView from account.views import ConfirmEmailView from account.views import ChangePasswordView, PasswordResetView, PasswordResetTokenView from account.views import Settin...
""" In order to save gate resources, test paths that have similar environmental requirements to the functional path are marked for discovery. """ import os.path def load_tests(loader, tests, pattern): this_dir = os.path.dirname(__file__) parent_dir = os.path.dirname(this_dir) target_dirs = [ this...
"""Musepack audio streams with APEv2 tags. Musepack is an audio format originally based on the MPEG-1 Layer-2 algorithms. Stream versions 4 through 7 are supported. For more information, see http://www.musepack.net/. """ __all__ = ["Musepack", "Open", "delete"] import struct from ._compat import endswith, xrange f...
"""Adds xref targets to the top of files.""" import os import sys testing = False DONT_TOUCH = ( './index.txt', ) def target_name(fn): if fn.endswith('.txt'): fn = fn[:-4] return '_' + fn.lstrip('./').replace('/', '-') def process_file(fn, lines): lines.insert(0, '\n') lines.insert(0,...
"""locallibrary URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cla...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.module_utils.facts.collector import BaseFactCollector try: import selinux HAVE_SELINUX = True except ImportError: HAVE_SELINUX = False SELINUX_MODE_DICT = { 1: 'enforcing', 0: 'permissive', -1...
#For future compatibility with Python 3 from __future__ import division, print_function, unicode_literals, absolute_import import warnings warnings.simplefilter('default',DeprecationWarning) import sys import crowTestUtils as utils distribution1D = utils.findCrowModule('distribution1D') laplace_distribution = distri...
from django.test import SimpleTestCase from ..utils import setup class CommentSyntaxTests(SimpleTestCase): @setup({'comment-syntax01': '{# this is hidden #}hello'}) def test_comment_syntax01(self): output = self.engine.render_to_string('comment-syntax01') self.assertEqual(output, 'hello') ...
""" This module shows an example of using Decorators """ from functools import wraps print("\n\n\nSimple Decorator\n") # Simple decorator def func_decorator(decorated_func): print("Inside the decorator...") def wrap(*args, **kwargs): print("Before function call") decorated_func(*args, **kwargs) print("After f...
import errno import os import time import lit.Test # pylint: disable=import-error import lit.TestRunner # pylint: disable=import-error import lit.util # pylint: disable=import-error from libcxx.test.executor import LocalExecutor as LocalExecutor import libcxx.util class LibcxxTestFormat(object): ...
"""Miscellaneous functions to mask Python/Jython differences.""" import os import sha if os.name != "java": BaseException = Exception from sets import Set import array import math def createByteArraySequence(seq): return array.array('B', seq) def createByteArrayZeros(howMany): ...
from optparse import make_option from django.core.cache.backends.db import BaseDatabaseCache from django.core.management.base import LabelCommand, CommandError from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS from django.db.utils import DatabaseError from django.utils.encoding import fo...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat import unittest from units.compat.mock import patch, MagicMock from ansible.executor.play_iterator import PlayIterator from ansible.playbook import Playbook from ansible.playbook.play_context import PlayContext ...
from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Screens.HelpMenu import HelpableScreen from Components.ActionMap import HelpableActionMap, ActionMap from Components.Sources.List import List from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Prog...
""" This module performs simulated annealing to find a state of a system that minimizes its energy. An example program demonstrates simulated annealing with a traveling salesman problem to find the shortest route to visit the twenty largest cities in the United States. """ # How to optimize a system with simulated an...
import schedulers_all # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding index on 'Profile', fields ['created_on'] db.create_index('environments_profile', ['created_on']) ...
from __future__ import division, unicode_literals import logging import numpy as np import re from monty.json import MSONable from pymatgen.core.composition import Composition from pymatgen.entries.computed_entries import ComputedEntry from monty.json import MontyDecoder from monty.fractions import gcd_float import ...
from twisted.internet import task from twisted.internet import reactor from twisted.web import resource, static from coherence import __version__ from coherence.extern.et import ET, indent from coherence.upnp.services.servers.switch_power_server import SwitchPowerServer from coherence.upnp.services.servers.dimming_s...
"""Test version bits warning system. Generate chains with block versions that appear to be signalling unknown soft-forks, and test that warning alerts are generated. """ from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import re fro...
from oslo_db.sqlalchemy import session class DBConnection(object): """Context manager class which handles a DB connection. An existing connection can be passed as a parameter. When nested block is complete the new connection will be closed. This class is not thread safe. """ def __i...
#!/usr/bin/env python import sys usage = """ jsToPaths.py <filename> Takes a js file with a list of ctx commands from http://www.omnisoftsystems.com/?returnUrl=/iTrax/Home/svg2Canvas/0 Formats it into a list of paths for use in Cocoon. """ header = """ (function(){ var paths = [ function(ctx) {""" footer = "...
"""Python 2.x/3.x compatibility tools""" import sys __all__ = ['geterror', 'long_', 'xrange_', 'ord_', 'unichr_', 'unicode_', 'raw_input_', 'as_bytes', 'as_unicode'] def geterror (): return sys.exc_info()[1] try: long_ = long except NameError: long_ = int try: xrange_ = xrange except Nam...
import os import re import subprocess import pytest import tempfile from metakernel import MetaKernel from metakernel.tests.utils import (get_kernel, get_log_text, EvalKernel, clear_log_text) def test_magics(): kernel = get_kernel() for magic in ['cd', 'connect_info', 'down...
from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framework.mininode import CTransaction, NetworkThread from test_framework.blocktools import create_coinbase, create_block from test_framework.comptool import TestInstance, TestManager from test_framework.script...
import re def check_sexp(sexp): """Verify that the argument is a proper sexp. That is, raise an exception if the argument is not a string or a list, or if it contains anything that is not a string or a list at any nesting level. """ if isinstance(sexp, list): for s in sexp: ...
""" I'm a test drop-in. The plugin system's unit tests use me. No one else should. """ from zope.interface import classProvides from twisted.plugin import IPlugin from twisted.test.test_plugin import ITestPlugin, ITestPlugin2 class TestPlugin: """ A plugin used solely for testing purposes. ...
from threading import Thread, Lock import zmq from Queue import Queue from binascii import crc32 from CellCycle.MemoryModule.MemoryManagement import standardSlaveGetRequest, standardTransferRequest, standardMasterSetRequest, standardMasterGetRequest from CellCycle.AWS.AWSlib import * from socket import socket, AF_INET,...
# coding: utf-8 # VMware Carbon Black EDR Taxii Connector © 2013-2020 VMware, Inc. All Rights Reserved. ################################################################################ import logging import os from datetime import datetime, timedelta from typing import Any, Dict, List, Optional import simplejson as...
"""Test base for tf.keras Models in multi-worker mode.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import threading # pylint: disable=g-direct-tensorflow-import from tensorflow.contrib.distribute.python import collective_all_reduce_strategy as colle...
"""Helpers for data entry flows for config entries.""" from typing import Awaitable, Callable, Union from homeassistant import config_entries from .typing import HomeAssistantType # mypy: allow-untyped-defs, no-check-untyped-defs DiscoveryFunctionType = Callable[[], Union[Awaitable[bool], bool]] class DiscoveryFl...
import collections import json import os class Loader(object): def __init__(self, search_path=None): if not search_path: search_path = [ os.path.join(os.path.dirname(__file__), "data"), ] self.search_path = search_path def find(self, path): for...
"""Tests for the evo_optimizers.py module.""" import unittest import warnings import isambard import isambard.optimisation.evo_optimizers as ev_opts from isambard.optimisation.evo_optimizers import Parameter warnings.filterwarnings("ignore") @unittest.skipUnless('scwrl' in isambard.settings.global_settings, ...
import base64 import contextlib import cStringIO from openerp import tools from openerp.osv import fields,osv from openerp.tools.translate import _ from openerp.tools.misc import get_iso_codes NEW_LANG_KEY = '__new__' class base_language_export(osv.osv_memory): _name = "base.language.export" def _get_langua...
import atexit import base64 import httplib import urllib import mmap import errno import socket def vmware_path(datastore, datacenter, path): ''' Constructs a URL path that VSphere accepts reliably ''' path = "/folder/%s" % path.lstrip("/") # Due to a software bug in vSphere, it fails to handle ampersand i...
from classes import * import numpy as np import random class Crisis: """ Crisis event - defines the crisis event and calculates the affect on world """ def __init__(self, center_x, center_y, strength, wave1, wave2, wave3): self.center_x = center_x self.center_y = center_y self.strength...
# coding: utf-8 """ GLUT Inputhook support functions """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this ...
# transformations applied to the harmonics of a sound import numpy as np from scipy.signal import resample from scipy.interpolate import interp1d def harmonicFreqScaling(hfreq, hmag, freqScaling, freqStretching, timbrePreservation, fs): """ Frequency scaling of the harmonics of a sound hfreq, hmag: frequencies and...
#!/usr/bin/env python # encoding: utf-8 import sys import re import os import zipfile try: import zlib compression = zipfile.ZIP_DEFLATED except: compression = zipfile.ZIP_STORED PACK_FILE_EXTENSIONS = ('.xml', '.bmp') def buildPack(packName): if not os.path.isdir(packName): print ("Invalid pack name: ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.core import checks from django.core.exceptions import FieldDoesNotExist from django.db import models class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the curre...
from django.contrib import admin from django.db.models import Prefetch from django.utils.html import format_html from django.utils.translation import ugettext_lazy as _ from django.urls import reverse from olympia.addons.models import Addon from olympia.translations.utils import truncate_text from olympia.zadmin.admin...
from __future__ import (unicode_literals, print_function, division) import os import platform import sys from xml.dom import minidom def main(): inputs = sys.argv[1:] for fn in inputs: with open(fn, 'r') as f: absFn = os.path.abspath(fn) fnDir = os.path.dirname(absFn) s = f.read() dom = minidom.parseS...
"""Upgrade recipe for new column tag.recjson_value.""" import os from invenio.dbquery import run_sql from invenio.config import CFG_PREFIX depends_on = ['invenio_release_1_1_0'] def info(): """Upgrade recipe information.""" return "Set up autocompletion for DEMOTHE authors" def do_upgrade(): """Upgra...
"""Specific JSLint errors checker.""" import gflags as flags FLAGS = flags.FLAGS class Rule(object): """Different rules to check.""" # Documentations for specific rules goes in flag definition. BLANK_LINES_AT_TOP_LEVEL = 'blank_lines_at_top_level' INDENTATION = 'indentation' WELL_FORMED_AUTHOR = 'well_...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation) on 2019-05-07. # 2019, SMART Health IT. from . import domainresource class ImmunizationEvaluation(domainresource.DomainResource): """ Immunization evaluation i...
#!/usr/bin/env python """ Module graph Implements a directed acyclic graph (DAG) which will throw an error when a circular dependancy is created. A topological sort is used to determine what nodes can be run first. """ import logging logger = logging.getLogger(__name__) class Node: def __init__(self, name): ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.urls import ConnectionError from ansible.module_utils.basic import...
"""Tests for tf.GrpcServer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.client import session from tensorflow.python.framework import errors_impl from tensorflow.python.ops import math_ops from tensorflow.python.ops import vari...
# -*- coding: utf-8 -*- """Definition of the Criacao content type """ from zope.interface import implements, directlyProvides import datetime from DateTime import DateTime from Products.Archetypes import atapi from Products.ATContentTypes.content import base from Products.ATContentTypes.content import schemata from P...
# -*- coding: utf-8 -*- """ Covenant Add-on 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. This prog...
"""Tests for tensorflow.python.client.Timeline.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import json from tensorflow.core.protobuf import config_pb2 from tensorflow.python.client import session from tensorflow.python.client import timeline from t...
from ycmd.utils import ToUtf8IfNeeded from ycm.client.base_request import ( BaseRequest, JsonFromFuture, HandleServerException ) TIMEOUT_SECONDS = 0.5 class CompletionRequest( BaseRequest ): def __init__( self, request_data ): super( CompletionRequest, self ).__init__() ...
import os from setuptools import setup, find_packages version = '0.2' install_requires = ['aiohttp >= 0.15.1'] tests_require = install_requires + ['nose'] def read(f): return open(os.path.join(os.path.dirname(__file__), f)).read().strip() setup(name='sockjs', version=version, description=('SockJS ...
"""Searches for albums in the MusicBrainz database. """ from __future__ import division, absolute_import, print_function import musicbrainzngs import re import traceback from urlparse import urljoin from beets import logging import beets.autotag.hooks import beets from beets import util from beets import config VARI...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} from ansible.module_utils.nxos import get_config, load_config, run_commands from ansible.module_utils.nxos import nxos_argument_spec, check_args from ansible.module_utils.basic impo...
from .listeners import Listeners, ListenerProxy from .loggerhelper import AbstractLoggerProxy class LibraryListeners(Listeners): def __init__(self): self._running_test = False self._setup_or_teardown_type = None self._global_listeners = {} def __nonzero__(self): return True ...
""" Speakerdeck Tag --------------- This implements a Liquid-style speakerdeck tag for Pelican. Syntax ------ {% speakerdeck id %} Example ------- {% speakerdeck 82b209c0f181013106da6eb14261a8ef %} Output ------ <script async class="speakerdeck-embed" data-id="82b209c0f181013106da6eb14261a8ef" data-r...
import copy import inspect from importlib import import_module from django.db import router from django.db.models.query import QuerySet from django.utils import six from django.utils.encoding import python_2_unicode_compatible def ensure_default_manager(cls): """ Ensures that a Model subclass contains a defa...
########################### 1. 導入所需模組 import cherrypy import os ########################### 2. 設定近端與遠端目錄 # 確定程式檔案所在目錄, 在 Windows 有最後的反斜線 _curdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) # 設定在雲端與近端的資料儲存目錄 if 'OPENSHIFT_REPO_DIR' in os.environ.keys(): # 表示程式在雲端執行 download_root_dir = os.environ['OPE...
class TnsnamesStack: def __init__(self): self._stack = [] def contains_entry(self, entry): """ Returns True, if stack contains entry, False otherwise :param entry: the entry to be checked :return: True, if stack contains entry, False otherwise :rtype: bool ...
import logging from functools import partial import math import json from pymongo import ASCENDING, DESCENDING from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.http import HttpResponseBadRequest, HttpResponseNotFo...