code stringlengths 1 199k |
|---|
"""
WSGI config for geology project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... |
import theano
import numpy
import scipy
from theano import tensor
from blocks.bricks import Initializable, Linear
from blocks.bricks.parallel import Parallel
from blocks.bricks.base import lazy, application
from blocks.bricks.attention import (
GenericSequenceAttention, SequenceContentAttention,
ShallowEnergyCo... |
from django.conf.urls import url, patterns
urlpatterns = patterns(
"phileo.views",
url(r"^like/(?P<content_type_id>\d+):(?P<object_id>\d+)/$", "like_toggle", name="phileo_like_toggle")
) |
import numpy as np
from milk.supervised.base import supervised_model
class fast_classifier(object):
def __init__(self):
pass
def set_option(self, _k, _v):
pass
def train(self, features, labels, **kwargs):
examples = {}
for f,lab in zip(features, labels):
if lab no... |
"""Test mempool limiting together/eviction with the wallet."""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class MempoolLimitTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.extra... |
__all__ = ['E']
import operator
import sys
import threading
import numpy
double = numpy.double
default_kind = 'double'
type_to_kind = {bool: 'bool', int: 'int', long: 'long', float: 'float',
double: 'double', complex: 'complex', str: 'str'}
kind_to_type = {'bool': bool, 'int': int, 'long': long, 'float'... |
from __future__ import absolute_import, unicode_literals
import json
import logging
import traceback
import time
from google.appengine.api import app_identity, mail, capabilities
from google.appengine.runtime import DeadlineExceededError
from tekton.gae.middleware import Middleware
from tekton.router import PathNotFoun... |
"""Show some histograms for a directory a Xcode project files."""
from __future__ import print_function
import sys
import argparse
from os.path import abspath, dirname, join
import multiprocessing
from collections import defaultdict, Counter
import codecs
sys.path.insert(1, dirname(dirname(abspath(__file__))))
import u... |
from __init__ import *
from dao.dbArticle import SolutionArticle
from dao.dbTag import Tag
def generate_tags(data):
tag_list = []
for tag in data:
if tag == '':
continue
has_tag = Tag.query.filter(Tag.name == tag).first()
if not has_tag:
new_tag = Tag(tag)
... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_bicep_r.iff"
result.attribute_template_id = 0
result.stfName("wearables_name","ith_armor_s01_bicep_r")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ... |
from django.db.models import Case, IntegerField, Sum, Value, When
from django.db.models import CharField
from rest_framework.response import Response
from rest_framework import generics
from . import models
from . import serializers
from . import filters
LA_Bureaus = ['MF']
EO_Bureaus = ['MY', 'PA', 'PS', 'PW', 'PU', '... |
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Font(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.yaxis.title"
_path_str = "layout.yaxis.title.font"
_valid_props = {"color", "family", "... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/food/shared_drink_aludium_pu36.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
"""Fetch Massacheusetts Department of Transportation feeds.
MassDOT supplies the feeds for MA not covered by MBTA (Boston's transit authority).
http://www.massdot.state.ma.us/DevelopersData.aspx
"""
import logging
from FeedSource import FeedSource
BASE_URL = 'http://www.massdot.state.ma.us/Portals/0/docs/developers/'
L... |
"""
test_indivdual.py
Test the individual class.
Created by Måns Magnusson on 2013-03-07.
Copyright (c) 2013 __MyCompanyName__. All rights reserved.
"""
import sys
import os
from ped_parser import individual
class TestIndividual(object):
"""Test class for testing how the individual class behave"""
def setup_cla... |
from emokit.emotiv import Emotiv
import platform
if platform.system() == "Windows":
import socket # Needed to prevent gevent crashing on Windows. (surfly / gevent issue #459)
import gevent
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
is_running = True
def evt_main(rin... |
"Messages used to internally control thesplog settings."
from thespian.actors import ActorSystemMessage
class SetLogging(ActorSystemMessage):
def __init__(self, threshold, useLogging, useFile):
self.threshold = threshold
self.useLogging = useLogging
self.useFile = useFile |
"""Test the listsincelast RPC."""
from test_framework.test_framework import StarwelsTestFramework
from test_framework.util import assert_equal, assert_array_result, assert_raises_rpc_error
class ListSinceBlockTest (StarwelsTestFramework):
def set_test_params(self):
self.num_nodes = 4
self.setup_clea... |
from nose.tools import *
from localimport import localimport
import os
import sys
modules_dir = os.path.join(os.path.dirname(__file__), 'modules')
def test_localimport_with_autodisable():
sys.path.append(modules_dir)
import another_module as mod_a
try:
with localimport('modules') as _imp:
import some_mo... |
import demistomock as demisto
incident = demisto.incidents()
data = {
"Type": 17,
"ContentsFormat": "pie",
"Contents": {
"stats": [
{
"data": [
int(incident[0].get('CustomFields', {}).get('xdrhighseverityalertcount', 0))
],
... |
from lib import incrementer
print(incrementer(2)) |
"""Interactive widgets for the Jupyter notebook.
Provide simple interactive controls in the notebook.
Each Widget corresponds to an object in Python and Javascript,
with controls on the page.
To put a Widget on the page, you can display it with IPython's display machinery::
from ipywidgets import IntSlider
from... |
"""
Scrapy settings for RecipesScraper project.
"""
BOT_NAME = 'RecipesScraper'
SPIDER_MODULES = ['RecipesScraper.spiders']
NEWSPIDER_MODULE = 'RecipesScraper.spiders'
ROBOTSTXT_OBEY = True
COOKIES_ENABLED = False
ITEM_PIPELINES = {
'RecipesScraper.pipelines.JsonPipeline': 300,
}
AUTOTHROTTLE_ENABLED = True
AUTOTHR... |
import MySQLdb
file_ = open('city.csv', 'w')
file_.write ('city_id,city,country_id\n')
db = MySQLdb.connect( user='etudiants',
passwd='etudiants_1',
host='192.168.99.100',
db='sakila')
cur = db.cursor()
cur.execute("SELECT * FROM city")
for row in cur.fe... |
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages']
templates_path = ['.templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'ObservationTools'
copyright = '2017, IA'
author = 'IA'
versi... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/deed/event_perk/shared_fire_pit_deed.iff"
result.attribute_template_id = 2
result.stfName("event_perk","fire_pit_name")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
"""
Given an int n, return True if it is within 10 of 100 or 200. Note: abs(num) computes the absolute value of a number.
near_hundred(93) == True
near_hundred(90) == True
near_hundred(89) == False
"""
def near_hundred(n):
return 190 <= abs(n) <= 210 or 90 <= abs(n) <= 110
def test_function():
assert near_hundr... |
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
ALLOWED_HOSTS = []
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'django_netjsongraph.db',
}
}
SECRET_KEY = 'fn)t*+$)ugeyip6-#txyy$5wf2ervc0d2n#h)qb)y5@ly$t*@w'
INSTALLED_APPS = [
'djang... |
import os
def findFileName(path, ext):
name = ''
for projFile in os.listdir(path):
# cocoapods will generate _Pods.xcodeproj as well
if projFile.endswith(ext) and not projFile.startswith('_Pods'):
name= projFile[:-len(ext):]
return name
def DirectoryOfThisScript():
return os.path.dirname( os.path.... |
def add(x, y):
"""This function adds two numbers"""
return x + y
def subtract(x, y):
"""This function subtracts two numbers"""
return x - y
def multiply(x, y):
"""This function multiplies two numbers"""
return x * y
def divide(x, y):
"""This function divides two numbers"""
return x / y
print("Se... |
from __future__ import absolute_import
import Cookie
import copy
import threading
import time
import urllib
import urlparse
from email.utils import parsedate_tz, formatdate, mktime_tz
import netlib
from netlib import http, tcp, odict, utils
from netlib.http import cookies
from .tcp import TCPHandler
from .primitives im... |
from __future__ import absolute_import
from utils import ensure_dir, symlink_unless_exists
from .downloader import download_url, DownloadError, get_dList
from bisect import bisect
from datetime import datetime, timedelta
from pyhdf import SD
import pytz
import requests
import os
import os.path as osp
import sys
import ... |
from __future__ import (division, absolute_import, print_function,
unicode_literals)
from beets.plugins import BeetsPlugin
from beets.dbcore import types
from beets.util.confit import ConfigValueError
from beets import library
class TypesPlugin(BeetsPlugin):
@property
def item_types(self... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/loot/loot_schematic/shared_death_watch_mandalorian_belt_schematic.iff"
result.attribute_template_id = -1
result.stfName("craft_item_ingredients_n","armor_mandalorian_belt")
#### BEGIN MODIFICATIONS ####
#### END... |
from yowsup.layers.protocol_contacts.protocolentities.iq_sync_get import GetSyncIqProtocolEntity
from yowsup.structs import ProtocolTreeNode
from yowsup.layers.protocol_contacts.protocolentities.test_iq_sync import SyncIqProtocolEntityTest
class GetSyncIqProtocolEntityTest(SyncIqProtocolEntityTest):
def setUp(self)... |
__author__ = 'bernardo'
import csv
import mechanize
import re
import time
import BeautifulSoup
import smtplib
def sendEmail(result, sfrom, pwd, sto):
SMTP_SERVER = 'smtp.live.com'
SMTP_PORT = 587
sender = 'sfrom'
recipient = 'sto'
subject = 'Promocoes'
body = result
body = "<b>" + body + "<b... |
from operator import attrgetter
from inspect import signature
from callgraph.hooks import Hooks
from callgraph.utils import AuPair
from callgraph.symbols import Symbol, UnarySymbol
from callgraph.symbols import IterableConstantSymbol, MappingConstantSymbol
from callgraph.nodes import make_node
from callgraph.indent_pri... |
"""Subclass of IsClassMethods, which is generated by wxFormBuilder."""
from beatle import model
from beatle.lib import wxx
from beatle.activity.models.ui import ui as ui
from beatle.app.utils import cached_type
class IsClassMethods(ui.IsClassMethods):
"""
This dialog allows to add/remove is_class methods.
"... |
import os
from gettext import gettext as _
from pulp.bindings.exceptions import NotFoundException
from pulp.client.arg_utils import convert_boolean_arguments
from pulp.client.extensions.decorator import priority
from pulp.client.extensions.extensions import PulpCliCommand, PulpCliOption
from pulp.client.commands.pollin... |
import time
import requests
import answer
min_question_id = 1000
max_question_id = 5604
sleep_time = 10
submit_url = 'http://acm.hdu.edu.cn/submit.php?action=submit'
login_url = 'http://acm.hdu.edu.cn/userloginex.php?action=login'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 '
... |
import os
import cgi
import argparse
import BaseHTTPServer
import CGIHTTPServer
import cgitb
cgitb.enable() ## enable CGI error reporting
def web_server(port):
server = BaseHTTPServer.HTTPServer
handler = CGIHTTPServer.CGIHTTPRequestHandler #RequestsHandler
server_address = ("", port)
handler.cgi_direc... |
from __future__ import absolute_import
import cStringIO
from . import exception as dns_exception
from . import rdata as dns_rdata
from . import rdatatype as dns_rdatatype
from . import name as dns_name
class NSEC(dns_rdata.Rdata):
"""NSEC record
@ivar next: the next name
@type next: dns_name.Name object
... |
import os
from autotest.client import test, utils
tests = [["aio-dio-invalidate-failure", "poo"],
["aio-dio-subblock-eof-read", "eoftest"],
["aio-free-ring-with-bogus-nr-pages", ""],
["aio-io-setup-with-nonwritable-context-pointer", ""],
["aio-dio-extend-stat", "file"],
]
nam... |
"""
Module responsible for handling the command line arguments for Gramps.
"""
import sys
import os
import getopt
import logging
import shutil
from glob import glob
from gramps.gen.const import (LONGOPTS, SHORTOPTS, USER_PLUGINS, VERSION_DIR,
HOME_DIR, TEMP_DIR, THUMB_DIR, ENV_DIR, USER_CS... |
from glob import glob
import fitsio
import sys
from astrometry.util.fits import *
from astrometry.util.file import *
from astrometry.util.starutil_numpy import *
from astrometry.libkd.spherematch import *
from collections import Counter
from legacypipe.oneblob import _select_model
from legacypipe.survey import wcs_for_... |
import gi
gi.require_version('CinnamonDesktop', '3.0')
from gi.repository import Gtk, GdkPixbuf, Gio, GLib, GObject, Gdk
from util import utils, trackers
MAX_IMAGE_SIZE = 320
MAX_IMAGE_SIZE_LOW_RES = 200
class FramedImage(Gtk.Image):
"""
Widget to hold the user face image. It attempts to display an image at
... |
"""
The _TLSAutomaton class provides methods common to both TLS client and server.
"""
import struct
from scapy.automaton import Automaton
from scapy.config import conf
from scapy.error import log_interactive
from scapy.packet import Raw
from scapy.layers.tls.basefields import _tls_type
from scapy.layers.tls.cert impor... |
meta = {
'language': 'Suomi',
'maintainer': '***vacant***',
'encoding': 'iso-8859-1',
'direction': 'ltr',
}
text = {
'''Create this page''':
'''Luo tämä sivu''',
'''Edit "%(pagename)s"''':
'''Muokkaa "%(pagename)s"''',
'''Reduce editor size''':
'''Pienennä editointi ikkunan kokoa''',
'''Describe %s here.''':
''... |
from __future__ import absolute_import
from __future__ import division |
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
from app import db
import os.path
db.create_all()
if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
api.create(SQLALCHEMY_MIGRATE_REPO, 'database repository')
api.version_control(SQLALCHEMY_DAT... |
from __future__ import print_function, absolute_import, division
from .project import Project
from .builder import ProjectBuilder, FahProjectBuilder |
"""
Texture Replacement
+++++++++++++++++++
Example of how to replace a texture in game with an external image.
``createTexture()`` and ``removeTexture()`` are to be called from a
module Python Controller.
"""
from bge import logic
from bge import texture
def createTexture(cont):
"""Create a new Dynamic Texture"""
... |
import common
import sys, os, traceback
import time
import random
import re
import urllib
import string
from string import lower
from entities.CList import CList
from entities.CItemInfo import CItemInfo
from entities.CListItem import CListItem
from entities.CRuleItem import CRuleItem
import customReplacements as cr
imp... |
from similaritymeasures import Similarity
def main():
""" main function to create Similarity class instance and get use of it """
measures = Similarity()
print measures.euclidean_distance([0,3,4,5],[7,6,3,-1])
print measures.jaccard_similarity([0,1,2,5,6],[0,2,3,5,7,9])
if __name__ == "__main__":
main() |
from ..utils import strip_nnn
from . import attachnode
from . import export
def is_group_root(obj, objects):
if not obj.parent:
return True
return obj.parent.name not in objects
def collect_objects(collection):
objects = {}
def collect(col):
for o in col.objects:
objects[o.na... |
import click
import pickle
from build import Build
@click.group()
def cli():
pass
@cli.command()
@click.option('--cache-file', default='test-cache')
@click.option('--query')
def query(cache_file, query):
with open(cache_file, 'rb') as f:
key, criteria = query.split('=')
buildobjs = pickle.load(f... |
""" Checks assigning attributes not found in class slots
will trigger assigning-non-slot warning.
"""
from collections import deque
from missing import Unknown
class Empty(object):
""" empty """
class Bad(object):
""" missing not in slots. """
__slots__ = ['member']
def __init__(self):
self.miss... |
import xbmc, xbmcgui, xbmcaddon, xbmcplugin, re
import urllib, urllib2
import re, string
import threading
import os
import base64
import urlparse
import xbmcplugin
import cookielib
__addon__ = xbmcaddon.Addon()
__addonname__ = __addon__.getAddonInfo('name')
__icon__ = __addon__.getAddonInfo('icon')
addon... |
import random
from gnuradio import gr, gr_unittest, blocks
import pmt
class qa_repack_bits_bb (gr_unittest.TestCase):
def setUp (self):
random.seed(0)
self.tb = gr.top_block ()
self.tsb_key = "length"
def tearDown (self):
self.tb = None
def test_001_simple (self):
"""... |
"""
Profile script for CNFgen package
"""
from __future__ import print_function
import os
import sys
from contextlib import contextmanager
@contextmanager
def erase_stdout():
with file(os.devnull,"w") as null:
old_stdout = sys.stdout
sys.stdout = null
yield
sys.stdout = old_stdout
de... |
from __future__ import unicode_literals
import frappe, json
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.utils import get_url, cint
from frappe.utils.user import get_user_fullname
from frappe.utils.print_format import download_pdf
from frappe.desk.form.load import get_attachments
from... |
import os
from cosmos.api import Cosmos, py_call
from cosmos.util.helpers import environment_variables
def use_cuda_device(some_arg, num_gpus):
assert "CUDA_VISIBLE_DEVICES" in os.environ
print(("some_arg", some_arg))
print(("CUDA_VISIBLE_DEVICES", os.environ["CUDA_VISIBLE_DEVICES"]))
assert len(os.envi... |
import os
import logging
from stat import ST_MODE
import xattr
from kiwi.command import Command
log = logging.getLogger('kiwi')
class DataSync:
"""
**Sync data from a source directory to a target directory
using the rsync protocol**
:param str source_dir: source directory path name
:param str target... |
import sys
from . import constants
from .charsetprober import CharSetProber
class MultiByteCharSetProber(CharSetProber):
def __init__(self):
CharSetProber.__init__(self)
self._mDistributionAnalyzer = None
self._mCodingSM = None
self._mLastChar = [0, 0]
def reset(self):
Ch... |
from trepan.processor.command import base_subcmd as Mbase_subcmd
class SetPatSub(Mbase_subcmd.DebuggerSubcommand):
"""**set patsub** *from-re* *replace-string*
Add a substitution pattern rule replacing *patsub* with
*replace-string* anywhere it is found in source file names. If a
substitution rule was previously s... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import errno
import fcntl
import os
import pipes
import pty
import select
import subprocess
import time
from ansible import constants as C
from ansible.compat.six import PY3, text_type, binary_type
from ansible.errors import Ansible... |
from mycroft.messagebus.message import Message
from mycroft.util.log import getLogger
__author__ = 'jdorleans'
LOGGER = getLogger(__name__)
class EnclosureAPI:
"""
This API is intended to be used to interface with the hardware
that is running Mycroft. It exposes all possible commands which
can be sent ... |
import jmbitcoin as btc
import pytest
def test_bip21_decode():
# These should raise exception because of not being valid BIP21 URI's
with pytest.raises(ValueError):
btc.decode_bip21_uri('')
btc.decode_bip21_uri('nfdjksnfjkdsnfjkds')
btc.decode_bip21_uri('175tWpb8K1S7NmH4Zx6rewF9WQrcZv245... |
import roslib;
import rospy
import serial
import time
import rospy
from sensor_msgs.msg import JointState
global COM
def callback(data):
rospy.loginfo(rospy.get_caller_id()+"I heard %s",data.position)
global COM
buffer=[]
j =[0.7,0.5,0.0,0.2,-0.4,1.5]
j[0]=data.position[0]
while 1:
A = COM... |
'''
SASMOL: Copyright (C) 2011 Joseph E. Curtis, Ph.D.
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 3 of the License, or
(at your option) any later version.
T... |
from __future__ import unicode_literals
from django.db import models, migrations
def from_election_to_elections(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
Election = apps.get_model("elections", ... |
from pyknyx.common.singleton import *
import unittest
from pyknyx.services.logger import logging; logger = logging.getLogger(__name__)
from pyknyx.services.logger import logging
logger = logging.getLogger(__name__)
logging.getLogger("pyknyx").setLevel(logging.ERROR)
@six.add_metaclass(Singleton)
class SingletonTest(obj... |
from Products.ZenTestCase.BaseTestCase import BaseTestCase
from ZenPacks.zenoss.ZenJMX.datasources.JMXDataSource import JMXDataSource
class TestJMXDataSource(BaseTestCase):
def afterSetUp(self):
self.ds = JMXDataSource(id='1')
def test_getDescription(self):
self.assertEqual(self.ds.getDescriptio... |
""" VirtualMachineMonitorAgent plays the role of the watch dog for the Virtual Machine
"""
import os
import time
import glob
from DIRAC import S_OK, S_ERROR, gConfig, rootPath
from DIRAC.ConfigurationSystem.Client.Helpers import Operations
from DIRAC.Core.Base.AgentModule ... |
"""
The converters package provide functions to quickly convert on the fly from
one format to another. It is responsible to check what external library are
present, and do the job as best as possible with what we have in hand.
"""
from manuskript.converters.abstractConverter import abstractConverter
from manuskript.con... |
import re
import json
from .common import InfoExtractor
from ..utils import determine_ext
class HarkIE(InfoExtractor):
_VALID_URL = r'https?://www\.hark\.com/clips/(.+?)-.+'
_TEST = {
u'url': u'http://www.hark.com/clips/mmbzyhkgny-obama-beyond-the-afghan-theater-we-only-target-al-qaeda-on-may-23-2013',
... |
'''
main tuning script, LCLS
'''
import numpy as np
from ocelot.mint.mint import Optimizer, Action
from ocelot.mint.flash1_interface import FLASH1MachineInterface, FLASH1DeviceProperties, TestInterface
mi = FLASH1MachineInterface()
dp = FLASH1DeviceProperties()
opt = Optimizer(TestInterface(), dp)
opt.debug = True
opt.... |
import numpy as np
from esdl.cube_provider import CubeSourceProvider
from esdl.cube_config import CubeConfig
class TestCubeSourceProvider(CubeSourceProvider):
"""
CubeSourceProvider implementation used for testing cube generation without any source files.
The following usage generates a cube with two variab... |
from sqlalchemy.schema import (
Table,
Column,
MetaData,
ForeignKey)
from sqlalchemy.types import (
Text,
JSON,
DateTime,
Integer,
String)
from collections import defaultdict
from uuid import uuid4
import datetime
class SchemaStore:
def __init__(self):
self.metadata = def... |
from zope.interface import Interface
class IIndexableByStartDateTime(Interface):
def getAdjustedStartDate(self):
"""
Returns a tz-aware datetime
"""
class IIndexableByEndDateTime(Interface):
def getAdjustedEndDate(self):
"""
Returns a tz-aware datetime
"""
class I... |
"""Unit tests for the io module."""
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import time
import array
import random
import unittest
import weakref
import warnings
import abc
import signal
import errno
from itertools import cycle, count
from collections import de... |
import os
import re
import json
import importlib
from django.http import HttpResponse, HttpResponseServerError
from cloudscape.common import config
from cloudscape.common import logger
from cloudscape.common.vars import T_BASE
from cloudscape.engine.api.base import APIBase
from cloudscape.common.utils import JSONTempla... |
from __future__ import print_function
import strparser, strparser_intentdefinition, strlocale, strtrans
import time, os, sys, argparse, codecs, csv
from os.path import expanduser
from fuzzywuzzy import fuzz
from colorama import init
from colorama import Fore, Back, Style
import unicodedata2
init(autoreset=True)
def len... |
../../../../../../share/pyshared/papyon/gnet/proxy/SOCKS5.py |
"""
BIANA: Biologic Interactions and Network Analysis
Copyright (C) 2009 Javier Garcia-Garcia, Emre Guney, Baldo Oliva
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 versi... |
import argparse
from pyfastaq import tasks
def run(description):
parser = argparse.ArgumentParser(
description = 'Prints the number of sequences in input file to stdout',
usage = 'fastaq count_sequences <infile>')
parser.add_argument('infile', help='Name of input file')
options = parser.pars... |
import sys
import os
import logging
import pdb
import urllib2
import json
import ijson
from dbmanagr.writer import Writer
from dbmanagr import logger as log
from dbmanagr.jsonable import from_json
COMMANDS = {
'dbdiff': 'differ',
'dbexec': 'executer',
'dbexport': 'exporter',
'dbgraph': 'grapher',
'd... |
import unittest
from test.basetestcases import PluginLoadingMixin
class StatisticsLoadingTest (PluginLoadingMixin, unittest.TestCase):
def getPluginDir(self):
"""
Должен возвращать путь до папки с тестируемым плагином
"""
return "../plugins/statistics"
def getPluginName(self):
... |
import argparse
import json
import csv
import sys
sys.path.append('python')
import plotting
import utils
from opener import opener
parser = argparse.ArgumentParser()
parser.add_argument('-b', action='store_true') # passed on to ROOT when plotting
parser.add_argument('--outdir', required=True)
parser.add_argument('--pl... |
"""
ShotFactory library.
"""
__revision__ = "$Rev: 2006 $"
__date__ = "$Date: 2007-08-20 06:02:52 +0530 (Mon, 20 Aug 2007) $"
__author__ = "$Author: johann $" |
from __future__ import absolute_import
import urlparse
import urllib
from datetime import datetime
from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.utils.encoding import smart_unicode, sma... |
import sys
import logging
import numpy as np
from aravis import Camera
if __name__ == "__main__":
#cam = ar.get_camera("Prosilica-02-2130A-06106")
#cam = Camera("AT-Automation Technology GmbH-20805103")
cam = Camera(loglevel=logging.DEBUG)
if len(sys.argv) > 1:
path = sys.argv[1]
else:
... |
class Charset(object):
common_name = 'NotoSansDevanagari-Regular'
native_name = ''
def glyphs(self):
glyphs = []
glyphs.append(0x0065) #uni0961
glyphs.append(0x0178) #glyph00376
glyphs.append(0x02D8) #glyph00728
glyphs.append(0x0179) #glyph00377
glyphs.app... |
"""Generate template values for attributes.
Extends IdlType with property |constructor_type_name|.
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
import idl_types
from idl_types import inherits_interface
from v8_globals import includes
import v8_types
import v8_utilities
from v8_utilit... |
class TestInput(object):
"""Groups information about a test for easy passing of data."""
def __init__(self, test_name, timeout):
"""Holds the input parameters for a test.
Args:
test: name of test (not an absolute path!)
timeout: Timeout in msecs the driver should use while ru... |
import os.path
from datetime import datetime
from django.conf import settings
from django.test.client import RequestFactory
from django.test.utils import override_settings
import pytest
from django_jinja.backend import Jinja2
from jinja2 import Markup
from mock import patch
from pyquery import PyQuery as pq
from bedroc... |
"""Serializer/Deserializer objects for usage with SQLAlchemy query structures,
allowing "contextual" deserialization.
Any SQLAlchemy query structure, either based on sqlalchemy.sql.*
or sqlalchemy.orm.* can be used. The mappers, Tables, Columns, Session
etc. which are referenced by the structure are not persisted in s... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("notification", "0004_delete_old_email_notification")]
operations = [
migrations.RenameModel(
old_name="TempEmailNotification", new_name="EmailNotification"
... |
from connection import Conn as Connection |
import pytest
from django.test import RequestFactory
from django.core.urlresolvers import reverse
from api.transaction.serializers import TransactionSerializer
from iati.transaction.factories import TransactionFactory
class TestTransactionSerializer:
"""
Test if transaction model is serialized correctly.
""... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.