content string |
|---|
"""Copyright 2009:
Isaac Carroll, Kevin Clement, Jon Handy, David Carroll, Daniel Carroll
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 ... |
from oslo_serialization import jsonutils as json
from six.moves.urllib import parse as urllib
from tempest.api_schema.response.compute.v2_1 import flavors as schema
from tempest.api_schema.response.compute.v2_1 import flavors_access \
as schema_access
from tempest.api_schema.response.compute.v2_1 import flavors_ex... |
import re
from wtforms.validators import Regexp, HostnameValidation, ValidationError, StopValidation
from flask_bombril.r import R
from flask_bombril.form_validators.utils import raise_with_stop
class EmailFormat(Regexp):
def __init__(self, stop=True):
self.message = R.string.validators.invalid_email_for... |
"""This script reads config.h.meson, looks for header
checks and writes the corresponding meson declaration.
Copy config.h.in to config.h.meson, replace #undef
with #mesondefine and run this. We can't do this automatically
because some configure scripts have #undef statements
that are unrelated to configure checks.
""... |
from functools import partial
from slm_lab import ROOT_DIR
from slm_lab.lib import logger, util
import os
import pydash as ps
import torch
import torch.nn as nn
NN_LOWCASE_LOOKUP = {nn_name.lower(): nn_name for nn_name in nn.__dict__}
logger = logger.get_logger(__name__)
class NoOpLRScheduler:
'''Symbolic LRSch... |
#!/usr/bin/env python
# This file should be compatible with both Python 2 and 3.
# If it is not, please file a bug report.
"""
High level operations on subusers.
"""
#external imports
import sys
#internal imports
import subuserlib.classes.user,subuserlib.resolve,subuserlib.classes.subuser,subuserlib.verify,subuserlib... |
import libvirt
from libvirt import libvirtError
from libvirttestapi.src import sharedmod
from libvirttestapi.utils import utils
from libvirttestapi.utils.utils import get_xml_value
required_params = ('guestname',)
optional_params = {}
def check_guest_status(domobj):
"""Check guest current status"""
state =... |
from ConditionalWidget import ConditionalWidget
from GUIComponent import GUIComponent
from enigma import ePixmap, eTimer
from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE
from os import path
from skin import loadPixmap
class Pixmap(GUIComponent):
GUI_WIDGET = ePixmap
def getSize(self):
s = self.in... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, absolute_import
import os
import json
def get_sources(src_dir='src', ending='.cpp'):
"""Function to get a list of files ending with `ending` in `src_dir`."""
return [os.path.join(src_dir, fnm) for fnm in os.listdir(src_dir) if fnm... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = '7sDream'
import os
import shutil
from zhihu import ZhihuClient, ActType
def test_question():
url = 'http://www.zhihu.com/question/24825703'
question = client.question(url)
# 获取该问题的详细描述
print(question.title)
# 亲密关系之间要说「谢谢」吗?
# 获取该... |
from HTMLComponent import HTMLComponent
from GUIComponent import GUIComponent
from config import KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_OK, KEY_TOGGLEOW, KEY_ASCII, KEY_TIMEOUT, KEY_NUMBERS, ConfigElement, ConfigText, ConfigPassword
from Components.ActionMap import NumberActionMap... |
{
'name': 'Keyboard shortcuts',
'version': '1.1',
'category': 'Tools',
'description': """
This module add some keyboard shortcuts similar to the ones in the GTK-client.
On a form, mode edit:
Ctrl + S : Save the current object
On a form, mode view:
Ctrl + Delete : Delete the... |
import sys
from django.core import management
from django.core.management.base import CommandError
from django.test import TestCase
from django.utils import translation
from django.utils.six import StringIO
class CommandTests(TestCase):
def test_command(self):
out = StringIO()
management.call_com... |
"""
USA-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select, CharField
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits... |
"""
Represents an EC2 Security Group
"""
from boto.ec2.ec2object import TaggedEC2Object
from boto.exception import BotoClientError
class SecurityGroup(TaggedEC2Object):
def __init__(self, connection=None, owner_id=None,
name=None, description=None, id=None):
super(SecurityGroup, self).__... |
"""
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... |
'''Event dispatch framework.
All objects that produce events in pyglet implement `EventDispatcher`,
providing a consistent interface for registering and manipulating event
handlers. A commonly used event dispatcher is `pyglet.window.Window`.
Event types
===========
For each event dispatcher there is a set of events... |
class InstanceInfo(object):
"""
Represents an EC2 Instance status response from CloudWatch
"""
def __init__(self, connection=None, id=None, state=None):
"""
:ivar str id: The instance's EC2 ID.
:ivar str state: Specifies the current status of the instance.
"""
se... |
import sys
import time
try:
import boto
import boto.ec2
from boto.vpc import VPCConnection
HAS_BOTO = True
except ImportError:
HAS_BOTO = False
if not HAS_BOTO:
module.fail_json(msg='boto required for this module')
def copy_image(module, ec2):
"""
Copies an AMI
module : Ansib... |
import libbe
import libbe.command
import libbe.command.util
import libbe.util.utility
DUE_TAG = 'DUE:'
class Due (libbe.command.Command):
"""Set bug due dates
>>> import sys
>>> import libbe.bugdir
>>> bd = libbe.bugdir.SimpleBugDir(memory=False)
>>> io = libbe.command.StringInputOutput()
>... |
"""Pathname and path-related operations for the Macintosh."""
import os
import warnings
from stat import *
import genericpath
from genericpath import *
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getatime","getc... |
"""
Implementation of "reverification" service to communicate with Reverification XBlock
"""
import logging
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db import IntegrityError
from opaque_keys.edx.keys import CourseKey
from student.models import Cou... |
# -*- coding: utf-8 -*-
import os
import wx
from . import configelements
from outwiker.core.system import getImagesDir
from outwiker.gui.guiconfig import MainWindowConfig
from outwiker.gui.controls.formatctrl import FormatCtrl
from outwiker.gui.preferences.baseprefpanel import BasePrefPanel
class MainWindowPanel(B... |
import sys
import os
import gettext
_ = gettext.gettext
sys.path.append("/usr/share/rhn/")
from up2date_client import rhnreg
from up2date_client import hardware
from up2date_client import rpmUtils
from up2date_client import up2dateErrors
from up2date_client import rhncli
class RegisterKsCli(rhncli.RhnCli):
de... |
'''Unit test that checks postprocessing of files.
Tests postprocessing by having the postprocessor
modify the grd data tree, changing the message name attributes.
'''
import os
import re
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
import unittest
im... |
from data_explorer.util import elasticsearch_util
def test_convert_to_index_name():
dataset_name = "Project Baseline"
assert "project_baseline" == elasticsearch_util.convert_to_index_name(
dataset_name)
def test_range_to_number():
def _inner(range_str, expected_number):
actual_number = e... |
"""@author Sebastien E. Bourban
"""
"""@note ... this work is based on a collaborative effort between
.________. ,--.
| | . ( (
|,-. / HR Wallingford EDF - LNHE / \_... |
import sys, os, string, re
from ..PluginBase import PluginFeatureBase, ProjectBase, ConfigBase, QueryBase
from ..PluginBase import PluginProcess
from ..CtagsCache import CtagsThread
class IdutilsFeature(PluginFeatureBase):
def __init__(self):
PluginFeatureBase.__init__(self)
self.feat_desc = [
['REF', '... |
import gzip
import optparse
import os
import m5
from m5.objects import *
from m5.util import addToPath
from m5.internal.stats import periodicStatDump
addToPath('../')
from common import MemConfig
addToPath('../../util')
import protolib
# this script is helpful to observe the memory latency for various
# levels in a... |
"""
Lithuanian-language mappings for language-dependent features of
reStructuredText.
"""
__docformat__ = 'reStructuredText'
directives = {
# language-dependent: fixed
u'dėmesio': 'attention',
u'atsargiai': 'caution',
u'pavojinga': 'danger',
u'klaida': 'error',
u'užu... |
'''
3D Rotating Monkey Head
========================
This example demonstrates using OpenGL to display a rotating monkey head. This
includes loading a Blender OBJ file, shaders written in OpenGL's Shading
Language (GLSL), and using scheduled callbacks.
The monkey.obj file is an OBJ file output from the Blender free 3... |
"""runpy.py - locating and running Python code using the module namespace
Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.
This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as wel... |
#!/usr/bin/env python
#
# Test double-spend-relay and notification code
#
from test_framework import BitcoinTestFramework
from decimal import Decimal
from util import *
class DoubleSpendRelay(BitcoinTestFramework):
#
# Create a 4-node network; roles for the nodes are:
# [0] : transaction creator
# [... |
""" Auth page """
import flask
from flask import redirect
from werkzeug.exceptions import NotFound
from inginious.frontend.pages.utils import INGIniousPage, INGIniousAuthPage
class AuthenticationPage(INGIniousPage):
def process_signin(self,auth_id):
auth_method = self.user_manager.get_auth_method(auth_id... |
# -*- coding: UTF-8 -*-
"""
Kodi urlresolver plugin
Copyright (C) 2016 alifrezser
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 ... |
import unittest
from TacxBlueMotionPowerCalculator import TacxBlueMotionPowerCalculator
class TacxBlueMotionPowerCalculatorTest(unittest.TestCase):
def setUp(self):
self.calculator = TacxBlueMotionPowerCalculator()
def test_calculation_min(self):
power = self.calculator.power_from_speed(0.0)... |
import threading
import agentFreUtil as util
def mk_add_listener(self):
def f(l):
x = self.next()
self.listeners[x] = l
def d():
del self.listeners[x]
return d
return f
def mk_prepare(self):
def f():
for l in self.listeners.itervalues():
l.p... |
#!/usr/bin/python2
# encoding: utf-8
"""
Temperature.py
Created by Alexander Rössler on 2014-03-24.
"""
from fdm.r2temp import R2Temp
import argparse
import time
import sys
import hal
# The CRAMPS board thermistor input has one side grounded and the other side
# pulled high through a 1.00K resistor to 1.8V. Follo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import struct
from ctypes import *
class IPHeader(Structure):
_fields_ = [
('ihl', c_ubyte, 4),
('version', c_ubyte, 4),
('tos', c_ubyte),
('len', c_ushort),
('id', ... |
from __future__ import absolute_import
import datetime
import logging
import os
import sys
import socket
from socket import error as SocketError, timeout as SocketTimeout
import warnings
from .packages import six
from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection
from .packages.six.moves.http... |
import os
import csv
from Application import *
class InputTechnicalAnalysis(object):
'''
InputTechnicalAnalysis loads the input file TechnicalIndicators.csv
'''
Inputs = []
def __init__(self):
self._rootPath = Application.getRootDirectory() # Get application root directory
... |
import unittest
from telemetry import benchmark
from telemetry.core import browser_options
from telemetry.core.platform import android_device
from telemetry.core.platform import android_platform_backend
from telemetry.core.backends.chrome import android_browser_finder
from telemetry.unittest import system_stub
class... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import inspect
import warnings
from functools import wraps
import six
from pants.base.revision import Revision
from pants.version import VERSION
_PANTS_SEMVER = Re... |
import pytest
import os
from units.utils.amazon_placebo_fixtures import placeboify, maybe_sleep
from ansible.modules.cloud.amazon import ec2_vpc_vpn
from ansible.module_utils._text import to_text
from ansible.module_utils.ec2 import get_aws_connection_info, boto3_conn, boto3_tag_list_to_ansible_dict
class FakeModule(... |
"""
Customized Mixin2to3 support:
- adds support for converting doctests
This module raises an ImportError on Python 2.
"""
from distutils.util import Mixin2to3 as _Mixin2to3
from distutils import log
from lib2to3.refactor import RefactoringTool, get_fixers_from_package
import setuptools
class DistutilsRefactorin... |
#!/usr/bin/env python3
import os
import redis
import json
from flask import Flask, render_template, redirect, request, url_for, make_response
if 'VCAP_SERVICES' in os.environ:
VCAP_SERVICES = json.loads(os.environ['VCAP_SERVICES'])
CREDENTIALS = VCAP_SERVICES["rediscloud"][0]["credentials"]
r = redis.Redis... |
from pecan import expose
__all__ = [
'BaseRootController'
]
class BaseRootController(object):
logger = None
controllers = None
default_controller = None
@expose()
def _lookup(self, *remainder):
version = ''
if len(remainder) > 0:
version = remainder[0]
... |
import base64
import cStringIO
import string
import struct
import dns.exception
import dns.rdata
import dns.rdatatype
b32_hex_to_normal = string.maketrans('0123456789ABCDEFGHIJKLMNOPQRSTUV',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567')
b32_normal_to_hex = string.maketrans('ABCDEFGHIJKLMNOP... |
"""Cinder OS API WSGI application."""
import sys
import warnings
from cinder import objects
warnings.simplefilter('once', DeprecationWarning)
from oslo_config import cfg
from oslo_log import log as logging
from oslo_service import wsgi
from cinder import i18n
i18n.enable_lazy()
# Need to register global_opts
fro... |
__author__ = "Brian Lenihan <<EMAIL>"
__copyright__ = "Copyright (c) 2012 Python for Android Project"
__license__ = "Apache License, Version 2.0"
import logging
import android
from pyxmpp2.jid import JID
from pyxmpp2.client import Client
from pyxmpp2.settings import XMPPSettings
from pyxmpp2.interfaces import XMPPFea... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['stableinterface'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.mysql import mysql_connect
from ansible.module_utils.pycompat24 import get_exception
from an... |
"""
Test variable expansion of '<!()' syntax commands where they are evaluated
more then once..
"""
import os
import TestGyp
test = TestGyp.TestGyp(format='gypd')
expect = test.read('commands-repeated.gyp.stdout')
# Set $HOME so that gyp doesn't read the user's actual
# ~/.gyp/include.gypi file, which may contain ... |
''' Pollen Cloud Compiler Client '''
import hashlib
import time
import os
import random
from pollen.scrlogger import ScrLogger
from pollen import utils
LOGGER = ScrLogger()
class LoginPreparer(object):
def __init__(self, args_):
self.args = args_
self.aid = str(os.getpid()) + '_' + str(random... |
# from .core.cmd_fxn.io import find, out_dir, forward
import contextlib
import importlib
import inspect
import json
import pprint
from functools import wraps
import funcsigs
import os
import re
from decorator import decorator
import sys
from cosmos import (
WorkflowStatus,
StageStatus,
TaskStatus,
NOO... |
"""
tests.test_component_http
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests Home Assistant HTTP component does what it should do.
"""
# pylint: disable=protected-access,too-many-public-methods
import unittest
import json
import requests
import homeassistant as ha
import homeassistant.bootstrap as bootstrap
import homeassistant.... |
'''Large file support
- break a file into smaller blocks, and encrypt them, and store the
encrypted blocks in another file.
- take such an encrypted files, decrypt its blocks, and reconstruct the
original file.
The encrypted file format is as follows, where || denotes byte concatenation:
FIL... |
import sqlalchemy
from glance.db.sqlalchemy.migrate_repo import schema
def get_images_table(meta):
return sqlalchemy.Table('images', meta, autoload=True)
def upgrade(migrate_engine):
meta = sqlalchemy.schema.MetaData(migrate_engine)
images_table = get_images_table(meta)
images_table.columns['locati... |
""" Newforms Admin configuration for Photologue
"""
from django.contrib import admin
from django.contrib.contenttypes import generic
from models import *
class GalleryAdmin(admin.ModelAdmin):
list_display = ('title', 'date_added', 'photo_count', 'is_public')
list_filter = ['date_added', 'is_public'... |
from oslo.config import cfg
from neutron.common import rpc as n_rpc
from neutron.openstack.common import log as logging
LOG = logging.getLogger(__name__)
FWaaSOpts = [
cfg.StrOpt(
'driver',
default='',
help=_("Name of the FWaaS Driver")),
cfg.BoolOpt(
'enabled',
defaul... |
from Module import AbstractModule
# Chrom Pos <Sample> [<Sample> ...]
#
# Each value in the matrix is:
# <ref>/<alt>/<vaf>
class Module(AbstractModule):
def __init__(self):
AbstractModule.__init__(self)
def run(
self, network, in_data, out_attributes, user_options,
num_cores, out... |
"""Suite Miscellaneous Standards: Useful events that aren\xd5t in any other suite
Level 0, version 0
Generated from /Developer/Applications/Apple Help Indexing Tool.app
AETE/AEUT resource version 1/1, language 0, script 0
"""
import aetools
import MacOS
_code = 'misc'
class Miscellaneous_Standards_Events:
def ... |
import json
import logging
import math
import os
from abc import abstractmethod, ABCMeta
from typing import List, Type, Callable, Sequence
from useintest.modules.irods.models import IrodsUser, IrodsDockerisedService, Version
from useintest.services.controllers import DockerisedServiceController
_DOCKER_REPOSITORY = "... |
"""The tests for the Netatmo sensor platform."""
from unittest.mock import patch
import pytest
from homeassistant.components.netatmo import sensor
from homeassistant.components.netatmo.sensor import MODULE_TYPE_WIND
from homeassistant.helpers import entity_registry as er
from .common import TEST_TIME, selected_platf... |
import array
import struct
from ImpactPacket import Header, Data
from IP6_Address import IP6_Address
class ICMP6(Header):
#IP Protocol number for ICMP6
IP_PROTOCOL_NUMBER = 58
protocol = IP_PROTOCOL_NUMBER #ImpactDecoder uses the constant "protocol" as the IP Protocol Number
#Size of ICMP6... |
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Production"),
"icon": "fa fa-star",
"items": [
{
"type": "doctype",
"name": "Work Order",
"description": _("Orders released for production."),
},
{
"type": "doctype",
"na... |
#!/usr/bin/env python
''' @package eWRT.access.http
provides access to resources using http '''
from __future__ import print_function
# (C)opyrights 2008-2012 by Albert Weichselbraun <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public L... |
from __future__ import print_function
import re
import sys
from command import Command
from error import GitError
CHANGE_RE = re.compile(r'^([1-9][0-9]*)(?:[/\.-]([1-9][0-9]*))?$')
class Download(Command):
common = True
helpSummary = "Download and checkout a change"
helpUsage = """
%prog {project change[/patch... |
#!/usr/bin/env python
__author__ = 'Laurens Bossen'
__copyright__ = ''
import unittest
import _gfrd as mod
import numpy
class FirstPassageGreensFunction1DTestCase( unittest.TestCase ):
def setUp( self ):
pass
def tearDown( self ):
pass
def test_Instantiation( self ):
D =... |
import os, re, shutil
def copygeocoding(source, prefix, dest):
entries = []
for root, dirs, files in os.walk(source):
for f in files:
if not re.search(r'^\d+\.txt$', f):
continue
country = f[:-4]
s = os.path.join(root, f)
lang = ... |
"""
=================================================
Pixel importances with a parallel forest of trees
=================================================
This example shows the use of forests of trees to evaluate the importance
of the pixels in an image classification task (faces). The hotter the pixel,
the more impor... |
import json
import os
import pipes
import stat
def _get_facter_dir():
if os.getuid() == 0:
return '/etc/facter/facts.d'
else:
return os.path.expanduser('~/.facter/facts.d')
def _write_structured_data(basedir, basename, data):
if not os.path.exists(basedir):
os.makedirs(basedir)
... |
from django import forms
from django.contrib.auth import (
authenticate,
get_user_model,
login,
logout,
)
User = get_user_model()
class UserLoginForm(forms.Form):
username = forms.CharField()
password = forms.CharField(widget=forms.PasswordInput)
def clean(self, *args, **kwargs):
... |
"""develop tests
"""
import sys
import os
import shutil
import unittest
import tempfile
from setuptools.sandbox import DirectorySandbox, SandboxViolation
def has_win32com():
"""
Run this to determine if the local machine has win32com, and if it
does, include additional tests.
"""
if not sys.platfo... |
import constants, re
class CharSetProber:
def __init__(self):
pass
def reset(self):
self._mState = constants.eDetecting
def get_charset_name(self):
return None
def feed(self, aBuf):
pass
def get_state(self):
return self._mState
def get_co... |
import os
import yaml
from mock import patch
from numpy.testing import assert_array_almost_equal
from matplotlib import animation
import boids.boids.boids as boids
from nose.tools import assert_raises
config_filename = 'boids/config.yaml'
config = yaml.load(open(config_filename))
def test_boids_fixtures():
regr... |
from compat import callable, cmp, reduce, defaultdict, py25_dict, \
threading, py3k_warning, jython, pypy, win32, set_types, buffer, pickle, \
update_wrapper, partial, md5_hex, decode_slice, dottedgetter,\
parse_qsl, any, contextmanager
from _collections import NamedTuple, ImmutableContainer, immutabledict... |
m5.util.addToPath('../configs/common')
from cpu2000 import eon_cook
workload = eon_cook(isa, opsys, 'mdred')
root.system.cpu.workload = workload.makeLiveProcess() |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (build by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... |
class SQLParseError(Exception):
pass
class UnclosedQuoteError(SQLParseError):
pass
# maps a type of identifier to the maximum number of dot levels that are
# allowed to specify that identifier. For example, a database column can be
# specified by up to 4 levels: database.schema.table.column
_PG_IDENTIFIER_T... |
"""Provides device automations for NEW_NAME."""
from typing import List
import voluptuous as vol
from homeassistant.components.automation import AutomationActionType, state
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
from homeassistant.const import (
CONF_DEVICE_ID,
CONF_DOMAIN,... |
################################################################
### Native code neural network with backpropagation training.
################################################################
from __future__ import with_statement
__all__ = "MLP".split()
from numpy import *
from pylab import *
from scipy import *
fro... |
"""develop tests
"""
import os
import shutil
import site
import sys
import tempfile
import unittest
from distutils.errors import DistutilsError
from setuptools.command.develop import develop
from setuptools.command import easy_install as easy_install_pkg
from setuptools.compat import StringIO
from setuptools.dist impo... |
from __future__ import absolute_import
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen... |
"""A package for parsing, handling, and generating email messages."""
__version__ = '5.1.0'
__all__ = [
'base64mime',
'charset',
'encoders',
'errors',
'feedparser',
'generator',
'header',
'iterators',
'message',
'message_from_file',
'message_from_binary_file',
'message_... |
from msrest.service_client import ServiceClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.vaults_operations import VaultsOperations
from . import models
class KeyVaultManagementClientConfiguration(AzureConfiguration):
"""Co... |
"""Simple DNS server comparison benchmarking tool.
Designed to assist system administrators in selection and prioritization.
"""
__author__ = '<EMAIL> (Thomas Stromberg)'
import datetime
import math
import sys
import base_ui
import conn_quality
import nameserver_list
class NameBenchCli(base_ui.BaseUI):
"""A com... |
"""
===================================
Compare cross decomposition methods
===================================
Simple usage of various cross decomposition algorithms:
- PLSCanonical
- PLSRegression, with multivariate response, a.k.a. PLS2
- PLSRegression, with univariate response, a.k.a. PLS1
- CCA
Given 2 multivari... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import xbmcplugin,xbmcgui,xbmc,xbmcaddon
import os,sys,urllib
def get_params():
param=[]
paramstring=sys.argv[2]
if len(paramstring)>=2:
params=sys.argv[2]
cleanedparams=params.replace('?','')
if (par... |
"Utility functions used by the btm_matcher module"
from . import pytree
from .pgen2 import grammar, token
from .pygram import pattern_symbols, python_symbols
syms = pattern_symbols
pysyms = python_symbols
tokens = grammar.opmap
token_labels = token
TYPE_ANY = -1
TYPE_ALTERNATIVES = -2
TYPE_GROUP = -3
class MinNode(... |
import functools
import logbook
import math
import numpy as np
import backtest.utils.math_utils as zp_math
import pandas as pd
from pandas.tseries.tools import normalize_date
from six import iteritems
from . risk import (
alpha,
check_entry,
choose_treasury,
downside_risk,
sharpe_ratio,
sort... |
import unittest
from brown.core import brown
from brown.core.font import Font
class TestFont(unittest.TestCase):
def setUp(self):
brown.setup()
def test_init(self):
test_font = Font('Bravura', 12, 2, False)
assert(test_font.family_name == 'Bravura')
assert(test_font.size == ... |
""" A simple setuptools file """
from setuptools import setup
setup(
name="PyPi_py3",
version='0.1 dev',
description='Ensure proper python3 adherence among pypi package maintainers',
long_description="""Inspired by Guido's talk at PyCon2015, many packages on the pypi repository are still
... |
"""SiteCompare command to invoke the same page in two versions of a browser.
Does the easiest compatibility test: equality comparison between two different
versions of the same browser. Invoked with a series of command line options
that specify which URLs to check, which browser to use, where to store results,
etc.
""... |
__author__ = 'Robert Meyer'
import os
import logging
import platform
from pypet.tests.testutils.ioutils import unittest
from pypet.trajectory import Trajectory
from pypet.environment import Environment
from pypet.parameter import Parameter
from pypet.tests.testutils.ioutils import run_suite, make_temp_dir, \
get... |
"""Interface for a roster of members."""
from __future__ import absolute_import, unicode_literals
__metaclass__ = type
__all__ = [
'IRoster',
]
from zope.interface import Interface, Attribute
class IRoster(Interface):
"""A roster is a collection of `IMembers`."""
name = Attribute(
"""Th... |
"""Support for Automation Device Specification (ADS)."""
import threading
import struct
import logging
import ctypes
from collections import namedtuple
import asyncio
import async_timeout
import voluptuous as vol
from homeassistant.const import (
CONF_DEVICE, CONF_IP_ADDRESS, CONF_PORT, EVENT_HOMEASSISTANT_STOP)
... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# ># IOOS System Test: [Extreme Events Theme:](https://github.com/ioos/system-test/wiki/Development-of-Test-Themes#theme-2-extreme-events) Coastal Inundation
# <markdowncell>
# ### Can we compare observed and modeled wave parameters?
# This notebo... |
import os
from datetime import datetime
from time import time
from tenable_io.api.models import Scan
from tenable_io.api.scans import ScanExportRequest
from tenable_io.client import TenableIOClient
from tenable_io.exceptions import TenableIOApiException
def example(test_name, test_file):
# Generate unique name... |
import numpy as np
import scipy as sp
from scipy import ndimage
from nose.tools import assert_equal, assert_true
from numpy.testing import assert_raises
from sklearn.feature_extraction.image import (
img_to_graph, grid_to_graph, extract_patches_2d,
reconstruct_from_patches_2d, PatchExtractor, extract_patches)... |
"""Handles rendering of the list of actions in the footer of the page create/edit views."""
from django.conf import settings
from django.forms import Media, MediaDefiningClass
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.functional import cached_property
from dj... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.