content
stringlengths
4
20k
import logging logger = logging.getLogger() import hwsim_utils def test_p2p_go_invite(dev): """P2P GO inviting a client to join""" addr0 = dev[0].p2p_dev_addr() addr1 = dev[1].p2p_dev_addr() logger.info("Generate BSS table entry for old group") # this adds more coverage to testing by forcing the ...
from openerp import models, fields, exceptions, api from openerp.tools.translate import _ from openerp.osv import osv, fields as old_fields import time from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DEFAULT_SERVER_DATE_FORMAT class stock_inventory(osv.Model): _inherit = "stock.inventory" def _get_...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} ################################################################################ # Imports ################################################################################ from distutils.v...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from ansible.plugins.callback import CallbackBase from ansible.utils.path import makedirs_safe from ansible.utils.unicode import to_bytes from ansible.constants import TREE_DIR class CallbackModule(CallbackBase): '...
"""Tests for ceilometer/storage/impl_log.py """ from oslotest import base from ceilometer.storage import impl_log class ConnectionTest(base.BaseTestCase): def test_get_connection(self): conn = impl_log.Connection(None) conn.record_metering_data({'counter_name': 'test', ...
from boto.compat import json class UnexpectedHTTPResponseError(Exception): def __init__(self, expected_responses, response): self.status = response.status self.body = response.read() self.code = None try: body = json.loads(self.body) self.code = body["code"]...
import pytest from mock import patch from pip.vcs.subversion import Subversion @patch('pip.vcs.call_subprocess') @pytest.mark.network def test_obtain_should_recognize_auth_info_url(call_subprocess_mock, script): svn = Subversion(url='svn+http://username:<EMAIL>/') svn.obtain(script.scratch_path / 'test') ...
# -*- coding: utf-8 -*- """ pygments.lexers.markup ~~~~~~~~~~~~~~~~~~~~~~ Lexers for non-HTML markup languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexers.html import HtmlLexer, XmlLexer from pygme...
"""##Ops for image manipulation. ### API This module provides functions for image manipulation; currently, only projective transforms (including rotation) are supported. ## Image `Ops` @@angles_to_projective_transforms @@compose_transforms @@rotate @@transform @@bipartite_match @@single_image_random_dot_stereograms...
# coding=utf-8 """ MegSiacua -- Functions to work with one or a list of ExSiacua exercises. READ THIS: MegBook inherits this class! MegBook is the author front-end. AUTHORS: - Pedro Cruz (2016-01): first modifications for use in SMC. TESTS: check MegBook """ #*************************************************...
# -*- coding: utf-8 -*- from __future__ import absolute_import import struct from ..thrift import TType from .exc import TProtocolException # VERSION_MASK = 0xffff0000 VERSION_MASK = -65536 # VERSION_1 = 0x80010000 VERSION_1 = -2147418112 TYPE_MASK = 0x000000ff def pack_i8(byte): return struct.pack("!b", byt...
# coding: utf-8 # pylint: disable=too-many-arguments, too-many-locals """Definition of various recurrent neural network cells.""" from __future__ import print_function import bisect import random import numpy as np from ..io import DataIter, DataBatch, DataDesc from .. import ndarray def encode_sentences(sentences, ...
from spacewalk.common.rhnConfig import initCFG from spacewalk.server.rhnSQL import initDB from spacewalk.server.xmlrpc import registration initCFG("server.xmlrpc") initDB('rhnuser/rhnuser@webdev') r = registration.Registration() data = { 'os_release': '8.0', 'profile_name': 'test local', 'architecture': ...
"""Tests for Python ops defined in math_grad.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework impor...
from __future__ import (absolute_import, division, print_function) __metacl_interfaceass__ = type from units.compat.mock import patch from ansible.modules.network.nxos import nxos_acl_interface from .nxos_module import TestNxosModule, load_fixture, set_module_args class TestNxosAclInterfaceModule(TestNxosModule): ...
# -*- coding: utf-8 -*- """ pygments.formatters.other ~~~~~~~~~~~~~~~~~~~~~~~~~ Other formatters: NullFormatter, RawTokenFormatter. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments...
#!/usr/bin/env python """ FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2008 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") h...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} def main(): module = AnsibleModule( argument_spec=dict( name=dict(required=True, aliases=['publisher']), state=dict(default='present', choices=...
""" This module houses the ctypes function prototypes for GDAL DataSource (raster) related data structures. """ from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p from functools import partial from django.contrib.gis.gdal.libgdal import lgdal from django.contrib.gis.gdal.prototypes.generation import ( ...
from collections import namedtuple from scipy.stats import mannwhitneyu, fisher_exact import seaborn as sb import pandas as pd import matplotlib.pyplot as plt from sklearn.metrics import roc_curve from .model import bootstrap_auc def vertical_percent(plot, percent=0.1): """ Using the size of the y axis, retur...
""" Lonely Planet Country Views """ from __future__ import absolute_import from django.views.generic import DetailView, ListView from core.views.base import BaseView from lonelyplanet.models.country import LPCountry class BaseLonelyPlanetCountryView(BaseView): """ Base class for Lonely Planet views """ ...
import find_mxnet import mxnet as mx import os, sys from collections import namedtuple ConvExecutor = namedtuple('ConvExecutor', ['executor', 'data', 'data_grad', 'style', 'content', 'arg_dict']) def get_symbol(): # declare symbol data = mx.sym.Variable("data") conv1_1 = mx.symbol.Convolution(name='conv1_...
"""The tests for the Alert component.""" # pylint: disable=protected-access from copy import deepcopy import unittest from homeassistant.setup import setup_component from homeassistant.core import callback import homeassistant.components.alert as alert import homeassistant.components.notify as notify from homeassistan...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup version = '0.2.4' if sys.argv[-1] == 'publish': try: import wheel print("Wheel version: ", wheel.__version__) except ImportError: ...
from gnuradio import gr, gr_unittest from gnuradio import blocks import ieee802_15_4_swig as ieee802_15_4 from css_phy import physical_layer as phy class qa_interleaver_ii (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () def tearDown (self): self.tb = None def test_001...
#!/usr/bin/python # -*- coding: utf-8 -*- """ This bot goes over multiple pages of a wiki, and edits them without changes. This is for example used to get category links in templates working. This script understands various command-line arguments: &params; -purge Do not touch but purge the page -botflag...
from lib.hachoir_core.field import MissingField from lib.hachoir_metadata.metadata import (registerExtractor, Metadata, RootMetadata, MultipleMetadata) from lib.hachoir_metadata.metadata_item import QUALITY_GOOD from lib.hachoir_metadata.safe import fault_tolerant from lib.hachoir_parser.video import MovFile, AsfFi...
# -*- coding: utf-8 -*- import datetime as dt from flask_login import UserMixin from mytrade.extensions import bcrypt from mytrade.database import ( Column, db, Model, ReferenceCol, relationship, SurrogatePK, ) class Role(SurrogatePK, Model): __tablename__ = 'roles' name = Column(db....
import time from openerp.osv import fields, osv class account_analytic_balance(osv.osv_memory): _name = 'account.analytic.balance' _description = 'Account Analytic Balance' _columns = { 'date1': fields.date('Start of period', required=True), 'date2': fields.date('End of period', required=...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import datetime import os import traceback import textwrap from ansible.compat.six import iteritems, string_types from ansible import constants as C from ansible.errors import AnsibleError, AnsibleOptionsError from ansible.plugin...
__version__ = "0.1" import Image, ImageFile from OleFileIO import * # we map from colour field tuples to (mode, rawmode) descriptors MODES = { # opacity (0x00007ffe): ("A", "L"), # monochrome (0x00010000,): ("L", "L"), (0x00018000, 0x00017ffe): ("RGBA", "LA"), # photo YCC (0x00020000, 0x...
#!/usr/bin/env python # -*- coding: utf-8 -*- test_names = [] current = [] test_sections = [] sample_types = [] descriptions = [] print_names = [] old_sort = [] uom = [] hand_edit = ['PaCO2','HCO3'] current_tests_file = open('testNameCurrent.txt','r') name_file = open('testNameDesired.txt','r') test_se...
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" callback Function = any(any... arguments); interface TestTreatNonCallableAsNull1 { [TreatNonCallableAsNull] attribute Function? onfoo; attribute Function? onbar; }; """) results = parser.finish() ...
from MenuList import MenuList from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN from enigma import eListboxPythonMultiContent, eListbox, gFont, RT_HALIGN_LEFT from Tools.LoadPixmap import LoadPixmap import skin selectionpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_defaul...
from sys import argv import re infile = open(argv[1],'r') popfile = open(argv[2] + 'popfile','w') indfile = open(argv[2] + 'indfile','w') indzone = 0 for lines in infile: if re.match("\d+:", lines.strip()): popfile.write(lines) elif lines.strip().endswith("Inferred clusters"): indzone = 1 ...
""" Interface to various templating engines. """ import os.path __all__ = [ "render_cheetah", "render_genshi", "render_mako", "cache", ] class render_cheetah: """Rendering interface to Cheetah Templates. Example: render = render_cheetah('templates') render.hello(name="cheetah") ...
"""Module containing bug report helper(s).""" from __future__ import print_function import json import platform import sys import ssl import urllib3 import chardet from . import __version__ as requests_version try: from .packages.urllib3.contrib import pyopenssl except ImportError: pyopenssl = None Open...
from __future__ import unicode_literals import webnotes from webnotes.widgets.reportview import execute as runreport from webnotes.utils import getdate def execute(filters=None): priority_map = {"High": 3, "Medium": 2, "Low": 1} todo_list = runreport(doctype="ToDo", fields=["name", "date", "description", "priori...
from django.utils.translation import ugettext_lazy as _ from desktop.lib.conf import Config HS2_GET_TABLES_MAX = Config( key="hs2_get_tables_max", help=_("The max number of records in the result set permitted to do a HS2 GetTables call."), type=int, default=1000 )
"""Most of these tests come from the examples in Bronstein's book.""" from sympy import Poly, S, symbols, oo, I from sympy.integrals.risch import (DifferentialExtension, NonElementaryIntegralException) from sympy.integrals.rde import (order_at, order_at_oo, weak_normalizer, normal_denom, special_denom, bound_de...
import unittest from lhc.collections import IntervalSet from lhc.interval import Interval class TestIntervalSet(unittest.TestCase): def test_add(self): set_ = IntervalSet() set_.add(Interval(0, 1000)) self.assertEqual(1, len(set_)) self.assertTrue(any(Interval(0, 1000) in bin fo...
""" NetworkX ======== NetworkX (NX) is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks. https://networkx.lanl.gov/ Using ----- Just write in Python >>> import networkx as nx >>> G=nx.Graph() >>> G.add_edge(1,2) ...
from subprocess import Popen,PIPE import sys import json result = {} result['all'] = {} pipe = Popen(['zoneadm', 'list', '-ip'], stdout=PIPE, universal_newlines=True) result['all']['hosts'] = [] for l in pipe.stdout.readlines(): # 1:work:running:/zones/work:3126dc59-9a07-4829-cde9-a816e4c5040e:native:shared s = l...
from smv import * from pyspark.sql.functions import * from airlineapp.datamodel import inputset from airlineapp.core import utils __all__ = ['FlightMaster'] class FlightMaster(SmvPyModule, SmvPyOutput): """Derive flight level master""" def requiresDS(self): return [inputset.DimFlightLeg, inputset.Di...
#!/usr/bin/env python3 import argparse import json import sys def dump_json(obj, out, pretty): if pretty: json.dump(obj, out, indent=2, sort_keys=True) else: json.dump(obj, out, separators=(",", ":"), sort_keys=True) return def main(): parser = argparse.ArgumentParser(description="Sor...
from __future__ import division, absolute_import, print_function from distutils.core import Command from numpy.distutils import log #XXX: Linker flags def show_fortran_compilers(_cache=[]): # Using cache to prevent infinite recursion if _cache: return _cache.append(1) from numpy.distutils.fcompiler i...
import numpy as np import utils def expanded_indexer(key, ndim): """Given a key for indexing an ndarray, return an equivalent key which is a tuple with length equal to the number of dimensions. The expansion is done by replacing all `Ellipsis` items with the right number of full slices and then paddi...
""" urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (<EMAIL>)' __license__ = 'MIT' __version__ = '1.10.2' from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encode_multipart_fo...
# -*- coding: utf-8 -*- # pylint: disable=I0011 """ rTorrent Daemon Jobs. Copyright (c) 2012 The PyroScope Project <<EMAIL>> """ # 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 versi...
"""The tests for Home Assistant ffmpeg.""" import asyncio from unittest.mock import patch, MagicMock import homeassistant.components.ffmpeg as ffmpeg from homeassistant.setup import setup_component, async_setup_component from tests.common import ( get_test_home_assistant, assert_setup_component, mock_coro) clas...
# 330-patching-array.py class Solution(object): def minPatches_wa(self, nums, n): # Wrong answer. not this method. """ :type nums: List[int] :type n: int :rtype: int """ # Example: # nums = [1, 2, 4, 9] # rbound = 1 + 2 + 4 = 7 count ...
from django.http import HttpResponseRedirect from django.shortcuts import render from django.http import HttpResponse from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required, permission_required import json import random from django.views.decorators.csrf im...
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
""" ============================= Ledoit-Wolf vs OAS estimation ============================= The usual covariance maximum likelihood estimate can be regularized using shrinkage. Ledoit and Wolf proposed a close formula to compute the asymptotically optimal shrinkage parameter (minimizing a MSE criterion), yielding th...
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from django.db.models import Max class Message(models.Model): user = models.ForeignKey(User, related_name='+') message = models.TextField(max_length=1000, blank=True) date = mode...
import mixture # Example for context-specific independence (CSI) structure learning. # First we generate a data set from a three component mixture with a CSI like structure # in the distribution parameters. Then a five component CSI mixture is trained. # The training should recover the true number of components (thre...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} import re from ansible.module_utils.network.nxos.nxos import get_config, load_config from ansible.module_utils.network.nxos.nxos import nxos_argument_spec, check_args from ansible.mo...
import sys """This script is used to generate the mailbox templates in `rethinkdb/src/rpc/mailbox/typed.hpp`. It is meant to be run as follows (assuming that the current directory is `rethinkdb/src/`): $ ../scripts/generate_rpc_templates.py > rpc/mailbox/typed.hpp """ def ncsep(template, nargs): return ", ".joi...
#!/usr/bin/env python """ Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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 co...
from optparse import make_option import sys from google.appengine._internal.django.conf import settings from google.appengine._internal.django.core.management.base import NoArgsCommand from google.appengine._internal.django.core.management.color import no_style from google.appengine._internal.django.core.management.sq...
import collections, os, subprocess, sys import test_framework, utils class AllUnitTests(test_framework.Test): def __init__(self, filters=[]): super(AllUnitTests, self).__init__() self.filters = filters self.configured = False self.tests = None def filter(self, filter): ...
from _ms5803 import ffi, lib class Sensor(object): """ MS5803 sensor communication interface. """ def __init__(self, f_dev, address): """ Initialize pressure sensor and read its calibration coefficients. :param f_dev: I2C device filename, i.e. /dev/i2c-0. :param address...
import sys import os import pysos import signal # these two variables should be changed depending on the test drivers PID # and the type of message it will be sending, If you are using the generic_test.c # then it is likely these two values can stay the same TEST_MODULE = 0x80 MSG_TEST_DATA= 33 ALARM_LEN = 60 START_...
"""Support for Soma Smartshades.""" import logging from api.soma_api import SomaApi from requests import RequestException import voluptuous as vol from homeassistant import config_entries from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_HOST, CONF_PORT import homeassistant.hel...
""" Report from a cobbler master. FIXME: reinstante functionality for 2.0 Copyright 2007-2009, Red Hat, Inc and Others Anderson Silva <<EMAIL>> Michael DeHaan <michael.dehaan AT gmail> This software may be freely redistributed under the terms of the GNU general public license. You should have received a copy of the ...
'''Unit test for bug#554''' from sample import * class Bug554: def crash(self): class Crasher(ObjectType): pass if __name__ == '__main__': bug = Bug554() bug.crash()
from pyalgotrade import strategy from pyalgotrade import plotter from pyalgotrade.tools import yahoofinance from pyalgotrade.technical import ma from pyalgotrade.technical import cumret from pyalgotrade.stratanalyzer import sharpe from pyalgotrade.stratanalyzer import returns class MarketTiming(strategy.Back...
import requests import re from garmin_uploader import logger URL_HOSTNAME = 'https://connect.garmin.com/modern/auth/hostname' URL_LOGIN = 'https://sso.garmin.com/sso/login' URL_POST_LOGIN = 'https://connect.garmin.com/modern/' URL_PROFILE = 'https://connect.garmin.com/modern/currentuser-service/user/info' # noqa URL...
import sys import re import os import ConfigParser from novaclient import client as nova_client try: import json except ImportError: import simplejson as json ################################################### # executed with no parameters, return the list of # all groups and hosts NOVA_CONFIG_FILES = [os.p...
# -*- coding: utf-8 -*- """upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). """ from base64 import standard_b64encode from distutils import log from distutils.errors import DistutilsOptionError import os import socket import zipfile import tempfile import ...
import os import sys import shutil import logging import codecs import inspect import re from string import Template from runner import check_output _log = logging.getLogger('utils') def safe_makedirs(path): try: os.makedirs(path) except OSError, e: # Ignore if it exists if e.errno !...
#!/usr/bin/python usage=''' Usage: own_midi_comparaison.py filename.wav filename.mid [pitch_min pitch_max filtering] Mandatory arguments : two files to compare Optional arguments : pitch_min (smallest pitch considered), pitch_max (biggest pitch considered), filtering (true or false) ''' import sys fro...
__revision__ = "$Id$" ## Description: function Send_Modify_Mail ## This function sends an email saying the document has been ## correctly updated ## Author: T.Baron ## PARAMETERS: addressesMBI: email addresses to which the mail is sent ## fieldna...
from django.db import models from participator.models import Participator,University from . import suitHeightChoices,howOldChoices,equipmentChoices,statusChoices,pledgeChoices,GENDER,speedChangeChoices,suspensionChoices,wheelSizeChoices,brakeTypeChoices,handlebarChoices from datetime import timedelta # Create your mode...
from pymiecoated import Mie import sys import os import numpy as np from pprint import pprint from datetime import datetime import mysql.connector import math import matplotlib.pyplot as plt import matplotlib.colors import calendar from scipy.optimize import curve_fit assumed_coating_th = [41,43,44,40,38,40,44,41,38,3...
"""Utilities for working with multiple processes.""" from __future__ import absolute_import, division, with_statement import errno import logging import os import sys import time from binascii import hexlify from tornado import ioloop try: import multiprocessing # Python 2.6+ except ImportError: multiproc...
# -*- coding: utf-8 -*- """QGIS Unit tests for the OGR/MapInfo tab provider. .. note:: 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 2 of the License, or (at your option) any later v...
from gnuradio import gr, gr_unittest import howto_swig class qa_howto (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () def tearDown (self): self.tb = None def test_001_square_ff (self): src_data = (-3, 4, -5.5, 2, 3) expected_result = (9, 16, 30.25, 4, ...
{ 'name': 'Sales Analytic Distribution', 'version': '1.0', 'category': 'Sales Management', 'description': """ The base module to manage analytic distribution and sales orders. ================================================================= Using this module you will be able to link analytic accounts ...
#!/usr/bin/python #$Id$ """ Program to find the bipartite match. Hopcroft-Karp bipartite max-cardinality matching and max independent set David Eppstein, UC Irvine, 27 Apr 2002 Explaination: TODO """ def bipartiteMatch(graph): '''Find maximum cardinality matching of a bipartite graph (U,V,E). The input format is...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import forms from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.forms import formsets from django.utils.translation import ugettext_lazy as _ from crispy_forms.helper import FormHelper from cr...
""" EasyBuild support for software that uses CMake configure step and Ninja build install. @author: Kenneth Hoste (Ghent University) @author: Pavel Grochal (INUITS) """ from easybuild.easyblocks.generic.cmakemake import CMakeMake from easybuild.easyblocks.generic.mesonninja import MesonNinja class CMakeNinja(CMakeMa...
import math from sverchok.utils.csg_geom import * class CSG(object): """ ## License Copyright (c) 2011 Evan Wallace (http://madebyevan.com/), under the MIT license. Python port Copyright (c) 2012 Tim Knip (http://www.floorplanner.com), under the MIT license. """ def __init__(self): sel...
from __future__ import division from __future__ import absolute_import import collections import scipy as sp import scipy.linalg import itertools as it import operator as op import functools as ft import sympy import math from functools import partial as par from os.path import join as pjoin from math import sin, cos...
DATE_FORMAT = 'Y년 n월 j일' TIME_FORMAT = 'A g:i:s' DATETIME_FORMAT = 'Y년 n월 j일 g:i:s A' YEAR_MONTH_FORMAT = 'Y년 F월' MONTH_DAY_FORMAT = 'F월 j일' SHORT_DATE_FORMAT = 'Y-n-j.' SHORT_DATETIME_FORMAT = 'Y-n-j H:i' # FIRST_DAY_OF_WEEK = # The *_INPUT_FORMATS strings use the Python strftime format syntax, # see http://docs.pyth...
#!/usr/bin/env python """ This script extracts metrics from a RabbitMQ instance. The usage of this script is as follows: rabbitmq_monitoring.py """ import json from time import sleep import collections import sys from os.path import basename import urllib2 from base64 import b64encode from string import replace ...
"""Ops to use variables as resources.""" # pylint: disable=g-bad-name from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.core.framework import attr_value_pb2 from tensorflow.python.framework import ops from tensorflow.python.ops import array_op...
import re import simplejson from django.conf import settings from common import api from common import normalize from common import profile from common import util from common.tests import ViewTestCase class ExploreTest(ViewTestCase): def test_explore_when_signed_out(self): l = profile.label('explore_get...
"""distutils.command.build_py Implements the Distutils 'build_py' command.""" import sys, os import sys from glob import glob from distutils.core import Command from distutils.errors import * from distutils.util import convert_path, Mixin2to3 from distutils import log class build_py (Command): d...
from setuptools import setup, find_packages version = '0.1' LONG_DESCRIPTION = """ AwesomeStream ============= AwesomeStream is a set of tools for creating a "stream server". That is, a server which can store information about events that happen, and can query back those events in reverse-chronological order, slice...
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
import dlib def main(): # In this example, we have three types of samples: class 0, 1, or 2. That # is, each of our sample vectors falls into one of three classes. To keep # this example very simple, each sample vector is zero everywhere except at # one place. The non-zero dimension of each vector ...
from sklearn import preprocessing import matplotlib.pyplot as plt import numpy as np nbaPGData = [ [ 15.8, 8.2, 8.1, 1.7 ], [ 25.4, 10.3, 10.1, 1.8 ], [ 22.1, 5.6, 3.1, 1.1 ], [ 16.7, 3.4, 3.7, 1.0 ], [ 16.2, 6.9, 5.6, 1.1 ], [ 13.1, 5.3, 4.6, 1.6 ], [ 17.3, 4.8, 4.1, 0.8 ], [ 17.7, 5.0, 3.8, 2.0 ], [ 26.9, 6.6, 4.5, ...
import pkg_resources import sys from grpc_tools import _protoc_compiler def main(command_arguments): """Run the protocol buffer compiler with the given command-line arguments. Args: command_arguments: a list of strings representing command line arguments to `protoc`. """ command_arguments = ...
#!/usr/bin/env python import os import sys import fnmatch import argparse import itertools sys.path.insert(0, '..') import ninja_syntax objdir = 'obj' def flags(*args): return ' '.join(itertools.chain(*args)) def object_file(f): (root, ext) = os.path.splitext(f) return os.path.join(objdir, root + '.o'...
"""Fixer that changes filter(F, X) into list(filter(F, X)). We avoid the transformation if the filter() call is directly contained in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. NOTE: This is still not correct if the original code was depending on filter(F, X) to return a string if X is a...
"""Python bindings for The Festival Speech Synthesis System. http://code.google.com/p/pyfestival/ http://www.cstr.ed.ac.uk/projects/festival/ """ __version__ = "0.2.0" __all__ = [ 'Festival', 'FestivalServer', 'FestivalClient', 'say' ] import os import signal import subprocess import socket class Festival(object...
from __future__ import print_function from pybrain.structure import FeedForwardNetwork from pybrain.structure import LinearLayer, SigmoidLayer from pybrain.structure import BiasUnit,TanhLayer from pybrain.structure import FullConnection from pybrain.datasets import SupervisedDa...
import sys import re import os import ConfigParser from novaclient import client as nova_client from six import iteritems try: import json except ImportError: import simplejson as json sys.stderr.write("WARNING: this inventory module is deprecated. please migrate usage to openstack.py\n") ##################...
from essentia_test import * from essentia import * from essentia.streaming import AudioOnsetsMarker, MonoWriter from numpy import pi, sin import os file = "foo.wav" class TestAudioOnsetsMarker_Streaming(TestCase): def testRegression(self): sr = 44100 inputSize = sr # 1 second of audio inp...