content string |
|---|
from __future__ import absolute_import
from __future__ import unicode_literals
from builtins import str
import mock
from oauth2client.client import AccessTokenCredentials
import unittest
import datalab.bigquery
import datalab.context
class TestCases(unittest.TestCase):
@mock.patch('datalab.bigquery._api.Api.table... |
""" Test for assert_deallocated context manager and gc utilities
"""
import gc
from scipy._lib._gcutils import set_gc_state, gc_state, assert_deallocated, ReferenceError
from nose.tools import assert_equal, raises
def test_set_gc_state():
gc_status = gc.isenabled()
try:
for state in (True, False):
... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from ..units.general import Velocity, Time, Distance
from ..data.constants import LIGHT_VELOCITY
from ..movement import Movement
from ..relativity import contraction_factor, lorentz_factor, time_dilation, \
length_contraction, RelativistMovement
import pytest
class T... |
import numpy as np
import catmap
from .parser_base import *
string2symbols = catmap.string2symbols
Template = catmap.Template
class TableParser(ParserBase):
"""Parses attributes based on column headers and filters.
Additional functionality may be added by inheriting and defining
the parse_{header_name... |
from __future__ import print_function
from sklearn.linear_model import LinearRegression
from load_ml100k import load
import numpy as np
import similar_movie
import usermodel
import corrneighbours
reviews = load()
reg = LinearRegression()
es = np.array([
usermodel.all_estimates(reviews),
corrneighbours.all_esti... |
#!/usr/bin/env python
'''
Image Embedding Extension for Python-Markdown
======================================
Converts lone links to embedded images, provided the file extension is allowed.
Ex:
http://www.ericfehse.net/media/img/ef/blog/django-pony.jpg
becomes
<img src="http://www.ericfehse.net/media/img... |
import requests
from cloudbot import hook
max_length = 100
def goog_trans(api_key, text, source, target):
url = 'https://www.googleapis.com/language/translate/v2'
if len(text) > max_length:
return "This command only supports input of less then 100 characters."
params = {
'q': text,
... |
import FreeCAD
import Path
import PathScripts.PathOp as PathOp
import PathScripts.PathLog as PathLog
from PySide import QtCore
__title__ = "Path Custom Operation"
__author__ = "sliptonic (Brad Collette)"
__url__ = "http://www.freecadweb.org"
__doc__ = "Path Custom object and FreeCAD command"
if False:
PathLog.s... |
from configurations import Configuration, values
import redis
class Common(Configuration):
REDIS_HOST = 'redis'
REDIS_PORT = 6379
REDIS_DB = 0
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format' : "[%(a... |
import os
import sys
import logging
import kfp
import fire
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
class MyCLI:
"""
CLI for Kubeflow Pipelines.
This CLI allows us to compile and run our pipelines in Kubeflow Pipelines without accessing
Kubeflow portal.
"""
... |
"""Self-test for Crypto.Random.OSRNG package"""
__revision__ = "$Id$"
import os
def get_tests(config={}):
tests = []
if os.name == 'nt':
from Crypto.SelfTest.Random.OSRNG import test_nt; tests += test_nt.get_tests(config=config)
from Crypto.SelfTest.Random.OSRNG import test_winrandom; ... |
import json
import logging
import posixpath
import re
from compiled_file_system import Cache
from extensions_paths import EXAMPLES
from samples_data_source import SamplesDataSource
import third_party.json_schema_compiler.json_comment_eater as json_comment_eater
import url_constants
_DEFAULT_ICON_PATH = 'images/sampl... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : <EMAIL>
**... |
"""
A number of function that enhance IDLE on MacOSX when it used as a normal
GUI application (as opposed to an X11 application).
"""
import sys
import Tkinter
from os import path
_appbundle = None
def runningAsOSXApp():
"""
Returns True if Python is running from within an app on OSX.
If so, assume that ... |
"""Test for the Iris model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import shutil
import tempfile
import unittest
import iris
class IrisTest(unittest.TestCase):
def setUp(self):
self._tmp_dir = tempfile.mkdtemp()
... |
# pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from nose.tools import assert_true, assert_equal # pylint: disable=E0611
from terrain.steps import reload_the_page
from selenium.common.exceptions import StaleElementReferenceException
############### ACTIONS ####################
@step(... |
#! /usr/bin/env python
assert __name__ == "__main__"
import sys
from macro import Macro, writeFile
tmpl = """\
@node %(name)s
@unnumberedsec %(name)s
@majorheading Synopsis
%(synopsis)s
@majorheading Description
%(description)s
@majorheading Source Code
Download the
@uref{http://git.savannah.gnu.org/gitweb/?p=... |
import sys
import xbmc
import RussianKey
import xbmcgui
import xbmcaddon
_addon_ = xbmcaddon.Addon("service.RussianKeyboard")
if sys.version_info >= (2, 7):
import json
else:
import simplejson as json
def json_query(query):
xbmc_request = json.dumps(query)
result = xbmc.executeJSONRPC(xbmc_request)
result = ... |
"""
This program accumulates by month the maximum high temperature, the
minimum high temperature, the number of days and the accumulated high
temperatures. The latter two are used to calculate the average high
temperature for the month.
"""
monlst = []
for i in range(12):
monlst.append([0, 0, 0, 200]) # sublist[Da... |
"""functions related to animation"""
import pymel.util as _util
import pymel.internal.factories as _factories
import general as _general
import pymel.internal.pmcmds as cmds
def currentTime( *args, **kwargs ):
"""
Modifications:
- if no args are provided, the command returns the current time
"""
if ... |
import csv
import os
import copy
import re
from decimal import Decimal
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse, FormRequest
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from scrapy.http.c... |
"""
platformer.py
Author: Matthew F
Credit: Robbie
Assignment:
Write and submit a program that implements the sandbox platformer game:
https://github.com/HHS-IntroProgramming/Platformer
Platformer.listenKeyEvent("keydown", "s", self.SPRING)
Platformer.listenKeyEvent("keyup", "s", self.SPRINGoff)
... |
try:
from twisted.plugin import pluginPackagePaths
__path__.extend(pluginPackagePaths(__name__))
except ImportError:
# Twisted 2.5 doesn't include pluginPackagePaths
import sys, os
__path__.extend([os.path.abspath(os.path.join(x, 'mediasources', 'modules', 'Sitecom'))
for x in s... |
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers_async # type: ignore
from google.api_core import operations_v1 # type: ignore
from google.au... |
from tests.config import base_folder, base_url
from core.generate import generate, save_generated
from core.channels.channel import Channel
from unittest import TestCase
import subprocess
import utils
import random
import hashlib
import os
def setUpModule():
subprocess.check_output("""
BASE_FOLDER="{base_folder}/g... |
import fs.osfs
import os, os.path
from capa.capa_problem import LoncapaProblem
from mock import Mock, MagicMock
import xml.sax.saxutils as saxutils
TEST_DIR = os.path.dirname(os.path.realpath(__file__))
def tst_render_template(template, context):
"""
A test version of render to template. Renders to the re... |
import perf
def main():
cpus = perf.cpu_map()
threads = perf.thread_map()
evsel = perf.evsel(task = 1, comm = 1, mmap = 0,
wakeup_events = 1, watermark = 1,
sample_id_all = 1,
sample_type = perf.SAMPLE_PERIOD | perf.SAMPLE_TID | perf.SAMPLE_CPU)
evsel.open(cpus = cpus, threads = threads);
evlist... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import,print_function
import os
import sys
import code
import warnings
import string
import inspect
import argparse
from flask import _request_ctx_stack
from .cli import prompt, prompt_pass, prompt_bool, prompt_choices
from ._compat import izip, text_type
cl... |
import subprocess
import omniORB
import rawdata
__all__ = ('factory')
class CorbaStream(object):
def __init__(self, orbargs, orb, format, numa_policy):
reader_args = numa_policy(['streams/corba/reader'] + orbargs)
self.reader_proc = subprocess.Popen(reader_args, stdout=subprocess.PIPE)
io... |
import django.dispatch
#: Sent after ensuring that the cart and order are valid.
#:
#: :param sender: The controller which performed the sanity check.
#: :type sender: ``payment.views.confirm.ConfirmController``
#:
#: :param controller: The controller which performed the sanity check.
#: :type controller: ``payment.vi... |
# Access WeakSet through the weakref module.
# This code is separated-out because it is needed
# by abc.py to load everything else at startup.
from _weakref import ref
__all__ = ['WeakSet']
class _IterationGuard:
# This context manager registers itself in the current iterators of the
# weak container, such ... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..aes import aes_cbc_decrypt
from ..compat import (
compat_b64decode,
compat_ord,
compat_str,
)
from ..utils import (
bytes_to_intlist,
ExtractorError,
intlist_to_bytes,
int_or_none,
... |
import sqlalchemy as sql
def upgrade(migrate_engine):
meta = sql.MetaData()
meta.bind = migrate_engine
token = sql.Table('token', meta, autoload=True)
idx = sql.Index('ix_token_valid', token.c.valid)
idx.create(migrate_engine)
def downgrade(migrate_engine):
meta = sql.MetaData()
meta.bin... |
import os
import subprocess
# hardcoded paths
HUNTER_DIR='..'
PACKAGES_DIR=os.path.join(HUNTER_DIR, 'cmake/projects')
DOCS_PKG_DIR=os.path.join(HUNTER_DIR, 'docs', 'packages', 'pkg')
# get all wiki entries
docs_filenames = [x for x in os.listdir(DOCS_PKG_DIR) if x.endswith('.rst')]
docs_entries = [x[:-4] for x in doc... |
import os
import unittest
from nose.tools import assert_is_not_none
from sqlalchemy import text
from wcloud.tasks.db_tasks import connect, create_db, destroy_db
# Fix the working directory.
cwd = os.getcwd()
if cwd.endswith(os.path.join("wcloud", "test")):
cwd = cwd[0:len(cwd)-len(os.path.join("wcloud", "test"))]... |
# Adapted from test_file.py by Daniel Stutzbach
#from __future__ import unicode_literals
import sys
import os
import unittest
from array import array
from weakref import proxy
from test.test_support import (TESTFN, findfile, check_warnings, run_unittest,
make_bad_fd)
from UserList impor... |
from Core.config import Config
from Core.maps import User
from Core.loadable import loadable, route
class quits(loadable):
usage = " <pnick>"
@route(r"(\S+)", access = "member")
def execute(self, message, user, params):
# assign param variables
search=params.group(1)
# do stuff h... |
from solent import Engine
from solent import SolentQuitException
from solent import log
from solent.util import RailLineConsole
LC_ADDR = 'localhost'
LC_PORT = 8200
MTU = 1490
I_NEARCAST = '''
i message h
i field h
message init
message line_console_connect
field addr
field port
... |
"""Tests for GceClusterResolver."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.cluster_resolver.python.training.cluster_resolver import UnionClusterResolver
from tensorflow.contrib.cluster_resolver.python.training.gce_cluster_re... |
import qctests.ICDC_aqc_10_local_climatology_check as ICDC
import util.testingProfile
import numpy as np
##### ICDC 10 local climatology check.
##### --------------------------------------------------
class TestClass():
parameters = {
'db': 'iquod.db',
'table': 'unit'
}
def setUp(self):
... |
"""Utilities for working with callables."""
import abc
import collections
import enum
import functools
import logging
class Outcome(object):
"""A sum type describing the outcome of some call.
Attributes:
kind: One of Kind.RETURNED or Kind.RAISED respectively indicating that the
call returned a value o... |
# -*- encoding: utf-8 -*-
import os
SECRET_KEY = 'p23jof024jf5-94j3f023jf230=fj234fp34fijo'
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEST_DATA_DIR = os.path.join(BASE_DIR, 'tests', 'test_data')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_mpa_ascii.py
-----------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
************************... |
#!/usr/bin/env python
try:
import pacman
except ImportError:
import alpm
pacman = alpm
import os, tempfile, shutil, sys, re
remove = False
if len(sys.argv) > 1:
if sys.argv[1] == "--help":
print "no longer necessary %s fpms" % sys.argv[2]
sys.exit(0)
elif sys.argv[1] == "--remove":
remove = True
arch = s... |
"""Tests for hyperplane_lsh_probes."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.nearest_neighbor.python.ops.nearest_neighbor_ops import hyperplane_lsh_probes
from tensorflow.python.platform import test
cl... |
"""
API for initiating and tracking requests for credit from a provider.
"""
import datetime
import logging
import uuid
import pytz
from django.db import transaction
from edx_proctoring.api import get_last_exam_completion_date
from openedx.core.djangoapps.credit.exceptions import (
UserIsNotEligible,
CreditP... |
from re import compile, MULTILINE
from os import walk, getcwd
notice = ('''/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* 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 th... |
from collections import defaultdict
def autodict():
return defaultdict(autodict)
flag_fields = autodict()
symbolic_fields = autodict()
def define_flag_field(event_name, field_name, delim):
flag_fields[event_name][field_name]['delim'] = delim
def define_flag_value(event_name, field_name, value, field_str):
... |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.absp... |
# -*- coding: utf-8 -*-
"""
pygments.scanner
~~~~~~~~~~~~~~~~
This library implements a regex based scanner. Some languages
like Pascal are easy to parse but have some keywords that
depend on the context. Because of this it's impossible to lex
that just by using a regular expression lexer like ... |
GEO_INTERFACE_MARKER = "__geo_interface__"
def is_mapping(ob):
return hasattr(ob, "__getitem__")
def to_mapping(ob):
if hasattr(ob, GEO_INTERFACE_MARKER):
candidate = ob.__geo_interface__
candidate = to_mapping(candidate)
else:
candidate = ob
if not is_mapping(candidate):
... |
# -*- coding: utf-8 -*-
"""Test for autolag of adfuller
Created on Wed May 30 21:39:46 2012
Author: Josef Perktold
"""
import numpy as np
from numpy.testing import assert_equal, assert_almost_equal
import statsmodels.tsa.stattools as tsast
from statsmodels.datasets import macrodata
def test_adf_autolag():
#see i... |
"""Example of Estimator for DNN-based text classification with DBpedia data."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
import numpy as np
import pandas
from sklearn import metrics
import tensorflow as tf
FLAGS = None
M... |
from datadog_checks.base.checks.prometheus.prometheus_base import PrometheusCheck
from datadog_checks.base.errors import CheckException
EVENT_TYPE = SOURCE_TYPE_NAME = 'portworx'
class PortworxCheck(PrometheusCheck):
"""
Collect px metrics from Portworx
"""
def __init__(self, name, init_config, agen... |
from iptest.assert_util import *
def test_range():
Assert(range(10) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
Assert(range(0) == [])
Assert(range(-10) == [])
Assert(range(3,10) == [3, 4, 5, 6, 7, 8, 9])
Assert(range(10,3) == [])
Assert(range(-3,-10) == [])
Assert(range(-10,-3) == [-10, -9, -8, -7... |
import argparse
import requests
import socket
from urlparse import urlparse
def CheckServiceAddress(address):
hostname = urlparse(address).hostname
service_address = socket.gethostbyname(hostname)
print service_address
def GetServerResponse(address):
print 'Send request to:', address
response = requests.... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import glob
from ansible.plugins.lookup import LookupBase
class LookupModule(LookupBase):
def run(self, terms, variables=None, **kwargs):
basedir = self.get_basedir(variables)
ret = []
for... |
import sys
import linecache
import time
import socket
import traceback
import thread
import threading
import Queue
from idlelib import CallTips
from idlelib import AutoComplete
from idlelib import RemoteDebugger
from idlelib import RemoteObjectBrowser
from idlelib import StackViewer
from idlelib import... |
# RAVEn Plugin
#
#
#
# Plugin parameter definition below will be parsed during startup and copied into Manifest.xml, this will then drive the user interface in the Hardware web page
#
"""
<plugin key="RAVEn" name="RAVEn Zigbee energy monitor" author="dnpwwo" version="1.3.10" externallink="https://rainforest... |
"""Provides the CameraDetection class which creates a window for detecting objects in a video stream."""
try:
# Python 3
import tkinter as Tkinter
from tkinter import N, E, S, W
from tkinter import ttk
from tkinter import messagebox as tkMessageBox
from tkinter import filedialog as tkFi... |
# -*- 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 'ManualEnrollmentAudit'
db.create_table('student_manualenr... |
SECRET_KEY = 'test'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'controlcenter',
)
MIDDLEWARE_CLASSES = (
'django.contr... |
from .compat import wrap_ord
NUM_OF_CATEGORY = 6
DONT_KNOW = -1
ENOUGH_REL_THRESHOLD = 100
MAX_REL_THRESHOLD = 1000
MINIMUM_DATA_THRESHOLD = 4
# This is hiragana 2-char sequence table, the number in each cell represents its frequency category
jp2CharContext = (
(0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0... |
# -*- coding: utf-8 -*-
"""
osisoft_pi_webapi_python_client.client
~~~~~~~~~~~~~~~~~~~
This module contains the client used to access OSIsoft PI infrastructure and data
"""
from src.osisoftpy import _base, _server
class client(_base):
"""A client to interact with the PI Web WebAPI"""
def __init__(self,
... |
"""Convenience functions for using the idmap database."""
__docformat__ = "restructuredText"
import ldb
import samba
class IDmapDB(samba.Ldb):
"""The IDmap database."""
# Mappings for ID_TYPE_UID, ID_TYPE_GID and ID_TYPE_BOTH
TYPE_UID = 1
TYPE_GID = 2
TYPE_BOTH = 3
def __init__(self, url=No... |
from __future__ import unicode_literals
from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point
from django.contrib.gis.maps.google.gmap import GoogleMapException
from django.utils.six.moves import xrange
from math import pi, sin, log, exp, atan
# Constants used for degree to radian conversion, a... |
"""Test-appropriate entry points into the gRPC Python Beta API."""
from grpc._adapter import _intermediary_low
from grpc.beta import implementations
def not_really_secure_channel(
host, port, client_credentials, server_host_override):
"""Creates an insecure Channel to a remote host.
Args:
host: The name... |
from __future__ import unicode_literals
import datetime
from django.db import models
class UserPhoto(models.Model):
user_name = models.CharField(max_length=128, default="")
user_phone = models.CharField(max_length=128, default="")
access_code = models.CharField(max_length=128)
photo_name = models.CharField(... |
#! /usr/bin/env python3
"""
Parse an IDX file like the one used in the MNIST handwritten digit database.
A description of the format is on this page: http://yann.lecun.com/exdb/mnist/
"""
import struct
import array
import sys
def _is_sequence(seq):
return hasattr(seq, '__getitem__') and not hasattr(seq, 'strip')... |
# -*- coding: utf-8 -*-
"""
Display output of given script.
Display output of any executable script set by 'script_path'.
Pay attention. The output must be one liner, or will break your i3status !
The script should not have any parameters, but it could work.
Configuration parameters:
- cache_timeout : how often w... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import re
try:
from itertools import izip
except ImportError:
izip = zip
from ansi... |
"""Reader for the OCA products
"""
"""
How to gather the LRIT files and skip the header:
for file in `ls /disk2/testdata/OCA/L-000-MSG3__-MPEF________-OCAE_____-0000??___-*-__`;do echo $file; dd if=$file bs=1c skip=103 >> tmp;done
"""
import os
import pygrib
import numpy as np
import os.path
from glob import glob
i... |
import os
import subprocess
from django.core.files.temp import NamedTemporaryFile
from django.db.backends.base.client import BaseDatabaseClient
from django.utils.six import print_
def _escape_pgpass(txt):
"""
Escape a fragment of a PostgreSQL .pgpass file.
"""
return txt.replace('\\', '\\\\').replace... |
"""
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE_CLASSES = [
'django.middleware.cache.UpdateCa... |
"""
XML serializer.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from xml.dom import pulldom
from xml.sax import handler
from xml.sax.expatreader import ExpatParser as _ExpatParser
from django.apps import apps
from django.conf import settings
from django.core.serializers import bas... |
from datetime import datetime
from uuid import uuid4
from odoo import api, exceptions, fields, models, _
class PaymentAcquirerTest(models.Model):
_inherit = 'payment.acquirer'
provider = fields.Selection(selection_add=[('test', 'Test')])
@api.model
def create(self, values):
if values.get('p... |
from __future__ import absolute_import, division, print_function
class Infinity(object):
def __repr__(self):
return "Infinity"
def __hash__(self):
return hash(repr(self))
def __lt__(self, other):
return False
def __le__(self, other):
return False
def __eq__(sel... |
"""
Client side of the console RPC API.
"""
from oslo.config import cfg
from oslo import messaging
from nova import rpc
rpcapi_opts = [
cfg.StrOpt('console_topic',
default='console',
help='The topic console proxy nodes listen on'),
]
CONF = cfg.CONF
CONF.register_opts(rpcapi_opts)
... |
jp2CharContext = (
(0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1),
(2,4,0,4,0,3,0,4,0,3,4,4,4,2,4,3,3,4,3,2,3,3,4,2,3,3,3,2,4,1,4,3,3,1,5,4,3,4,3,4,3,5,3,0,3,5,4,2,0,3,1,0,3,3,0,3,3,0,1,1,0,4,3,0,3,3... |
from plex import Plex
from tests.core.helpers import read
import responses
# Set client configuration defaults
Plex.configuration.defaults.server(host='mock')
@responses.activate
def test_get_all():
responses.add(
responses.GET, 'http://mock:32400/:/prefs',
body=read('fixtures/prefs.xml'), statu... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configurat... |
microcode = '''
# RCPPS
# RCPSS
''' |
import unittest
import numpy as np
from VelocityConversion import MantleConversion, UnavailableMethodError
def assemblage():
a = {
"ol": 0.617,
"cpx": 0.133,
"opx": 0.052,
"gnt": 0.153,
"jd": 0.045,
"XFe": 0.11
}
return a
class TestVelocityConversion(unittes... |
from .operation_display import OperationDisplay
from .dimension import Dimension
from .metric_specification import MetricSpecification
from .service_specification import ServiceSpecification
from .operation import Operation
from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabil... |
from collections import OrderedDict
import sys
import warnings
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
from django.core.paginator import InvalidPage
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from ... |
from setuptools import setup
setup(name='wtss',
version='0.5.0',
description='Python Client API for Web Time Series Service',
url='https://github.com/e-sensing/wtss.py',
author='Gilberto Ribeiro de Queiroz',
author_email='<EMAIL>',
license='LGPL3',
packages=['wtss'],
zip... |
import unittest
import os
import commands
import glob
import comm
class TestEhAppBuild(unittest.TestCase):
def test_build(self):
comm.setUp()
app_name = "Eh"
sample_src_pref = "/tmp/crosswalk-demos/workshop-cca-eh"
comm.buildGoogleApp(app_name, sample_src_pref, self)
if __name__ ... |
import sys
import mock
import os
from mock import patch, call
import kiwi
from .test_helper import argv_kiwi_tests
from kiwi.tasks.system_prepare import SystemPrepareTask
class TestSystemPrepareTask(object):
def setup(self):
sys.argv = [
sys.argv[0], '--profile', 'vmxFlavour', 'system', 'p... |
"""
Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 2 of the License,
or (at your option) any la... |
# -*- 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 'Settings'
db.create_table(u'vpw_settings', (
... |
microcode = '''
def macroop CVTSS2SD_XMM_XMM {
cvtf2f xmml, xmmlm, destSize=8, srcSize=4, ext=Scalar
};
def macroop CVTSS2SD_XMM_M {
ldfp ufp1, seg, sib, disp, dataSize=8
cvtf2f xmml, ufp1, destSize=8, srcSize=4, ext=Scalar
};
def macroop CVTSS2SD_XMM_P {
rdip t7
ldfp ufp1, seg, riprel, disp, data... |
"""Implement various utils.
Utilities that could potentially exist in separate packages should be placed in
this file.
"""
import sys
import warnings
from collections import namedtuple
from six import StringIO
import logging
import shlex
import six
from flask import has_app_context, current_app
from functools import... |
"""A simple script for inspect checkpoint files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string("file_name", "", "Checkpoint filename")
tf.app.flags.DEFINE_string... |
"""Controller coordinates sampling and training model.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import pickle
import random
flags = tf.flags
gfile = tf.gfile
FLAGS = flags.FLAGS
def find_best_eps_lam... |
from setuptools import setup, find_packages
import os.path
def project_path(*names):
return os.path.join(os.path.dirname(__file__), *names)
setup(
name='zeit.retresco',
version='1.32.3.dev0',
author='gocept, Zeit Online',
author_email='<EMAIL>',
url='http://www.zeit.de/',
description="vi... |
import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
ProjectFactory,
AuthUserFactory,
PrivateLinkFactory,
)
from osf.utils import permissions
@pytest.fixture()
def user():
return AuthUserFactory()
@pytest.mark.django_db
@pytest.mark.enable_quickfiles_creat... |
"""This module hosts code to handle unknown OSes."""
from image_creator.distro import OSBase
class Unsupported(OSBase):
"""OS class for unsupported OSes"""
def __init__(self, image, **kwargs):
super(Unsupported, self).__init__(image, **kwargs)
def collect_metadata(self):
"""Collect metad... |
from __future__ import absolute_import
import six
import github.GithubObject
import github.ProjectColumn
from . import Consts
class Project(github.GithubObject.CompletableGithubObject):
"""
This class represents Projects. The reference can be found here http://developer.github.com/v3/projects
"""
... |
from livesettings import config_value
from payment.listeners import capture_on_ship_listener
from product.models import Product
from product.listeners import default_product_search_listener, discount_used_listener
from satchmo_store.contact import signals as contact_signals
from satchmo_store.mail import send_html_emai... |
"""This module wraps the Android Asset Packaging Tool."""
import os
from devil.utils import cmd_helper
from pylib import constants
_AAPT_PATH = os.path.join(constants.ANDROID_SDK_TOOLS, 'aapt')
def _RunAaptCmd(args):
"""Runs an aapt command.
Args:
args: A list of arguments for aapt.
Returns:
The out... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.