content
string
# -*- coding: utf-8 -*- import numpy as np from scipy import integrate import matplotlib # in cygwin matplotlib.use('Agg') from matplotlib.pylab import * def yfp_gfp(t, y): a = 80. k = 50. a1 = 20. a2 = 20. u1 = 20. u2 = 20. u3 = 20. u4 = 20. dna = 150. UVB = y[0] puvr8 ...
"""AoC Day 10 Usage: day10.py <filename> day10.py (-h | --help) day10.py --version Options: -h --help Show this screen. --version Show version. """ from docopt import docopt from collections import defaultdict class Instruction: def __init__(self, from_bot, low_type, low_id, high_type, high_i...
import unittest import numpy import chainer from chainer import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition class TestScale(unittest.TestCase): def setUp(self): self.x1 = numpy.r...
import sys from io import StringIO import pytest import logging from compiler import jam, lekvar, llvm from compiler.jam.lexer import Tokens, Lexer def test_lexer(): test = """# def:end )= def :def_end=new (return(a) # if=else-78_788_934_0 ///* ===<=>=<>!= defend+_- end""" # Expected output token typ...
# coding=utf-8 """ Implementation of exporting process to CSV functionality, as proposed in article "Spreadsheet-Based Business Process Modeling" by Kluza k. and Wisniewski P. """ from __future__ import print_function import copy import pandas as pd import re import six import bpmn_python.bmpn_python_consts as const...
import enum from typing import Optional from airflow.typing_compat import TypedDict class DagRunType(str, enum.Enum): """Class with DagRun types""" BACKFILL_JOB = "backfill" SCHEDULED = "scheduled" MANUAL = "manual" def __str__(self) -> str: # pylint: disable=invalid-str-returned retur...
""" Date editing module for Gramps. The EditDate provides visual feedback to the user to indicate if the associated GtkEntry box contains a valid date. Red means that the date is not valid, and will be viewed as a text string instead of a date. The DateEditor provides a dialog in which the date can be unambiguously b...
# -*- coding: utf-8 -*- import os import sys import urllib2 import requests import re from lxml import etree def StringListSave(save_path, filename, slist): if not os.path.exists(save_path): os.makedirs(save_path) path = save_path+"/"+filename+".txt" with open(path, "w+") as fp: ...
#!/usr/bin/env python """ CmpRuns - A simple tool for comparing two static analyzer runs to determine which reports have been added, removed, or changed. This is designed to support automated testing using the static analyzer, from two perspectives: 1. To monitor changes in the static analyzer's reports on real co...
from nupic.bindings.math import * from nupic.bindings.algorithms import * import sys import numpy import pylab import cPickle #-------------------------------------------------------------------------------- # Embed sequences - a utility to train a Grouper # # Embeds sequences passed into a random text of size text_s...
""" This pipeline allow to find the minimum value of each volume to apply a common offset """ import os import numpy as np from protoclass.data_management import T2WModality from protoclass.data_management import GTModality from protoclass.preprocessing import RicianNormalization from protoclass.preprocessing impor...
#!/usr/bin/env python """ Test Python Conversions.""" from __future__ import absolute_import from __future__ import print_function import redhawk import redhawk.python.python_tree_converter as P import redhawk.common.get_ast as G import redhawk.utils.key_value_store as KVStore import nose.tools import ast import gl...
from __future__ import print_function import sys import re import boto import argparse import json import threading import time import datetime from argparse import RawTextHelpFormatter from boto.kinesis.exceptions import ProvisionedThroughputExceededException import poster # To preclude inclusion of aws keys into t...
"""SK-learn grid-search and test scripts for Logistic Regression models""" __author__ = "Gabriel Urbain" __copyright__ = "Copyright 2017, Gabriel Urbain" __license__ = "MIT" __version__ = "0.2" __maintainer__ = "Gabriel Urbain" __email__ = "<EMAIL>" __status__ = "Research" __date__ = "September 1st, 2017" import pr...
import hexchat import random __module_name__ = 'Rainbows' __module_author__ = 'OverCoder' __module_version__ = '0.9' __module_description__ = 'Send each text with rainbow backgrounds' enabled = False def toggle(words, word_eols, userdata): global enabled enabled = not enabled if enabled: hexchat....
import sys def usage(): print("usage: cfpsplit.py HEADER") def main(): if len(sys.argv) != 2: usage() sys.exit(-1) try: hdrhex = int(sys.argv[1], 16) except Exception: print("HEADER must be in hexadecimal format") sys.exit(-1) if hdrhex > 0x1fffffff: ...
from __future__ import absolute_import from __future__ import print_function import ldap import ldap.cidict import ldap.filter import ldap.modlist import sys def record2entry(record): """ Mutates record into entry dictionary understandable by the library. """ return ldap.cidict.cidict({ 'obje...
from gettext import gettext as _ from gi.repository import GObject from gi.repository import Gtk from gi.repository import Gdk from gi.repository import Pango from gi.repository import WebKit from sugar3.graphics.toolbutton import ToolButton from sugar3.graphics import iconentry from sugar3.graphics.toolbarbox import...
#!/usr/bin/env python import argparse import pprint import glob import os # becode decoder from here http://effbot.org/zone/bencode.htm import re def tokenize(text, match=re.compile("([idel])|(\d+):|(-?\d+)").match): i = 0 while i < len(text): m = match(text, i) s = m.group(m.lastindex) ...
import json import os import unittest import numpy as np from scipy.sparse import csr_matrix import robotreviewer from robotreviewer.ml.classifier import MiniClassifier from robotreviewer.ml.vectorizer import ModularVectorizer from robotreviewer.ml.vectorizer import InteractionHashingVectorizer from robotreviewer.ml....
from collections import Counter import weakref from supplies.strings import splitcamel class Named: def __init__(self, *args, name, **kws): super().__init__(*args, **kws) self.name = name def __repr__(self): r = super().__repr__() return '{} ({})'.format(r, self.name) def...
import proto # type: ignore __protobuf__ = proto.module( package="google.ads.googleads.v8.errors", marshal="google.ads.googleads.v8", manifest={"ChangeStatusErrorEnum",}, ) class ChangeStatusErrorEnum(proto.Message): r"""Container for enum describing possible change status errors. """ class...
from setuptools import setup, find_packages setup( name='ants', version='0.0.1', url='https://github.com/wcong/ants', description='open source, distributed, restful crawler engine', long_description=open('README.rst').read(), author='wcong', maintainer='Wcong', maintainer_email='<EMAIL...
# -*- 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 'Redirect' db.create_table('django_redirect', ( ...
from shinytest import ShinyTestCase class TestShinyTypes(ShinyTestCase): def test_to_bool(self): from shinymud.models.shiny_types import to_bool self.assertTrue(to_bool('true')) self.assertTrue(to_bool('True')) self.assertTrue(to_bool(1)) self.assertTrue(to_bool('1')) ...
#!/usr/bin/env python #@+leo-ver=4-thin #@+node:tbrown.20070622094435.1:@thin pageframe.py """Create n-up SVG layouts""" #@+others #@+node:tbrown.20070622103716:imports import sys, inkex try: import xml.etree.ElementTree as ElementTree except: try: from lxml import etree as ElementTree except: ...
# -*- coding: utf-8 -*- import fauxfactory import pytest from cfme import test_requirements from cfme.automate.explorer.namespace import NamespaceAddView from cfme.utils.update import update pytestmark = [test_requirements.automate] @pytest.fixture( scope="module", params=["plain", "nested_existing"]) def p...
from elements import Twiss mytwiss = Twiss() mytwiss.betax = 6.85338806855804 mytwiss.alphax = 1.11230788371885 mytwiss.etax = 3.89188697330735e-012 mytwiss.etaxp = 63.1945125619190e-015 mytwiss.betay = 2.94129410712918 mytwiss.alphay = -1.91105724003646 mytwiss.etay = 0 mytwiss.etayp = 0 mytwiss.nemitx = 5.0880733958...
from .lin_op import LinOp def LinOpFactory(input_shape, output_shape, forward, adjoint, norm_bound=None): """Returns a function to generate a custom LinOp. Parameters ---------- input_shape : tuple The dimensions of the input. output_shape : tuple The dimensions of the output. ...
from __future__ import print_function """ Calendar Server principal management web UI. """ __all__ = [ "PrincipalsResource", ] from cStringIO import StringIO from zipfile import ZipFile from twistedcaldav.simpleresource import SimpleResource from twisted.internet.defer import inlineCallbacks, returnValue from ...
import urllib2 import codecs from bs4 import BeautifulSoup meta_inf = open('tokens.txt', 'r').read() def definition_for_table(table): result = '' options = table.find_all('tr') # Add the LHS of the definition. name = options[0].find_all('td') prefix = name[0].string.replace('-', '_') + ' ::= ' ...
from __future__ import unicode_literals import os import sys from inspect import getmro from warnings import warn import six from django.db import OperationalError from django.conf import global_settings as defaults from django.utils.module_loading import import_string from mezzanine.utils.deprecation import get_mid...
# encoding: utf-8 from nose.tools import assert_equal, assert_in from routes import url_for import ckan.plugins as plugins import ckan.tests.helpers as helpers import ckan.model as model from ckan.tests import factories webtest_submit = helpers.webtest_submit submit_and_follow = helpers.submit_and_follow custom_gro...
import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import matplotlib.cm as cm from random import * from pylab import * class Scatter: def __init__(self, dict_): self.fig = plt.figure(1) self.ax = self.fig.add_subplot(111, projection='3d') self.dict ...
from netbench.pattern_match.b_state import b_State from netbench.pattern_match.b_symbol import DEF_SYMBOLS from netbench.pattern_match.b_symbol import b_Symbol from netbench.pattern_match.sym_char import b_Sym_char from netbench.pattern_match.sym_char_class import b_Sym_char_class from netbench.pattern_match.sym_kchar ...
""" Import of ``clone``, ``BaseEstimator`` and ``TransformerMixin`` from Scikit-learn's ``base.py`` """ # License: BSD 3 clause import copy import warnings from collections import defaultdict import numpy as np from scipy import sparse from .. import six from ..funcsigs import signature __version__ = '0.19.1' #...
from sys import argv, exit from PIL import Image import sys sys.path.insert(0, '../caffe/python/') import caffe PREFIX_DIR = '' IN_DIR = PREFIX_DIR + 'maps/' OUT_DIR = PREFIX_DIR + 'data/' TESTS_DIR = PREFIX_DIR + 'tests/' TRAIN_DB_FILENAME = OUT_DIR + 'train.txt' MODEL_FILE = PREFIX_DIR + 'snapshots/_iter_100000...
import productstatus.api import productstatus.exceptions import json api = productstatus.api.Api( 'https://productstatus.met.no' ) # You can easily set up an event listener using the API client. The default operation is to block # until an event is received, or you can specify a timeout in the constructor. event...
from cntk import output_variable, FreeDimension from cntk.ops.functions import UserFunction import yaml import numpy as np import numpy.random as npr from utils.rpn.bbox_transform import bbox_transform from utils.cython_modules.cython_bbox import bbox_overlaps try: from config import cfg except ImportError: fr...
__all__ = [ 'AppCommandManager' ] import os import logging from os.path import join as pjoin from os.path import basename, splitext from collections import defaultdict from cliff.commandmanager import EntryPointWrapper from raxcli.commands import HelpCommand LOG = logging.getLogger(__name__) class AppCommand...
import argparse import logging import os import unittest from keras.layers import recurrent import numpy as np from shcomplete.model2correct import Seq2seq, generate_model, get_chars, train_correct from shcomplete.model2correct import generator_misprints, dislpay_sample_correction class DataGenerator(unittest.TestC...
import os import subprocess import datetime def termination_string(): """ Gets the current system time and appends it to a termination notice. """ now = datetime.datetime.now() time = now.strftime("%Y-%m-%d %H:%M:%S.%f") end_time = "Script exiting at %s\n" % time return end_time def run(lo...
#!/usr/bin/env python import sys import re import argparse import time # Set time Var dateTime = time.strftime("%d-%m-%Y %H:%M") # Arg Input (Like a pirate) p = argparse.ArgumentParser(description='Convert NetNTLM John Hashes to Hashcat Format') p.add_argument('-i','--hash',action='store_true',help='Enter one-time h...
#!/usr/bin/env python ''' Project: Geothon (https://github.com/MBoustani/Geothon) File: Vector/create_shp_point.py Description: This code creates a point shapefile from latitude and longitue. Author: Maziyar Boustani (github.com/MBoustani) ''' import os try: import ogr except ImportError:...
import decimal from django.core.serializers import json from django.db import models from django.http import HttpResponse from django.views.decorators.csrf import csrf_protect from django.contrib.auth.decorators import login_required from django.template import RequestContext from django.template.loader import render_...
# coding=utf-8 """Collection of OpenFOAM boundary conditions (e.g. wall, inlet, outlet).""" from copy import deepcopy from collections import OrderedDict from fields import AtmBoundaryLayerInletVelocity, AtmBoundaryLayerInletK, \ AtmBoundaryLayerInletEpsilon, Calculated, EpsilonWallFunction, FixedValue, \ Inlet...
""" Django settings for ade project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Selected(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scattercarpet" _path_str = "scattercarpet.selected" _valid_props = {"marker", "textfont"} ...
#coding:utf-8 import threading import time import datetime import json from urllib import unquote from django.http import HttpResponse, HttpRequest import simplejson import json from decimal import * from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response, redirect fro...
#! /usr/bin/python # -*- coding: utf-8 -*- ##==========## ## argument ## ##==========## import argparse import sys class ArgumentParser(argparse.ArgumentParser): def error(self, message): sys.stderr.write('error: %s\n' % message) self.print_help() sys.exit(2) class MyFormatter(argparse.Arg...
from settings import * S = Settings() def enum(**enums): return type('Enum', (), enums) Key = enum(X=1, Y=4, A=2, B=3, L1=5, R1=6, L2=7, R2=8, SELECT=9, HOME=10, UP=11, DOWN=12, LEFT=13, RIGHT=14, BACK=15, ENTER=16) TOTAL_KEYS = 17 _verbose = S.get('dev', 'debug') key_state = [False for i in range(...
#Creates a BPT diagram for all objects, and a second figure that shows objects for which single lines are low import numpy as np import matplotlib.pyplot as plt from astropy.io import ascii import sys, os, string import pandas as pd from astropy.io import fits import collections from astropy.cosmology import WMAP9 as c...
# third party software customized by goodcrypto from syr.surlex.grammar import Parser, RegexScribe, get_all_nodes, MacroTagNode from syr.surlex.macros import MacroRegistry, DefaultMacroRegistry import re class Surlex(object): def __init__(self, surlex, macro_registry=DefaultMacroRegistry()): self.translat...
# Programming karte hue hume “condition” likhne ki jaroorat padti hai. # Matlab ek variable ki value ke hisaab se hume alag alag cheezein karni hoti hai. # Maan lo hume apne hostel ke liye menu banana hai # Ab yeh example dekhte hai day = raw_input("Din enter karo\n") if day == "Monday": # Agar din Monday hai toh ...
''' Main file for setting up experiments, and compiling results. @authors: David Duvenaud (<EMAIL>) James Robert Lloyd (<EMAIL>) Roger Grosse (<EMAIL>) Created Jan 2013 ''' from collections import namedtuple from itertools import izip import numpy as np nax = np.newaxis import...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Slightly based on AboutModules in the Ruby Koans # from runner.koan import * class AboutMultipleInheritance(Koan): class Nameable: def __init__(self): self._name = None def set_name(self, new_name): self._name = new_name ...
import collections import os import sys import numpy try: from PIL import Image available = True except ImportError as e: available = False _import_error = e import chainer from chainer.dataset.convert import concat_examples from chainer.dataset import download from chainer import function from chaine...
"""Subclass of HPPFrame, which is generated by wxFormBuilder.""" import wx import maingui import hppserv class HPPEvent(wx.PyEvent): def __init__(self, pyEventId, msg=None): wx.PyEvent.__init__(self) self.SetEventType(pyEventId) self.msg = msg class WxQueue(object): def __init__(se...
from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from django.db import transaction from cloud_notes.models import Folder, Note, HashTags from django.contrib.auth.models import User import re class Command(BaseCommand): def handle(self, *args, **option...
"""Tests to ensure rl_utils calculations are correct.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import absltest import numpy as np from eager_pg import rl_utils class RLUtilsTest(absltest.TestCase): def test_calculate_returns...
import os import suds from OpenSSL import crypto from base64 import b64encode from pytrustnfe.xml import render_xml, sanitize_response from pytrustnfe.client import get_authenticated_client from pytrustnfe.certificado import extract_cert_and_key_from_pfx, save_cert_key from pytrustnfe.nfse.assinatura import Assinatura ...
from enigma import eEPGCache from Components.Converter.Converter import Converter from Components.Element import cached from Components.Converter.genre import getGenreStringSub from Components.config import config from Tools.Directories import resolveFilename, SCOPE_ACTIVE_SKIN from time import localtime, mktime, strf...
import time import threading import sublime import sublime_plugin # import .webfaction from .sublime_interactive.formatters import rectangle from .sublime_interactive.commands import SublimeInteractiveUpdateViewCommand from .sublime_interactive.event_listeners import SublimeInteractiveEventListener from .sublime_inte...
from web.core import request import djrq.middleware import web from djrq.model import * from basecontroller import BaseController class RootController(BaseController): from requestcontroller import RequestController from whatsnewcontroller import WhatsNewController from browsecontroller import BrowseContr...
#!/usr/bin/python3 import sys import os import string import subprocess def usage(): sys.stderr.write('Usage: %s filename\n' % sys.argv[0]) def main(): if len(sys.argv) != 2: usage() sys.exit(1) filename = sys.argv[1] lines = open(filename).read().split('\n') if os.path.exists('....
# -*- coding: utf-8 -*- import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import pyxb.binding.generate import pyxb.utils.domutils from xml.dom import Node import os.path xsd='''<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSch...
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, PickleType from sqlalchemy.schema import UniqueConstraint from neutron.db.models_v2 import model_base class VlanAllocation(model_base.BASEV2): """Represents allocation state of vlan_id on physical network.""" __tablename__ = 'ovs_vlan_alloc...
from flask import session, render_template from app import app from app.models import * def getUser(userName): query = Users.query.filter_by(username=userName) if query.count()>0: return query.first() return "No such user" @app.route('/SPA') def spa(): return render_template('SPA.html') ...
''' Last modified 3-20-2017, Matt Faytak. Praat script and portions of Python are from Jevon Heath, Stephen Ho, Michelle Ching. This script is a utility for processing TextGrid files in an ultrasound directory structure via Praat; it generates and stores in plaintext files a subject-specific list of audio files, as wel...
import distutils import os import pytest from google import showcase def test_pagination(echo): text = 'The hail in Wales falls mainly on the snails.' results = [i for i in echo.paged_expand({ 'content': text, 'page_size': 3, })] assert len(results) == 9 assert results == [showcase...
import unittest from rx import operators as ops from rx.testing import TestScheduler, ReactiveTest on_next = ReactiveTest.on_next on_completed = ReactiveTest.on_completed on_error = ReactiveTest.on_error subscribe = ReactiveTest.subscribe subscribed = ReactiveTest.subscribed disposed = ReactiveTest.disposed created =...
from typing import Optional, Tuple from solo.server.statuses import Http4xx from solo.server.definitions import HttpMethod from solo.server.runtime.dependencies import Runtime from ...server.request import Request from .util import as_sorted_tuple class RequestMethodPredicate: def __init__(self, val: Tuple[HttpM...
import six import pytest from flask import Flask from flask_apiblueprint import APIBlueprint @pytest.fixture def app(): app = Flask(__name__) app.config['TESTING'] = True return app @pytest.fixture def v1_blueprint(app): blueprint = APIBlueprint('v1', __name__, url_prefix='/v1') @blueprint.rou...
""" Handlers for project related API calls """ __copyright__ = """ Copyright (C) 2016 Potential Ventures Ltd This file is part of theopencorps <https://github.com/theopencorps/theopencorps/> """ __license__ = """ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero...
import os, struct import argparse, subprocess import getpass, platform from StringIO import StringIO from datetime import datetime from crc32 import CRC32 from elf import ELFObject class VersionInfo: format = "<II32s16s16s16s16s" git_cmd = "git describe --always --dirty" def __init__(self, elf): ...
import os from urllib.parse import quote import google.oauth2.credentials import requests from apiclient.http import MediaFileUpload from googleapiclient.discovery import build from googleapiclient.errors import HttpError import frappe from frappe import _ from frappe.integrations.doctype.google_settings.google_setti...
""" L{SFTPFile} """ from binascii import hexlify from collections import deque import socket import threading import time from paramiko.common import * from paramiko.sftp import * from paramiko.file import BufferedFile from paramiko.sftp_attr import SFTPAttributes class SFTPFile (BufferedFile): """ Proxy ob...
from __future__ import division, print_function import os import numpy as np from bisect import bisect import utils """ Rhythm features module. """ onsets_dir = '' beats_dir = '' def compute_and_write(data_dir, track_list=None, features=None): """Compute frame-based features for all audio files in a folder....
from sqlalchemy import * from sqlalchemy.types import TypeEngine from sqlalchemy.sql.expression import ClauseElement, ColumnClause,\ FunctionElement, Select, \ BindParameter from sqlalchemy.schema import DDLElement, CreateColumn, CreateTable from ...
import time, os, glob, string from .. import hook, bar, manager, xkeysyms, xcbq import base class NullCompleter: def actual(self, qtile): return None def complete(self, txt): return txt class GroupCompleter: def __init__(self, qtile): self.qtile = qtile self.thisfinal = N...
from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.contrib.loader import XPathItemLoader from scrapy.contrib.loader.processor import TakeFirst, Compose, MapCompose from scrapy.selector import HtmlXPathSelector from scrapy.utils.url import ...
from __future__ import division import waldo.backend from sqlalchemy import and_ from waldo.uniprot.models import Entry from waldo.translations.services import translate import urllib _translate = { 'EXP' : 'Inferred from Experiment', 'IDA' : 'Inferred from Direct Assay', 'IPI' : 'Inferred from...
"""Development settings and globals.""" from __future__ import absolute_import from os.path import join, normpath from .base import * ########## DEBUG CONFIGURATION # See: https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = False # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-de...
from msrest.serialization import Model class DiskInstanceView(Model): """The instance view of the disk. :param name: The disk name. :type name: str :param statuses: The resource status information. :type statuses: list of :class:`InstanceViewStatus <azure.mgmt.compute.compute.v2016_04_30_pre...
# -*- coding: utf-8 -*- """ This module contains the tool of uwosh.addcard """ import os from setuptools import setup, find_packages def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() version = '0.1' long_description = ( read('README.txt') + '\n' + 'Change histor...
from pprint import pprint from hpOneView.oneview_client import OneViewClient from config_loader import try_load_from_file config = { "ip": "<oneview_ip>", "credentials": { "userName": "<username>", "password": "<password>" } } # Try load config from a file (if there is a config file) confi...
import pandas import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from sklearn.cluster import KMeans from sklearn.manifold import TSNE features = [ "mean_of_the_integrated_profile", "standard_deviation_of_the_integrated_profile", "excess_kurtosis_of_the_integrated_pr...
""" rencode -- Web safe object pickling/unpickling. """ __version__ = '1.0.1' __all__ = ['dumps', 'loads'] # Original bencode module by Petru Paler, et al. # # Modifications by Connelly Barnes: # # - Added support for floats (sent as 32-bit or 64-bit in network # order), bools, None. # - Allowed dict keys to be ...
""" Unit tests for faulty data sets. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import unittest import ga4gh.datamodel.datasets as datasets import ga4gh.datamodel.references as references import ga4gh.datamodel.variants as variants impor...
import multiprocessing import os import sys import subprocess from distutils import sysconfig from distutils.command.build import build as DistutilsBuild from setuptools import setup, Extension def build_common(dynamic_library_extension): python_include = sysconfig.get_python_inc() python_library = os.path.jo...
''' computes a spanning tree for a point set s.t. it has low crossing number to the line set, using the multiplicative weights method ''' from spanningtree.highdimgraph import crossing def add_edge_to_solution_merge_ccs(graph, i, j): ccs = graph.connected_components cci = ccs.get_connected_component(i) cc...
#!/usr/bin/python """Generate cartesian product of experiment variables for execution""" import redis import itertools from pprint import pprint import subprocess import json GROUPS = [] CMDS = [] REPLACE_STR = '$exp' from settings import * r = redis.StrictRedis(host=REDIS_ENDPOINT, port=REDIS_PORT, ...
from openstack import resource class RoleDomainUserAssignment(resource.Resource): resource_key = 'role' resources_key = 'roles' base_path = '/domains/%(domain_id)s/users/%(user_id)s/roles' # capabilities allow_list = True # Properties #: name of the role *Type: string* name = resourc...
""" OVSappctlFdbShowBridge - command ``/usr/bin/ovs-appctl fdb/show [bridge-name]`` =============================================================================== This module provides class ``OVSappctlFdbShowBridgeCount`` to parse the output of command ``/usr/bin/ovs-appctl fdb/show [bridge-name]``. Sample command o...
"""TFX Tuner component definition.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from typing import Any, Dict, NamedTuple, Optional, Text from kerastuner.engine import base_tuner from tfx import types from tfx.components.tuner import executor from tfx...
"""Tests for stack.py.""" import pytest @pytest.fixture def sample_stack(): """Create testing stacks.""" from stack import Stack one_stack = Stack([1]) empty_stack = Stack() new_stack = Stack([1, 2, 3, 4, 5]) return one_stack, empty_stack, new_stack def test_stack_empty_length(): """Tes...
#!/usr/bin/env python2 """Download images from a reddit.com subreddit.""" from __future__ import print_function import os import re import StringIO import sys import logging from urllib2 import urlopen, HTTPError, URLError from httplib import InvalidURL from argparse import ArgumentParser from os.path import ( ex...
from boto.pyami.config import Config, BotoConfigLocations from boto.storage_uri import BucketStorageUri, FileStorageUri import os, re, sys import logging import logging.config from boto.exception import InvalidUriError __version__ = '2.0b1' Version = __version__ # for backware compatibility UserAgent = 'Boto/%s (%s)'...
#!/usr/bin/env python # coding=utf-8 import unittest from src.stats_manager import StatsManager from src.stats_manager import format_column from src.stats_manager import format_columns class TestStatsManager(unittest.TestCase): def setUp(self): self.mgr = StatsManager() def test_initialize(self): ...
__doc__ = "" __version__ = "1.0.0" __author__ = "Fabien Marteau <<EMAIL>>" from project import Project from bus import Bus from component import Component from generic import Generic from hdl_file import Hdl_file from interface import Interface from pin import Pin from platform import...