content string |
|---|
#!/usr/bin/env python
# File created on 06 Jun 2011
from __future__ import division
__author__ = "William Van Treuren"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["William Van Treuren", "Greg Caparaso", "Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "William Va... |
"""Unit test utilities for Google C++ Testing Framework."""
__author__ = '<EMAIL> (Zhanyong Wan)'
import atexit
import os
import shutil
import sys
import tempfile
import unittest
_test_module = unittest
# Suppresses the 'Import not at the top of the file' lint complaint.
# pylint: disable-msg=C6204
try:
import sub... |
class NipapError(Exception):
""" NIPAP base error class.
"""
error_code = 1000
class NipapInputError(NipapError):
""" Erroneous input.
A general input error.
"""
error_code = 1100
class NipapMissingInputError(NipapInputError):
""" Missing input.
Most input is passed i... |
from __future__ import unicode_literals
import unittest
from django.utils import regex_helper
class NormalizeTests(unittest.TestCase):
def test_empty(self):
pattern = r""
expected = [('', [])]
result = regex_helper.normalize(pattern)
self.assertEqual(result, expected)
def te... |
import sys
import os
from pyhatch.hatch_supt import Hatch
SIMPLEDESC='''PyProTem acts as a temporary project for test purposes.'''
LONGDESC="""Use pyProTem to test tox usage locally, travis CI on checkin to
GitHub, tk_nosy to watch files locally and alert breakage, operation under
both python 2 and 3 on Windows an... |
import logging
import zlib
import io
from ._collections import HTTPHeaderDict
from .exceptions import DecodeError
from .packages.six import string_types as basestring, binary_type
from .util import is_fp_closed
log = logging.getLogger(__name__)
class DeflateDecoder(object):
def __init__(self):
self._f... |
from m5.SimObject import SimObject
class AlphaInterrupts(SimObject):
type = 'AlphaInterrupts'
cxx_class = 'AlphaISA::Interrupts'
cxx_header = "arch/alpha/interrupts.hh" |
# -*- coding: utf-8 -*-
# (mostly translation, see implementation details)
# Licence: BSD 3 clause
"""
The built-in regression models submodule for the gaussian_process module.
"""
import numpy as np
def constant(x):
"""
Zero order polynomial (constant, p = 1) regression model.
x --> f(x) = 1... |
from unittest import TestCase
from django.utils.baseconv import (
BaseConverter, base2, base16, base36, base56, base62, base64,
)
from django.utils.six.moves import range
class TestBaseConv(TestCase):
def test_baseconv(self):
nums = [-10 ** 10, 10 ** 10] + list(range(-100, 100))
for converte... |
"""
========================================================
Topics extraction with Non-Negative Matrix Factorization
========================================================
This is a proof of concept application of Non Negative Matrix
Factorization of the term frequency matrix of a corpus of documents so
as to extra... |
"""Individual test case execution."""
__all__ = [
'MultipleExceptions',
'RunTest',
]
import sys
from testtools.testresult import ExtendedToOriginalDecorator
class MultipleExceptions(Exception):
"""Represents many exceptions raised from some operation.
:ivar args: The sys.exc_info() tuples for ... |
#!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <<EMAIL>>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting XML data, a... |
import re
from collections import namedtuple
from fake_switches import group_sequences
from fake_switches.dell.command_processor.enabled import DellEnabledCommandProcessor, to_vlan_ranges, _is_vlan_id, \
_assemble_elements_on_lines
from fake_switches.switch_configuration import VlanPort, AggregatedPort
class Del... |
import re
import gdb
class pp_s (object):
def __init__(self, val):
self.val = val
def to_string(self):
m = self.val["m"]
return "m=<" + str(self.val["m"]) + ">"
class pp_ss (object):
def __init__(self, val):
self.val = val
def to_string(self):
return "super st... |
from __future__ import unicode_literals
import boto3
import json
import sure # noqa
from moto import mock_resourcegroups
@mock_resourcegroups
def test_create_group():
resource_groups = boto3.client("resource-groups", region_name="us-east-1")
response = resource_groups.create_group(
Name="test_reso... |
"""Tools not exempt from being descended into in tracebacks"""
import time
__all__ = ['make_decorator', 'raises', 'set_trace', 'timed', 'with_setup',
'TimeExpired', 'istest', 'nottest']
class TimeExpired(AssertionError):
pass
def make_decorator(func):
"""
Wraps a test decorator so as to pr... |
"""
Copyright (c) 2014, CloudSigma AG
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the fo... |
# This uses the EpuckBasic code as the interface to webots, and the epuck2 code to connect an ANN
# to webots.
import epuck2
import epuck_basic as epb
import graph
import prims1
# The webann is a descendent of the webot "controller" class, and it has the ANN as an attribute.
class WebAnn(epb.EpuckBasic):
def __... |
import os
try:
from twisted.trial import unittest
except ImportError, le:
print "Skipping %s since it requires Twisted and Twisted could not be imported: %s" % (__name__, le,)
else:
from pyutil import PickleSaver, fileutil
class Thingie(PickleSaver.PickleSaver):
def __init__(self, fname, delay... |
#!/opt/anaconda1anaconda2anaconda3/bin/python
#
# Wrapper script for invoking the jar.
#
# This script is written for use with the Conda package manager and is ported
# from a bash script that does the same thing, adapting the style in
# the peptide-shaker wrapper
# (https://github.com/bioconda/bioconda-recipes/blob/ma... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import os
import traceback
try:
from OpenSSL import crypto
except ImportError:
pyo... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v2 as tf
from tensorflow.compiler.mlir.tensorflow.tests.tf_saved_model import common
class TestModule(tf.Module):
# Check that we get shapes annotated on function arguments.
#
... |
# This is an ultra-minimal "dapp framework" that simplifies the deployment
# process by generating a config.js file that specifies the ABI for all of
# the contracts that you need and also includes the ability to update
# addresses. By default, it simply scans through every .se and .sol file in
# the current directory ... |
import os
from django.conf import settings
from django.core.cache import get_cache
from django.core.cache.backends.db import BaseDatabaseCache
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.creation import DatabaseCreation
class SpatiaLiteCreation(DatabaseCreation):
def cr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
wzbench
~~~~~~~
A werkzeug internal benchmark module. It's used in combination with
hg bisect to find out how the Werkzeug performance of some internal
core parts changes over time.
:copyright: 2009 by the Werkzeug Team, see AUTHORS for more d... |
# pylint: disable=invalid-name, attribute-defined-outside-init
"""
Tests for basic common operations related to Course Action State managers
"""
from ddt import ddt, data
from django.test import TestCase
from collections import namedtuple
from opaque_keys.edx.locations import CourseLocator
from course_action_state.mode... |
"""Tests for SavedModel utils."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.core.framework import types_pb2
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework imp... |
"""
Tests for the certificates models.
"""
from datetime import datetime, timedelta
from ddt import data, ddt, unpack
from pytz import UTC
from django.conf import settings
from milestones.tests.utils import MilestonesTestCaseMixin
from mock import patch
from nose.plugins.attrib import attr
from badges.tests.factories ... |
import product_pricelist
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
# -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import parse_dict_header, ... |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc"))
import json
import shutil
import subprocess
import tempfile
import traceback
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
def check_array_result(object_array,... |
#!/usr/bin/env python
"""
Backport pull requests to a particular branch.
Usage: backport_pr.py branch [PR]
e.g.:
python tools/backport_pr.py 0.13.1 123
to backport PR #123 onto branch 0.13.1
or
python tools/backport_pr.py 1.x
to see what PRs are marked for backport that have yet to be applied.
Copied fr... |
from __future__ import absolute_import, division, unicode_literals
import re
from . import _base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(_base.Filter):
spacePreserveElements = frozenset... |
import mraa
# This example will change the LCD backlight on the Grove-LCD RGB backlight
# to a nice shade of purple
x = mraa.I2c(0)
x.address(0x62)
# initialise device
x.writeReg(0, 0)
x.writeReg(1, 0)
# sent RGB color data
x.writeReg(0x08, 0xAA)
x.writeReg(0x04, 255)
x.writeReg(0x02, 255) |
from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsOptionError
import distutils
import os
import configparser
from setuptools import Command
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
def config_file(kind="local"):
"""Get the filename o... |
# This is a sample hardware file for UDP control. Use this file for my 2010 transceiver
# described in QEX and for the improved version HiQSDR. To turn on the extended
# features in HiQSDR, update your FPGA firmware to version 1.1 or later and use use_rx_udp = 2.
from __future__ import print_function
import struct,... |
"""Generators for classes of graphs used in studying social networks."""
import itertools
import math
import random
import networkx as nx
# Copyright(C) 2011 by
# Ben Edwards <<EMAIL>>
# Aric Hagberg <<EMAIL>>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['Ben Edwards (<EMAIL>)',
... |
"""Setup some common test helper things."""
import functools
import logging
import pytest
import requests_mock as _requests_mock
from homeassistant import util
from homeassistant.util import location
from .common import async_test_home_assistant
from .test_util.aiohttp import mock_aiohttp_client
logging.basicConfig... |
"""
Example:
.. UIExample:: 200
from flexx import ui
class Example(ui.Widget):
def init(self):
with ui.FormLayout():
ui.Label(text='Pet name:')
self.b1 = ui.LineEdit()
ui.Label(text='Pet Age:')
self.b2 = ui.LineEdit()... |
"""Class representing an X.509 certificate chain."""
from utils import cryptomath
class X509CertChain:
"""This class represents a chain of X.509 certificates.
@type x509List: list
@ivar x509List: A list of L{tlslite.X509.X509} instances,
starting with the end-entity certificate and with ever... |
"""
The Netio switch component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.netio/
"""
import logging
from collections import namedtuple
from datetime import timedelta
import voluptuous as vol
from homeassistant.core import callback
from home... |
import unittest
import sys
from alphatwirl.roottree import EventBuilderConfig
##__________________________________________________________________||
hasROOT = False
try:
import ROOT
hasROOT = True
except ImportError:
pass
if hasROOT:
from alphatwirl.roottree.EventBuilder import EventBuilder
##______... |
from collections import Counter
def ones(d):
return 1*d.count(1)
def twos(d):
return 2*d.count(2)
def threes(d):
return 3*d.count(3)
def fours(d):
return 4*d.count(4)
def fives(d):
return 5*d.count(5)
def sixes(d):
return 6*d.count(6)
def threeOfAKind(d):
if max(Counter(d).itervalues())>=3:
return sum(d... |
"""Sample remote_api appengine_config for copying datastore across apps.
For more information, see
http://code.google.com/appengine/docs/adminconsole/
Note that this appengine_config.py file is the same one that you would
use for appstats; if you are bundling this with your existing app you may
wish to copy the versi... |
"""
Implementation of JSONEncoder
"""
import re
try:
from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
pass
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')
HAS_UTF8 = re.compile(r'[\x80-\xff]')
ESCAPE_DCT = ... |
#!/usr/bin/env python
#
# Testing ndarray with 3 axes
#
import numpy as np
from NdArrayIndexer import NdArrayIndexer
# Structure of unsorted list to be converted in the same shape as testing_array
testing_list = [
[[[7, 2, 76], [132, 32, 1], [201, 23, 224], [201, 23, 224]],
[[101, 102, 103], [111, 112, 113]... |
#!/usr/bin/env python
"""Generators - Directed Graphs
----------------------------
"""
from nose.tools import *
from networkx import *
from networkx.generators.directed import *
class TestGeneratorsDirected():
def test_smoke_test_random_graphs(self):
G=gn_graph(100)
G=gnr_graph(100,0.5)
G... |
import math
import uuid
from copy import copy
from logbook import Logger
from collections import defaultdict
from six import text_type, iteritems
from six.moves import filter
import zipline.errors
import zipline.protocol as zp
from zipline.finance.slippage import (
VolumeShareSlippage,
transact_partial,
... |
# Utilities for the demos
import sys, win32api, win32con, win32ui
NotScriptMsg = """\
This demo program is not designed to be run as a Script, but is
probably used by some other test program. Please try another demo.
"""
NeedGUIMsg = """\
This demo program can only be run from inside of Pythonwin
You must start Py... |
from gnocchi.ceilometer.resources import base
class CephAccount(base.ResourceBase):
@staticmethod
def get_resource_extra_attributes(sample):
return {}
@staticmethod
def get_metrics_names():
return ['radosgw.api.request',
'radosgw.objects.size',
'radosgw... |
import functools
import warnings
from importlib import import_module
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.html import conditional_escape
from django.utils.inspect import getargspec
from django.utils.itercompat import is_iterable
from .base import... |
"""string helper module"""
import re
class __loader__(object):
pass
def formatter_field_name_split(fieldname):
"""split the argument as a field name"""
_list=[]
for _name in fieldname:
_parts = _name.split('.')
for _item in _parts:
is_attr=False #fix me
if re.... |
import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import PaypalProvider
class PaypalOAuth2Adapter(OAuth2Adapter... |
try:
from cs import CloudStack, CloudStackException, read_config
has_lib_cs = True
except ImportError:
has_lib_cs = False
class AnsibleCloudStack:
def __init__(self, module):
if not has_lib_cs:
module.fail_json(msg="python library cs required: pip install cs")
self.result... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from collections import OrderedDict
from cms.models import Page, CMSPlugin
from .base import SubcommandsCommand
def get_descendant_ids(root_id):
"""
Returns the a generator of primary keys which represent
d... |
import supybot.conf as conf
import supybot.registry as registry
def configure(advanced):
# This will be called by supybot to configure this module. advanced is
# a bool that specifies whether the user identified himself as an advanced
# user or not. You should effect your configuration by manipulating th... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2016-2017 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the... |
def register_all():
# NOTE(danms): You must make sure your object gets imported in this
# function in order for it to be registered by services that may
# need to receive it via RPC.
__import__('nova.objects.agent')
__import__('nova.objects.aggregate')
__import__('nova.objects.bandwidth_usage')
... |
"""Python part of the warnings subsystem."""
# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
import linecache
import sys
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings", "catch_warnings"]
def... |
"""Extensions to the 'distutils' for large or complex distributions"""
import os
import functools
import distutils.core
import distutils.filelist
from distutils.util import convert_path
from fnmatch import fnmatchcase
from six.moves import filter, map
import setuptools.version
from setuptools.extension import Extens... |
"""
==================
GMM classification
==================
Demonstration of Gaussian mixture models for classification.
See :ref:`gmm` for more information on the estimator.
Plots predicted labels on both training and held out test data using a
variety of GMM classifiers on the iris dataset.
Compares GMMs with sp... |
"""Common interfaces and implementation."""
import abc
import collections
import six
def _fuss(tuplified_metadata):
return tuplified_metadata + ((
'grpc.metadata_added_by_runtime',
'gRPC is allowed to add metadata in transmission and does so.',
),)
FUSSED_EMPTY_METADATA = _fuss(())
def f... |
from django import db
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.contrib.contenttypes.views import shortcut
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpRequest
from django.test... |
"""Affinity Propagation clustering algorithm."""
# Gael Varoquaux <EMAIL>
# License: BSD 3 clause
import numpy as np
from ..base import BaseEstimator, ClusterMixin
from ..utils import as_float_array, check_array
from ..utils.validation import check_is_fitted
from ..metrics import euclidean_distances
from ..m... |
import glob
from optparse import OptionParser
import subprocess
import os
import os.path
import re
import shutil
import sys
version = 'build-all.py, version 0.01'
build_dir = '../all-kernels'
make_command = ["vmlinux", "modules", "dtbs"]
make_env = os.environ
make_env.update({
'ARCH': 'arm',
'KCONFIG_... |
try:
from pyVmomi import vim, vmodl
HAS_PYVMOMI = True
except ImportError:
HAS_PYVMOMI = False
def create_vsan_cluster(host_system, new_cluster_uuid):
host_config_manager = host_system.configManager
vsan_system = host_config_manager.vsanSystem
vsan_config = vim.vsan.host.ConfigInfo()
vsan... |
#// screen manager imported from http://kivy.org/docs/api-kivy.uix.screenmanager.html
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from random import random
from kivy.uix.widget import Widget
from kivy.graphics import Color... |
#!/usr/bin/env python
#
# cd_hit * (clusterassembled reads with database)
# cd_hit_est used as this is the nt clustering tool
# http://weizhongli-lab.org/lab-wiki/doku.php?id=cd-hit-user-guide
# follow this link to get the download.
# https://github.com/weizhongli/cdhit
# cd_hit-0.9.10-bin-64.tar.gz
#
# (c) The James H... |
import shutil
import os
from unittest import skipIf
import boto
from effect import Effect, sync_perform, ComposedDispatcher
from twisted.python.filepath import FilePath
from twisted.trial.unittest import SynchronousTestCase
from ..aws import boto_dispatcher, UploadToS3
from flocker.provision._effect import dispatcher... |
from __future__ import print_function, unicode_literals, division, absolute_import
from os import path, sys
sys.path.append( path.dirname(path.abspath(__file__)) + '/thirdparty/future/src' )
from builtins import ( bytes, dict, int, list, object, range, str, ascii, chr,
hex, input, next, oct, open, pow, round, super,... |
import unittest
import transaction
from pyramid import testing
from .core.models import DBSession
# class TestMyViewSuccessCondition(unittest.TestCase):
# def setUp(self):
# self.config = testing.setUp()
# from sqlalchemy import create_engine
# engine = create_engine('sqlite://')
# from .models import (
# ... |
from openerp.osv import osv
class account_move_line_select(osv.osv_memory):
"""
Account move line select
"""
_name = "account.move.line.select"
_description = "Account move line select"
def open_window(self, cr, uid, ids, context=None):
mod_obj = self.pool.get('ir.model.data')
... |
import asposewordscloud
from asposewordscloud.WordsApi import WordsApi
from asposewordscloud.WordsApi import ApiException
from asposewordscloud.models import RunResponse
import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
from asposestoragecloud.StorageApi import ResponseMessage
apiKey = "... |
"""Set up script for mod_pywebsocket.
"""
from distutils.core import setup, Extension
import sys
_PACKAGE_NAME = 'mod_pywebsocket'
# Build and use a C++ extension for faster masking. SWIG is required.
_USE_FAST_MASKING = False
if sys.version < '2.3':
print >> sys.stderr, '%s requires Python 2.3 or later.' % _... |
"""Implementation of sample attack."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
from scipy.misc import imread
from scipy.misc import imsave
from nets import inception_v3, inception_v4, inception_resnet_v2, resnet_v2
fro... |
from Screens.Screen import Screen
from Components.ActionMap import NumberActionMap
from Components.Label import Label
from Components.ChoiceList import ChoiceEntryComponent, ChoiceList
from Components.Sources.StaticText import StaticText
import enigma
class ChoiceBox(Screen):
def __init__(self, session, title = "", l... |
"""
EasyBuild support for building and installing BLACS, implemented as an easyblock
@author: Stijn De Weirdt (Ghent University)
@author: Dries Verdegem (Ghent University)
@author: Kenneth Hoste (Ghent University)
@author: Pieter De Baets (Ghent University)
@author: Jens Timmerman (Ghent University)
"""
import glob
i... |
# -*- coding: utf-8 -*-
"""
.. _tut-eeg-fsaverage-source-modeling:
EEG forward operator with a template MRI
========================================
This tutorial explains how to compute the forward operator from EEG data
using the standard template MRI subject ``fsaverage``.
.. caution:: Source reconstruction witho... |
#pythran export dist(float [], float[], float[], int, bool, bool, bool)
#runas import numpy as np ; N = 20 ; x = np.arange(0., N, 0.1) ; L = 4 ; periodic = True ; dist(x, x, x, L,periodic, periodic, periodic)
#bench import numpy as np ; N = 300 ; x = np.arange(0., N, 0.1) ; L = 4 ; periodic = True ; dist(x, x, x, L,per... |
try:
import simplejson as json
except:
import json
from st2actions.runners import AsyncActionRunner
from st2common.constants.action import (LIVEACTION_STATUS_RUNNING)
RAISE_PROPERTY = 'raise'
def get_runner():
return AsyncTestRunner()
class AsyncTestRunner(AsyncActionRunner):
def __init__(self):
... |
from typing import List, Optional, Tuple
from django.db import connections
from psqlextra.models import PostgresPartitionedModel
from .config import PostgresPartitioningConfig
from .constants import AUTO_PARTITIONED_COMMENT
from .error import PostgresPartitioningError
from .partition import PostgresPartition
from .p... |
"""
Useful (non-periodic) GP Kernel Functions
"""
import numpy as np
import scipy.spatial
from scipy.special import gamma,kv
###################################################################################################
#Exponential class
def SqExponentialRad(X,Y,theta,white_noise=False):
"""
Standard square... |
'''
Progress class for modules. Represents where a student is in a module.
Useful things to know:
- Use Progress.to_js_status_str() to convert a progress into a simple
status string to pass to js.
- Use Progress.to_js_detail_str() to convert a progress into a more detailed
string to pass to js.
In particular... |
from pupylib.PupyModule import *
import StringIO
import pupylib.utils
import SocketServer
import threading
import socket
import logging
import struct
import traceback
import time
__class_name__="Socks5Proxy"
CODE_SUCCEEDED='\x00'
CODE_GENERAL_SRV_FAILURE='\x01'
CODE_CONN_NOT_ALLOWED='\x02'
CODE_NET_NOT_REACHABLE='\x0... |
"""
This is a python interface to Adobe Font Metrics Files. Although a
number of other python implementations exist (and may be more complete
than mine) I decided not to go with them because either they were
either
1) copyrighted or used a non-BSD compatible license
2) had too many dependencies and I wanted a fr... |
import random
from math import sin, pi
from spiralgalaxygame.body import Body, BodyKind
from spiralgalaxygame.geometry import Vector, Circle
from spiralgalaxygame.discdist import DiscreteDistribution
def generate_galaxy_bodies(randgen = random.random,
parentmu = 1000,
... |
import pysal
import os.path
import scipy.io as sio
import pysal.core.FileIO as FileIO
from pysal.weights import W
from pysal.weights.util import full, full2W
from warnings import warn
__author__ = "Myunghwa Hwang <<EMAIL>>"
__all__ = ["MatIO"]
class MatIO(FileIO.FileIO):
"""
Opens, reads, and writes weights ... |
"""
Use Case 14 - jcy
MulensModel will be written assuming the coordinate system
(t0,u0,alpha) are defined relative to the center of mass. This is not
always the most efficient choice for fitting. This use case covers the
conversion from center of magnification coordinates to center of mass
coordinates. Essentially, i... |
"""
Django module for Course Metadata class -- manages advanced settings and related parameters
"""
from django.conf import settings
from django.utils.translation import ugettext as _
from six import text_type
from xblock.fields import Scope
from xblock_django.models import XBlockStudioConfigurationFlag
from xmodule.m... |
from __future__ import print_function, unicode_literals
from os import path, getcwd, listdir
import subprocess
import sys
from mach.decorators import (
CommandArgument,
CommandProvider,
Command,
)
from servo.command_base import CommandBase, cd, call
@CommandProvider
class MachCommands(CommandBase):
... |
"""
Differential and pseudo-differential operators.
"""
# Created by Pearu Peterson, September 2002
__all__ = ['diff',
'tilbert','itilbert','hilbert','ihilbert',
'cs_diff','cc_diff','sc_diff','ss_diff',
'shift']
from numpy import pi, asarray, sin, cos, sinh, cosh, tanh, iscomplexobj
i... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
)
class HotStarIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hotstar\.com/(?:.+?[/-])?(?P<id>\d{10})'
_TESTS = [{
'url': 'http... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
from ansible.module_utils.aws.core import AnsibleAWSModule, is_boto3_error_code
from ansible.module_utils.ec2 import AWSRetry, boto3_tag_list_to_ansible_dict, camel_dict_to_snake_d... |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... |
{
'name': 'Test Module',
'category': 'Website',
'summary': 'Custom',
'version': '1.0',
'description': """
Test
""",
'author': 'OpenERP SA',
'depends': ['website'],
'data': [
'test.xml',
],
'installable': True,
'application': True,
} |
# -*- coding: utf-8 -*-
"""
pygments.styles.bw
~~~~~~~~~~~~~~~~~~
Simple black/white only style.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, Strin... |
import math
from gnuradio import gr, gr_unittest, analog, blocks
class test_pll_refout(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()
def tearDown(self):
self.tb = None
def test_pll_refout(self):
expected_result = ((1+0j),
(1+6.408735... |
import os
import mock
from nova import test
from nova.virt.hyperv import constants
from nova.virt.hyperv import pathutils
class PathUtilsTestCase(test.NoDBTestCase):
"""Unit tests for the Hyper-V PathUtils class."""
def setUp(self):
self.fake_instance_dir = os.path.join('C:', 'fake_instance_dir')
... |
"""
Management class for migration / resize operations.
"""
import os
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import units
from nova import exception
from nova.i18n import _, _LE
from nova import objects
from nova.virt import configdrive
from nova.virt.hyperv import imageca... |
import json
import logging
import os
import tempfile
import threading
from pyformance.reporters.reporter import Reporter
from desktop.lib.metrics import global_registry
LOG = logging.getLogger(__name__)
class FileReporter(Reporter):
def __init__(self, location, *args, **kwargs):
super(FileReporter, self).__in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.