content string |
|---|
import codecs
import json
import os
from datetime import datetime
class InputError(Exception):
"""Exception raised for errors in the input.
Attributes:
location -- where error occurred
msg -- explanation of the error
"""
def __init__(self, location, msg):
Exception.__init__(s... |
"""Tests for the NZBGet integration."""
from datetime import timedelta
from homeassistant.components.nzbget.const import DOMAIN
from homeassistant.const import (
CONF_HOST,
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,
CONF_SCAN_INTERVAL,
CONF_SSL,
CONF_USERNAME,
CONF_VERIFY_SSL,
)
from tests.a... |
# lamosity needed to make things reliable on Windows :-(
# (borrowed from Python's test_support.py)
import errno
import os
import shutil
import sys
import time
import warnings
if sys.platform.startswith("win"): # pragma: no cover
def _waitfor(func, pathname, waitall=False):
# Perform the operation
... |
#!/usr/bin/env python
##############################################
## Script to calculate the statistics (mean ##
## and variance) required to apply ##
## normalisation to a dataset using online ##
## augmentations. ##
##############################################
import numpy as... |
""" Transaction Handler Module: This is the point-of-entry for RQ Workers. """
from rq import (
Connection,
Queue,
Worker,
get_current_job
)
from database import (
get_repo_object,
db,
status,
get_trans_object
)
from utils import (
DockerUtils,
set_server_status
)
logger = st... |
""" GlusterFS native protocol (glusterfs) driver for shares.
Manila share is a GlusterFS volume. Unlike the generic driver, this
does not use service VM approach. Instances directly talk with the
GlusterFS backend storage pool. Instance use the 'glusterfs' protocol
to mount the GlusterFS share. Access to the share is ... |
#!/usr/bin/env python
import sys, os, string, subprocess
#aliasing the filenames using the labels
def run_command(command):
print "Running command: " + command
err_capture_file = open("my.stderr", 'w') # writing stderr to a file
cmd_run = subprocess.Popen(args=command, shell=True, stderr=err_captur... |
from foam.core.exception import CoreException
class MergeDPIDMismatch(object):
def __init__ (self, a, b):
super(MergeDPIDMismatch, self).__init__()
self.a = a
self.b = b
def __str__ (self):
return "Attempt to merge mismatched datapaths: %s, %s" % (self.a, self.b)
class Port(object):
def __init__... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import setup
import maestro
with open('README.md') as readme_file:
readme = readme_file.read()
requirements = [
'pyqt5',
'pyaudio',
'pyqtgraph',
'numpy',
'python_speech_features',
'tensorflow-gpu',
'cement'
]
test_requirements = [
]
setup(
nam... |
register_rulegroup("inventory",
_("Hardware/Software-Inventory"),
_("Configuration of the Check_MK Hardware and Software Inventory System"))
group = "inventory"
register_rule(group,
"active_checks:cmk_inv",
Transform(
Dictionary(
elements = [
( "sw_changes",
... |
import unittest
import numpy as np
from op_test import OpTest
def modified_huber_loss_forward(val):
if val < -1:
return -4. * val
elif val < 1:
return (1. - val) * (1. - val)
else:
return 0.
class TestModifiedHuberLossOp(OpTest):
def setUp(self):
self.op_type = 'modif... |
from spack import *
class FindCirc(Package):
"""Find-circ is a collection of python scripts
detecting head-to-tail spliced (back-spliced) sequencing reads,
indicative of circular RNA (circRNA) in RNA-seq data."""
homepage = "https://github.com/marvin-jens/find_circ"
url = "https://github.com... |
# -*- coding: utf-8 -*-
SEARCH_URL_ROOT = '/hub/search_beta'
ADMINS = ['qingfeng', 'xutao', 'xyb', 'huanghuang', 'liwentao', 'fanjianjin',
'testuser']
DATE_FORMAT = "%Y-%m-%dT%H:%M:%S"
SRC_SIZE_LIMIT = 500000
PERPAGE_LIMIT = 10
WATCHS = 1
FORKS = 2
UPDATED = 3
INDEXED = 4
BADGES = 5
PRAISES = 6
FOLLOWER... |
#! /usr/bin/env python2
import ringo_config
cfg = ringo_config.RingoConfig()
import pyximport; pyximport.install(build_dir=cfg.pyximport_build())
import argparse
import re
import datetime
import math
from tabulate import tabulate
import file_ops
from simulation import Simulation
import os
from ringo_config import Ringo... |
import errno
import os
import subprocess
import unittest
from airflow import jobs, models
from airflow.utils.state import State
from airflow.utils.timezone import datetime
DEV_NULL = '/dev/null'
TEST_DAG_FOLDER = os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'dags')
DEFAULT_DATE = datetime(2015, 1, 1... |
from __future__ import print_function
import os
import sys
from keras.callbacks import ModelCheckpoint, EarlyStopping, TensorBoard, ReduceLROnPlateau
from keras.applications.resnet50 import ResNet50
from keras.applications.imagenet_utils import preprocess_input
from keras.models import Model
from keras.layers import ... |
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from mo_collections.matrix import Matrix
from mo_math import AND
from jx_python import jx
from jx_elasticsearch.es09.util import aggregates, build_es_query, compileEdges2Term
from jx_python import es09
from j... |
import batch_generators
import numpy as np
import model
import optimizers
import preprocess
import word2vec
"""Simple paragraph 2 vector implementation."""
def read_file(self, fname):
with open(fname, 'r') as f:
data = f.read()
paras = data.split('\n\n')
docs = [para.split() for para in paras]
return docs
d... |
test_cases = r"""
Test creation of a survey
>>> from survey.models import *
>>> from django.contrib.auth.models import *
>>> import datetime
>>> user = User.objects.create_user('user_test', '<EMAIL>','password')
>>> user.save()
>>> survey = survey = Survey(title="survey 1", slug="survey-1",
... opens=datetime.datetim... |
import cgi
import cgitb
cgitb.enable()
from shared.functionality.editfile import main
from shared.cgiscriptstub import run_cgi_script
run_cgi_script(main) |
import collections
from recordclass import recordclass
from recordclass import structclass
from typing import _type_check
import sys as _sys
_PY36 = _sys.version_info[:2] >= (3, 6)
_excluded = ('__new__', '__init__', '__slots__', '__getnewargs__',
'__fields__', '_field_defaults', '_field_types',
... |
from __future__ import absolute_import
from __future__ import unicode_literals
from collections import OrderedDict
from flask_wtf import FlaskForm
from wtforms import (BooleanField, RadioField, TextAreaField, validators)
from puppetboard.core import get_app
app = get_app()
QUERY_ENDPOINTS = OrderedDict([
# Pupp... |
'''
a container of track
'''
import argparse
import sys
import os
import numpy as np
import pandas as pd
import scipy
from ..fileio import get_files, get_dirs, ts_indict
from ..utils import sort_dict, filename_data
from .track import Track
from ..eep.critical_point import CriticalPoint, Eep
max_mass = 1000.
min_ma... |
"""Tests for renewal updater interfaces"""
import unittest
import mock
from certbot import interfaces
from certbot import main
from certbot import updater
from certbot.plugins import enhancements
import certbot.tests.util as test_util
class RenewUpdaterTest(test_util.ConfigTestCase):
"""Tests for interfaces.Re... |
from django.shortcuts import get_object_or_404
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from rest_framework.authentication import TokenAuthentication
from rest_framework.views import APIView
from rest_framework import status
from django.http import HttpResponse... |
"""Test the Enphase Envoy config flow."""
from unittest.mock import MagicMock, patch
import httpx
from homeassistant import config_entries, setup
from homeassistant.components.enphase_envoy.const import DOMAIN
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
async def test_form... |
#!/usr/bin/env python2
import MySQLdb
import ConfigParser
import sys
import argparse
QUERY_TITLES_GET = "SELECT emp_no, title, from_date, to_date FROM titles"
QUERY_TITLES_INSERT = (
"INSERT INTO titles (emp_no, title, from_date, to_date) "
"VALUES (%s, %s, %s, %s)"
)
def load_config(fp):
config = Config... |
"""
Views and helper functions for handling DocumentCreator's various requests.
"""
import json
from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
from django.core.exceptions import ObjectDoesNotExist
from django.forms import HiddenInput
from django.forms.models im... |
from math import isclose
import numpy as np
from pytest import fixture
from hoomd.box import Box
@fixture
def box_dict():
return dict(Lx=1, Ly=2, Lz=3, xy=1, xz=2, yz=3)
def test_base_constructor(box_dict):
box = Box(**box_dict)
for key in box_dict:
assert getattr(box, key) == box_dict[key]
@... |
#blast: blastp
#database: nr
#usage: python Blast_with_Fasta.py fasta_file e_threshold > output_file
#output:SEQUENCE ID, SIZE, NUMBER OF HITS:
# alignment title(description), alignemnt length, e-value, score, identity, accession
import sys
from Bio.Blast import NCBIWWW
from Bio.Blast import NCBIXML
from Bio ... |
import time
from sketch.util.dateformat import DateFormat, TimeFormat, datetime_to_timestamp, utc_mktime
from sketch.util.timesince import timesince as ts, timeuntil as tu
__all__ = ['date_format', 'time_format', 'short_date', 'iso_date',
'rfc2822_date', 'datetimeformat', 'timesince', 'timeuntil', 'utc_ti... |
#!/usr/bin/env python
import os
import sys
import time
import logging
import numpy as np
import pandas as pd
from datetime import datetime
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import RandomizedSearchCV
from sklearn.preprocessing import MinMaxScaler
from moloi.config_processi... |
from nose.plugins.attrib import attr
from test.integration.base import DBTIntegrationTest
class TestPrePostRunHooks(DBTIntegrationTest):
def setUp(self):
DBTIntegrationTest.setUp(self)
self.run_sql_file("test/integration/014_hook_tests/seed_run.sql")
self.fields = [
'state',
... |
"""Tests for Cert Expiry setup."""
from datetime import timedelta
from homeassistant.components.cert_expiry.const import DOMAIN
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.config_entries import ENTRY_STATE_LOADED, ENTRY_STATE_NOT_LOADED
from homeassistant.const import CONF_HO... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------------------------------
model_piloto
model manager da pilotagem
revision 0.2 2015/nov mlabru
pep8 style conventions
revision 0.1 2014/nov mlabru
initial release (Linux/Python)
-----------... |
from binman.etype.blob_ext import Entry_blob_ext
class Entry_intel_me(Entry_blob_ext):
"""Entry containing an Intel Management Engine (ME) file
Properties / Entry arguments:
- filename: Filename of file to read into entry
This file contains code used by the SoC that is required to make it work.
... |
from datetime import datetime
from timeit import timeit as tt
t2 = tt('x=range(100)')
print(t2)
# 函数运行装饰器
def decorate_func_time(func):
from datetime import datetime as dt
def inner(*args, **kwargs):
start = dt.now()
ret = func(*args, **kwargs)
delta = dt.now() - start
print(f... |
"""Mixin classes that customize the filestore integration of AreaDetector
FilePlugins.
To be used like so:
from ophyd.areadetector.detectors import PerkinElmerDetector
from ophyd.areadetector.plugins import HDF5Plugin
from ophyd.areadetector.trigger_mixins import SingleTrigger
from ophyd.areadetector.... |
from django.conf.urls import url
from representatives.models import app_settings
from representatives.views import (
RepresentativeSetListView, RepresentativeSetDetailView, RepresentativeListView,
ElectionListView, ElectionDetailView, CandidateListView)
urlpatterns = [
url(r'^representatives/$', Represent... |
from threading import local
localdata = local()
localdata.exec_globals = {'__builtins__': __builtins__}
def register_exec_global(fun, name=''):
if name:
localdata.exec_globals[name] = fun
else:
try:
localdata.exec_globals[fun.__name__] = fun
except AttributeError: # meth... |
#!/usr/bin/env python
import os
import sys
from datetime import time
import unittest
file_path = os.path.join(os.path.dirname(__file__), '..')
sys.path.insert(0, os.path.abspath(file_path))
from pysrt import SubRipItem, SubRipTime, InvalidItem
from pysrt.compat import basestring
from pysrt.compat import str
class ... |
from Table import Table
import copy
from random import shuffle, randint
import numpy as np
'''
Class with static methods to return
stratified sample of a given data set
'''
class StratifiedSample(object):
'''
Returns the proper ratio of class values for each
partition
'''
@staticmeth... |
# -*- coding: utf-8 -*-
"""
werkzeug.contrib.atom
~~~~~~~~~~~~~~~~~~~~~
This module provides a class called :class:`AtomFeed` which can be
used to generate feeds in the Atom syndication format (see :rfc:`4287`).
Example::
def atom_feed(request):
feed = AtomFeed("My Blog", feed... |
#!/usr/bin/python -Es
import dbus
import dbus.service
import dbus.mainloop.glib
from gi.repository import GObject, GLib
import slip.dbus.service
from slip.dbus import polkit
import os
import Atomic
class atomic_dbus(slip.dbus.service.Object):
default_polkit_auth_required = "org.atomic.readwrite"
class Args(... |
import requests
import json
import threading, Queue
import time
try:
import websocket
WebSocketsAvailabe = True
except ImportError:
WebSocketsAvailabe = False
#from enum import Enum
#class RunningStates(Enum):
class RunningStates(object):
"""Valid running states of a player"""
On = 1
Off = 2
... |
#!/usr/bin/env python3
import sys
import os
import traceback
import subprocess
import types
IVERILOG_PATH = 'iverilog'
ROOT_DIR = '.' + os.path.sep
TEST_DIR = ROOT_DIR + 'tests'
TMP_DIR = ROOT_DIR + '.tmp'
sys.path.append(ROOT_DIR)
from polyphony.compiler.__main__ import compile_main, logging_setting
from polyphony... |
import os
import sys
import subprocess
import re
from tests_config import *
from sets import Set
#If imported values are not defined then set to zero (or disabled)
if not vars().has_key('ENABLE_WALLET'):
ENABLE_WALLET=0
if not vars().has_key('ENABLE_polcoind'):
ENABLE_polcoind=0
if not vars().has_key('ENABLE_U... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import time
import urllib.request
import shutil
WORK_DIR = os.environ['HOME'] + "/map_build/"
def info(msg):
print("II: " + msg)
def warn(msg):
print("WW: " + msg)
def error(msg):
print("EE: " + msg)
def cities15000():
# get the geoname... |
from django.contrib.auth.models import User
from tastypie import fields
from tastypie.resources import ModelResource
from tastypie.authorization import Authorization
from core.models import Note, MediaBit
from related_resource.models import Category, Tag, ExtraData, Taggable,\
TaggableTag, Person, Company, Produ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
'''Migration to add the functions necessary in order to generate ids at the database level'''
dependencies = [
('cbh_chembl_id_generator',
'0003_r... |
from optparse import (
Option, Values, OptionParser, IndentedHelpFormatter, OptionValueError)
# pylint: enable=deprecated-module
from copy import copy
import socket
from dns import resolver, rdatatype
from dns.exception import DNSException
import dns.name
# pylint: disable=import-error
from six.moves.configparser ... |
import os
from testrunner.local import testsuite
from testrunner.objects import testcase
class FuzzerVariantGenerator(testsuite.VariantGenerator):
# Only run the fuzzer with standard variant.
def FilterVariantsByTest(self, testcase):
return self.standard_variant
def GetFlagSets(self, testcase, variant):
... |
"""
There are two possible choices for a python FITS file reading package
compatible with Ginga: astropy/pyfits and fitsio. Both are based on
the CFITSIO library, although it seems that astropy's version has
changed quite a bit from the original, while fitsio is still tracking
the current version.
To force the use of... |
"""
.. automodule::
:members:
.. autoclass:: Observables
:members:
"""
from __future__ import print_function
import numpy as np
import scipy as sp
import pylayers.antprop.loss as plm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
class Observables(object):
""" Generate observab... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from pytest import raises
from aspen import Response
from aspen.exceptions import CRLFInjection
def test_response_is_a_wsgi_callable():
response = Response(body=b"... |
def donuts(count):
# +++your code here+++
if count >= 10:
return 'Number of donuts: many'
else:
return 'Number of donuts: ' + str(count)
return
# B. both_ends
# Given a string s, return a string made of the first 2
# and the last 2 chars of the original string,
# so 'spring' yields 'spng'. However, if... |
"""rhw URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/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')
Class-based v... |
from mxnet.gluon.model_zoo import vision
from mxnet.test_utils import assert_almost_equal
import mxnet as mx
import numpy as np
import os
batch_shape = (1, 3, 224, 224)
url = 'https://github.com/dmlc/web-data/blob/master/mxnet/doc/tutorials/python/predict_image/cat.jpg?raw=true'
model_file_name = 'resnet18_v2_trt_test... |
import os
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from lutris.game import Game
from lutris.startup import check_config
# from lutris import settings
from lutris import pga
from lutris.gui.config.common import GameDialogCommon
from lutris.gui.config.add_game import AddGameDialog
from l... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coupon', '0006_auto_20160505_2146'),
]
operations = [
migrations.AlterField(
model_name='coupon',
na... |
"""
This module deals with making images (np arrays). It provides drawing
methods that are difficult to do with the existing Python libraries.
"""
import numpy as np
def blit(im1, im2, pos=[0, 0], mask=None, ismask=False):
"""
Blits ``im1`` on ``im2`` as position ``pos=(x,y)``, using the
``mask`` if provi... |
import re
from urllib.parse import urljoin, urlsplit
from django.conf import settings
from django_webtest import WebTest
from mock import Mock, patch
from candidates.tests.factories import (
ElectionFactory,
ParliamentaryChamberFactory,
PartySetFactory,
PostFactory,
)
from .ee_postcode_results import... |
from tempest.lib.common.utils import data_utils
from tempest.lib import exceptions as lib_exc
from tempest import test
from neutron.tests.tempest.api import base
ADDRESS_SCOPE_NAME = 'smoke-address-scope'
class AddressScopeTestBase(base.BaseAdminNetworkTest):
@classmethod
@test.requires_ext(extension="add... |
import sys
import os
import xmlrpclib
import optparse
import config
from rhnapi import RHNClient
def cliOptions():
usage = "%prog <URL> [options]"
parser = optparse.OptionParser(usage=usage)
parser.add_option("-c", "--channel", action="store", default=None,
dest="channel",
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
longqi 11/Feb/16 10:27
A simple example of an animated plot
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig, ax = plt.subplots()
big_radius = 4
small_radius = big_radius / 2
ax.set_xlim(-big_radius, big_radius)
ax.se... |
from __future__ import unicode_literals
from builtins import object
from monolithe.lib import SDKUtils
from .specification_api import SpecificationAPI
from .specification_attribute import SpecificationAttribute
class Specification(object):
""" Defines a specification object
"""
def __init__(self, file... |
import os
from nose.plugins.attrib import attr
from tests.product.base_product_case import BaseProductTestCase, \
LOCAL_RESOURCES_DIR
class TestPackageInstall(BaseProductTestCase):
def setUp(self):
super(TestPackageInstall, self).setUp()
self.setup_docker_cluster()
self.install_prest... |
import unittest
import make_runtime_features_utilities as util
from blinkbuild.name_style_converter import NameStyleConverter
class MakeRuntimeFeaturesUtilitiesTest(unittest.TestCase):
def test_cycle_in_dependency(self):
# Cycle: 'c' => 'd' => 'e' => 'c'
graph = {
'a': ['b'],
... |
from __future__ import nested_scopes, generators
__version__ = '$Revision: 1.38 $'[11:-2]
import os, sys
from UserDict import UserDict
class InsensitiveDict:
"""Dictionary, that has case-insensitive keys.
Normally keys are retained in their original form when queried with
.keys() or .items(). If in... |
name = 'Little MUD Engine'
version = '0.1'
port = None # Should be set when initialise() is called.
import logging, errors, genders, options, util, objects, db, commands
from time import time, ctime
from socket import gethostbyaddr, gaierror
from threading import Thread
logger = logging.getLogger('Server')
started =... |
from django.conf.urls import url
from django.conf import settings
from django.views import static
from django.contrib import admin
from base_app import views as base_views
from hash import views as hash_views
from crypto import views as crypto_views
# Uncomment the next two lines to enable the admin:
admin.autodisco... |
from weboob.capabilities.cinema import ICapCinema, Person, Movie
from weboob.tools.backend import BaseBackend
from .browser import ImdbBrowser
from urllib import quote_plus
__all__ = ['ImdbBackend']
class ImdbBackend(BaseBackend, ICapCinema):
NAME = 'imdb'
MAINTAINER = u'Julien Veyssier'
EMAIL = '<EMAI... |
from django.shortcuts import render
from django.http import Http404, HttpResponse
# Create your views here.
from blog.models import Post
from tagging.models import Tag
from django.template.context import RequestContext
from blog.utils import get_protect_data
def get_tag_cloud():
try:
return Tag.objects.cl... |
"""Built-in activation functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object
from tensorflow.python.keras.ut... |
#!/usr/bin/env python
# Based on Morningstar documentation here
# http://www.morningstarcorp.com/wp-content/uploads/2014/02/TSMPPT.APP_.Modbus.EN_.10.2.pdf
# and heavily modified version of the script here
# http://www.fieldlines.com/index.php?topic=147639.0
import time
counter = 0
import sys
if len(sys.argv) <= 1:... |
#!/usr/bin/python
#
# Tool to set up Linux large page support with minimal effort
#
# by Jarod Wilson <<EMAIL>>
# (c) Red Hat, Inc., 2009
#
# Requires hugeadm from libhugetlbfs 2.7 (or backported support)
#
import os
debug = False
# must be executed under the root to operate
if os.geteuid() != 0:
print "You must... |
import commands
import sys
from ModulosDevice.ComunicacionDB import Comunication
from ModulosDevice.Cruds import Query
list_OID = {'address': '.1.3.6.1.2.1.4.20.1.1',
'serial': '1.3.6.1.4.1.9.5.1.2.19',
'name':'iso.3.6.1.2.1.1.5',
'model': '1.3.6.1.2.1.47.1.1.1.1.13',
'model_alternative': '1.3.6.1.4.1.9.5.1.2.16'}
li... |
# -*- coding: utf-8 -*-
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 'CanonicalFieldEntryLabel'
db.create_table(u'crowdataapp_c... |
class double_mutant:
def doublemuts(self,stabdata,pKa_values):
"""Find all double mutant cycles and analyze them as a function of pH"""
#
# Standardize the names
#
for key in stabdata.keys():
muts=key.split('+')
import string
muts=string.... |
"""
SoftLayer.tests.CLI.modules.dedicatedhosts_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import json
from unittest import mock as mock
import SoftLayer
from SoftLayer.CLI import exceptions
from SoftLayer.fixtures import SoftLayer_Product_Package
from SoftL... |
from __future__ import division
from builtins import zip
from builtins import range
from past.utils import old_div
import numpy as np
from boututils.file_import import file_import
from boututils.surface_average import surface_average
from boututils.showdata import showdata
from boutdata.collect import collect
from pyla... |
"""The aim of this library is to abstract pubsub."""
#check this for the console version (wx should dissappear)
try:
from other.pubsub import ALL_TOPICS, Publisher
except ImportError:
from wx.lib.pubsub import ALL_TOPICS, Publisher
#---Send
class SendListener:
def __init__(self, topic=ALL_TOPICS):
... |
from oslo_config import cfg
from oslo_config import types
vnc_group = cfg.OptGroup(
'vnc',
title='VNC options',
help="""
Virtual Network Computer (VNC) can be used to provide remote desktop
console access to instances for tenants and/or administrators.""")
ALL_OPTS = [
cfg.BoolOpt(
'enabled',
... |
"""
Contains the CLICommand class that can be subclassed to create new
Swiftly commands.
"""
"""
Copyright 2011-2013 Gregory Holt
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.apac... |
#!/usr/bin/env python
import re
import sys
from pushover import init, Client
REGEX_LINK = re.compile('(.*)\s+Link encap:(.*)\s+HWaddr\s+(.*)')
REGEX_LINK_ADDR = re.compile('\s+inet addr:((\d{1,3}\.?){4})')
REGEX_LINK_MASK = re.compile('\s+Mask:((\d{1,3}\.?){4})')
REGEX_LINK_PTP = re.compile('\s+P-t-P:((\d{1,3}\.?){4... |
import wsgiref.simple_server
import urllib.parse
dict=["REQUEST_METHOD","HTTP_COOKIE","QUERY_STRING","PATH_INFO"]
html="""
<html>
<body>
<form action="/sign" method="post">
<textarea name="username" rows="3" cols="60"></textarea>
<textarea name="password" rows="3" cols="60"></textarea>
<di... |
from operator import or_
from sqlalchemy import and_
from pywishlist.database import db_session
from pywishlist.models.wish import Wish
from pywishlist.utils import runQuery
class WishesService:
def __init__(self):
pass
@staticmethod
def get_wish_by_id(wish_id):
return runQuery(Wish.que... |
from unittest import TestCase
from lxml.etree import XML
from enkel.wansgli.testhelpers import unit_case_suite, run_suite
from enkel.batteri.staticcms.validate_post import \
validate_post, validate_post_field
from enkel.model.field.xmlf import XmlField
post = u"""
<post xmlns="http://enkel.wsgi.net/xml/staticcms">... |
from numpy import *
from sklearn import linear_model
#####################################################################
# Note: This file contains both ELM (classifier) and ELR (regressor)
#####################################################################
def phi(X, H, f, scale=0.2, mask=0.0):
'''
Gener... |
# coding=utf-8
from __future__ import absolute_import, division, print_function
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License"
import octoprint.plugin
import sys
import ins... |
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.config import config, configfile, getConfigListEntry
from Components.ConfigList import ConfigListScreen
from Components.SystemInfo import SystemInfo
from Components.Sources.StaticText import StaticText
from Components.Pixmap im... |
"""
GIS API's subpackage:
GRASS GIS Python tools for network analysis
"""
from grass.pygrass.modules import Module
"""
Create and Mantain network
"""
def network_from_arcs(networkFC, networkOUT):
"""
v.net is used for network preparation and maintenance. Its main use is
to create a vector... |
"""
This module is a collimator node class for TEAPOT lattice
"""
import os
import math
# import the auxiliary classes
from orbit.utils import orbitFinalize, NamedObject, ParamsDictObject
# import general accelerator elements and lattice
from orbit.lattice import AccNode, AccActionsContainer, AccNodeBunchTracker
# ... |
import logging
import time
from _thread import RLock
from functools import lru_cache, wraps
from os import environ
from select import select
import paramiko
from . import master_ip, master_leader_ip, marathon_leader_ip
from .helpers import validate_key, try_close, get_transport, start_transport
from ..errors import D... |
from diva import Diva, Dashboard, row_layout
from diva.widgets import *
import pandas as pd
import numpy as np
app = Diva()
@app.view('convert: Dashboard')
def dashboard_view():
a = pd.DataFrame(np.random.randn(10, 10))
b = pd.DataFrame(np.random.randn(10, 10))
c = pd.DataFrame(np.random.randn(10, 10))
... |
from __future__ import absolute_import, division, print_function
import math
import os
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import root_pandas
from uncertainties import ufloat
from histograms import histogram
from plotting_utilities import (
add_si_formatter,
COLOURS as colours... |
#!/usr/bin/python3
from bottle import route, request
from settings import config
from citoplasma.filterip import filterip
#from multiprocessing import Process, Pipe
from subprocess import Popen, PIPE
from uuid import uuid4
from shlex import quote
import hashlib
import os
import signal
import sys
import json
if not ha... |
from setuptools import setup
setup(
name = "PySPED",
version = "0.1.1",
author = "Aristides Caldeira",
author_email = '<EMAIL>',
test_suite='tests',
keywords = ['nfe', 'nfse', 'cte', 'sped', 'edf', 'ecd'],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Plugi... |
from couchpotato.core.helpers.request import getParams
from couchpotato.core.logger import CPLog
from functools import wraps
from threading import Thread
from tornado.gen import coroutine
from tornado.web import RequestHandler, asynchronous
import json
import threading
import tornado
import traceback
import urllib
log... |
import time
import datetime
import re
import urllib
import subprocess
import os
import pytz
import requests
from slugify import slugify
from django.core.handlers.wsgi import WSGIRequest
from django.conf import settings
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.exception... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.