text
stringlengths
17
737k
# -*- coding: utf-8 -*- import logging import threading import storj.exception as sjexc import os from PyQt4 import QtCore, QtGui from six import print_ from .qt_interfaces.dashboard_ui import Ui_MainMenu from .bucket_edition import BucketEditingUI from .client_config import ClientConfigurationUI from .engine impor...
"""Module providing implementations of the api.TextSource interface.""" from __future__ import absolute_import from . import beautify from . import api from .common import wget import itertools import logging import os import rdflib import tarfile def _is_legacy_uid(uid): """Helper function for `remote_uri_form...
import sys try: from django.conf import settings from django.test.utils import get_runner settings.configure( SECRET_KEY='fakesecretkey', # Disable some system checks during tests for now # Django 1.11 appears to have gotten more strict about these # and now tests do not ru...
#! /usr/bin/env python # Copyright (c) 2008, Stefano Taschini <taschini@ieee.org> # All rights reserved. # See LICENSE for details. def main(argv = None): import test, glob import os.path as op def jglob(*s): return glob.glob(op.join(*s)) prefix = op.dirname(__file__) return test.app( ...
#!/usr/bin/env python import os import sys import re import gc import locale import shutil import time import unittest import doctest import operator import subprocess import tempfile import traceback import warnings try: import platform IS_PYPY = platform.python_implementation() == 'PyPy' IS_CPYTHON = pl...
"""empty message Revision ID: 24d8d4008534 Revises: 1057f3f25ff9 Create Date: 2016-04-12 12:11:40.313652 """ # revision identifiers, used by Alembic. revision = '24d8d4008534' down_revision = '1057f3f25ff9' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def upgrade(): ...
import psycopg2 from ede.credentials import DB_NAME, DB_PASS, DB_PORT, DB_USER, DB_HOST from datetime import datetime conn = psycopg2.connect(database=DB_NAME, user=DB_USER, password=DB_PASS, host=DB_HOST, port=DB_PORT) cur = conn.cursor() # Q0: return metadata of all grid datasets in DB d...
# -*- coding: utf-8 -*- ''' vdirsyncer.sync ~~~~~~~~~~~~~~~ The function in `vdirsyncer.sync` can be called on two instances of `Storage` to synchronize them. Due to the abstract API storage classes are implementing, the two given instances don't have to be of the same exact type. This allows u...
import os, sys, nrrd, cmtk, gc, subprocess, shutil, png import numpy as np import warpScoring.CheckImages as ci from cmtk import cur, tempfolder, active, run_stage, cmtkdir, template, checkDir, host, templatedir from PIL import Image wlzDir = "/partition/bocian/VFBTools/Woolz2013Full/bin/" Fiji = "nice /partition/boci...
#!/usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright # n...
""" Copyright 2017-2018 Fizyr (https://fizyr.com) 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 http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
""" The topographica simulator module. The Simulator object is the central object of a Topographica simulation. It handles the simulation clock and maintains communication between the components of the simulation. A simulation is structured as a directed graph of event-processing nodes called EventProcessors (EPs)...
# """EasyEngine site controller.""" from cement.core.controller import CementBaseController, expose from cement.core import handler, hook from ee.core.cron import EECron from ee.core.sslutils import SSL from ee.core.variables import EEVariables from ee.core.domainvalidate import ValidateDomain from ee.core.fileutils im...
#-*- coding: utf-8 -*- import os import datetime from google.appengine.ext.webapp.util import run_wsgi_app as run from google.appengine.ext import webapp from google.appengine.api import memcache from google.appengine.ext.webapp import template from django.utils import simplejson from libs import pydouban from utils ...
""" Tk-based graphical user interface (GUI). This package implements a Topographica GUI based on the Tk toolkit, through the Tkinter interface to Python. The rest of Topographica does not depend on this package or any module in it, and thus other GUIs or other types of interfaces can also be used. $Id$ """ __version...
import os import logging import flask import telepot import telepot.loop as pot_loop import telepot.delegate as pot_delegate logging.basicConfig(filename='plan_bot.log') BOT_API_TOKEN = os.environ.get('PLAN_BOT_TOKEN', '') BOT_HOOK_URL = os.environ.get('PLAN_BOT_URL', '/bot/hook') # bot related class Planner(tele...
# -*- coding: utf-8 -*- # *************************************************************************** # * * # * Copyright (c) 2018 sliptonic <shopinthewoods@gmail.com> * # * ...
import collections import cPickle as pickle import glob import hashlib import json import logging import os import re import shutil import stat import StringIO import tempfile import zipfile from datetime import datetime from itertools import groupby from xml.dom import minidom from zipfile import BadZipfile from djan...
#!/usr/bin/env python import argparse import copy import os import sys from saml2.metadata import entity_descriptor, metadata_tostring_fix from saml2.metadata import entities_descriptor from saml2.metadata import sign_entity_descriptor from saml2.sigver import security_context from saml2.validate import valid_instance...
from ott.utils import file_utils from ott.utils import object_utils try: import configparser except ImportError: import ConfigParser as configparser import os import sys import logging log = logging.getLogger(__file__) SECTION = 'view' INI = ['app.ini', 'client.ini', 'services.ini', 'view.ini', 'base.ini', '...
from django.contrib.admin.utils import quote, unquote from django.core.paginator import Paginator from django.shortcuts import get_object_or_404 from django.template.response import TemplateResponse from django.urls import reverse from django.utils.translation import gettext as _ from django.views.generic.base import V...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
''' Compare local fonts against fonts available on fonts.google.com ''' from __future__ import print_function from flask import Flask, render_template from fontTools.ttLib import TTFont from fontTools.pens.areaPen import AreaPen from glob import glob from collections import namedtuple import ntpath import requests impo...
# -*- coding: utf-8 -*- """ This module allows to convert standard data representations (e.g., a spike train stored as Neo SpikeTrain object) into other representations useful to perform calculations on the data. An example is the representation of a spike train as a sequence of 0-1 values (binned spike train). .. au...
# Copyright 2021 DeepMind Technologies Limited # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
from flask import Flask, g, request, render_template, redirect, url_for from uuid import uuid4 import os import json import rethinkdb as r from rethinkdb.errors import RqlRuntimeError, RqlDriverError import downloadfonts import models from comparefonts import compare_fonts from glyphpalette import fonts_all_glyphs imp...
# -*- coding: utf-8 -*- ## ## $Id: json.py,v 1.13 2009/04/23 14:53:16 pferreir Exp $ ## ## This file is part of CDS Indico. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN. ## ## CDS Indico is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## pub...
import os, rfc822 from zope.interface import implements from twisted.cred.portal import IRealm from twisted.mail import smtp, relaymanager from twisted.python.util import sibpath from twisted.python import log from axiom.item import Item, transacted from axiom.attributes import integer, reference, text, AND from a...
"""Galaxy Cluster Ensemble Calculations. Cluster mass-richness and mass-concentration scaling relations, and NFW halo profiles for weak lensing shear and magnification, including the effects of cluster miscentering offsets. This framework calculates properties and profiles for every individual cluster, storing the d...
import unittest import collections class TestFont(unittest.TestCase): # ------ # Layers # ------ def getFont_layers(self): font, _ = self.objectGenerator("font") for name in "ABCD": font.newLayer("layer " + name) return font def test_getLayer_unknown(self): ...
import os import json import cgi from twisted.internet import defer from twisted.web import server, resource from twisted.python import log from docker_xylem import utils class DockerService(resource.Resource): isLeaf = True addSlash = True def __init__(self, config): self.requestRouter = { ...
import sys import platform import os import re from substance.shell import (Shell) from subprocess import check_output from functools import lru_cache from pathlib import (PureWindowsPath, PurePosixPath) from substance.platform import (isWSL, isCygwin) @lru_cache(maxsize=None) def inner(path): if isCygwin(): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################# ## UniFi-Lab v0.0.2 ## ############################################################################# ##Copyright (c) 2012, Ubiquiti Networks...
import torch from torch.autograd.functional import vjp from .dopri5 import Dopri5Solver from .bosh3 import Bosh3Solver from .adaptive_heun import AdaptiveHeunSolver from .fixed_grid import Euler, Midpoint, RK4 from .fixed_adams import AdamsBashforth, AdamsBashforthMoulton from .dopri8 import Dopri8Solver from .misc imp...
from celery.decorators import task from celery.task.sets import subtask from subprocess import call from django.core.files.base import ContentFile from django.core.files.storage import FileSystemStorage from django.core.cache import cache from django.conf import settings from django.db.models import get_model from dja...
#!/usr/bin/env python from __future__ import print_function # png.py - PNG encoder/decoder in pure Python # # Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org> # Portions Copyright (C) 2009 David Jones <drj@pobox.com> # And probably portions Copyright (C) 2006 Nicko van Someren <nicko@nicko.org> # # Orig...
#!/usr/bin/env python import abc debug = True class TypeSpecifier(metaclass=abc.ABCMeta): """Base-class for special type containers.""" @abc.abstractmethod def validate_type(self, x) -> bool: """Verify that x satisfies this type specifier.""" pass def wrap_type(self, x): """S...
# -*- coding: utf-8 -*- import os import sys import re import time import socket import select import subprocess import paramiko # Regular expression for matching IPv4 address. IPV4 = re.compile('^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$') # Regular expression for matching IPv6 address. IPV6 = re.compile( '^...
#!/usr/bin/env python # Copyright (c) 2013-2014 Turbulenz Limited from sys import argv, stdout from json import loads as load_json, dumps as dump_json from yaml import load as load_yaml from os.path import join as path_join, exists as path_exists, splitext, basename, normpath, getmtime, dirname from os import makedirs...
import card_manager class Building: """ A container that represents buildings in GtR. The primary data members are the building foundation, site, and materials. Once the building is complete, the site is removed. The materials remain, however. A completed building has no memory of its site. """ ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created on Tue Apr 08 08:45:59 2014 # License is MIT, see COPYING.txt for more details. # @author: Danilo de Jesus da Silva Bellini """ Julia and Mandelbrot fractals image creation """ from __future__ import division, print_function import pylab, argparse, collections, i...
''' Created on 2015/6/12 :author: hubo ''' from __future__ import print_function, absolute_import, division from .matchtree import MatchTree, EventTree from .pqueue import CBQueue from .event import Event,withIndices from time import time, sleep from datetime import datetime from signal import signal, SIGTERM, SIGINT...
# doc:slow-example """ ================================ Compute ICA components on epochs ================================ ICA is fit to MEG raw data. We assume that the non-stationary EOG artifacts have already been removed. The sources matching the ECG are automatically found and displayed. Subsequently, artefact det...
# The MIT License (MIT) # # Copyright (c) 2013 cpelley # # 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, copy, modify, m...
#------------------------------------------------------------------------------ # # Copyright (c) 2013, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions d...
import discord from discord.ext import commands class Fun: ''' A collection of commands to rolls dices, send cats, and drop mixtapes (probably) ''' def __init__(self, bot): self.bot = bot @commands.command() async def hello(self): ''' says the robot ''' await self.bot.r...
from anode.datastore.couchdb.couchdb_datastore import CouchDB_DataStore from anode.datastore.mockdb.mockdb_datastore import MockDB_DataStore from anode.datastore.datastore import NotFoundError class DirectoryServiceError(Exception): pass class KeyAlreadyExistsError(DirectoryServiceError): pass class KeyNot...
from datetime import datetime import discord from discord.ext import commands import asyncio import checks import database from dateutil.parser import isoparse from config import BGS_CHANNEL from data.faction import Faction from web import Web class BGS(commands.Cog): def __init__(self, bot: commands.Bot): ...
#!/usr/bin/env python """ fs.base: base class defining the FS abstraction. This module defines the most basic filesystem abstraction, the FS class. Instances of FS represent a filesystem containing files and directories that can be queried and manipulated. To implement a new kind of filesystem, start by sublcassi...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Scaffold Ordering with Weighted Maps. """ import os.path as op import os import sys import logging import numpy as np import networkx as nx from itertools import combinations, product from collections import defaultdict from functools import partial from jcvi impor...
#!/usr/local/bin/python2.7 import os import hashlib import gzip import time import datetime import mimetypes from boto.s3.connection import S3Connection from boto.s3.key import Key from config import (AWS_KEY, AWS_SECRET_KEY, AWS_BUCKET, AWS_DIRECTORY, HTML_EXPIRES, STATIC_EXPIRES, ABSOLUTE_PATH) PUSH_FROM = ABS...
from discord.ext import commands from .utils import config, checks from collections import Counter import re import discord class Mod: """Moderation related commands.""" def __init__(self, bot): self.bot = bot self.config = config.Config('mod.json', loop=bot.loop) def bot_user(self, messa...
#!/usr/bin/env python ''' GAEUnit: Google App Engine Unit Test Framework Usage: 1. Put gaeunit.py into your application directory. Modify 'app.yaml' by adding the following mapping below the 'handlers:' section: - url: /test.* script: gaeunit.py 2. Write your own test cases by extending unittest.TestCas...
from flask import Flask, redirect, url_for, render_template, flash, request, abort, jsonify from flaskext.sqlalchemy import SQLAlchemy from datetime import datetime import highlight, random app = Flask(__name__) app.config.from_pyfile('config.py') db = SQLAlchemy(app) class paste(db.Model): id = db.Column(db.Inte...
# Copyright 2015 Red Hat, Inc. # All Rights Reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
import fnmatch import functools import io import ntpath import os import posixpath import re import six import sys from collections import Sequence from contextlib import contextmanager from errno import EINVAL, ENOENT from operator import attrgetter from stat import ( S_ISDIR, S_ISLNK, S_ISREG, S_ISSOCK, S_ISBLK, ...
# xpyBuild - eXtensible Python-based Build System # # This module holds definitions for various PathSet classes. A path set is a # lazily-resolved, thread-safe set of file/directory absolute paths, with # an optional (perhaps trivial) mapping to relative 'destination' paths # (which is used by some targets, e.g. cop...
# Easy paver commands for less command typing and more coding. # Visit http://paver.github.com/paver/ to get started. - @brandondean Sept. 30 from paver.easy import * path = path("./") @task def clean(): """Get rid of junk files.""" if path.files("bulkloader-*"): sh("rm bulkloader-*") print("All cleaned ...
from paver.easy import * from paver.release import setup_meta import paver.doctools import paver.virtual import paver.misctasks from paver.setuputils import setup options = environment.options setup(**setup_meta) options( minilib=Bunch( extra_files=['doctools', 'virtual'] ), sphinx=Bunch( ...
#!/usr/bin/env python """Run multiple command lines in parallel Syntax: parallelize.py <command line> ... Example: parallelize.py "runtests1.sh" "runtests2.sh" This scripts runs multiple command lines in parallel, but presents the result as if they were run in sequence. So if the first one fails, then we will exit ...
"""Script for sending OSF email digests to subscribed users and removing the records once sent.""" import logging import datetime from bson.code import Code from functools import partial from modularodm import Q from modularodm.exceptions import NoResultsFound from framework import sentry from framework.auth.core impo...
#!/usr/bin/env python """ Author: Shane Bussmann Last modified: 2014 February 26 Note: This is experimental software that is in a very active stage of development. If you are interested in using this for your research, please contact me first at sbussmann@astro.cornell.edu! Thanks. Purpose: Fit a parametric ...
#!/usr/bin/env python # -*- coding: utf-8; mode: python; -*- """Script for joining word2vec and task specicifc embeddings via least squares. """ ################################################################## # Imports from __future__ import print_function, unicode_literals import argparse import codecs import n...
""" Created on 16 May 2017 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) Note: time shall always be stored as UTC, then localized on retrieval. """ from scs_core.data.rtc_datetime import RTCDatetime from scs_host.bus.i2c import I2C from scs_host.lock.lock import Lock # -------------------------------...
""" <Program Name> seash_importer.py <Purpose> This is the module importer for seash. It allows developers to easily extend the functionality of seash without having to modify core seash files. The importer will expect a folder containing a file called __init__.py. This will be referenced here as the comman...
#!/usr/bin/env python from sys import exit, stdin from os import environ, path, unlink from tempfile import NamedTemporaryFile from subprocess import call from argparse import ArgumentParser import parser import lexer __author__ = "Juan J. Martinez <jjm@usebox.net>" __version__ = "0.5" app_name = "JTC" project_url =...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ gittime ~~~~~~~ Estimate time spent programming, aided by git commit metadata. More documentation and stuff is in the readme. Example usage:: python gittime.py git@github.com:uniphil/commit--blog.git For full usage details:: ...
#!/usr/bin/env python ''' lcmath.py - Waqas Bhatti (wbhatti@astro.princeton.edu) - Feb 2015 Contains various useful tools for calculating various things related to lightcurves (like phasing, sigma-clipping, etc.) ''' import logging import multiprocessing as mp from datetime import datetime import numpy as np from ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Astropy is a package intended to contain core functionality and some common tools needed for performing astronomy and astrophysics research with Python. It also provides an index for other astronomy packages and tools for managing them. """ from __fut...
# Copyright 2014 The Bazel Authors. All rights reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
""" Django settings for atmsite project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ...
from ggame import App, Color, LineStyle, Sprite from ggame import RectangleAsset, CircleAsset import math SCREEN_WIDTH = 1536 SCREEN_HEIGHT = 1024 red = Color(0xff0000, 1.0) green = Color(0x00ff00, 1.0) blue = Color(0x0000ff, 1.0) black = Color(0x000000, 1.0) purple = Color(0xff00ff, 1.0) thinline = LineStyle(0, blac...
from collections import namedtuple from enum import Enum from math import floor, log10 from sys import stdout Result = namedtuple('Result', 'id caller status message') Status = Enum('Status', 'Ok, Fail') def makeResult(id, caller, status, message=""): result = None if(id >= 0 and caller is not None and statu...
#!/usr/local/bin/python """Script to update a directory with the latest arsenal.com wallpapers. Usage: wallpaper.py --dir <path/to/directory> """ import argparse import os import wget import re import shutil import logging class ArsenalWallpaperExtractor(object): """Class to extract wallpapers from arsenal.c...
# -*- coding: utf-8 -*- ''' watdo.cli ~~~~~~~~~ This module contains both helper functions and main() for the CLI interface. :copyright: (c) 2013 Markus Unterwaditzer :license: MIT, see LICENSE for more details. ''' import watdo.editor as editor import watdo.model as model from .cli_utils im...
""" Created on June 10, 2012 @author: peta15 """ from wtforms import fields from wtforms import Form from wtforms import validators from lib import utils from webapp2_extras.i18n import lazy_gettext as _ from webapp2_extras.i18n import ngettext, gettext FIELD_MAXLENGTH = 50 # intended to stop maliciously long input ...
import time import tempfile import numpy import numpy as np import h5py from pyscf import lib from pyscf import ao2mo from pyscf.lib import logger from pyscf.cc import ccsd from pyscf.cc import rintermediates as imd from pyscf.lib import linalg_helper #einsum = np.einsum einsum = lib.einsum # This is restricted (R)C...
""" sentry.utils.models ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import base64 import logging from django.db import models, router from django.db.models import signals from django.db.models.expressions import Expr...
"""This module provides the HIL service's public API. TODO: Spec out and document what sanitization is required. """ import json import requests import uuid import flask from schema import Schema, And, Optional, SchemaError from urlparse import urlparse from hil import model, errors from hil.model import db from hil...
#!/usr/bin/env python3 # # This file is part of m.css. # # Copyright © 2017, 2018, 2019 Vladimír Vondruš <mosra@centrum.cz> # # 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 withou...
"""REST API for geocode services.""" from datetime import datetime, timedelta from girder.plugins.minerva.geonames import import_data from pymongo import GEOSPHERE from bson.objectid import ObjectId from girder.api.rest import Resource, loadmodel, RestException from girder.api.describe import Description from girder...
# i10chic.py # Animated simulation of chicane magnets # Import libraries import dls_packages import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation # Define matrices to modify the electron beam vector: # drift and kicker magnets. class Drifting: def __init__(self, step):...
__author__ = 'RMGiroux' import asyncio from asyncio import subprocess import sys from pylibinit import addlibpath addlibpath.add_lib_path() import blessings import tqdm class OutputCollector: def __init__(self, name): self.name = name @asyncio.coroutine def process_line(self, stream): w...
import responses from tempfile import NamedTemporaryFile from datetime import datetime import pytz from openpyxl import load_workbook from django.test import TestCase, Client, override_settings from django.core import mail from django.core.management import call_command from ci.management.commands.generate_reports i...
#!/usr/bin/python import os import sys import copy from pprint import pformat, PrettyPrinter from optparse import OptionParser from sfa.generic import Generic from sfa.util.xrn import Xrn from sfa.storage.record import Record from sfa.trust.hierarchy import Hierarchy from sfa.trust.gid import GID from sfa.trust.cert...
# import python libraries import os, sys, imp # import os-dependant libs import kivy from kivy.app import App from kivy.core.window import Window from kivy.uix.floatlayout import FloatLayout from kivy.uix.boxlayout import BoxLayout from kivy.uix.scrollview import ScrollView from core.gui.mapwidget import MapWidget # ...
#!/usr/bin/env python import os import sys import json import re import tree_functions # Functions functions = tree_functions.TreeFunctions() class Index(object): """docstring for Index""" def __init__(self, logger, constants): super(Index, self).__init__() self.c = constants self....
import itertools import struct import time import pytest import logging from flaky import flaky from cassandra import ConsistencyLevel, InvalidRequest from cassandra.metadata import NetworkTopologyStrategy, SimpleStrategy from cassandra.policies import FallthroughRetryPolicy from cassandra.query import SimpleStatemen...
# -*- coding: utf-8 -*- import logging.config from .activity import Activity # NOQA from .workflow import Workflow # NOQA from . import settings __version__ = '0.10.1' __author__ = 'Greg Leclercq' __license__ = "MIT" logging.config.dictConfig(settings.base.load()['LOGGING'])
import argparse from random import * import math from geo2d.geometry import * import itertools from tkinter import * import time from intervalset import AngularIntervalSet import sys,traceback from collections import namedtuple def random_color(): return "#%02x%02x%02x" % (randrange(0,255),randrange(0,255),randran...
#!/usr/bin/env python import ast import base64 import ccd import hashlib import os import numpy as np import sys import requests import cw from glob import glob from datetime import datetime class SparkException(Exception): pass class Spark(object): def __init__(self, config): self.config = config ...
import six import numpy as np from json import dump, load from contextlib import contextmanager from collections import Counter, defaultdict from pysam import ( AlignmentFile, CMATCH, CINS, CDEL, CREF_SKIP, CSOFT_CLIP, CHARD_CLIP, CPAD, CEQUAL, CDIFF) from dark.reads import Read, DNARead class UnequalRefer...
import sys import models from app import db import json import operator import time from datetime import datetime from sqlalchemy import * NUM_FRIENDS = 20 def upload_messages(userId, messageList): for message in messageList: direction = message["direction"] phoneNumber = message["phoneNumb...
""" Parse and traverse a Data Loaf grammar. """ from __future__ import print_function import argparse import random import re import sys __version__ = '0.1.0' # TODO: Make a WeightedMapping that caches sum def random_weighted(list_): total = sum([x[0] for x in list_]) n = random.uniform(0, total) for wei...
#!/usr/bin/python import datetime import wx import matplotlib import matplotlib.pyplot as plt from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas from mpl_toolkits.axes_grid1 import host_subplot import mpl_toolkits.axisartist as AA from matplotlib.font_manager import FontProperties from matplo...
""" Highest number of candidates per seats & longest ballots (most parties contesting a seat?) Geography – where are parties standing lots/no candidates - where are independents strongest, etc Maybe strongest region groups (e.g. are Bath independents standing everywhere in bath?) Gender New parties """ import collectio...
from collections import namedtuple import httplib from django.http import Http404, HttpResponse from django.shortcuts import get_object_or_404 from django.views import generic from .api import APIException, api_reverse from .parsers import RequestParser from .serializers import Serializer from .utils import querystri...
"""Functions for builtin CherryPy tools.""" import logging import re import cherrypy from cherrypy._cpcompat import basestring, md5, set, unicodestr from cherrypy.lib import httputil as _httputil from cherrypy.lib import is_iterator # Conditional HTTP request support # def v...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2003-2009 Edgewall Software # Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com> # Copyright (C) 2005-2006 Matthew Good <trac@matt-good.net> # Copyright (C) 2005-2006 Christopher Lenz <cmlenz@gmx.de> # All rights reserved. # # This software is li...
from __future__ import print_function import os, sys import json import subprocess import time import tempfile import threading from io import BytesIO import errno import boto3 import botocore import socket debug = True verbose = False def _last_common_snapshot(source, target): """ Given a list of sna...