code
stringlengths
1
199k
""" created 09/05/17 For executation of the kallisto quantification step To be run with three arguements * basedir - top level output directory * input directory - contains folders with .fastq.gz files * max_threads - how many threads to allocate to kallisto Returns kallisto quantifications and associated l...
from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud from pylab import * import numpy as np import matplotlib.pyplot as pp import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import rospy import hrl_lib.viz as hv import hrl_lib.util as ut import hrl_lib.matplotl...
def find_longest(arr): count = [len(str(v)) for v in arr] max_value = max(count) max_index = count.index(max_value) return arr[max_index] def find_longest(arr): return max(arr, key=lambda x: len(str(x)))
import platform import re UNKNOWN = 0 RASPBERRY_PI = 1 BEAGLEBONE_BLACK = 2 def platform_detect(): return BEAGLEBONE_BLACK
import numpy as _np import lnls as _lnls import pyaccel as _pyaccel from . import lattice as _lattice default_cavity_on = False default_radiation_on = False default_vchamber_on = False def create_accelerator(optics_mode=_lattice.default_optics_mode, energy=_lattice.energy): lattice = _lattice.create_lattice(optics_...
from django.conf.urls import url from django.conf.urls import patterns from django.shortcuts import redirect urlpatterns = patterns( "", url(r"^$", "n7.web.n7.views.demo", name="demo"), url(r"^triples/$", "n7.web.n7.views.trainer", name="trainer"), url(r"^novels/$", "n7.web.n7.views.trainer_add", name="...
''' Week-2:Exercise-grader-polysum A regular polygon has n number of sides. Each side has length s. The area of a regular polygon is: (0.25∗n∗s^2)/tan(π/n) The perimeter of a polygon is: length of the boundary of the polygon Write a function called polysum that takes 2 arguments, n and s. This function should sum the a...
print(sum(map(int, str(2**1000))))
from __future__ import unicode_literals from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ('contentcuration', '0038_contentnode_author'), ] operations = [ migrations.AlterField( model_name='formatpreset', ...
import os import re from setuptools import setup base_path = os.path.dirname(__file__) def get_long_description(): readme_md = os.path.join(base_path, "README.md") with open(readme_md) as f: return f.read() with open(os.path.join(base_path, "cfscrape", "__init__.py")) as f: VERSION = re.compile(r'.*...
from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import render def home(request): return render(request, 'home.html', {'context_var': 'expected'}) def withUrlFields(request, value): return HttpResponse(value) @login_required def requiresLogin(r...
import json from google import search import csv def searchGoogle(query,dic): bloomberg = [] forbes = [] # later do forbes as well for url in search(query, stop=10): print(url) if 'bloomberg.com/research/stocks/private/person' in url: bloomberg.append(url) if 'bloo...
from twilio.rest.ip_messaging import TwilioIpMessagingClient account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" token = "your_auth_token" client = TwilioIpMessagingClient(account, token) service = client.services.get(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") channel = service.channels.get(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXX...
from . import common import os import hglib class test_paths(common.basetest): def test_basic(self): f = open('.hg/hgrc', 'a') f.write('[paths]\nfoo = bar\n') f.close() # hgrc isn't watched for changes yet, have to reopen self.client = hglib.open() paths = self.client...
chaine = input("donne un nombre : ") nombre = int(chaine) triple = nombre compteur=1 while(compteur<=10): triple=triple*3 print(triple) compteur=compteur+1
""" Given a function rand7 which generates a uniform random integer in the range 1 to 7, write a function rand10 which generates a uniform random integer in the range 1 to 10. Do NOT use system's Math.random(). """ def rand7(): return 0 class Solution: def rand10(self): """ generate 7 twice, (rv...
import question_template game_type = 'input_output' source_language = 'C' parameter_list = [ ['$x1','int'],['$x2','int'],['$x3','int'],['$y0','int'], ] tuple_list = [ ['for_continue_', [0,1,2,None], [0,2,2,None], [0,4,2,None], [0,6,2,None], [0,7,2,None], [None,None,2,1], [None,None,2,2], [None,None,2,...
""" Geofilters ---------- Filters coded oriented to filter and detect uncorrect data. """ import os import numpy as np import pandas as pd from collections import Counter from sklearn.neighbors import KDTree from pySpatialTools.Preprocess.Transformations.Transformation_2d.geo_filters\ import check_in_square_area de...
__author__ = "Ildar Bikmamatov" __email__ = "vistoyn@gmail.com" __copyright__ = "Copyright 2016" __license__ = "MIT" __version__ = "1.0.1" from . import log from .lib import * from .error import * from .colors import colorf from .datelib import *
from __future__ import print_function import sys import subprocess class AutoInstall(object): _loaded = set() @classmethod def find_module(cls, name, path, target=None): if path is None and name not in cls._loaded: cls._loaded.add(name) print("Installing", name) t...
from __future__ import unicode_literals
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lots_admin', '0021_auto_20160927_0941'), ] operations = [ migrations.AlterField( model_name='address', name='ward', f...
""" Allows access to the bot account's watchlist. The watchlist can be updated manually by running this script. Syntax: python pwb.py watchlist [-all | -new] Command line options: -all - Reloads watchlists for all wikis where a watchlist is already present -new - Load watchlists for all wik...
"""Graphical user interface to Delta-Elektronika SM-700 Series controllers.""" import sys import pyhard2.driver as drv import pyhard2.driver.virtual as virtual import pyhard2.driver.deltaelektronika as delta import pyhard2.ctrlr as ctrlr def createController(): """Initialize controller.""" config = ctrlr.Config...
import os from helpers import make_file from unittest import TestCase import quilt.refresh from quilt.db import Db, Patch from quilt.utils import TmpDirectory class Test(TestCase): def test_refresh(self): with TmpDirectory() as dir: old_dir = os.getcwd() try: os.chdir...
""" nmap_scanner.py: Scan local network with NMAP Author: Vladimir Ivanov License: MIT Copyright 2020, Raw-packet Project """ from raw_packet.Utils.base import Base import xml.etree.ElementTree as ET import subprocess as sub from tempfile import gettempdir from os.path import isfile, join from os import remove from typ...
from ipfs_connector import IPFSConnector, IPFSConfig from nn_loader import NNListener, NNLoader class ProcessorCallback: pass class Processor(NNListener): def __init__(self, callback: ProcessorCallback, ipfs_config: IPFSConfig): print("Connecting to IPFS server %s:%d..." % (ipfs_config.server, ipfs_conf...
from .manager import Manager __version__ = '0.2.4'
import socket,Queue from threading import * PORT = 11337 def listener(queueToDatabase,queueToMatchMaking,setupSocket): #Configure server Socket setupSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) #Listen on all interfaces setupSocket.bind(('0.0.0.0',PORT)) setupSocket.setblocking(True)...
DB = "db" Name = "name" Tables = "tables" Table = "table" Columns = "columns" Column = "column" Attributes = "attributes" Initials = "initials" Initial = "initial" InitialValue = "initialvalue" Value = "value" PrimaryKey = "primarykey"
""" oyPivotSwitcher.py by Erkan Ozgur Yilmaz (c) 2009 v10.5.17 Description : ------------- A tool for easy animating of switching of pivots Version History : ----------------- v10.5.17 - modifications for Maya 2011 and PyMel 1.0.2 v9.12.25 - removed oyAxialCorrectionGroup script import - moved to new versioning scheme ...
import subprocess def convert_chinese(text): return subprocess.getoutput("echo '%s' | opencc -c hk2s.json" % text)
""" events.py Defines a simple event handler system similar to that used in C#. Events allow multicast delegates and arbitrary message passing. They use weak references so they don't keep their handlers alive if they are otherwise out of scope. """ import weakref import maya.utils from functools import partial, wraps ...
from django.conf.urls import url from api import views urlpatterns = [ url(r'stations/$', views.get_stations, name='api_stations'), url(r'entry/(?P<station_id>\d+)/$', views.make_entry, name='api_entry'), url(r'new/$', views.add_station, name='api_add_station'), # Booking api url(r'booking/(?P<resid...
from __future__ import print_function """ .. curentmodule:: pylayers.util.project .. autosummary:: """ import numpy as np import os import sys import shutil import pkgutil import pdb import seaborn as sns import logging class PyLayers(object): """ Generic PyLayers Meta Class """ def help(self,letter='az',ty...
import flask import json import bson import os from flask import request, redirect import sys from fontana import twitter import pymongo DEFAULT_PORT = 2014 DB = 'fontana' connection = pymongo.Connection("localhost", 27017) db = connection[DB] latest_headers = {} MODERATED_SIZE = 40 class MongoEncoder(json.JSONEnc...
from __future__ import print_function import argparse import os import random import torch import torch.nn as nn import torch.backends.cudnn as cudnn import torch.optim as optim import torchvision.datasets as dset import torchvision.transforms as transforms import torchvision.utils as vutils from torch.autograd import ...
import os def get_template_path(path): file_path = os.path.join(os.getcwd(), path) if not os.path.isfile(file_path): raise Exception("This is not a valid template path %s"%(file_path)) return file_path def get_template(path): file_path = get_template_path(path) return open(file_path).read() def render_context(te...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('core', '0011_auto_20151207_0017'), ('roster', '0001_initial')...
import utils from flask import render_template, redirect, request, session, url_for, json, jsonify from . import murmurbp from .User import User @murmurbp.route("/users", methods = ['GET']) def get_all_users(): u = User() ul = utils.obj_to_dict(u.get_all()) data = [{'UserId': k, 'UserName': v} for k, v in u...
from collections import OrderedDict import astropy.coordinates as coord import astropy.units as u import matplotlib.pyplot as plt import numpy as np import spherical_geometry.polygon as sp from astropy.table import Table import astropy.time as time from .gbm_detector import BGO0, BGO1 from .gbm_detector import NaI0, Na...
from django.db import models from django.template.defaultfilters import truncatechars class Setting(models.Model): name = models.CharField(max_length=100, unique=True, db_index=True) value = models.TextField(blank=True, default='') value_type = models.CharField(max_length=1, choices=(('s', 'string'), ('i', ...
import os os.environ["SEAMLESS_COMMUNION_ID"] = "simple-remote" os.environ["SEAMLESS_COMMUNION_INCOMING"] = "localhost:8602" import seamless seamless.set_ncores(0) from seamless import communion_server communion_server.configure_master( buffer=True, transformation_job=True, transformation_status=True, ) fro...
import io import os import sys import re from setuptools import setup if sys.argv[-1] == "publish": os.system("python setup.py sdist upload") sys.exit() packages = [ "the_big_username_blacklist" ] install_requires = [] tests_requires = [ "pytest==3.0.5", ] try: from pypandoc import convert long_...
""" This script contains the abstract animation object that must be implemented by all animation extension. """ class AbstractAnimation(object): """ An abstract animation that defines method(s) that must be implemented by animation extensions. """ def __init__(self, driver): self.driver ...
import time, sys, signal, atexit import pyupm_bmp280 as sensorObj sensor = sensorObj.BMP280() def SIGINTHandler(signum, frame): raise SystemExit def exitHandler(): print "Exiting" sys.exit(0) atexit.register(exitHandler) signal.signal(signal.SIGINT, SIGINTHandler) while (1): sensor.update() print "Co...
from django.db.backends import BaseDatabaseIntrospection class DatabaseIntrospection(BaseDatabaseIntrospection): def get_table_list(self, cursor): "Returns a list of table names in the current database." cursor.execute("SHOW TABLES") return [row[0] for row in cursor.fetchall()]
import csv import loremipsum import random import re from encoded.loadxl import * class Anonymizer(object): """Change email addresses and names consistently """ # From Colander. Not exhaustive, will not match .museum etc. email_re = re.compile(r'(?i)[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}') random_wo...
from cast.analysers import log, mainframe class EmptyParagraphEndOfSection(mainframe.Extension): def __init__(self): self.program = None def start_program(self, program): self.program = program def end_program(self, _): self.program = None def start_section(self, section): ...
"""This module contains some functions for EM analysis. """ __author__ = 'Wenzhi Mao' __all__ = ['genPvalue', 'calcPcutoff', 'showPcutoff', 'transCylinder', 'showMRCConnection', 'showMRCConnectionEach', 'gaussian3D'] def interpolationball(matrix, index, step, r, **kwargs): """Interpolation the value by t...
class Solution: # @param {string[]} strs # @return {string} def longestCommonPrefix(self, strs): if not len(strs): return '' if len(strs) == 1: return strs[0] ret = [] for i in range(0, len(strs[0])): for j in range(1, len(strs)): ...
from __future__ import absolute_import import numpy as np from keras import backend as K from .utils import utils def negate(grads): """Negates the gradients. Args: grads: A numpy array of grads to use. Returns: The negated gradients. """ return -grads def absolute(grads): """Com...
import parser import logging def test(code): log = logging.getLogger() parser.parser.parse(code, tracking=True) print "Programa con 1 var y 1 asignacion bien: " s = "program id; var beto: int; { id = 1234; }" test(s) print "Original: \n{0}".format(s) print "\n" print "Programa con 1 var mal: " s = "program ; va...
import sys import os extensions = ['sphinx.ext.todo'] todo_include_todos = True templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'contents' project = u'CoderDojo Twin Cities Python for Minecraft' copyright = u'by multiple <a href="https://github.com/CoderDojoTC/python-minecraft/graphs/contributors">c...
import unittest from wechatpy.constants import WeChatErrorCode class WeChatErrorCodeTestCase(unittest.TestCase): """ensure python compatibility""" def test_error_code(self): self.assertEqual(-1000, WeChatErrorCode.SYSTEM_ERROR.value) self.assertEqual(42001, WeChatErrorCode.EXPIRED_ACCESS_TOKEN.v...
from pudzu.charts import * from pudzu.sandbox.bamboo import * flags = pd.read_csv("../dataviz/datasets/countries.csv").filter_rows("organisations >> un").split_columns('country', "|").split_rows('country').set_index('country').drop_duplicates(subset='flag', keep='first') def flag_image(c): return Image.from_url_wit...
from rcr.robots.dagucar.DaguCar import DaguCar def main(): car = DaguCar( "/dev/rfcomm1", 500 ) car.MoveForward( 15 ) car.Pause( 1000 ) car.MoveBackward( 15 ) car.Pause( 1000 ) car.MoveLeft( 15 ) car.Pause( 1000 ) car.MoveRight( 15 ) car.Pause( 1000 ) car.MoveForwardLeft( 15 ) ...
from django.conf.urls import url from cats.views.cat import ( CatList, CatDetail ) from cats.views.breed import ( BreedList, BreedDetail ) urlpatterns = [ # Cats URL's url(r'^cats/$', CatList.as_view(), name='list'), url(r'^cats/(?P<pk>\d+)/$', CatDetail.as_view(), name='detail'), # Bree...
import os import sys import yaml from etllib.conf import Conf from etllib.yaml_helper import YAMLHelper from plugins import PluginEngine class RulesEngine(list): def __init__(self): self.rules_path = os.path.dirname(os.path.realpath(__file__)) self.conf = Conf() self.load() self.filt...
import py from rpython.rlib.signature import signature, finishsigs, FieldSpec, ClassSpec from rpython.rlib import types from rpython.annotator import model from rpython.rtyper.llannotation import SomePtr from rpython.annotator.signature import SignatureError from rpython.translator.translator import TranslationContext,...
from fabric.api import task, local, run from fabric.context_managers import lcd import settings @task(default=True) def build(): """ (Default) Build Sphinx HTML documentation """ with lcd('docs'): local('make html') @task() def deploy(): """ Upload docs to server """ build() ...
import threading import upnp import nupnp class DiscoveryThread(threading.Thread): def __init__(self, bridges): super(DiscoveryThread, self).__init__() self.bridges = bridges self.upnp_thread = upnp.UPnPDiscoveryThread(self.bridges) self.nupnp_thread = nupnp.NUPnPDiscoveryThread(self...
""" This module is responsible for doing all the authentication. Adapted from the Google API Documentation. """ from __future__ import print_function import os import httplib2 import apiclient import oauth2client try: import argparse flags = argparse.ArgumentParser( parents=[oauth2client.tools.argparser...
import numpy as np import pandas as pd from ElectionsTools.Seats_assignation import DHondt_assignation from previous_elections_spain_parser import * import os pathfiles = '../data/spain_previous_elections_results/provincia/' pathfiles = '/'.join(os.path.realpath(__file__).split('/')[:-1]+[pathfiles]) fles = [pathfiles+...
from django.utils.translation import ugettext_lazy as _ def get_legend_class(position): return 'legend-' + str(position) class LEGEND_POSITIONS: BOTTOM = _('bottom') TOP = _('top') LEFT = _('left') RIGHT = _('right') get_choices = ((get_legend_class(BOTTOM), BOTTOM), (get_lege...
from enum import Enum from typing import List, Union import logging import math try: from flask_babel import _ except ModuleNotFoundError: pass class VehicleType(Enum): CAR = 1 TRUCK_UPTO_4 = 2 PICKUP_UPTO_4 = 3 TRUCK_4_TO_10 = 4 TRUCK_12_TO_16 = 5 TRUCK_16_TO_34 = 6 TRUCK_ABOVE_34 =...
def get_secret_for_user(user, ipparam): print("Looking up user %s with ipparam %s" % (user, ipparam)) return "user_secret" def allowed_address_hook(ip): return True def chap_check_hook(): return True def ip_up_notifier(ifname, localip, remoteip): print("ip_up_notifier") def ip_down_notifier(arg): ...
import numpy as np import matplotlib.pyplot as plt x = np.arange(0, 5, 0.1) y = np.sin(x) plt.plot(x, y) plt.show()
__revision__ = "test/Configure/ConfigureDryRunError.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" """ Verify the ConfigureDryRunError. """ import os import TestSCons _obj = TestSCons._obj test = TestSCons.TestSCons() lib = test.Configure_lib NCR = test.NCR # non-cached rebuild CR = test.CR # cached r...
"""Define and register a listing directive using the existing CodeBlock.""" from __future__ import unicode_literals import io import os import uuid try: from urlparse import urlunsplit except ImportError: from urllib.parse import urlunsplit # NOQA import docutils.parsers.rst.directives.body import docutils.par...
""" Python expresses functional and modular scope for variables. """ x = 5 def f1(): """If not local, reference global. """ return x def f2(): """Local references global. """ global x x = 3 return x print f1() print f2() print x
from setuptools import setup import os import sys import platform import imp import argparse version = imp.load_source('version', 'lib/version.py') if sys.version_info[:3] < (3, 4, 0): sys.exit("Error: Electrum requires Python version >= 3.4.0...") data_files = [] if platform.system() in ['Linux', 'FreeBSD', 'Drago...
from django.conf.urls.defaults import patterns, url from django.contrib.auth.decorators import login_required from views import PollDetailView, PollListView, PollVoteView urlpatterns = patterns('', url(r'^$', PollListView.as_view(), name='list'), url(r'^(?P<pk>\d+)/$', PollDetailView.as_view(), name='detail'), ...
from django.db import transaction from .base import BaseForm from .composite import CompositeForm from .formset import FormSet class BaseModelForm(BaseForm): def save(self, commit=True): retval = [] with transaction.atomic(): for form in self._subforms: if form.empty_perm...
HTBRootQdisc = """\ tc qdisc add dev {interface!s} root handle 1: \ htb default {default_class!s}\ """ HTBQdisc = """\ tc qdisc add dev {interface!s} parent {parent!s} handle {handle!s} \ htb default {default_class!s}\ """ NetemDelayQdisc = """\ tc qdisc add dev {interface!s} parent {parent!s} handle {handle!s} \ netem...
from flask import request, abort, session from functools import wraps import logging import urllib.request as urllib2 import numpy as np import cv2 import random from annotator_supreme.views import error_views from io import StringIO from PIL import Image from annotator_supreme import app import os import base64 def re...
from Bio import Phylo from numpy import zeros import math import multiprocessing as mp class PhyloKernel: def __init__(self, kmat=None, rotate='ladder', rotate2='none', subtree=False, normalize='mean', sigma=1, ...
from typing import List import torch from torch import nn from fairseq.modules.quant_noise import quant_noise class AdaptiveInput(nn.Module): def __init__( self, vocab_size: int, padding_idx: int, initial_dim: int, factor: float, output_dim: int, cutoff: List[...
import sys import argparse import numpy import math class Image: def __init__(self, matrix=[[]], width=0, height=0, depth=0): self.matrix = matrix self.width = width self.height = height self.depth = depth def set_width_and_height(self, width, height): self.width = width self.height = height self.matrix...
"""Tests for mongodb backend Authors: * Min RK """ import os from unittest import TestCase from nose import SkipTest from pymongo import Connection from IPython.parallel.controller.mongodb import MongoDB from . import test_db conn_kwargs = {} if 'DB_IP' in os.environ: conn_kwargs['host'] = os.environ['DB_IP'] if 'D...
import logging from pyvisdk.exceptions import InvalidArgumentError log = logging.getLogger(__name__) def ExtendedElementDescription(vim, *args, **kwargs): '''''' obj = vim.client.factory.create('ns0:ExtendedElementDescription') # do some validation checking... if (len(args) + len(kwargs)) < 4: r...
__author__ = 'zhuzhezhe' ''' 功能实现:命令行下发布微博,获取最新微博 ''' from weibo import Client import getopt import sys import configparser versions = '0.1.5' def write_data(uname, pwd): conf = configparser.ConfigParser() conf['LOGIN'] = {} conf['LOGIN']['username'] = uname conf['LOGIN']['password'] = pwd with ope...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details. """ import logging def setup_logging(name="cct", level=logging.DEBUG): # create logger logger = logging.getLogger(name) logger.handlers...
from datetime import datetime import structlog from flask import Blueprint, request from conditional.util.ldap import ldap_get_intro_members from conditional.models.models import FreshmanCommitteeAttendance from conditional.models.models import CommitteeMeeting from conditional.models.models import FreshmanAccount from...
""" Django settings for jstest project. Generated by 'django-admin startproject' using Django 1.10.4. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os BASE...
from itertools import count from typing import Union from dataclasses import dataclass, field from OnePy.constants import ActionType, OrderType from OnePy.sys_module.components.exceptions import (OrderConflictError, PctRangeError) from OnePy.sys_module.metabase_env im...
import json import sys import web from coloredcoinlib import BlockchainState, ColorDefinition blockchainstate = BlockchainState.from_url(None, True) urls = ( '/tx', 'Tx', '/prefetch', 'Prefetch', ) class ErrorThrowingRequestProcessor: def require(self, data, key, message): value = data.get(key) ...
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="heatmapgl.hoverlabel.font", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.cm fig = plt.figure() ax = {} ax["DropOut"] = fig.add_subplot(121) ax["NoDropOut"] = fig.add_subplot(122) dList = {} dList["DropOut"] = ["DropOut1","DropOut2","DropOut3"] dList["NoDropOut"] = ["NoDropOut1","NoDropOut2"] def m...
from wordbook.domain.models import Translation def test_translation_dto(): t = Translation( id=1, from_language='en', into_language='pl', word='apple', ipa='ejpyl', simplified='epyl', translated='jabłko', ) assert t.dto_autocomplete() == dict( ...
import Cookie import base64 import calendar import datetime import email.utils import functools import gzip import hashlib import hmac import httplib import logging import mimetypes import os.path import re import stat import sys import time import types import urllib import urlparse import uuid from tornado import web...
from setuptools import setup, find_packages setup( name="RaspberryRacer", version="0.1", description="Raspberry Racer", author="Diez B. Roggisch", author_email="deets@web.de", entry_points= { 'console_scripts' : [ 'rracer = rracer.main:main', ]}, install_requi...
import sqlite3 from flask import Flask, request, g, redirect, url_for, abort, \ render_template, flash, session from wtforms import Form, TextField, validators from model import QueueEntry import os from sqlobject import connectionForURI, sqlhub DATABASE = 'bifi.db' DEBUG = True SECRET_KEY = "CHANGEME" ap...
"""Test package."""
import cProfile import unittest import pstats if __name__ == '__main__': suite = unittest.TestLoader().discover('.') def runtests(): # set verbosity to 2 to see each test unittest.TextTestRunner(verbosity=1, buffer=True).run(suite) cProfile.run( 'runtests()', filename='test_cprofile_res...
from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('campaign', '0005_auto_20160716_1624'), ] operations = [ migrations.AddField( model_name='charity', n...
"""python-opscripts setup """ from __future__ import absolute_import, division, print_function import os.path import re import site import sys import glob from setuptools import find_packages, setup setup_path = os.path.dirname(os.path.realpath(__file__)) re_info = re.compile(r""" # Description docstring ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('photos', '0002_auto_20160919_0737'), ] operations = [ migrations.CreateModel( name='Rover', fields=[ ('id', model...
print "HANDLING IMPORTS...", import os import time import random import operator import argparse import numpy as np import cv2 from sklearn.utils import shuffle import itertools import scipy.io.wavfile as wave from scipy import interpolate import python_speech_features as psf from pydub import AudioSegment import pickl...
from exchanges import helpers from exchanges import kraken from decimal import Decimal def opportunity_1(): sellLTCbuyEUR = kraken.get_current_bid_LTCEUR() sellEURbuyXBT = kraken.get_current_ask_XBTEUR() sellXBTbuyLTC = kraken.get_current_ask_XBTLTC() opport = 1-((sellLTCbuyEUR/sellEURbuyBTX)*sellXBTbuyLTC) r...