content
string
from openerp import fields, models class MedicalInsurancePlan(models.Model): _inherit = 'medical.insurance.plan' person_num = fields.Integer('Person Number')
#!/usr/bin/env python # -*- coding: utf-8 -*- """ The server module is responsible for keeping track of the connections, and send the messages to the parser. """ import threading import select import socket import Queue import logging import random import sys from parser import Parser from tcp_client import TCPClient...
#!/usr/bin/python3 """ Terminal program to convert Trello's json-exports to markdown. See: https://github.com/phipsgabler/trello2md """ import sys import argparse import json import re # a url in a line (obligatory starting with the protocol part) find_url = re.compile('(^|.* )([a-zA-Z]{3,4}://[^ ]*)(.*)$') #####...
from collections import UserList import pygame from attr import attrib, attrs import assets from assets.animation import FrameType from .entity import Entity from .graphics import Frame from .movement import Direction from .state import AnimationState, State from .system import SystemFlag def get_blood_frames( ...
#!/usr/bin/python # # Find all the two-word compound words in a dictionary. A two-word # compound word is a word in the dictionary that is the concatenation # of exactly two other words in the dictionary. Assume input will be a # number of lowercase words, one per line, in alphabetical order, # numbering around, say, 1...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Various utitity methods... """ import inspect import traceback verbose = False def stripUsername(username): if username[0:1] in ['@', '%', '!']: username = username[1:] return username def write(text, outputType="*", priority=1): """Write out t...
import os import copy import subprocess import collections import hashlib import functools import numpy from lazyflow.rtype import Roi, SubRegion from lazyflow.graph import Operator, InputSlot, OutputSlot, OrderedSignal from lazyflow.utility import BigRequestStreamer from lazyflow.utility.io.blockwiseFileset import B...
#!/usr/bin/env python2 from __future__ import print_function import sys, argparse, re __author__ = 'Kumar' coords_file = "" #out_prefix = ("" for i in range(2)) ref_map, filter_map = ({} for i in range(2)) ref_start, ref_end, qry_start, qry_end, pid, ref, qry, ref_len, qry_len = ([] for i in range(9)) def string_to_...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import division import numbers from datetime import date, datetime, time, timedelta from fractions import Fraction from _common import (MICROSECONDS_IN_SECOND, MICROSECONDS_IN_MINUTE, MICROSECONDS_IN_HOUR, MICROSECONDS_IN_DAY, ...
from __future__ import absolute_import, unicode_literals import logging import pprint import time import traceback from flask import appcontext_tearing_down, current_app, g, has_request_context, request, request_tearing_down from sqlalchemy.engine import Engine from sqlalchemy.event import listens_for from indico.co...
#!/bin/python # -*- coding: utf-8 -*- # Fenrir TTY screen reader # By Chrys, Storm Dragon, and contributers. from fenrirscreenreader.core import debug import time class command(): def __init__(self): pass def initialize(self, environment): self.env = environment self.env...
from copy import copy from utils.log import log from req import Service class BaseService: def __init__(self): self.db = Service.db self.form_validation = Service.form_validation self.log = Service.log def gen_insert_sql(self, tablename, _data): data = copy(_data) for c...
from __future__ import division import copy from operator import attrgetter from ryu import cfg from ryu.base import app_manager from ryu.base.app_manager import lookup_service_brick from ryu.controller import ofp_event from ryu.controller.handler import MAIN_DISPATCHER, DEAD_DISPATCHER from ryu.controller.hand...
from django.test import TestCase from mock import patch import six import silk from silk.profiling.dynamic import _get_module, _get_parent_module, profile_function_or_method from .util import mock_data_collector class TestGetModule(TestCase): """test for _get_module""" def test_singular(self): modu...
import unittest from flask import Flask, current_app from flask_selfdoc import Autodoc class TestErrorHandling(unittest.TestCase): def test_app_not_initialized(self): app = Flask(__name__) autodoc = Autodoc() with app.app_context(): with current_app.test_request_context(): ...
# coding: utf-8 """ Qc API Qc API # noqa: E501 The version of the OpenAPI document: 3.0.0 Contact: <EMAIL> Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import datetime import telestream_cloud_qc from telestream_cloud_qc.models.modify...
__author__ = 'James DeVincentis <<EMAIL>>' import json from ..parser import Parser class Json(Parser): def __init__(self): # Try and parse the JSON data, this is one instance where we have to load it all raw = self.file.read() if raw.startswith('{') and raw.endswith('}'): ra...
#!/usr/bin/env python import logging import argparse from intervaltree import IntervalTree, Interval from cpt_gffParser import gffParse, gffWrite from Bio.SeqRecord import SeqRecord from Bio.Seq import Seq logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) def validFeat(rec): for feat in re...
import fileinput import shlex import sys import argparse from phyltr.plumbing.sources import NewickParser from phyltr.plumbing.sinks import NewickFormatter class PhyltrCommand(object): source = NewickParser sink = NewickFormatter __options__ = [] # Derived classes should add parser arguments here. ...
import gzip import paddle.v2.dataset.flowers as flowers import paddle.v2 as paddle import reader import vgg import resnet import alexnet import googlenet import argparse DATA_DIM = 3 * 224 * 224 CLASS_DIM = 102 BATCH_SIZE = 128 def main(): # parse the argument parser = argparse.ArgumentParser() parser.ad...
import os import tempfile from integration_tests import AgentlessTestCase from integration_tests.framework.constants import CLOUDIFY_USER from integration_tests.tests.utils import get_resource as resource from manager_rest.constants import DEFAULT_TENANT_NAME class TestScriptMapping(AgentlessTestCase): def tes...
import random def possible_moves(problem): current = current_state(problem) possibles = [] for i in range(0, len(problem.datastructs)): for j in range(0, len(problem.membanks)): if problem.X[i][j] == False: remaining_capacity = problem.membanks[j]['capacity'] for ai in range(0, len(problem.datastructs...
# -*- coding: utf-8 -*- """Extract and parse MPEG7 Video Signatures. Hash based on MPEG7 FARMES""" import random import subprocess import sys from os.path import basename, dirname, exists from statistics import mode from typing import Tuple import imageio_ffmpeg import iscc from loguru import logger as log from lxml im...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from jinja2 import Environment, FileSystemLoader, select_autoescape from datetime import datetime from flask import Flask, request import json import os import RPi.GPIO as gpio from time import sleep from pymongo import MongoClient import logging import threading from py...
# coding: utf-8 from __future__ import absolute_import from google.appengine.ext import ndb from api import fields import config import model import util class Config(model.Base, model.ConfigAuth): analytics_id = ndb.StringProperty(default='', verbose_name='Tracking ID') announcement_html = ndb.TextProperty(de...
#!/usr/bin/env python # # Usage: # run from shell, or # % python <this_file.py> # You may need to put EXOSIMS in your $PYTHONPATH, e.g., # % PYTHONPATH=/path/to/exomissionsim <this_file.py> r"""MissionSim module unit tests Michael Turmon, JPL, Apr. 2016 """ import os import json import unittest from EXOSIMS.Mi...
#!/usr/bin/env python # coding: utf-8 # Eclipse Detection # ============================ # # Setup # ----------------------------- # Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the lates...
import sys import syslog import configparser import pycurl import pypad from io import BytesIO def eprint(*args,**kwargs): print(*args,file=sys.stderr,**kwargs) def ProcessPad(update): n=1 section='Url'+str(n) while(update.config().has_section(section)): if update.shouldBeProcessed(section): ...
import madanalysis.IOinterface.text_file_writer as TextFileWriter from madanalysis.enumeration.color_type import ColorType from madanalysis.enumeration.font_type import FontType from madanalysis.enumeration.script_type import ScriptType from madanalysis.IOinterface.text_report import TextReport import logging import t...
import argparse import os from config import Main import instrumentation_results_manager as manager import doit_manager import run_cmds class FiddleArgParser(argparse.ArgumentParser): def __init__(self, name="", plugin=None, arg_parsers=[]): self.name = name parser = argparse.Argu...
"""Utilities for choosing which member of a replica set to read from.""" from collections import abc from pymongo import max_staleness_selectors from pymongo.errors import ConfigurationError from pymongo.server_selectors import (member_with_tags_server_selector, secondary_with_ta...
# coding: spec from harpoon.errors import ImageDepCycle from harpoon.layers import Layers from noseOfYeti.tokeniser.support import noy_sup_setUp, noy_sup_tearDown from tests.helpers import HarpoonCase import mock import six if six.PY3: from itertools import zip_longest else: def zip_longest(lst1, lst2): ...
from utils import * from team import Team class Game(): def __init__(self, id=None, homeTeam=None, visitors=None, homeScore=0, visitorScore=0, periods=None, scheduledTime=None, startTime=None, endTime=None, status=0, feeds={}, comment='', season=None): self.id = id self.homeTeam = Team(homeTeam) self.vis...
def explore(lines): y = 0 x = lines[0].index('|') dx = 0 dy = 1 answer = '' steps = 0 while True: x += dx y += dy if lines[y][x] == '+': if x < (len(lines[y]) - 1) and lines[y][x+1].strip() and dx != -1: dx = 1 dy = 0 ...
"""Utilities for unit testing""" import os import sys import stat import tempfile import unittest import logging import types from ganeti import utils def GetSourceDir(): return os.environ.get("TOP_SRCDIR", ".") def _SetupLogging(verbose): """Setupup logging infrastructure. """ fmt = logging.Formatter("%...
AID_DB = ( { 'name':'visa', 'print_name':'VISA', 'code':[0xa0,0x00,0x00,0x00,0x03], 'child':( { 'name':'debit_credit', 'print_name':'Debit/Credit', 'code':[0x10,0x10] }, { 'name':'electron', 'print_name':'Electron', 'code':[0x20,0x10] }, { 'name':'v_pay', 'print_n...
# -*- coding: utf-8 -*- from openerp import api, models class OffspringReport(models.AbstractModel): _name = 'report.livestock.offspring_report' @api.multi def render_html(self, data=None): report_obj = self.env['report'] target_obj = self.env['livestock.animal'] report = report_...
from __future__ import print_function, absolute_import, division import _pygaussian import f90wrap.runtime import logging class Gaussianstuff(f90wrap.runtime.FortranModule): """ Module gaussianstuff Defined at gaussian.F90 lines 4-789 """ @f90wrap.runtime.register_class("gaussian") ...
import unittest from dosbox.command.invoker import * from dosbox.filesystem.drive import * from tests.command.library.cmd_mock import * from tests.console.mock_outputter import * class InvokerTestCase(unittest.TestCase): def setUp(self): self.invoker = Invoker() self.outputter = MockOutputter()...
from __future__ import unicode_literals from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions from django.contrib.auth import get_user_model from ...
""" These managers handles the """ from django.db import models from django.db.models import Q from src.typeclasses.managers import returns_typeclass_list, returns_typeclass _GA = object.__getattribute__ _PlayerDB = None _ObjectDB = None _ChannelDB = None _SESSIONS = None # error class class CommError(Exception): ...
import logging import struct from ingest import Ingest from appAux import loadFile import pyregf from AmCacheParser import _processAmCacheFile_StringIO import settings import ntpath logger = logging.getLogger(__name__) # Module to ingest AmCache data # File extension must be '.hve' # Hostname = File name # Note: Exact...
# This file is formatted with black. # https://github.com/psf/black import os import json import subprocess import sys # Current commit if os.environ.get("TRAVIS"): COMMIT = os.environ["TRAVIS_COMMIT"] else: # For local dev proc = subprocess.run( ["git", "rev-parse", "HEAD"], capture_output=True,...
# -*- coding: utf-8 -*- """Unit tests for generic score/LM tests and conditional moment tests Created on Mon Nov 17 08:44:06 2014 Author: Josef Perktold License: BSD-3 """ import numpy as np from numpy.testing import assert_allclose from statsmodels.regression.linear_model import OLS from statsmodels.stats._diagno...
from wader.common.consts import WADER_CONNTYPE_USB from core.hardware.huawei import HuaweiWCDMADevicePlugin class HuaweiE180(HuaweiWCDMADevicePlugin): """:class:`~core.plugin.DevicePlugin` for Huawei's E180""" name = "Huawei E180" version = "0.1" author = u"Pablo Martí" __remote_name__ = "E180" ...
from qutip import * from numpy import * from time import time def test_15(N=1.0): """ mcsolve_f90 evolution of 8-spin chain """ test_name='8-spin MC_F90 [256]' N = 8# number of spins # uniform parameters h = 1.0 * 2 * pi * ones(N) Jz = 0.1 * 2 * pi * ones(N) Jx = 0.1 * 2 * pi * on...
## util.py ## Author: Yangfeng Ji ## Date: 09-13-2014 ## Time-stamp: <yangfeng 09/16/2014 13:09:09> from scipy.sparse import lil_matrix def label2action(label): """ Transform label to action """ items = label.split('-') if len(items) == 1: action = (items[0], None, None) elif len(items) ==...
#!/usr/bin/env python3 """ Unit tests for MetSim """ import os import subprocess import tempfile from collections import OrderedDict import numpy as np import pandas as pd import pytest import xarray as xr import metsim.cli.ms as cli import metsim.metsim from metsim.metsim import MetSim from metsim import io class...
import logging import os import pytest import retrying import test_util.aws import test_util.helpers from test_util.helpers import retry_boto_rate_limits log = logging.getLogger(__name__) ENV_FLAG = 'ENABLE_RESILIENCY_TESTING' skip_if_resiliency_not_enabled = pytest.mark.skipif( ENV_FLAG not in os.environ or o...
from __future__ import unicode_literals from django.conf import settings from django.conf.urls import patterns, url from django.core.urlresolvers import RegexURLResolver, Resolver404, NoReverseMatch from django.http import HttpResponse from django.utils import unittest from multiurl import multiurl, ContinueResolving ...
import re import sys import sickbeard import urllib import datetime from dateutil import parser from sickbeard.common import USER_AGENT, Quality from sickrage.helper.common import dateFormat, dateTimeFormat class SickBeardURLopener(urllib.FancyURLopener): version = USER_AGENT class AuthURLOpener(SickBeardURL...
#!/usr/bin/env python # -*- encoding: utf-8 -*- '''Miscellaneous utility tests''' import pytest import numpy as np import pumpp from pumpp import ParameterError xfail = pytest.mark.xfail @pytest.mark.parametrize('dtype', [int, np.int64, pytest.param('not a type',...
sharp=u"\u266f" flat=u"\u266d" # chord catalog chords = [ ("Triads",[ ["Major", "", ["1","3","5"]], ["Minor", "m", ["1","b3","5"]], ["Augmented", "+", ["1","3","#5"]], ["Diminished", "dim", ["1","b3","b5"]], ["Suspended", "sus4", ["1","4","5"]], ["Major, flatted fifth", "("+fla...
''' Created on Dec 14, 2013 @author: xapharius ''' import unittest import numpy as np from algorithms.linearRegression import LinearRegressionFactory from algorithms.linearRegression import LinearRegression from mrjob.protocol import JSONProtocol from numpy.testing.utils import assert_equal from numpy.ma.testutils imp...
"""Module with rights related methods. """ __authors__ = [ '"Sverre Rabbelier" <<EMAIL>>', ] from soc.logic import dicts class Checker(object): """Checker class that maps from prefix and status to membership. """ SITE_MEMBERSHIP = { 'admin': [], 'restricted': ['host'], 'member': ['user...
from typing import Optional from datetime import datetime from django.core.urlresolvers import reverse from django.utils.safestring import mark_safe from titlecase import titlecase as titlecase_external DEFAULT_HEAD_LENGTH = 2 NB_HYPHEN = '‑' NBSP = '\u00A0' # non-breaking white-space """ Links and anchors """ ...
#!/usr/bin/env python3 from sklearn.cluster import DBSCAN from ..helper import mkdir_p import matplotlib.pyplot as plt from collections import defaultdict import os def get_colors_list(df, id): idx = list(map(int, list(df[df.pw == id].x1))) clrs = list(df[df.pw == id].x2) ordered_clrs = [x for _, x in s...
# coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed 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 copy of the License at ...
class Node(): def __init__(self, val, left=None, right=None): self.val = val self.left = left self.right = right class BinaryTree(): def __init__(self): self.root = Node(5) node1_0 = Node(2) node1_1 = Node(3) node2_0 = Node(-1) node2_1 = Node(4) ...
import time import re import random import os import chardet # extra supybot import supybot.ircmsgs as ircmsgs import supybot.conf as conf import supybot.schedule as schedule # stock supybot import supybot.utils as utils from supybot.commands import * import supybot.plugins as plugins import supybot.ircutils as ircutil...
#coding: utf-8 from django import template from django.template.loader import render_to_string from easy_maps.models import Address from django.conf import settings register = template.Library() @register.tag def easy_map(parser, token): """ The syntax: {% easy_map <address> [<width> <height>] [<zoom>...
import os import argparse from migen import * from litex_boards.platforms import kc705 from litex.soc.cores.clock import * from litex.soc.integration.soc_core import * from litex.soc.integration.builder import * from litex.soc.cores.led import LedChaser from litedram.modules import MT8JTF12864 from litedram.phy imp...
__author__ = 'dmergens' import sys from mi.core.log import get_logger from mi.dataset.dataset_driver import DataSetDriver from mi.dataset.parser.glider import GliderParser class ParadMDriver: def __init__(self, base_python_code_path, source_file_path, particle_data_handler_object, config): sel...
''' Created on 2009-09-22 @author: beaudoin This module contains classes representing different possible type of data members within proxy object. A member knows how to get/set itself from/to the wrapped object. ''' import MathLib import PyUtils class TopLevel(object): def __init__(self, type...
import logging, time, re from autotest_lib.client.common_lib import error from autotest_lib.client.virt import virt_utils, virt_test_utils, aexpect def run_vlan(test, params, env): """ Test 802.1Q vlan of NIC, config it by vconfig command. 1) Create two VMs. 2) Setup guests in 10 different vlans by v...
""" @file base.py Contains the functions that compute the features calculate filterbank features. Provides e.g. fbank and mfcc features for use in ASR applications Author: James Lyons 2012 """ import numpy import sigproc from scipy.fftpack import dct from scipy.ndimage import convolve1d import scipy.signal import s...
from rest_framework.urlpatterns import format_suffix_patterns from django.urls import re_path from apis.runs import views from polycommon.apis.urls import runs runs_urlpatterns = [ re_path(runs.URLS_RUNS_DETAILS, views.RunDetailView.as_view()), re_path(runs.URLS_RUNS_RESTART, views.RunRestartView.as_view()),...
"""SDBIN data item.""" from .. import variables from .base import DataItemBase class SDBIN(DataItemBase): """ Send bin information. :Types: :class:`Binary <secsgem.secs.variables.Binary>` :Length: 1 **Values** +-------+---------------------------+-----------------------------------...
#!/usr/bin/python import asm, csv, datetime, sys """ Import script for Pets In Need custom access db 15th December, 2014 """ # For use with fields that just contain the sex def getsexmf(s): if s.startswith("MALE"): return 1 elif s.startswith("FEMALE"): return 0 else: return 2 de...
#!/usr/bin/env python3 import glob import os import sys import django from django.conf import settings from django.core.management import execute_from_command_line BASE_DIR = os.path.abspath(os.path.dirname(__file__)) sys.path.append(os.path.abspath(os.path.join(BASE_DIR, '..'))) # Unfortunately, apps can not be in...
# coding: utf-8 import logging import os import sys from pushover import Pushover from pushover.utils import setup_argparser, setup_logger, parse_config #: Module logger log = logging.getLogger(__name__) #: Default configuration path DEFAULT_CONFIG = '~/.pushover.conf' def main(): """ `pushover` command. ...
from __future__ import absolute_import import sys import textwrap from distutils.spawn import find_executable from gi.repository import Gtk, GLib from . import Utils, Actions, Constants from ..core import Messages class SimpleTextDisplay(Gtk.TextView): """ A non user-editable gtk text view. """ de...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import re import textwrap from contextlib import closing from xml.etree import ElementTree from pants.backend.jvm.subsystems.scala_platform import ScalaPlat...
"""Test the Met integration init.""" from homeassistant.components.met.const import ( DEFAULT_HOME_LATITUDE, DEFAULT_HOME_LONGITUDE, DOMAIN, ) from homeassistant.config import async_process_ha_core_config from homeassistant.config_entries import ( ENTRY_STATE_LOADED, ENTRY_STATE_NOT_LOADED, ENTR...
#!/usr/bin/python #Andrew Hannebrink #This is a configuration file written in Python source code for ease of manipulation. Save it at /usr/local/etc/dhcpcfg.py. This file is read when dhcplog.py, dhcpsearch.py, rest.py, and dhcppurge.py run. These parameters are necessary for the program to work, and may contain sensi...
import idaapi import idautils import idc from ..core import fix_addresses from .xref import Xref from .instruction import Instruction from ..ui import updates_ui from .base import get_selection, get_offset_name, demangle from .. import data class Comments(object): """IDA Line Comments Provides easy access to...
#!/usr/bin/python """ Calendar Events. Copyright (c) 2015 Kauinoa License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use,...
"""Dump statistics about each word in the index. usage: wordstats.py data.fs [index key] $Id$ """ from ZODB.Storage.FileStorage import FileStorage def main(fspath, key): fs = FileStorage(fspath, read_only=1) db = ZODB.DB(fs) rt = db.open().root() index = rt[key] lex = index.lexicon idx = in...
__all__ = [ 'HelpOperation', 'ListOperation', 'UploadOperation', 'DownloadOperation', 'InfoOperation', 'DeleteOperation', ] from .help import HelpOperation from .list import ListOperation from .upload import UploadOperation from .download import DownloadOperation from .info import InfoOperation ...
"""A fake implementation for the `scandir` function working with FakeFilesystem. Works with both the function integrated into the `os` module since Python 3.5 and the standalone function available in the standalone `scandir` python package. """ import os import sys from pyfakefs.extra_packages import use_scandir_packa...
from Products.CMFCore.interfaces import ISiteRoot from Products.CMFCore.WorkflowCore import WorkflowException from Acquisition import aq_inner from Products.CMFPlone import utils from Products.CMFPlone.browser.interfaces import INavigationBreadcrumbs from Products.CMFPlone.interfaces import IHideFromBreadcrumbs from Pr...
import subprocess from prj_generator import SafeWriteFile from common_names import * def build_apps(plats = "S60v3"): cmd = subprocess.Popen('bldmake bldfiles', stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=plats, shell=True) out, err = cmd.communicate() cmd1 = subprocess.Popen('abld build gcce urel', ...
import eHive import os import sys import subprocess import string import random import glob from Coord import * def random_generator(size=6, chars=string.ascii_uppercase + string.digits): return ''.join(random.choice(chars) for x in range(size)) class SplitVCF(eHive.BaseRunnable): """Split a VCF into chunks c...
from .base import BaseWidget, BaseGroupWidget from .manager import WidgetManager from .dialog import DialogWindow, DialogOpenerCommand from .widgets import *
import re import csv import logging from MsgPackConnection import * import tempfile import time import os import subprocess from math import isnan from math import sqrt from sklearn.linear_model.base import LinearModel def studentize(values): n = len(values) arith_mean = sum(values)/n variance = sqrt(1.0/n...
import lib.result_functions_file as RFF import lib.maglib as MSG import lib.graphicsData as drawGraphic import datetime import numpy #这个库是用来统计某个词语的频率变化并以折线统计图的形式显示 #这是tieba-zhuaqu项目的用户端基本插件 #该函数是可定义的显示函数(慎用) #参数说明:word:要统计的词语 scale:时间段(单位:天) datelist:贴吧帖子元数据 def singleWordTF(word,datalist,scale=30): #实现解析时间线,获取最小...
""" Evaluate PFAM and TIGRFAM HMMs when applied to ORFs and full genomes. """ __author__ = 'Donovan Parks' __copyright__ = 'Copyright 2013' __credits__ = ['Donovan Parks'] __license__ = 'GPL3' __version__ = '1.0.0' __maintainer__ = 'Donovan Parks' __email__ = '<EMAIL>' __status__ = 'Development' import os from check...
import numpy as np import theano import theano.tensor as T from pylearn2.models.mlp import Layer from pylearn2.utils import wraps, sharedX class NormalizingLayer(Layer): def __init__(self, layer_name, denoms): self.layer_name = layer_name self.ndenoms = len(denoms) self.denoms = sharedX(den...
import cStringIO import operator def indent(rows, hasHeader=False, headerChar='-', delim=' | ', justify='left', separateRows=False, prefix='', postfix='', wrapfunc=lambda x: x): """Indents a table by column. - rows: A sequence of sequences of items, one sequence per row. - hasHeader: True...
""" The itty-bitty Python web framework. Totally ripping off Sintra, the Python way. Very useful for small applications, especially web services. Handles basic HTTP methods (PUT/DELETE too!). Errs on the side of fun and terse. Example Usage:: from itty import get, run_itty @get('/') def index(reque...
from __future__ import print_function from builtins import int import sys import gettext gettext.install('rktool', './lang', True) from librksv import depexport from librksv import depparser from librksv import receipt from librksv import utils def usage(): print("Usage: ./merge.py [nomerge] <input file 1> <inp...
# -*- coding: utf-8 -*- """ *************************************************************************** ConfigDialog.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **************************...
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.network.panos....
# -*- coding: utf-8 -*- """ /*************************************************************************** SLD4rasterDialog A QGIS plugin Generates SLD (Styled Layer Descriptor) for raster layers. Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/ ...
"""Added document uploads and team deletion Revision ID: 735063d71b57 Revises: 76e2905cff66 Create Date: 2017-11-26 00:16:52.930412 """ # revision identifiers, used by Alembic. revision = '735063d71b57' down_revision = '76e2905cff66' branch_labels = None depends_on = None from alembic import op import sqlalchemy as ...
from tp.netlib.objects import OrderDescs from tp.client.objectutils import getResources constraints = """player(int,unicode) subtype(int,int) name(int,unicode) size(int,int) pos(int,int,int,int) vel(int,int,int,int) contains(int,int) universe(int) galaxy(int) star(int) planet(int) fleet(int) wormhole(int) start(int,in...
from flask import send_file from blakearchive import app, models, services, config # from test.mock import MockBlakeDataService # Configuration for local test runs belongs here app.config["DEBUG"] = True app.config["SECRET_KEY"] = config.app_secret_key app.config["SQLALCHEMY_DATABASE_URI"] = config.db_connection_strin...
#!/usr/bin/env python3 # TODO move it as part of Uczacz class import json import sys if len(sys.argv) < 3: print('Usage: ./insert.py "<unit name>" "<category name>"') sys.exit(1) with open("data/data.json", "r") as f: data = json.load(f) unit = sys.argv[1] category = sys.argv[2] if unit not in data.ke...
# -*- coding: utf-8 -*- """ This plugin is 3rd party and not part of p2p-streams addon Livefootballol.me """ import sys,os,requests current_dir = os.path.dirname(os.path.realpath(__file__)) basename = os.path.basename(current_dir) core_dir = current_dir.replace(basename,'').replace('parsers','') sys.path.append(co...
import os import pdb import numpy as np def remove_nans(a, b): """ Remove nans from two arrays if there is a nan in the same position in either of the arrays :param a: :param b: :return: """ a = np.asarray(a) b = np.asarray(b) mask = ~np.isnan(a) & ~np.isnan(b) a = a[mask] ...