code stringlengths 1 199k |
|---|
import datetime
import errno
import logging
import os
import os.path
import platform
import random
import select
import signal
import socket
import subprocess
import sys
import threading
import time
import unittest2
import werkzeug.serving
from werkzeug.debug import DebuggedApplication
if os.name == 'posix':
# Unix... |
from . import test_purchase_delivery |
from binascii import b2a_hex
import bitcoin.script
from bitcoin.script import countSigOps
from bitcoin.txn import Txn
from bitcoin.varlen import varlenEncode, varlenDecode
from collections import deque
from copy import deepcopy
from queue import Queue
import jsonrpc
import logging
from math import log
from merkletree i... |
"""Certificates API
This is a Python API for generating certificates asynchronously.
Other Django apps should use the API functions defined in this module
rather than importing Django models directly.
"""
import logging
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db.models ... |
class BaseComponent:
"""This is a basic interface for defining components.
The only requirement is to implement the name method that
uniquely identifies a component. It should also define other
methods that implement the component functionality.
"""
@classmethod
def name(cls):
raise ... |
"""
News resource
=============
It is an alias for archive without filtering out published items.
"""
from superdesk.resource import build_custom_hateoas
from apps.archive.archive import ArchiveResource, ArchiveService
from apps.archive.common import CUSTOM_HATEOAS
class NewsResource(ArchiveResource):
datasource = ... |
try:
import unittest2 as unittest
except ImportError:
import unittest
from tlslite.utils.ecc import decodeX962Point, encodeX962Point, getCurveByName,\
getPointByteSize
import ecdsa
class TestEncoder(unittest.TestCase):
def test_encode_P_256_point(self):
point = ecdsa.NIST256p.generator * 200... |
import os
import sys
from spack import *
class Slepc(Package):
"""Scalable Library for Eigenvalue Problem Computations."""
homepage = "http://www.grycap.upv.es/slepc"
url = "http://slepc.upv.es/download/distrib/slepc-3.6.2.tar.gz"
git = "https://bitbucket.org/slepc/slepc.git"
version('deve... |
"""distutils.dist
Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
"""
import sys, os, re
try:
import warnings
except ImportError:
warnings = None
from distutils.errors import *
from distutils.fancy_getopt import FancyGetopt, translate_longopt
from dis... |
''' Auto-generated ui widget plugin '''
from projexui.qt.QtDesigner import QPyDesignerCustomWidgetPlugin
from projexui.qt.QtGui import QIcon
import projex.resources
from projexui.widgets.xscintillaedit import XScintillaEdit as Base
setattr(Base, '__designer_mode__', True)
DEFAULT_XML = '''<ui language="c++" displayname... |
"""
Tri-Polar Grid Projected Plotting
=================================
This example demonstrates cell plots of data on the semi-structured ORCA2 model
grid.
First, the data is projected into the PlateCarree coordinate reference system.
Second four pcolormesh plots are created from this projected dataset,
using differe... |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from resources.datatables import FactionStatus
from java.util import Vector
def addTemplate(core... |
import ast
import X # I201
import flake8_import_order # I201 |
"""Command for describing target HTTPS proxies."""
from googlecloudsdk.compute.lib import base_classes
class Describe(base_classes.GlobalDescriber):
"""Display detailed information about a target HTTPS proxy."""
@staticmethod
def Args(parser):
cli = Describe.GetCLIGenerator()
base_classes.GlobalDescriber.... |
import json
from queue import Queue, Empty
import threading
import time
import requests
from mycroft.api import DeviceApi, is_paired
from mycroft.configuration import Configuration
from mycroft.session import SessionManager
from mycroft.util.log import LOG
from mycroft.version import CORE_VERSION_STR
from copy import c... |
import jsonschema
import mock
from rally.deploy.engines import devstack
from tests.unit import test
SAMPLE_CONFIG = {
"type": "DevstackEngine",
"provider": {
"name": "ExistingServers",
"credentials": [{"user": "root", "host": "example.com"}],
},
"localrc": {
"ADMIN_PASSWORD": "se... |
"""
Support for IP Webcam settings.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.android_ip_webcam/
"""
from homeassistant.components.switch import SwitchDevice
from homeassistant.components.android_ip_webcam import (
KEY_MAP, ICON_MAP, DATA_... |
"""
Client side of the heat engine RPC API.
"""
from heat.common import messaging
from heat.rpc import api as rpc_api
class EngineClient(object):
'''Client side of the heat engine rpc API.
API version history::
1.0 - Initial version.
1.1 - Add support_status argument to list_resource_types()
... |
"""Mox, an object-mocking framework for Python.
Mox works in the record-replay-verify paradigm. When you first create
a mock object, it is in record mode. You then programmatically set
the expected behavior of the mock object (what methods are to be
called on it, with what parameters, what they should return, and in
... |
import sys
import os
import csv
import glob
class Package:
def __init__(self, name, path):
self.name = name
self.path = path.strip().replace('/',os.path.sep)
self.included = set()
self.excluded = set()
self.globals = set()
def add_namespace(self, ns):
if ns:
... |
from __future__ import absolute_import, division, print_function, \
with_statement
import os
import socket
import select
import errno
import logging
from collections import defaultdict
import shell
__all__ = ['EventLoop', 'POLL_NULL', 'POLL_IN', 'POLL_OUT', 'POLL_ERR',
'POLL_HUP', 'POLL_NVAL', 'EVENT_NAM... |
from thrift.Thrift import *
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
class Iface:
def ping(self, name):
"""
Parameters:
- name
... |
'''
InfSourceSectionParser
'''
import Logger.Log as Logger
from Logger import StringTable as ST
from Logger.ToolError import FORMAT_INVALID
from Parser.InfParserMisc import InfExpandMacro
from Library import DataType as DT
from Library.Parsing import MacroParser
from Library.Misc import GetSplitValueList
from Object.Pa... |
'''
Novell ASAM Runner
==================
.. versionadded:: Beryllium
Runner to interact with Novell ASAM Fan-Out Driver
:codeauthor: Nitin Madhok <nmadhok@clemson.edu>
To use this runner, set up the Novell Fan-Out Driver URL, username and password in the
master configuration at ``/etc/salt/master`` or ``/etc/salt/mast... |
from __future__ import print_function
import numpy as np
import paddle.fluid.core as core
from paddle.fluid.op import Operator
def create_op(scope, op_type, inputs, outputs, attrs):
kwargs = dict()
op_maker = core.op_proto_and_checker_maker
op_role_attr_name = op_maker.kOpRoleAttrName()
if op_role_attr_... |
import os
import flask
from oslo_config import cfg
from oslo_log import log
import oslo_middleware.cors as cors_middleware
from oslo_middleware import request_id
from oslo_service import systemd
import six
import stevedore
from werkzeug import exceptions as werkzeug_exceptions
from sahara.api import acl
from sahara.api... |
"""This script is used to synthesize generated parts of this library."""
import synthtool as s
import synthtool.gcp as gcp
import logging
logging.basicConfig(level=logging.DEBUG)
gapic = gcp.GAPICGenerator()
common = gcp.CommonTemplates()
library = gapic.py_library(
"grafeas", "v1", config_path="/grafeas/artman_gra... |
from __future__ import print_function
import copy
import errno
import gc
import os
import pprint
import socket
import sys
import traceback
import eventlet
import eventlet.backdoor
import greenlet
from oslo.config import cfg
from neutron_fwaas.openstack.common._i18n import _LI
from neutron_fwaas.openstack.common import ... |
"""Invokes Asset Inventory API to export resources, and IAM policies.
For more information on the Cloud Asset Inventory API see:
https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview
"""
from __future__ import print_function
import argparse
import logging
import pprint
from concurrent import fut... |
"""Provides a UPNP discovery method that mimicks Hue hubs."""
import threading
import socket
import logging
import select
from aiohttp import web
from homeassistant import core
from homeassistant.components.http import HomeAssistantView
_LOGGER = logging.getLogger(__name__)
class DescriptionXmlView(HomeAssistantView):
... |
import os.path
RNASEQ_PIPELINE_DIR = os.path.dirname(__file__) |
"""Utility functions to save/load keras Model to/from SavedModel."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import six
from tensorflow.python.client import session
from tensorflow.python.estimator import keras as estimator_keras_util
from t... |
"""Config flow for Google Maps Travel Time integration."""
from __future__ import annotations
import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_API_KEY, CONF_MODE, CONF_NAME
from homeassistant.core import callback
import homeassistant.helpers.config_va... |
class ConfigurationError(Exception):
"""Raised when the cache isn't configured correctly."""
class QueueEmpty(Exception):
"""Raised when a connection cannot be acquired.""" |
class BaseRepo(object):
def __init__(self, config):
self._find_alarm_action_sql = \
"""SELECT id, type, name, address, period
FROM alarm_action as aa
JOIN notification_method as nm ON aa.action_id = nm.id
WHERE aa.alarm_definition_id = %s and aa.alarm... |
import datetime
import functools
import math
import operator
import fixtures
import iso8601
import numpy
import six
from gnocchi import carbonara
from gnocchi.tests import base
def datetime64(*args):
return numpy.datetime64(datetime.datetime(*args))
class TestBoundTimeSerie(base.BaseTestCase):
def test_benchmar... |
"""Config flow to configure the OVO Energy integration."""
import aiohttp
from ovoenergy.ovoenergy import OVOEnergy
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigFlow
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from .const import DOMAIN... |
"""Tests for OwnTracks config flow."""
from unittest.mock import patch
from homeassistant.setup import async_setup_component
from tests.common import mock_coro
async def test_config_flow_import(hass):
"""Test that we automatically create a config flow."""
assert not hass.config_entries.async_entries('owntracks'... |
"""This script is used to synthesize generated parts of this library."""
import synthtool as s
from synthtool import gcp
gapic = gcp.GAPICGenerator()
common = gcp.CommonTemplates()
versions = ["v1beta1", "v1beta2", "v1p1beta1", "v1p2beta1", "v1"]
for version in versions:
library = gapic.py_library(
"videoin... |
from optparse import OptionParser
import getpass
import os
import sys
import yaml
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir,
... |
from typing import Any, Dict, List, Union
from unittest import mock
import orjson
from zerver.lib.actions import (
do_remove_realm_custom_profile_field,
do_update_user_custom_profile_data_if_changed,
try_add_realm_custom_profile_field,
try_reorder_realm_custom_profile_fields,
)
from zerver.lib.external_... |
"""Accesses the google.devtools.containeranalysis.v1 ContainerAnalysis API."""
import pkg_resources
import warnings
from google.oauth2 import service_account
import google.api_core.client_options
import google.api_core.gapic_v1.client_info
import google.api_core.gapic_v1.config
import google.api_core.gapic_v1.method
im... |
from __future__ import absolute_import, division, print_function
def load_pem_traditional_openssl_private_key(data, password, backend):
return backend.load_traditional_openssl_pem_private_key(
data, password
)
def load_pem_pkcs8_private_key(data, password, backend):
return backend.load_pkcs8_pem_pri... |
"""
Copyright 2014 The Trustees of Princeton University
Licensed 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.org/licenses/LICENSE-2.0
Unless required by applicable ... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... |
"""Fake RPC implementation which calls proxy methods directly with no
queues. Casts will block, but this is very useful for tests.
"""
import inspect
import json
import time
import eventlet
from ceilometer.openstack.common.rpc import common as rpc_common
CONSUMERS = {}
class RpcContext(rpc_common.CommonRpcContext):
... |
"""
pygments.lexers.web
~~~~~~~~~~~~~~~~~~~
Lexers for web-related languages and markup.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
try:
set
except NameError:
from sets import Set as set
from pygments.lexer import ... |
from oct2py import octave
from cvxopt import matrix, solvers
from cvxpy import *
import numpy as np
def svm_classifier(X, y,mode):
[num_sample,d]=X.shape
mode_control=np.ones((num_sample,1))
for i in range(num_sample):
if(mode==1):
if(y[i]==-1):
mode_control[i]=0;
if(mode==2):
if(y[i]==1):
... |
from warpnet_framework.warpnet_client import *
from warpnet_framework.warpnet_common_params import *
from warpnet_experiment_structs import *
from twisted.internet import reactor
from datetime import *
from numpy import log10, linspace
import time
import sys
mods = [[2,2,2100,78-1]]
pktLens = [1412]; #range(1412, 91, -... |
import asyncio
import warnings
import psycopg2
from .log import logger
class Cursor:
def __init__(self, conn, impl, timeout, echo):
self._conn = conn
self._impl = impl
self._timeout = timeout
self._echo = echo
@property
def echo(self):
"""Return echo mode status."""
... |
from behave.formatter.base import Formatter
class PlainFormatter(Formatter):
"""
Provides a simple plain formatter without coloring/formatting.
In addition, multi-line text and tables are not shown in output (SAD).
"""
name = 'plain'
description = 'Very basic formatter with maximum compatibility... |
import datetime
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.db.models import Sum
from django.contrib.contenttypes.models import ContentType
class TrendingManager(models.Manager):
def trending(self, model, days=30, kind=""):
views = self.filter(
... |
import simplejson as json
import threading
from sqlobject import SQLObject, connectionForURI
from sqlobject.sqlbuilder import Insert, Select, Delete
from octopus.dispatcher.model.node import FolderNode, TaskNode
from octopus.dispatcher.model.task import Task, TaskGroup
from octopus.dispatcher.model.command import Comma... |
__version__ = "who knows"
'''
I/O for VTK <https://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf>.
.. moduleauthor:: Nico Schlömer <nico.schloemer@gmail.com>
NOTE: Stolen from https://github.com/nschloe/meshio/blob/master/meshio/vtk_io.py
NOTE: which is distributed under the MIT license:
The MIT License (MIT)... |
from __future__ import absolute_import, unicode_literals
import operator
import sys
from collections import OrderedDict
from functools import reduce
from django import forms
from django.contrib.admin import FieldListFilter, widgets
from django.contrib.admin.exceptions import DisallowedModelAdminLookup
from django.contr... |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
import json
import os
from osbs.api import OSBS
from osbs.conf import Configuration
from atomic_reactor... |
"""
Test lldb data formatter subsystem.
"""
from __future__ import print_function
import os
import time
import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
import lldbsuite.test.lldbutil as lldbutil
class GlobalsDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__... |
"""
Features class used for Computer Vision algorithms.
"""
from .library import *
from .array import *
import numbers
class Features(object):
"""
A container class used for various feature detectors.
Parameters
----------
num: optional: int. default: 0.
Specifies the number of features.
... |
import subprocess
import sys
import os
import setup_util
def start(args, logfile, errfile):
setup_util.replace_text("rails-stripped/config/database.yml", "host: .*", "host: " + args.database_host)
try:
subprocess.check_call("cp Gemfile-jruby Gemfile", shell=True, cwd="rails-stripped", stderr=errfile, stdout=log... |
from __future__ import with_statement
from itertools import chain
from select import select
import os
import socket
import sys
import threading
from ssdb._compat import (b, xrange, imap, byte_to_chr, unicode, bytes, long,
BytesIO, nativestr, basestring,
LifoQueue, E... |
import pytest
import numpy as np
from numpy.testing import assert_allclose
from scipy import sparse
from sklearn.base import BaseEstimator
from sklearn.dummy import DummyClassifier
from sklearn.model_selection import LeaveOneOut, train_test_split
from sklearn.utils._testing import (assert_array_almost_equal,
... |
from __future__ import unicode_literals
def get_client_ip(request):
"""
Given an HTTP request, returns the related IP address.
"""
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR', None)
if x_forwarded_for:
ip = x_forwarded_for.split(',')[0]
else:
ip = request.META.get('... |
from __future__ import absolute_import
import uncertainties as U
from .. import asrootpy
__all__ = [
'as_ufloat',
'correlated_values',
]
def as_ufloat(roorealvar):
"""
Cast a `RooRealVar` to an `uncertainties.ufloat`
"""
if isinstance(roorealvar, (U.AffineScalarFunc, U.Variable)):
return... |
import sys, math, Queue
import pytos.tools.Drain as Drain
import pytos.Comm as Comm
from struct import *
class Straw( object ) :
def __init__( self , app ) :
self.app=app
self.linkLatency = .1
if "StrawM" not in app._moduleNames:
raise Exception("The StrawM module is not compiled... |
"""
Caching framework.
This package defines set of cache backends that all conform to a simple API.
In a nutshell, a cache is a set of values -- which can be any object that
may be pickled -- identified by string keys. For the complete API, see
the abstract BaseCache class in django.core.cache.backends.base.
Client co... |
"""
wakatime.compat
~~~~~~~~~~~~~~~
For working with Python2 and Python3.
:copyright: (c) 2014 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
import codecs
import os
import platform
import subprocess
import sys
is_py2 = (sys.version_info[0] == 2)
is_py3 = (sys.version_info[0] == 3)
i... |
import sys
import unittest
sys.path.insert(0, '.')
from pycparser import c_parser, c_generator, c_ast
_c_parser = c_parser.CParser(
lex_optimize=False,
yacc_debug=True,
yacc_optimize=False,
yacctab='yacctab')
def compare_asts(ast1, ast2):
if type(ast1)... |
"""Classification, regression and One-Class SVM using Stochastic Gradient
Descent (SGD).
"""
import numpy as np
import warnings
from abc import ABCMeta, abstractmethod
from joblib import Parallel
from ..base import clone, is_classifier
from ._base import LinearClassifierMixin, SparseCoefMixin
from ._base import make_da... |
"""Flashes firmware using Segger J-Link.
This script requires Segger hardware attached via JTAG/SWD.
See
https://chromium.googlesource.com/chromiumos/platform/ec/+/HEAD/docs/fingerprint/fingerprint-debugging.md#flash
for instructions.
"""
import argparse
import logging
import os
import shutil
import socket
import subpr... |
import unittest
import numpy as np
from chainer import testing
from chainercv.utils import generate_random_bbox
from chainercv.visualizations import vis_bbox
try:
import matplotlib # NOQA
_available = True
except ImportError:
_available = False
@testing.parameterize(
*testing.product_dict([
{
... |
'''
ooiui.core.app.science
Defines the application for the Science UI
'''
import os
from flask import Flask
from flask.ext.cache import Cache
from flask_environments import Environments
app = Flask(__name__, static_url_path='', template_folder='../../templates', static_folder='../../static')
env = Environments(app, def... |
from . import Event
class PlayerEvent(Event):
def setup(s):
s.username = s.username.encode('ascii')
class PlayerJoin(PlayerEvent):
username = Event.Arg(required=True)
ip = Event.Arg(required=True)
class PlayerQuit(PlayerEvent):
username = Event.Arg(required=True)
reason = Event.Arg(r... |
"""
Auto-discovers all unittests in the tests directory and runs them
"""
import unittest
loader = unittest.TestLoader()
tests = loader.discover('tests', pattern='*.py', top_level_dir='.')
testRunner = unittest.TextTestRunner()
testRunner.run(tests) |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CultivosVariedad'
db.create_table(u'indicador11_cultivosvariedad', (
(u'... |
import asyncore
import email.mime.text
from email.message import EmailMessage
from email.base64mime import body_encode as encode_base64
import email.utils
import socket
import smtpd
import smtplib
import io
import re
import sys
import time
import select
import errno
import textwrap
import unittest
from test import supp... |
from .dual_structured_quad import (
DualRectilinearGraph,
DualStructuredQuadGraph,
DualUniformRectilinearGraph,
)
from .structured_quad import (
RectilinearGraph,
StructuredQuadGraph,
UniformRectilinearGraph,
)
__all__ = [
"StructuredQuadGraph",
"RectilinearGraph",
"UniformRectilinea... |
import errno
import os
import re
import subprocess
import sys
def get_keywords():
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
... |
"""Module containing routines for estimating covariance models.
"""
import math
from pyvol.tseries.Transforms import SeqXform
import CovUtils
class CovEstimator:
"""Base class illustrating the API covariance estimators should follow
All covariance estimators should subclass this class and override at
least ... |
from invenio_workflows.definitions import WorkflowBase
class HarvestingWorkflowBase(WorkflowBase):
"""Base harvesting definition."""
@staticmethod
def get_title(bwo, **kwargs):
"""Return the value to put in the title column of HoldingPen."""
args = bwo.get_extra_data().get("args", {})
... |
from client import get_client
from client import (
BIGQUERY_SCOPE,
BIGQUERY_SCOPE_READ_ONLY,
JOB_CREATE_IF_NEEDED,
JOB_CREATE_NEVER,
JOB_SOURCE_FORMAT_NEWLINE_DELIMITED_JSON,
JOB_SOURCE_FORMAT_DATASTORE_BACKUP,
JOB_SOURCE_FORMAT_CSV,
JOB_WRITE_TRUNCATE,
JOB_WRITE_APPEND,
JOB_WRIT... |
"""This is file handles the command line interface
* We parse the options for both daemon and standalone usage
* When using using the standalone mode, we use the function "main"
defined here to begin the extraction of references
"""
__revision__ = "$Id$"
import traceback
import optparse
import sys
from in... |
from storage import *
from storageitu import *
set_logger(get_logfile_logger())
environment = Environment(False)
storage = Storage(environment)
storage.probe()
staging = storage.get_staging()
print(staging)
sdc1 = BlkDevice.find_by_name(staging, "/dev/sdc1")
blk_filesystem = sdc1.get_blk_filesystem()
blk_filesystem.set... |
def paint_icon_inventory(what, row, tags, customer_vars):
if (what == "host" or row.get("service_check_command","").startswith("check_mk_active-cmk_inv!")) \
and inventory.has_inventory(row["host_name"]):
return link_to_view(html.render_icon('inv', _("Show Hardware/Software-Inventory of this host")),
... |
"""
.. module:: monitor_correction_test
:platform: Unix
:synopsis: tests the monitor correction
.. moduleauthor:: Aaron Parsons <scientificsoftware@diamond.ac.uk>
"""
import unittest
from savu.test import test_utils as tu
from savu.test.travis.framework_tests.plugin_runner_test import \
run_protected_plugin_r... |
import taggit
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.utils.translation import ugettext as _
from geonode.base.models import ContactRole
from captcha.fields import ReCaptchaField
attrs_dict = {'class': 're... |
import frappe
from frappe import _
change_icons_map = [
{
"module_name": "Patient",
"color": "#6BE273",
"icon": "fa fa-user",
"doctype": "Patient",
"type": "link",
"link": "List/Patient",
"label": _("Patient")
},
{
"module_name": "Patient Encounter",
"color": "#2ecc71",
"icon": "fa fa-stethoscope... |
"""
plainbox.impl.exporter.test_text
================================
Test definitions for plainbox.impl.exporter.text module
"""
from io import BytesIO
from unittest import TestCase
from plainbox.impl.exporter.text import TextSessionStateExporter
class TextSessionStateExporterTests(TestCase):
def test_default_dump... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ctypes.util
import errno
import fcntl
import getpass
import locale
import logging
import os
import random
import subprocess
import sys
import textwrap
import time
from struct import unpack, pack
from termios import TIOCGWINSZ... |
from buildbot.util import netstrings
from twisted.protocols import basic
from twisted.trial import unittest
class NetstringParser(unittest.TestCase):
def test_valid_netstrings(self):
p = netstrings.NetstringParser()
p.feed("5:hello,5:world,")
self.assertEqual(p.strings, ['hello', 'world'])
... |
from __future__ import with_statement
import os.path
import datetime
import threading
import re
import glob
import stat
import traceback
import sickbeard
import xml.etree.cElementTree as etree
from name_parser.parser import NameParser, InvalidNameException, InvalidShowException
import subliminal
try:
from send2tras... |
from __future__ import absolute_import
import six
try:
from six.moves._thread import get_ident as _get_ident
except ImportError:
from six.moves._dummy_thread import get_ident as _get_ident
try:
from _abcoll import KeysView, ValuesView, ItemsView
except ImportError:
pass
class OrderedDict(dict):
'Dic... |
import operator
import os
import re
import subprocess
import time
import urllib
from xml.dom.minidom import parseString as parse_xml
from module.network.CookieJar import CookieJar
from module.network.HTTPRequest import HTTPRequest
from ..internal.Hoster import Hoster
from ..internal.misc import exists, isexecutable, js... |
from __future__ import unicode_literals
from django.db import models, migrations
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('talks', '0002_auto_20150808_2108'),
]
operations = [
migrations.AlterField(
model_name='speaker',
... |
from django.test.testcases import SimpleTestCase
from publicweb.extra_models import (NotificationSettings, OrganizationSettings,
NO_NOTIFICATIONS, FEEDBACK_MAJOR_CHANGES)
from django.contrib.auth.models import User, AnonymousUser
from organizations.models import Organization
from django.db.models.fields.related imp... |
import unittest
class TestCourseTopic(unittest.TestCase):
pass |
from __future__ import unicode_literals
from django.db import migrations, models
import django_mysql.models
class Migration(migrations.Migration):
dependencies = [
('base', '0008_auto_20160331_1405'),
]
operations = [
migrations.AddField(
model_name='snippet',
name='c... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('judge', '0038_profile_problem_count'),
]
operations = [
migrations.RemoveField(
model_name='contest',
name='is_external',
),
... |
"""Points and related utilities
"""
from ctypes import c_double
from ctypes import cast, POINTER
from shapely.coords import required
from shapely.geos import lgeos, DimensionError
from shapely.geometry.base import BaseGeometry
from shapely.geometry.proxy import CachingGeometryProxy
__all__ = ['Point', 'asPoint']
class ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0276_professional_integration'),
]
operations = [
migrations.AlterField(
model_name='learningunit',
name='end_year',
... |
from django.conf.urls import url
urlpatterns = [
url('test/(?P<arg>.+)/$', (lambda: 0), name="test"),
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.