text stringlengths 17 737k |
|---|
PACKAGE = 'herbpy'
import logging
import openravepy
import prpy
import prpy.rave, prpy.util
from prpy.base.barretthand import BarrettHand
from prpy.base.wam import WAM
from prpy.base.robot import Robot
from prpy.exceptions import PrPyException
from prpy.planning.base import UnsupportedPlanningError
from herbbase import... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
(c) 2016, Ben Doherty <bendohmv@gmail.com>
Sponsored by Oomph, Inc. http://www.oomphinc.com
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software... |
"""
sentry.interfaces
~~~~~~~~~~~~~~~~~
Interfaces provide an abstraction for how structured data should be
validated and rendered.
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import itertools
import urlparse
from django.http import Qu... |
"""Paypal Adaptive Payments Gateway"""
import urllib
from decimal import Decimal
from django.core.urlresolvers import reverse
from hiicart.gateway.base import PaymentGatewayBase, CancelResult, SubmitResult
from hiicart.gateway.paypal_adaptive import api
from hiicart.gateway.paypal_adaptive.errors import PaypalAdapti... |
#coding:utf-8
from django import forms
from django.contrib.auth import login, authenticate
from django.http import HttpResponse
from django.views.generic import View,TemplateView
from django.template import RequestContext
from django.shortcuts import render_to_response, redirect, get_object_or_404
from django.core.urlr... |
"""
sentry.interfaces
~~~~~~~~~~~~~~~~~
Interfaces provide an abstraction for how structured data should be
validated and rendered.
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import itertools
import urlparse
import warnings
from pygme... |
from plugin.api.responses import ARCADIACompResponse
from requests import post, codes
HOST_NAME = "34.250.221.100"
PORT = 80
URL = "http://{host}:{port}".format(
host=HOST_NAME,
port=PORT)
class ARCADIARestAPIClient(object):
def __init__(self, *args, **kwargs):
pass
def get_component_info(se... |
import os
import random
import time
import operator
import langdetect
from langdetect import DetectorFactory
from langdetect.lang_detect_exception import LangDetectException
import numpy
from gensim import corpora
from nltk import PerceptronTagger
from nltk.corpus import stopwords
from sklearn.ensemble import Random... |
import gzip
import json
import os
import re
import tarfile
import zipfile
import globus_sdk
from globus_sdk.base import BaseClient, merge_params, slash_join
from globus_sdk.response import GlobusHTTPResponse
from tqdm import tqdm
from six import print_
# Will uncomment the UUIDs once Search actually handles them as ... |
"""JSONSchema metadata plugin."""
import copy
import functools
import json
import logging
import pkgutil
import alchemyjsonschema
from pyramid.httpexceptions import (
HTTPBadRequest,
HTTPNotFound
)
from pyramid_jsonapi.metadata import VIEWS
class JSONSchema():
"""Metadata plugin to generate and validate... |
#
# Copyright 2016 The BigDL Authors.
#
# 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 ... |
#
# Copyright 2016 The BigDL Authors.
#
# 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 ... |
from django.db import migrations, models
from corehq.apps.app_manager.util import get_app_id_from_form_unique_id
from corehq.util.django_migrations import skip_on_fresh_install
@skip_on_fresh_install
def _populate_app_id(apps, schema_editor):
Call = apps.get_model('ivr', 'Call')
for call in Call.objects.dist... |
########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. 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... |
import numpy as np
from qstrader.portcon.order_sizer.order_sizer import OrderSizeGeneration
class DollarWeightedCashBufferedOrderSizeGeneration(OrderSizeGeneration):
"""
Creates a target portfolio of quantities for each Asset
using its provided weight and total equity available in the
Broker portfoli... |
#! /usr/bin/env python
import network
import network_agent
def random_select_and_update(network_of_agents):
n = len(network_of_agents.G)
# randomly select nodes from network_of_agents
num_update = n // 10 # select 10% of the nodes for update, performs floor division
agents_for_update = network_of_agen... |
# -*- encoding: utf-8
import os
import shutil
import subprocess
import sys
import click
import docker
import requests
from . import Site
@click.group()
def cli():
pass
@cli.command('build', help='(re)build the HTML for the website')
def build():
"""
Take the content folder and build it.
"""
s... |
# -*- coding: utf-8 -*-
"""
Django settings for Scavenger project.
Generated by 'django-admin startproject' using Django 1.10.6.
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/re... |
class Predicate(object):
"""
A predicate is used to check if a condition is met. It is used for preconditions,
postconditions, and invariants.
"""
def __init__(self, name, predicate):
"""
Constructs a Predicate object that holds a name and a predicate
"""
self.__name... |
from UserDict import UserDict
from django.utils.encoding import StrAndUnicode
from django.template.loader import render_to_string
# Sane boundary constants
MINIMUM_PAGE_LENGTH = 5
DEFAULT_OPTIONS = {
'columns': [], # table headers
'ordering': [], # override to Model._meta.ordering
'filters': {}, # field_... |
#!/usr/bin/python
from gi.repository import Gtk
from requests import post
import requests
import gobject
from couchdb import Database, Document, ResourceNotFound, Server
from couchdb.client import Row, ViewResults
import threading
import subprocess
import time
import sys
try:
import simplejson as json
except Impor... |
# Kubos CLI
# Copyright (C) 2016 Kubos Corporation
#
# 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 ... |
from django.test import TestCase
class HomePageTests(TestCase):
def test_home_page_redirect_on_logged_out(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 302)
|
__author__ = 'Konstantin Dmitriev'
from renderchan.module import RenderChanModule
import subprocess
import gzip
import os, sys
import re
import errno
class RenderChanSynfigModule(RenderChanModule):
def __init__(self):
RenderChanModule.__init__(self)
self.conf['binary']="synfig"
self.conf["... |
# -*- coding: UTF-8 -*-
"""
Usage:
leadbutt [options]
Options:
-h --help Show this screen.
-c FILE --config-file=FILE Path to a YAML configuration file [default: config.yaml].
-p INT --period INT Period length, in minutes (default: 1)
-n INT Number of data poin... |
"""Creates a participant, physical measurements, questionnaire responses, and biobank orders."""
import clock
import collections
import csv
import datetime
import logging
import random
from code_constants import PPI_SYSTEM, CONSENT_FOR_STUDY_ENROLLMENT_MODULE
from code_constants import CONSENT_FOR_ELECTRONIC_HEALTH_RE... |
# telepathy-python - Base classes defining the interfaces of the Telepathy framework
#
# Copyright (C) 2005, 2006 Collabora Limited
# Copyright (C) 2005, 2006 Nokia Corporation
# Copyright (C) 2006 INdT
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gener... |
import logging, math, six, builtins
import ptypes, ptypes.bitmap as bitmap
from ptypes import *
ptypes.setbyteorder(ptypes.config.byteorder.bigendian)
### Primitive types for records
class IdentifierLong(pbinary.terminatedarray):
class _object_(pbinary.struct):
_fields_ = [
(1, 'continue'),
... |
import glob
import hashlib
import os
import subprocess
import sys
#############################################################################
class PipelineStep(object):
"""Base class for pipeline steps."""
def __init__(self, name):
self.Name = name
def NeedsUpdate(self):
return False
... |
# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This pr... |
# -*- coding: utf-8 -*-
# This file is part of the pymfony package.
#
# (c) Alexandre Quercia <alquerci@email.com>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
from __future__ import absolute_import;
import os;
from time import time;
im... |
"""distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# Distutils version
#
# Updated automatically by the Python release process.
#
#--start constants--
__version__ = "3.3.0a1"
#--end constants--
|
"""Automatically create python package version info based on git date and hash
This simple little module is intended to be included as a git submodule by
other python packages, and used by setup.py on installation. See the README at
<https://github.com/moble/auto_version> for more details and instructions on
how to u... |
import exptools
import sys
from hilbert import hilbert_plot, hilbert_to_image
import rpy2.robjects as robjects
exptools.ensureSoftwareVersion('pyvenn','tip')
import pyvenn
_r_loaded = False
def load_r():
global _r_loaded
if not _r_loaded:
robjects.r('library(ggplot2)')
import numpy
class Plot:
de... |
VERSION = '0.1.3' |
#!/usr/bin/env python
# coding=utf-8
import locale, codecs, os
if codecs.lookup(locale.getpreferredencoding()).name == 'ascii':
os.environ['LANG'] = 'en_US.utf-8'
from dots.interpreter import AsciiDotsInterpreter
from dots.callbacks import IOCallbacksStorage
from dots import terminalsize
_, terminal_lines = te... |
import json
import logging
import os
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from rest_framework.decorators import api_view
from rest_framework.exceptions import NotFound, status, PermissionDenied, \
ValidationError as DRF_ValidationError
from django_irods.icommand... |
from __future__ import division
from .fourmomentum import FourMomentum
__all__ = ['calc_nbins', 'histpoints', 'FourMomentum']
import numpy as np
import scipy.stats as stats
import scipy as sp
import logging
def calc_nbins(x, maximum=150):
n = (max(x) - min(x)) / (2 * len(x)**(-1/3) * (np.percentile(x, 75) - n... |
""" Defines the basic Container class """
from contextlib import contextmanager
from enable.base import empty_rectangle, intersect_bounds
from enable.events import MouseEvent
from kiva import affine
from traits.api import Instance, List, Property
from .component import Component
class Container(Component):
""" ... |
import six
from django.db import models
from django.contrib.auth.models import User
PUBLISHED_CHOICES = (
('private', 'private'),
('shared', 'shared'),
('public', 'public')
)
@six.python_2_unicode_compatible
class Photo(models.Model):
user = models.ForeignKey(
User,
null=False
)... |
#!/usr/bin/python2.6
#
# Copyright 2011 Google 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 ... |
# Copyright 2020 Google LLC
#
# 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 writing, ... |
from continuum import Continuum, MavenTwoProject, MavenOneProject, AntProject, ShellProject, makeMailNotifier
import os
import shutil
import sys
import time
import traceback
print "############################################################"
print "Running integration tests"
print ""
print "NOTE:"
print "When running... |
# -*- coding: utf-8 -*-
import logging
from base import BaseStep
from dbaas_cloudstack.provider import CloudStackProvider
from dbaas_credentials.models import CredentialType
from util import get_credentials_for
from dbaas_cloudstack.models import PlanAttr, HostAttr
from physical.models import Host, Instance
LOG = logg... |
# coding=utf-8
import json
import requests
from globalvars import GlobalVars
import threading
# noinspection PyPackageRequirements
import websocket
from collections import Iterable
from datetime import datetime, timedelta
from glob import glob
import sys
import traceback
import time
import os
import datahandling
import... |
# -*- encoding:utf-8 -*-
import re
from django.forms.widgets import Widget, Select, MultiWidget
from django_widgets import SelectDateWidget
from django.utils.safestring import mark_safe
class SplitSelectDateTimeWidget(MultiWidget):
'''
This class combines SelectTimeWidget (from:
http://www.djangosnippets.o... |
# coding=utf-8
import json
import requests
from globalvars import GlobalVars
import threading
# noinspection PyPackageRequirements
import websocket
from collections import Iterable
from datetime import datetime, timedelta
import sys
import traceback
import time
import os
import datahandling
import parsing
import apiget... |
import os
import logging
from hashlib import sha256
import treq
import math
import binascii
from twisted.internet import defer, threads, reactor, error
from txupnp.upnp import UPnP
from lbryum.simple_config import SimpleConfig
from lbryum.constants import HEADERS_URL, HEADER_SIZE
from lbrynet import conf
from lbrynet.c... |
import collections
import random
from tenderloin.game.resources import tiles, deck, winds
class TableService(object):
def __init__(self):
self.tables = []
def get(self, tid):
return self.tables[tid]
def create(self, usernames):
tid = len(self.tables)
self.tables.append(... |
import hashlib
from collections import defaultdict
from electroncash.bitcoin import (
bfh, bh2u, MySigningKey, MyVerifyingKey, SECP256k1,
generator_secp256k1, point_to_ser, ser_to_point,
public_key_to_p2pkh, Hash,
pubkey_from_signature, msg_magic, TYPE_ADDRESS)
from electroncash.transaction import Trans... |
import datetime
import os
import sys
from django.conf import settings
from django.db import models
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
from models import MigrationHistory
from south.db import db
def get_app(app):
"""
Returns the migrations m... |
"""ACME protocol client class and helper functions."""
import csv
import json
import os
import shutil
import socket
import string
import sys
import time
import jsonschema
import M2Crypto
import requests
from letsencrypt.client import acme
from letsencrypt.client import apache_configurator
from letsencrypt.client impo... |
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""SelectionContainer class.
Represents a multipage container that can be used to group other widgets into
pages.
"""
from .widget_box import Box
from .widget import register
from .widget_core import CoreWidget
from ... |
#!/usr/bin/env python3
"""Systemd init script for one or more vanilla Minecraft servers.
Usage:
minecraft [options] (start | stop | kill | restart | status | backup) [<world>...]
minecraft [options] (update | revert) [<world> [snapshot <snapshot-id> | <version>]]
minecraft [options] saves (on | off) [<world>...... |
import json
from data_provider import DataProvider
from data_provider_neo import NeoDataProvider
from ..progress_indicator import ProgressIndicator
class NeoStoredProvider(NeoDataProvider):
def __init__(self, data, progress=ProgressIndicator()):
super(NeoStoredProvider, self).__init__(data['name'], progres... |
import discord
from discord.ext import commands
import asyncio
import os
import os.path
import sys
import aiohttp
import copy
import glob
from typing import List
import subprocess
from threading import Thread
import shlex
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # pytho... |
import httplib
import urllib
class examdownloader(object):
def __init__(self, mode):
self.mode = mode
def getContents(self, module, username, password, destination, updateStatus):
updateStatus('Connecting to server')
conn = httplib.HTTPSConnection('libbrs.nus.edu.sg')
page = '... |
# coding: utf-8
""" Port of NAFF to Python """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import logging
import os
import sys
# Third-party
from astropy import log as logger
import astropy.units as u
import matplotlib.pyplot as plt
import numpy ... |
import configparser
import os
import sys
from pyspark import SparkContext, SparkConf, SparkFiles
from pyspark.sql import SQLContext, Row
from datetime import datetime
from os_utils import make_directory, preparing_path, time_execution_log, check_file_exists
from subprocess import Popen, PIPE
from vina_utils import get_... |
# coding: utf-8
'''
See https://github.com/wheeler-microfluidics/microdrop/issues/216
'''
import bz2
import importlib
import itertools as it
import logging
import json
import platform
import re
import sys
import types
import conda_helpers as ch
import path_helpers as ph
import requests
logger = logging.getLogger(__n... |
# Copyright 2016 - Alcatel-Lucent
#
# 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 wri... |
# coding: utf-8
'''
See https://github.com/wheeler-microfluidics/microdrop/issues/216
'''
import itertools as it
import json
import conda_helpers as ch
MICRODROP_CONDA_ETC = ch.conda_prefix().joinpath('etc', 'microdrop')
MICRODROP_CONDA_SHARE = ch.conda_prefix().joinpath('share', 'microdrop')
def _channel_args(cha... |
# pylint: disable=missing-docstring, import-error
import os
import subprocess
from operator import itemgetter
import pandas as pd
def xgbfi(bst, feature_names, fmap='xgb.fmap', fdump='xgb.dump', **kwargs):
create_feature_map(feature_names, fmap)
dump_model(bst, fdump, fmap)
kwargs['dump_file'] = fdump
... |
import ctypes
import numpy
import sys
import os
lib_dirs = ('.',
'/lib',
'/usr/lib',
'/usr/local/lib',
'/opt/local/lib',
)
_FI = None
for d in lib_dirs:
try:
_FI = numpy.ctypeslib.load_library('libFreeImage', d)
except OSError... |
''' Inline Dropdown XBlock main Python class'''
import pkg_resources
from django.template import Context, Template
from django.utils.translation import ungettext
from xblock.core import XBlock
from xblock.fields import Scope, String, List, Float, Integer, Dict, Boolean
from xblock.fragment import Fragment
from lxml... |
import os
import sys
from collections import defaultdict, OrderedDict
this_dir = os.path.realpath(os.path.dirname(__file__))
sys.path.append(os.path.realpath(os.path.join(os.pardir, os.pardir)))
sys.path.append(os.path.realpath(os.path.join(os.pardir, os.pardir, os.pardir, 'python')))
from geodata.address_expansion... |
import requests
from bs4 import BeautifulSoup
from django.conf import settings
from django.utils.module_loading import import_string
from bluebottle.fsm.utils import document_notifications
api = settings.CONFLUENCE['api']
def clean_text(content):
return '\n'.join([
line.strip() for line
in conte... |
import unittest
import mmf
class TestSplitCategories(unittest.TestCase):
def test_when_none(self):
actual = mmf._split_categories('None')
expected = []
self.assertEqual(actual, expected)
def test_when_none_mixed_caps(self):
actual = mmf._split_categories('noNE')
expec... |
"""Compatibility fixes for older version of python, numpy and scipy
If you add content to this file, please give the version of the package
at which the fixe is no longer needed.
# XXX : copied from scikit-learn
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael... |
import csv
from math import e
import plot
class Gun:
"""A naval gun, as mounted on a ship.
Attributes:
- name: the gun designation in the 1921 tables.
- mount: the gun mount type (capital, secondary, cruiser, destroyer) in the 1921 tables.
- caliber: the caliber of the gun in inches.
... |
from redbot.core import commands, checks, Config, data_manager
from redbot.core.utils.chat_formatting import pagify
import discord
import random
import requests
import re
import enum
import urllib
import flickrapi
from bs4 import BeautifulSoup
from .pastebin import PasteBin
from .constants import SU_ITEMS, SSU_ITEMS, S... |
#!/usr/bin/python
"""Provides configuration management/handling for managing freeradius."""
import argparse
import os
import shutil
import hashlib
import json
import base64
import subprocess
import wrapper
import random
import string
import filecmp
import pwd
import urllib2
import urllib
import datetime
# user setup
C... |
#!/usr/bin/env python
# Copyright 2012 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Runs a command with optional isolated input/output.
run_isolated takes cares of setting up a temporary environment, runn... |
import boto3
import glob
import io
import json
import os
import re
import shutil
import subprocess
import tarfile
from botocore.client import Config
from django.conf import settings
from django.db import transaction
from django.utils import timezone
from typing import Dict, List
import numpy as np
import pandas as pd
... |
from configman import *
class PermsMan:
def __init__(self):
self.confman = ConfigMan("perms")
def set_cmd_perms(self, cmd, value):
value = int(value)
if value < 0 or value > 999:
raise Exception("Permissions level must be an integer between 0 and 999")
self.confman.... |
import asyncio
import collections
import logging
import random
import re
import typing
from datetime import datetime, timedelta
import discord
from cogbot.cog_bot import ChannelId, CogBot
from cogbot.extensions.helpchat.channel_state import ChannelState
SECONDS_UNTIL_IDLE = 1800
SECONDS_TO_POLL = 60
PREEMPTIVE_CACHE... |
##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
... |
# Copyright 2014-2016 The Meson development team
# 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 agree... |
# Contributors Listed Below - COPYRIGHT 2016
# [+] International Business Machines Corp.
#
#
# 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
#... |
# Copyright © 2017 Collabora Ltd.
#
# This file is part of pfg.
#
# pfg is free software: you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 2.1 of the License, or (at your option)
# any later version.
#
# pf... |
from __future__ import print_function
import itertools
import os
import random
import sys
import collections
import importlib
import json
import pkgutil
import threading
import warnings
import re
import logging
from functools import wraps
import flask
from flask import Flask, Response
from flask_compress import Comp... |
import ujson
import urllib
import os
import httplib
import time
import math
import urllib2
import jsonpatch
from boto.s3.connection import S3Connection, OrdinaryCallingFormat
import boto
from cStringIO import StringIO
# Item class
#____________________________________________________________________________________... |
'''
Section 'Damage' =============================================================
'''
import math
from PIL import Image
from hashlib import md5
import html2text
def rgb2hex(r, g, b):
return '{:02x}{:02x}{:02x}'.format(r, g, b).upper()
class SiteDamage:
image_importance = {}
css_importance = 0
multi... |
### Note this is Python 2.7, because Theano ###
from __future__ import division
import os
import glob
import datetime
import shelve
import numpy as np
from scipy.io import wavfile
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import StratifiedKFold
from sklearn.externals import joblib
... |
import os
import argparse
import logging
import multiprocessing
import subprocess
import fileinput
import traceback
from functools import partial, update_wrapper
import json
import base64
import time
import pysam
import pybedtools
import extract_pairs
from defaults import *
FORMAT = '%(levelname)s %(asctime)-15s %(n... |
import time
from simpleflow import (
activity,
Workflow,
futures,
)
@activity.with_attributes(task_list='quickstart', version='example')
def increment(x):
return x + 1
@activity.with_attributes(task_list='quickstart', version='example')
def double(x):
return x * 2
@activity.with_attributes(ta... |
from datetime import datetime
from datetime import timedelta
import pytz
from webob.response import gzip_app_iter
from ichnaea.content.models import (
MapStat,
MAPSTAT_TYPE,
Score,
SCORE_TYPE,
User,
)
from ichnaea.models import (
CellMeasure,
Measure,
RADIO_TYPE,
WifiMeasure,
W... |
"""
Converter for `git diff` paths
"""
import os
import subprocess
class GitPathTool(object):
"""
Converts `git diff` paths to absolute paths or relative paths to cwd.
This class should be used throughout the project to change paths from
the paths yielded by `git diff` to correct project paths
"""... |
from geoalchemy2 import Geography
from sqlalchemy.dialects import postgresql
from . import db
# A given town can be part of several ZUPC
town_zupc = db.Table(
'town_zupc', db.metadata,
db.Column('town_id', db.Integer, db.ForeignKey('town.id')),
db.Column('zupc_id', db.Integer, db.ForeignKey('ZUPC.id')),
... |
import logging
import warnings
from extruct.jsonld import JsonLdExtractor
from extruct.rdfa import RDFaExtractor
from extruct.w3cmicrodata import MicrodataExtractor
from extruct.opengraph import OpenGraphExtractor
from extruct.microformat import MicroformatExtractor
from extruct.uniform import _umicrodata_microformat,... |
# Class definition:
# ATLASSiteInformation
# This class is the ATLAS site information class inheriting from SiteInformation
# Instances are generated with SiteInformationFactory via pUtil::getSiteInformation()
# Implemented as a singleton class
# http://stackoverflow.com/questions/42558/python-and-the-singlet... |
from socket import timeout
import datetime
import calendar
from errbot import BotPlugin, botcmd
from pynano import User, Region
class NanoApiError(Exception):
pass
class NanoBot(BotPlugin):
"""Integrate Err with NaNoWriMo's word count API"""
min_err_version = '3.0.5' # Optional, but recommended
_... |
""" Affine image registration module consisting of the following classes:
AffineMap: encapsulates the necessary information to perform affine
transforms between two domains, defined by a `static` and a `moving`
image. The `domain` of the transform is the set of points in the
`static` image'... |
"""Various tools related to creating and working with streamlines
This module provides tools for targeting streamlines using ROIs, for making
connectivity matrices from whole brain fiber tracking and some other tools that
allow streamlines to interact with image data.
Important Note:
---------------
Dipy uses affine ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import string
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class RunningWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
layout = QHBoxLayout()
button = QPushButton('Click me t... |
"""
models.py
Base model for dirty_models.
"""
from .fields import BaseField, ModelField, ArrayField
from dirty_models.fields import IntegerField, FloatField, BooleanField, StringField, DateTimeField
from datetime import datetime
from dirty_models.model_types import ListModel
from dirty_models.base import BaseData
im... |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2015 SciFabric LTD.
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... |
from __future__ import print_function, division
import hashlib
import json
import os
def generate_file_md5(filename, blocksize=2**20):
m = hashlib.md5()
with open(filename, "rb") as f:
while True:
buf = f.read(blocksize)
if not buf:
break
m.update(bu... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import functools
import itertools
import lupa
from splash.qtrender import RenderScript, stop_on_error
from splash.lua import (
table_as_kwargs_method,
get_new_runtime,
start_main,
get_script_source,
lua2python,
python2lua,
)
from s... |
"""The main package of Spynl."""
from pkg_resources import iter_entry_points # pylint: disable=E0611
from pyramid.config import Configurator
from pyramid.security import NO_PERMISSION_REQUIRED
from pyramid.viewderivers import INGRESS
from spynl.main import serial, about, plugins, routing, events, endpoints, \
s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.