content
stringlengths
4
20k
"""Handlers for outcome details.""" from testtools import content, content_type from testtools.compat import _b, BytesIO from subunit import chunked end_marker = _b("]\n") quoted_marker = _b(" ]") empty = _b('') class DetailsParser(object): """Base class/API reference for details parsing.""" class SimpleDeta...
#!/usr/bin/env python import pika import sys from optparse import OptionParser from taskqueue.confparser import ConfigParser, NoSectionError def parse_cmdline(defaults): """Parse commandline options.""" parser = OptionParser() parser.add_option("-c", "--config", dest="config", def...
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import io import json import pytest import requests from functools import partial from tableschema import Field, exceptions # Constants DESCRIP...
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), (r'^test$','atap.views.test'), (r'^$', 'atap.views.list_tools'), (r'^accounts/login/$', 'atap.views.login'), (r'^accounts/logout/$', "atap.v...
######################################################################## # # This module contains classes for controlling and GUI representation of # spectrometer Shamrok SR303i connected to camera iDUS DU401A-BV # ######################################################################## from libs.gui.hardware_control ...
exec(open('functional/tests/_standalone_rst_defaults.py').read()) # Source and destination file names: test_source = 'standalone_rst_s5_html.txt' test_destination = 'standalone_rst_s5_html_1.html' # Keyword parameters passed to publish_file: writer_name = 's5_html' # Settings: settings_overrides['theme'] = 'small-bl...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['deprecated'], 'supported_by': 'community'} RETURNS = ''' name: description: Name of the IP Pool returned: always type: str sample: Server-IpAddrs id: description: AOS unique ID assigned to the IP Pool retur...
import os # toolchains options ARCH='arm' CPU='cortex-m3' CROSS_TOOL='keil' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') #device options # STM32_TYPE = # 'STM32F10X_LD','STM32F10X_LD_VL', # 'STM32F10X_MD','STM32F10X_MD_VL', # 'STM32F10X_HD','STM32F10X_HD_VL', # 'STM32F10X_XL','STM32F10X_CL' STM32_TYPE ...
from openerp import models, fields, api class PurchaseOrder(models.Model): _inherit = 'purchase.order' main_project_id = fields.Many2one('project.project', string="Main Project") @api.one @api.onchange('main_project_id') def onchange_project_id(self): for line in self.order_line: ...
from datetime import datetime, timedelta from flask import (Flask, render_template, flash, Markup, request, g, session, url_for, redirect) from flask_babel import gettext from flask_assets import Environment from flask_wtf.csrf import CSRFProtect, CSRFError from jinja2 import evalcontextfilter from o...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class FootyRoomIE(InfoExtractor): _VALID_URL = r'http://footyroom\.com/(?P<id>[^/]+)' _TESTS = [{ 'url': 'http://footyroom.com/schalke-04-0-2-real-madrid-2015-02/', 'info_dict': { 'id': 'scha...
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' Created on 2013-5-23 @author: liaoqiqi 打印zookeeper树 ''' from kazoo.client import KazooClient from kazoo.client import KazooState import datetime import time hosts = '10.48.57.42:8581,10.48.57.42:8582,10.48.57.42:8583' zk = KazooClient(hosts=hosts) zk.start() print ...
# -*- coding: iso-8859-1 -*- """ RPython implementation of MD5 checksums. See also the pure Python implementation in lib_pypy/md5.py, which might or might not be faster than this one on top of CPython. This is an implementation of the MD5 hash function, as specified by RFC 1321. It was implemented using Bruce Schneie...
# -*- coding: utf-8 -*- """ *************************************************************************** r_sum.py --------------------- Date : December 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *******************************...
""" Represents an EC2 Bundle Task """ from boto.ec2.ec2object import EC2Object class BundleInstanceTask(EC2Object): def __init__(self, connection=None): super(BundleInstanceTask, self).__init__(connection) self.id = None self.instance_id = None self.progress = None self.s...
# $Id: 301_ice_public_a.py 2392 2008-12-22 18:54:58Z bennylp $ # from inc_cfg import * # Note: # - need --dis-codec to make INVITE packet less than typical MTU uas_args = "--null-audio --id=\"<sip:<EMAIL>>\" --registrar=sip:sip.pjsip.org --username=test1 --password=test1 --realm=pjsip.org --proxy=\"sip:sip.pjsip.org...
""" :mod:`nexenta.nfs` -- Driver to store volumes on NexentaStor Appliance. ======================================================================= .. automodule:: nexenta.nfs .. moduleauthor:: Mikhail Khodos <<EMAIL>> .. moduleauthor:: Victor Rodionov <<EMAIL>> """ import hashlib import os from oslo.config import c...
from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class Top20Page(page_module.Page): def __init__(self, url, page_set, name=''): super(Top20Page, self).__init__(url=url, page_set=page_set, name=name) self.archive_data_file = '../data/chrome_proxy_top_20.j...
"""This package is deprecated. Please use `airflow.sensors` or `airflow.providers.*.sensors`.""" import warnings warnings.warn( "This package is deprecated. Please use `airflow.sensors` or `airflow.providers.*.sensors`.", DeprecationWarning, stacklevel=2, )
"""Class for post-handshake certificate checking.""" from .x509 import X509 from .x509certchain import X509CertChain from .errors import * class Checker(object): """This class is passed to a handshake function to check the other party's certificate chain. If a handshake function completes successfully, ...
from django.contrib.auth.models import User from django.contrib.gis.db import models from django.contrib.gis.geos import Point from django.template.defaulttags import register from django.utils.translation import ugettext_lazy as _ # filters from django.utils import timezone from django.utils.safestring import mark_s...
# -*- coding: utf-8 -*- """ Unit tests for analytics logic in framework/analytics/__init__.py """ import unittest import pytest from django.utils import timezone from nose.tools import * # flake8: noqa (PEP8 asserts) from flask import Flask from datetime import datetime from framework import analytics, sessions f...
""" ====================================================== Out-of-core classification of text documents ====================================================== This is an example showing how scikit-learn can be used for classification using an out-of-core approach: learning from data that doesn't fit into main memory. ...
import os import sys import rpm from filecmp import dircmp from . import util from . import mount from . import Atomic class Diff(Atomic): def diff(self): ''' Allows you to 'diff' the RPMs between two different docker images|containers. :return: None ''' helpers = DiffHelpe...
from __future__ import absolute_import, division, print_function __metaclass__ = type import json from ansible.module_utils._text import to_text from ansible.module_utils.network.common.utils import to_list, ComplexList from ansible.module_utils.connection import Connection, ConnectionError from ansible.module_utils.c...
"""Subset of inspect module from upstream python We use this instead of upstream because upstream inspect is slow to import, and significantly contributes to numpy import times. Importing this copy has almost no overhead. """ from __future__ import division, absolute_import, print_function import types __all__ = ['...
"""Combines stripped libraries and incomplete APK into single standalone APK. """ import optparse import os import shutil import sys import tempfile from util import build_utils from util import md5_check def CreateStandaloneApk(options): def DoZip(): with tempfile.NamedTemporaryFile(suffix='.zip') as interme...
import datetime import os import subprocess import tarfile import tempfile import yaml from shutil import rmtree from urllib2 import urlopen from ansible import constants as C from ansible.errors import AnsibleError class GalaxyRole(object): SUPPORTED_SCMS = set(['git', 'hg']) META_MAIN = os.path.join('meta'...
from __future__ import absolute_import from django import template from django.conf import settings from django.contrib.auth.decorators import login_required, permission_required from django.shortcuts import get_object_or_404, render_to_response from django.views.decorators.csrf import csrf_protect import django_comm...
import os import json import helpers.musicHelper as musicHelper import helpers.usbHelper as usbHelper from Processor import Processor from state.stateEnum import StateEnum from blindle_exceptions.FileNotFoundException import FileNotFoundException from blindle_exceptions.PendriveDisconnectedException import PendriveDis...
""" Publish Build Stats. """ import os import subprocess from dogapi import dog_http_api from coverage_metrics import CoverageMetrics class PublishStats(object): """ Publish stats to DataDog. """ def __init__(self, api_key): dog_http_api.api_key = api_key @staticmethod def report_met...
# -*- coding: utf-8 -*- """Tests of Beautiful Soup as a whole.""" import logging import unittest import sys import tempfile from bs4 import ( BeautifulSoup, BeautifulStoneSoup, ) from bs4.element import ( CharsetMetaAttributeValue, ContentMetaAttributeValue, SoupStrainer, NamespacedAttribute, ...
#! /usr/bin/env python # -*- coding:utf8 -*- import os,sys #! /usr/bin/env python # -*- coding:utf8 -*- import MySQLdb as mdb conn=mdb.connect(host="localhost",user='root',passwd='abcxxx123',db='yjy_xiyizonghe',unix_socket='/tmp/mysql.sock') cursor=conn.cursor() def get_media_url_to_file(): try: cursor.execute("se...
import os import pip import sys import json from distutils.version import LooseVersion from django.core.management.base import NoArgsCommand from django_extensions.management.color import color_style from optparse import make_option from pip.req import parse_requirements from django_extensions.management.utils import ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supported_by': 'certified'} try: import boto.ec2.cloudwatch from boto.ec2.cloudwatch import MetricAlarm...
#!/usr/bin/env mayapy import unittest import os """ This module is for integrating pymel tests into a larger unittest framework. If you just wish to test pymel, use pymel_test instead. """ import sys import inspect gCantRun = False try: import nose except ImportError: gCantRun = True print('** nose modul...
""" Helper methods for operations related to the management of network records and their attributes like bridges, PIFs, QoS, as well as their lookup functions. """ from nova import exception from nova.i18n import _ def find_network_with_name_label(session, name_label): networks = session.network.get_by_name_labe...
import mock from oslo_config import cfg from neutron import context from neutron.quota import resource from neutron.quota import resource_registry from neutron.tests import base from neutron.tests.unit import quota as test_quota class TestResourceRegistry(base.DietTestCase): def setUp(self): super(Test...
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_, assert_equal, assert_array_almost_equal from scipy.special import lambertw from numpy import nan, inf, pi, e, isnan, log, r_, array, complex_ from scipy.special._testutils import FuncData def test_...
#!/usr/bin/env python import psycopg2 import os, sys host = '' #ClientIP, ClientMac, host-decl-name if (len(sys.argv) > 1): command = sys.argv[1] clientIP = sys.argv[2] clientMac = sys.argv[3] hostname = sys.argv[4] if command == "commit": f = open("/tmp/leases",'a') s = "Leased: %s to %s\n" % (clientIP, ...
from flask import flash, redirect, url_for, session from flask.ext.bcrypt import Bcrypt from flask.ext.openid import OpenID from flask_oauth import OAuth from flask.ext.login import LoginManager from flask.ext.principal import Principal, Permission, RoleNeed bcrypt = Bcrypt() oid = OpenID() oauth = OAuth() principals ...
import json from django.test.client import Client, RequestFactory from django.test.utils import override_settings from mock import patch, MagicMock from courseware.models import XModuleUserStateSummaryField from courseware.tests.factories import UserStateSummaryFactory from courseware.tests.modulestore_config import ...
import clv_person_wkf
from sympy.physics.quantum import Dagger, AntiCommutator, qapply from sympy.physics.quantum.fermion import FermionOp from sympy.physics.quantum.fermion import FermionFockKet, FermionFockBra def test_fermionoperator(): c = FermionOp('c') d = FermionOp('d') assert isinstance(c, FermionOp) assert isinst...
import datetime import os import logging import re import six from six.moves import cPickle import numpy as np import xarray as xr import pandas as pd import requests log=logging.getLogger('usgs_nwis') from ... import utils from .. import rdb from .common import periods try: import seawater except ImportError:...
try: import json except ImportError: import simplejson as json # NB: a copy of this function exists in ../../modules/core/async_wrapper.py. Ensure any # changes are propagated there. def _filter_non_json_lines(data): ''' Used to filter unrelated output around module JSON output, like messages from ...
#!/usr/bin/env python """ Subtract one set of genomic intervals from another (base-by-base or whole intervals). The returned GenomicIntervals will be in the order of the first set of intervals passed in, with the corresponding meta-data. """ import traceback import fileinput from warnings import warn from bx.interval...
import re, urllib from ..images import ImageBase ## # Image class for DjangoWikiSlide class class DjangoWikiImage(ImageBase): @staticmethod def validParams(): params = ImageBase.validParams() return params @staticmethod def extractName(match): return match.group(1).strip() ## # Constructor ...
#!/usr/bin/env python import os import time import select import subprocess import sys from optparse import OptionParser from requests.exceptions import ConnectionError sys.path.insert(0, '/srv/newsblur') os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' import fabfile NEWSBLUR_USERNAME = 'sclay' IGNORE_HOSTS = [ ...
from __future__ import unicode_literals from wtforms.form import Form from wtforms.validators import ValidationError from .fields import CSRFTokenField class SecureForm(Form): """ Form that enables CSRF processing via subclassing hooks. """ csrf_token = CSRFTokenField() def __init__(self, formd...
"""Dialog for filtering data.""" from __future__ import division, print_function from .. import qtall as qt4 from .. import document from ..qtwidgets.datasetbrowser import DatasetBrowser from .veuszdialog import VeuszDialog def _(text, disambiguation=None, context="FilterDialog"): """Translate text.""" retur...
import unittest from livefyre import Livefyre from livefyre.tests import LfTest from livefyre.src.api.domain import Domain class DomainTestCase(LfTest, unittest.TestCase): def setUp(self): super(DomainTestCase, self).setUp() self.network = Livefyre.get_network(self.NETWORK_NAME, self.NETWORK_KEY)...
from django.db import models from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from newspaperizer.settings import settings from django.core.files.storage import FileSystemStorage from people.models import Person config = settings.get('books', dict()) path = config.get('path', '')...
## \file ## \ingroup tutorial_pyroot ## This macro displays the physical ROOT file structure ## ## \macro_image ## \macro_code ## ## \author Wim Lavrijsen from ROOT import TCanvas, TPaveLabel, TPave, TLine, TArrow, TText, TPaveText from ROOT import gROOT c1 = TCanvas( 'c1', 'ROOT File description', 200, 10, 700, 550 ...
''' matrix: [[1, 2, 3], [4, 5, 6]] ''' def matrix_solid(h, w, v): m2 = [] for y in range(h): row = [] for x in range(w): row.push(v) m2.push(row) return m2 def matrix_via_cellfunc(h, w, f): m2 = [] for y in range(h): row = [] for x in r...
"""Account summary.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting COLUMNS = ['datacenter', 'hardware', 'virtual_servers', 'vlans', 'subnets', 'public_ip...
#!/usr/bin/env python import argparse import collections import logging import os import shutil import signal import StringIO import subprocess import sys import tempfile import threading import time import cdec import aligner import decoder import util # Dummy input token that is unlikely to appear in normalized da...
"""Example illustrating the use of Apache Beam for solving distributing optimization tasks. This example solves an optimization problem which consists of distributing a number of crops to grow in several greenhouses. The decision where to grow the crop has an impact on the production parameters associated with the gre...
from __future__ import with_statement import os import sys import shutil import unittest import tempfile import mock from libcloud.common.types import LibcloudError from libcloud.storage.base import Container from libcloud.storage.types import ContainerDoesNotExistError from libcloud.storage.types import ContainerAl...
import sys import argparse import ConfigParser from vnc_api.vnc_api import * class EncapsulationProvision(object): def __init__(self, args_str=None): self._args = None if not args_str: args_str = ' '.join(sys.argv[1:]) self._parse_args(args_str) self._vnc_lib = VncApi...
import httplib as http import json import responses import time import urlparse from nose.tools import * # noqa from framework.auth import authenticate from framework.exceptions import PermissionsError, HTTPError from framework.sessions import get_session from website.oauth.models import ( ExternalAccount, Ex...
from openerp import tools from openerp.osv import fields,osv from openerp.addons.decimal_precision import decimal_precision as dp class hr_timesheet_report(osv.osv): _name = "hr.timesheet.report" _description = "Timesheet" _auto = False _columns = { 'date': fields.date('Date', readonly=True), ...
import re from livestreamer.compat import urlparse from livestreamer.plugin import Plugin from livestreamer.plugin.api import http, validate from livestreamer.plugin.api.utils import parse_json, parse_query from livestreamer.stream import RTMPStream, HTTPStream SWF_LIVE_URL = "https://www.filmon.com/tv/modules/FilmOn...
""" Classes to support XML for channel devices http://libvirt.org/formatdomain.html#elementCharSerial """ from virttest.libvirt_xml import base from virttest.libvirt_xml import accessors from virttest.libvirt_xml.devices.character import CharacterBase class Channel(CharacterBase): __slots__ = ('source', 'targe...
import constants # 255: Control characters that usually does not exist in any text # 254: Carriage/Return # 253: symbol (punctuation) that does not belong to word # 252: 0 - 9 # Windows-1255 language model # Character Mapping Table: win1255_CharToOrderMap = ( \ 255,255,255,255,255,255,255,255,255,255,254,255,255,254,...
"""BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21) This is both an example of how WSGI can be implemented, and a basis for running simple web applications on a local machine, such as might be done when testing or debugging an application. It has not been reviewed for security issues, howev...
#!/usr/bin/python import os ###This class is used to handle (read/write) file/folder. class FileHandle(object): ''' classdocs ''' input_dir = "" output_file = "" old_file_path_list = [] #constructor def __init__(self,input_dir, output_file = ""): if input_dir is "": ...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, parse_duration, ) class HornBunnyIE(InfoExtractor): _VALID_URL = r'http?://(?:www\.)?hornbunny\.com/videos/(?P<title_dash>[a-z-]+)-(?P<id>\d+)\.html' _TEST = { ...
#!PYRTIST:VERSION:0:0:1 from pyrtist.lib2d import Point, Tri #!PYRTIST:REFPOINTS:BEGIN bbox1 = Point(-37.5826573705, 64.8614862385) bbox2 = Point(146.843632129, -72.3863575296) bg1 = Point(54.63065, -25.8746116667) bg2 = Point(132.618249036, -25.8746116667) fg1 = Point(25.9196635922, -64.5110530769) fg2 = Point(127.536...
__all__ = [ 'HTML5TreeBuilder', ] import warnings from bs4.builder import ( PERMISSIVE, HTML, HTML_5, HTMLTreeBuilder, ) from bs4.element import NamespacedAttribute import html5lib from html5lib.constants import namespaces from bs4.element import ( Comment, Doctype, NavigableStr...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.cloudstack im...
from __future__ import absolute_import from __future__ import unicode_literals from functools import reduce import six from .const import LABEL_CONTAINER_NUMBER from .const import LABEL_PROJECT from .const import LABEL_SERVICE class Container(object): """ Represents a Docker container, constructed from the...
#!/usr/bin/env python # -*- coding: latin-1 -*- from .py3k import PY3K, basestring, unicode # fpdf php helpers: def substr(s, start, length=-1): if length < 0: length=len(s)-start return s[start:start+length] def sprintf(fmt, *args): return fmt % args def print_r(array): ...
import getpass import re from collections import namedtuple from leap.bitmask.bonafide.provider import Api from leap.bitmask.bonafide.session import Session from pixelated.bitmask_libraries.certs import LeapCertificate from pixelated.bitmask_libraries.provider import LeapProvider from pixelated.config import arguments...
from ccdc import cassandra from pyspark.sql import SparkSession from pyspark.sql import Row from pyspark.sql.types import IntegerType from pyspark.sql.types import StringType from pyspark.sql.types import StructField from pyspark.sql.types import StructType def table(): """Cassandra tile table name""" re...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import pytest from django.core.exceptions import ValidationError from machina.core.db.models import get_model from machina.test.factories import ForumPermissionFactory from machina.test.factories import UserFactory from machina.test.factories import Use...
from traits.has_traits import MetaHasTraits from pychron.core.helpers.logger_setup import new_logger from pychron.core.helpers.strtools import camel_case, to_list REGISTRY = {} FUNC_REGISTRY = {} logger = new_logger('DeviceFunctionRegistry') class DeviceFunctionRegistry(object): def __init__(self, name=None, ...
from pychecker2 import TestSupport from pychecker2 import FormatStringChecks class FormatTestCase(TestSupport.WarningTester): def testGoodFormats(self): self.silent('def f(x):\n' ' return "%s" % x\n') self.silent('def f(x):\n' " return ('%s' + '%s') % ...
""" Czech-language mappings for language-dependent features of reStructuredText. """ __docformat__ = 'reStructuredText' directives = { # language-dependent: fixed u'pozor': 'attention', u'caution (translation required)': 'caution', # jak rozlisit caution a warning? u'code (translation require...
#!/usr/bin/env python # encoding: utf-8 """ install.py Created by Charles-Axel Dein on 2011-10-03. Copyright (c) 2011 Charles-Axel Dein. All rights reserved. """ import shutil import os import logging INSTALL_DIRECTORY = "~/Library/Scripts/Applications/Omnigraffle Pro/" SCRIPTS = ("ExportAllFiles", "ExportAllLayers"...
""" Monkey-patch the edX platform Here be dragons (and simians!) * USE WITH CAUTION * No, but seriously, you probably never really want to make changes here. This module contains methods to monkey-patch [0] the edx-platform. Patches are to be applied as early as possible in the callstack (currently lms/startup.py and...
# Django settings for pyjsDemo project. import os STATIC = str(os.path.join(os.path.dirname(__file__), 'media').replace('\\','/')) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', '<EMAIL>'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 's...
"""SCons.Tool.swig Tool-specific initialization for swig. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # #...
# This Python file uses the following encoding: utf-8 # (C) 2020 Muthiah Annamalai # This file is part of open-tamil project import string from tamil.utf8 import get_letters from tamil.numeral import num2tamilstr def normalize_numeral_text(text_tokens): """ Input @text_tokens = ["இரு","நண்பர்கள்","௹","100","கொ...
# -*- encoding: utf-8 -*- import json from urllib import urlencode from twisted.internet.defer import inlineCallbacks from vumi.utils import http_request, http_request_full from vumi.tests.helpers import VumiTestCase from vumi.transports.api import HttpApiTransport from vumi.transports.tests.helpers import Transport...
import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.arrays import BooleanArray from pandas.core.arrays.boolean import coerce_to_array def test_boolean_array_constructor(): values = np.array([True, False, True, False], dtype="bool") mask = np.array([False, False, Fals...
import os import argparse import os import shutil import subprocess def GetBuildEnvironments(): return { 'Windows2017' : { 'global_build_call' : 'msbuild ALL_BUILD.vcxproj', 'parallel_option' : ' -m:??', 'configs': ' -p:Configuration=??', ...
"""Random forest implementation in tensorflow.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # pylint: disable=unused-import,wildcard-import from tensorflow.contrib.tensor_forest.client import * from tensorflow.contrib.tensor_forest.data import * from t...
#!/usr/bin/env python ''' Takes the WEKA output files, and for each line, replaces the instance number with the corresponding protein tag, removes the error column, replaces the predictions column with the true/false probability columns, and outputs to the specified file. Here is an example of the headers of an input f...
#!/usr/bin/python import sys, os import re from optparse import OptionParser JNI_GET_METHOD = 'GetMethodID' def getJavaMethods(filePath): inputFile = file(filePath) lineNo = 1 javaMethods = list() # fine JNI_GET_METHOD line by line for line in inputFile: funcStart = line.find(JNI_GET_...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------------------------------------------------- # INFO: # ----------------------------------------------------------------------------------------------------------------------- """ Author: Evan Hub...
# -*- coding: utf-8 -*- """ Class for reading data from NeuroExplorer (.nex) Documentation for dev : http://www.neuroexplorer.com/code.html Depend on: scipy Supported : Read Author: sgarcia,luc estebanez """ import os import struct import numpy as np import quantities as pq from neo.io.baseio import BaseIO fro...
from __future__ import absolute_import from __future__ import print_function import mock from twisted.internet import defer from twisted.trial import unittest from buildbot.mq import base from buildbot.mq import connector from buildbot.test.fake import fakemaster from buildbot.util import service class FakeMQ(serv...
from nose.tools import * # from voorpretgen import * import voorpretgen from voorpretgen import filemanager from voorpretgen import main from voorpretgen import spotify import unittest import pprint def setup(): print "SETUP!" def teardown(): print "TEAR DOWN!" def test_basic(): print "I ...
"""Tests for expectations of behaviour from the Xen driver.""" from oslo.config import cfg from nova.compute import power_state from nova import context from nova.objects import instance as instance_obj from nova.openstack.common import importutils from nova.tests import fake_instance from nova.tests.virt.xenapi impo...
from __future__ import division, print_function, absolute_import __all__ = ['odeint'] from . import _odepack from copy import copy _msgs = {2: "Integration successful.", 1: "Nothing was done; the integration time was 0.", -1: "Excess work done on this call (perhaps wrong Dfun type).", -2: ...
# -*- coding: utf-8 -*- """ Server-Sent Events client. This file is part of the Pywikibot framework. This module requires sseclient to be installed: pip install sseclient """ # # (C) xqt, 2017 # (C) Pywikibot team, 2017 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, ...
# -*- coding: utf-8 -*- """ pygments.formatters.rtf ~~~~~~~~~~~~~~~~~~~~~~~ A formatter that generates RTF files. :copyright: Copyright 2006-2011 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter __all__ = ['RtfFormatter'] ...
""" Tests for L{twisted.web.twcgi}. """ import sys, os from twisted.trial import unittest from twisted.internet import reactor, interfaces, error from twisted.python import util, failure, log from twisted.web.http import NOT_FOUND, INTERNAL_SERVER_ERROR from twisted.web import client, twcgi, server, resource from twi...
from bpy import context CONTEXT = { 0: { 'title': "Error Message", 'icon': 'CANCEL' }, 1: { 'title': "Warning Message", 'icon': 'ERROR' # I prefer this icon for warnings }, 2: { 'title': "Message", 'icon': 'NONE' }, 3: { 'title': "Ques...