code stringlengths 1 199k |
|---|
from __future__ import division
class ExitNode:
"""
Class for the exit node on our network
"""
def __init__(self, max_simulation_time):
"""
Initialise a node.
"""
self.individuals = []
self.id_number = -1
self.next_event_date = max_simulation_time
... |
PYIGNITION_VERSION = 1.0
DRAWTYPE_POINT = 100
DRAWTYPE_CIRCLE = 101
DRAWTYPE_LINE = 102
DRAWTYPE_SCALELINE = 103
DRAWTYPE_BUBBLE = 104
DRAWTYPE_IMAGE = 105
INTERPOLATIONTYPE_LINEAR = 200
INTERPOLATIONTYPE_COSINE = 201
UNIVERSAL_CONSTANT_OF_MAKE_GRAVITY_LESS_STUPIDLY_SMALL = 1000.0 # Well, Newton got one to make it les... |
import json
import math
import random
import os
class KMeans(object):
# TO-DO: Richard
def __init__(self, dataset=None):
file_path = os.path.dirname(os.path.realpath(__file__))
if dataset is None:
self.mega_dataset = json.loads(open(file_path + '/dataset.json', 'r').read())
e... |
"""
The full documentation is at https://python_hangman.readthedocs.org.
"""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_opti... |
from mongoengine.fields import BaseField
from marrow.package.canonical import name
from marrow.package.loader import load
class PythonReferenceField(BaseField):
"""A field that transforms a callable into a string reference using marrow.package on assignment, then back to the
callable when accessing."""
def to_python... |
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/player/shared_player_city_bank_corellia_style_01.iff"
result.attribute_template_id = -1
result.stfName("","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
__author__ = 'leif'
from django.contrib import admin
from models import *
admin.site.register(GameExperiment)
admin.site.register(UserProfile)
admin.site.register(MaxHighScore) |
"""
compiler tests.
These tests are among the very first that were written when SQLAlchemy
began in 2005. As a result the testing style here is very dense;
it's an ongoing job to break these into much smaller tests with correct pep8
styling and coherent test organization.
"""
from sqlalchemy.testing import eq_, is_, a... |
from django.views.generic import CreateView, UpdateView, DeleteView
from django.http import HttpResponse, HttpResponseRedirect
from django.template.loader import render_to_string
from django.template import RequestContext
from django.core.serializers.json import DjangoJSONEncoder
from django.conf import settings
try:
... |
from fine_mapping_pipeline.finemap.finemap import run_finemap, remove_surrogates, _write_matrix, _write_zscores
import logging
logging.basicConfig(level=logging.INFO)
def test_remove_surrogate(tmpdir):
input_matrix = 'tests/finemap_data/test.matrix'
input_zscore = 'tests/finemap_data/test.Z'
surrogates_out ... |
import os
import json
import six
from ddt import ddt, data, file_data, is_hash_randomized
from nose.tools import assert_equal, assert_is_not_none, assert_raises
@ddt
class Dummy(object):
"""
Dummy class to test the data decorator on
"""
@data(1, 2, 3, 4)
def test_something(self, value):
retu... |
import unittest
class TestModuleOnboarding(unittest.TestCase):
pass |
from icqsol.bem.icqPotentialIntegrals import PotentialIntegrals
from icqsol.bem.icqLaplaceMatrices import getFullyQualifiedSharedLibraryName
import numpy
def testObserverOnA(order):
paSrc = numpy.array([0., 0., 0.])
pbSrc = numpy.array([1., 0., 0.])
pcSrc = numpy.array([0., 1., 0.])
xObs = paSrc
int... |
import urllib, urllib2
import cookielib
import re
import time
from random import random
from json import dumps as json_dumps, loads as json_loads
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
project_root_path = os.path.abspath(os.path.join(os.path.dirname(__file__)))
sys.path.append(project_root_pat... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os.path
import string
import TestSCons
_python_ = TestSCons._python_
test = TestSCons.TestSCons()
test.subdir('subdir', 'sub2')
test.write('build.py', r"""
import sys
contents = open(sys.argv[2], 'rb').read() + open(sys.argv[3], 'rb').read()
file = op... |
"""Tests for base extension."""
import unittest
from grow.extensions import base_extension
class BaseExtensionTestCase(unittest.TestCase):
"""Test the base extension."""
def test_config_disabled(self):
"""Uses the disabled config."""
ext = base_extension.BaseExtension(None, {
'disabl... |
from sys import argv
def isprime(x):
"""Checks if x is prime number
Returns true if x is a prime number, otherwise false.
"""
if x <= 1:
return False
for n in range(2, (x - 1)):
if x % n == 0:
return False
return True
def main():
"""Main"""
filename, number =... |
from holmes.validators.base import Validator
from holmes.utils import _
class ImageAltValidator(Validator):
@classmethod
def get_without_alt_parsed_value(cls, value):
result = []
for src, name in value:
data = '<a href="%s" target="_blank">%s</a>' % (src, name)
result.app... |
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# @param root, a tree node
# @return a list of integers
def postorderTraversal(self, root):
pass |
from .models import Project,Member,Contact,Technology,Contributor
from rest_framework import serializers
class ContactSerializer(serializers.ModelSerializer):
class Meta:
model = Contact
fields = ('name', 'link')
class MemberSerializer(serializers.ModelSerializer):
contacts = ContactSerializer(m... |
from . animation import Animation
from .. layout import strip
class Strip(Animation):
LAYOUT_CLASS = strip.Strip
LAYOUT_ARGS = 'num',
def __init__(self, layout, start=0, end=-1, **kwds):
super().__init__(layout, **kwds)
self._start = max(start, 0)
self._end = end
if self._end... |
from msrest.serialization import Model
class DeploymentProperties(Model):
"""Deployment properties.
:param template: The template content. It can be a JObject or a well
formed JSON string. Use only one of Template or TemplateLink.
:type template: object
:param template_link: The template URI. Use o... |
import enum
class calendar_permissions(enum.IntEnum):
ASCIT = 21
AVERY = 22
BECHTEL = 23
BLACKER = 24
DABNEY = 25
FLEMING = 26
LLOYD = 27
PAGE = 28
RICKETTS = 29
RUDDOCK = 30
OTHER = 31
ATHLETICS = 32 |
import logging, sys
from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL
class InfoFilter(logging.Filter):
def filter(self, rec):
return rec.levelno in (logging.DEBUG, logging.INFO)
def _new_custom_logger(name='BiblioPixel',
fmt='%(levelname)s - %(module)s - %(message)s'):
lo... |
def make_colorscale_from_colors(colors):
if len(colors) == 1:
colors *= 2
return tuple((i / (len(colors) - 1), color) for i, color in enumerate(colors)) |
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_corellia_solitude_medium3.iff"
result.attribute_template_id = -1
result.stfName("poi_n","base_poi_building")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
class Solution(object):
# def convert(self, s, numRows):
# """
# :type s: str
# :type numRows: int
# :rtype: str
# """
# ls = len(s)
# if ls <= 1 or numRows == 1:
# return s
# temp_s = []
# for i in range(numRows):
# tem... |
"""Representation of Z-Wave binary_sensors."""
from openzwavemqtt.const import CommandClass, ValueIndex, ValueType
from homeassistant.components.binary_sensor import (
DOMAIN as BINARY_SENSOR_DOMAIN,
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from hom... |
"""
run quality assurance measures on functional data
"""
import sys,glob
sys.path.append('/corral-repl/utexas/poldracklab/software_lonestar/quality-assessment-protocol')
import os
import numpy
from run_shell_cmd import run_shell_cmd
from compute_fd import compute_fd
from qap import load_func,load_image, load_mask, sum... |
__version__ = "master" |
'''
Created on May 14, 2012
@author: Charlie
'''
import ConfigParser
import boto
import cgitb
cgitb.enable()
class MyClass(object):
def __init__(self, domain):
config = ConfigParser.RawConfigParser()
config.read('.boto')
key = config.get('Credentials', 'aws_access_key_id')
secretKey ... |
from .resource import Resource
class FlattenedProduct(Resource):
"""FlattenedProduct
:param id: Resource Id
:type id: str
:param type: Resource Type
:type type: str
:param tags:
:type tags: dict
:param location: Resource Location
:type location: str
:param name: Resource Name
... |
from .deployed_service_replica_info import DeployedServiceReplicaInfo
class DeployedStatefulServiceReplicaInfo(DeployedServiceReplicaInfo):
"""Information about a stateful service replica deployed on a node.
:param service_name: Full hierarchical name of the service in URI format
starting with `fabric:`.
... |
import unittest
import os
import json
from io import open
import warnings
from pymatgen.electronic_structure.bandstructure import Kpoint
from pymatgen import Lattice
from pymatgen.electronic_structure.core import Spin, Orbital
from pymatgen.io.vasp import BSVasprun
from pymatgen.electronic_structure.bandstructure impor... |
"""
SPLIF Fingerprints for molecular complexes.
"""
import logging
import itertools
import numpy as np
from deepchem.utils.hash_utils import hash_ecfp_pair
from deepchem.utils.rdkit_utils import load_complex
from deepchem.utils.rdkit_utils import compute_all_ecfp
from deepchem.utils.rdkit_utils import MoleculeLoadExcep... |
from .base import _Base, Base
from .base_collection import BaseCollection
from .habit_groups import HabitGroups
from .habit_groups_collection import HabitGroupsCollection
from .habits import Habits
from .habits_collection import HabitsCollection
from .users import Users
from .users_collection import UsersCollection
fro... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/inventory/shared_creature_inventory_6.iff"
result.attribute_template_id = -1
result.stfName("item_n","inventory")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
""" FileDialogDelegateQt.py: Delegate that pops up a file dialog when double clicked.
Sets the model data to the selected file name.
"""
import os.path
try:
from PyQt5.QtCore import Qt, QT_VERSION_STR
from PyQt5.QtWidgets import QStyledItemDelegate, QFileDialog
except ImportError:
try:
from PyQt4.Qt... |
import sys
import pprint
class Reference(object):
def __init__(self, tb_index, varname, target):
self.tb_index = tb_index
self.varname = varname
self.target = target
def marker(self, xtb, tb_index, key):
return Marker(self, xtb, tb_index, key)
class Marker(object):
def __init... |
"""
This scripts sets an initial layout for the ProEMOnline software. It uses the
PyQtGraph dockarea system and was designed from the dockarea.py example.
Contains:
Left column: Observing Log
Center column: Plots
Right column: Images and Process Log
Menu bar
"""
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, ... |
import _plotly_utils.basevalidators
class PadValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="pad", parent_name="layout.title", **kwargs):
super(PadValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_... |
from sentence import Sentence
from textblob import TextBlob
from itertools import chain
from collections import Counter
def findSubject(lines):
sentences = []
if len(lines) == 0:
print "messages are empty"
return None
for m in lines:
sentences.append(Sentence(m).nouns)
if len(sen... |
import xml.sax
import unittest
import test_utils
import xmlreader
import os
path = os.path.dirname(os.path.abspath(__file__) )
class XmlReaderTestCase(unittest.TestCase):
def test_XmlDumpAllRevs(self):
pages = [r for r in xmlreader.XmlDump(path + "/data/article-pear.xml", allrevisions=True).parse()]
... |
"""Burnin program
"""
import sys
import optparse
import time
import socket
import urllib
from itertools import izip, islice, cycle
from cStringIO import StringIO
from ganeti import opcodes
from ganeti import constants
from ganeti import cli
from ganeti import errors
from ganeti import utils
from ganeti import hyperviso... |
import threading
class BufferedPipeObject(object):
def __init__(self):
self.closed = False
self.contents = b""
self.access_mutex = threading.Lock()
self.waiting_for_content_semaphore = \
threading.Semaphore()
self.waiting_for_content_counter = 0
self._writ... |
from __future__ import absolute_import
"""Server-side pack repository related request implmentations."""
from bzrlib.smart.request import (
FailedSmartServerResponse,
SuccessfulSmartServerResponse,
)
from bzrlib.smart.repository import (
SmartServerRepositoryRequest,
)
class SmartServerPackRepositor... |
import os, platform
sysstr = platform.system()
if sysstr == "Windows":
LF = '\r\n'
elif sysstr == "Linux":
LF = '\n'
def StripStr(str):
# @Function: Remove space(' ') and indent('\t') at the begin and end of the string
oldStr = ''
newStr = str
while oldStr != newStr:
oldStr = newStr
... |
from collections import namedtuple
import os
import errno
import math
try:
import urlparse as url_parser
except ImportError:
import urllib.parse as url_parser
import parser
class M3U8(object):
'''
Represents a single M3U8 playlist. Should be instantiated with
the content as string.
Parameters:
... |
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import socket
import os
import re
import select
import time
import paramiko
import struct
import fcntl
import signal
import textwrap
import getpass
import fnmatch
import readline
import datetime
from multiprocessing import Pool
os.environ['DJANGO_SETTINGS_MODULE'] =... |
import hashlib
import binascii
class MerkleTools(object):
def __init__(self, hash_type="sha256"):
hash_type = hash_type.lower()
if hash_type == 'sha256':
self.hash_function = hashlib.sha256
elif hash_type == 'md5':
self.hash_function = hashlib.md5
elif hash_ty... |
"""
Miscellaneous functions, which are useful for handling bodies.
"""
from yade.wrapper import *
import utils,math,numpy
try:
from minieigen import *
except ImportError:
from miniEigen import *
def spheresPackDimensions(idSpheres=[],mask=-1):
"""The function accepts the list of spheres id's or list of bodies and ca... |
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.rest.gen_data import a_provider as _a_provider
from cfme.rest.gen_data import vm as _vm
from cfme.utils import error
from cfme.utils.rest import assert_response, delete_resources_from_collection
from cfme.utils.wait import wait_for
pytestmark... |
__author__ = 'Jesús Arroyo Torrens <jesus.arroyo@bq.com>'
__copyright__ = 'Copyright (C) 2014-2016 Mundo Reader S.L.'
__license__ = 'GNU General Public License v2 http://www.gnu.org/licenses/gpl2.html'
from horus.engine.driver.driver import Driver
from horus.engine.scan.ciclop_scan import CiclopScan
from horus.engine.s... |
from __future__ import absolute_import
from __future__ import print_function
from future.utils import lrange
ALL_RESULTS = lrange(7)
SUCCESS, WARNINGS, FAILURE, SKIPPED, EXCEPTION, RETRY, CANCELLED = ALL_RESULTS
Results = ["success", "warnings", "failure", "skipped", "exception", "retry", "cancelled"]
def statusToStrin... |
""" Product transfer management """
from decimal import Decimal
from kiwi.currency import currency
from storm.expr import Join, LeftJoin, Sum, Cast, Coalesce, And
from storm.info import ClassAlias
from storm.references import Reference
from zope.interface import implementer
from stoqlib.database.expr import NullIf
fro... |
from __future__ import print_function
import sys
import re
from cStringIO import StringIO
import yaml
import types
import jinja2
IN_PLACE_START = "/* START GENERATED CODE */"
IN_PLACE_END = "/* END GENERATED CODE */"
util_lua_dnp3_objects_c_template = """/* Copyright (C) 2015 Open Information Security Foundation
*
* ... |
"""
***************************************************************************
CreateWorkspace.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************************************... |
from __future__ import division
"""
These functions are for BOSSANOVA (BOss Survey of Satellites Around Nearby Optically obserVable milky way Analogs)
"""
import numpy as np
from matplotlib import pyplot as plt
import targeting
def count_targets(hsts, verbose=True, remove_cached=True, rvir=300, targetingkwargs={}):
... |
import hashlib
import logging
from x1category import X1Category
TOOL_PREFIX = 'X1Tool'
class X1Tool(object):
'appid:6376477c731a89e3280657eb88422645f2d1e2a684541222e21371f3110110d2'
DEFAULT_METADATA = {'name': "X1Tool", 'author': "admin", 'comments': "default", 'template': "default/index.html", 'category': X1Ca... |
import math
from Components.Renderer.Renderer import Renderer
from skin import parseColor
from enigma import eCanvas, eSize, gRGB, eRect
class AnalogClockLCD(Renderer):
def __init__(self):
Renderer.__init__(self)
self.fColor = gRGB(255, 255, 255, 0)
self.fColors = gRGB(255, 0, 0, 0)
self.fColorm = gRGB(255, 0,... |
"""
Utilities for database insertion
"""
import gridfs
import json
import pymongo
import paramiko
import os
import stat
import shutil
from monty.json import MSONable
class MongoDatabase(MSONable):
"""
MongoDB database class for access, insertion, update, ... in a MongoDB database
"""
def __init__(self, ... |
"""Record module signals."""
from blinker import Namespace
_signals = Namespace()
record_viewed = _signals.signal('record-viewed')
"""
This signal is sent when a detailed view of record is displayed.
Parameters:
recid - id of record
id_user - id of user or 0 for guest
request - flask request o... |
import k3d
k3d.check_node_environment(context, "MeshSourceScript")
cubes = context.output.primitives().create("cube")
matrices = cubes.topology().create("matrices", "k3d::matrix4")
materials = cubes.topology().create("materials", "k3d::imaterial*")
uniform = cubes.attributes().create("uniform")
color = uniform.create("... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Collective.slug'
db.add_column(u'collectives_collective', 'slug',
... |
from __future__ import print_function
import os
import shutil
import sys
from portage.util import normalize_path
os.chdir(os.environ["__PORTAGE_HELPER_CWD"])
def dodir(path):
try:
os.makedirs(path, 0o755)
except OSError:
if not os.path.isdir(path):
raise
os.chmod(path, 0o755)
def dofile(src,dst):
shutil.cop... |
import scipy.io.wavfile
from os.path import expanduser
import os
import array
from pylab import *
import scipy.signal
import scipy
import wave
import numpy as np
import time
import sys
import math
import matplotlib
import subprocess
fft_size = 2048
iterations = 300
hopsamp = fft_size // 8
def ensure_audio():
if not... |
from harpia.model.connectionmodel import ConnectionModel as ConnectionModel
from harpia.system import System as System
class DiagramModel(object):
# ----------------------------------------------------------------------
def __init__(self):
self.last_id = 1 # first block is n1, increments to each new bl... |
import os
from PyQt4 import QtGui, Qt, QtCore
from opus_gui.general_manager.views.ui_dependency_viewer import Ui_DependencyViewer
class DependencyViewer(QtGui.QDialog, Ui_DependencyViewer):
def __init__(self, parent_window):
flags = QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.Wind... |
class WebofknowledgePipeline(object):
def process_item(self, item, spider):
return item |
"""
***************************************************************************
AutoincrementalField.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*******************************************... |
import os
import sys
if __name__ == '__main__' and __package__ is None:
dir_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if dir_path != '/usr':
sys.path.insert(1, dir_path)
from kano_profile.badges import load_badge_rules
from kano.utils import write_json, uniqify_list
all_rules... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
module: sf_snapshot_schedule_manager
short_description: Manage SolidFire sn... |
'''
PyChess arena tournament script.
This script executes a tournament between the engines installed on your
system. The script is executed from a terminal with the usual environment.
'''
import os
import sys
from gi.repository import GLib
from gi.repository import GObject
GObject.threads_init()
mainloop = ... |
"""Generate test data for IDTxl network comparison unit and system tests.
Generate test data for IDTxl network comparison unit and system tests. Simulate
discrete and continous data from three correlated Gaussian data sets. Perform
network inference using bivariate/multivariate mutual information (MI)/transfer
entropy ... |
from __future__ import with_statement
import os
import re
import threading
import datetime
import traceback
import sickbeard
from common import SNATCHED, SNATCHED_PROPER, SNATCHED_BEST, Quality, SEASON_RESULT, MULTI_EP_RESULT
from sickbeard import logger, db, show_name_helpers, exceptions, helpers
from sickbeard import... |
from __future__ import absolute_import
import os
import txaio
if os.environ.get('USE_TWISTED', False):
txaio.use_twisted()
else:
txaio.use_asyncio()
from autobahn import wamp
from autobahn.wamp import message
from autobahn.wamp import exception
from autobahn.wamp import protocol
import unittest2 as unittest
cla... |
from service import ccnet_rpc, monitor_rpc, seafserv_rpc, \
seafserv_threaded_rpc, ccnet_threaded_rpc
"""
WebAccess:
string repo_id
string obj_id
string op
string username
"""
class SeafileAPI(object):
def __init__(self):
pass
# fileserver token
def get_fileserver_access_token(se... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('changeset', '0022_auto_20160222_2358'),
]
operations = [
migrations.AddField(
model_name='userdetail',
name='contributor_uid',
... |
from core import messages
from core.weexceptions import FatalException
from mako import template
from core.config import sessions_path, sessions_ext
from core.loggers import log, stream_handler
from core.module import Status
import os
import yaml
import glob
import logging
import urlparse
import atexit
import ast
print... |
from distutils.core import setup
import py2exe
opts = {
"py2exe": {
"compressed": 1,
"optimize": 2,
"ascii": 1,
"bundle_files": 1,
"packages": ["encodings"],
"dist_dir": "dist"
}
}
setup (name = "Gomoz",
fullname = "Gomoz web scanner",
version = "1.0.1",
description... |
"""
Module for smallrnaseq configuration file. Used with command line app.
Created Jan 2017
Copyright (C) Damien Farrell
"""
from __future__ import absolute_import, print_function
import sys, os, string, time
import types, re, subprocess, glob, shutil
import pandas as pd
try:
import configparser
except:
import ... |
import re
import urlparse
from ..internal.misc import json
from ..internal.XFSAccount import XFSAccount
class UptoboxCom(XFSAccount):
__name__ = "UptoboxCom"
__type__ = "account"
__version__ = "0.21"
__status__ = "testing"
__description__ = """Uptobox.com account plugin"""
__license__ = "GPLv3"
... |
import sys;
import os;
import random;
import string;
from hashlib import sha1
from subprocess import *
import socket;
sys.path.append("/usr/lib/domoleaf");
from DaemonConfigParser import *;
MASTER_CONF_FILE_BKP = '/etc/domoleaf/master.conf.save';
MASTER_CONF_FILE_TO = '/etc/domoleaf/master.conf... |
"""
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 lat... |
from django.conf import settings
from django.conf.urls import patterns, url
from haystack.views import SearchView
from elections.forms import ElectionForm
from elections.views import ElectionsSearchByTagView, HomeView, ElectionDetailView,\
CandidateDetailView, SoulMateDetailView, FaceToFaceView, AreaDetailView, \
... |
../../../../../share/pyshared/twisted/python/urlpath.py |
from couchpotato.core.event import addEvent
from couchpotato.core.helpers.variable import tryFloat
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from couchpotato.environment import Env
from urlparse import urlparse
import re
import time
log = CPLog(__name__)
class Provider(P... |
import argparse, requests, sys, configparser, zipfile, os, shutil
from urllib.parse import urlparse, parse_qs
appname="ConverterUpdater"
author="Leo Durrant (2017)"
builddate="05/10/17"
version="0.1a"
release="alpha"
filesdelete=['ConUpdate.py', 'Converter.py', 'LBT.py', 'ConverterGUI.py', 'LBTGUI.py']
directoriesdelet... |
import SpaceScript
import multiprocessing
from multiprocessing import Process, Queue, Pipe, Lock
from SpaceScript import frontEnd
from SpaceScript import utility
from SpaceScript.frontEnd import terminal
from SpaceScript.utility import terminalUtility
from SpaceScript.terminal import terminal as terminal
from SpaceScri... |
'''
Base module for all of the exceptions classes used internally.
Created on 10 Dec 2013
@author: alex
'''
class PheException(Exception):
'''
This is the top level class that EVERYTHING must be derived from. In particular,
this class contains an abstract property called 'phe_return_code'. This property
... |
"""Methods and utilties for performing Omega pipline scans
See Chatterji 2005 [thesis] for details on the Q-pipeline.
"""
__author__ = 'Duncan Macleod <duncan.macleod@ligo.org>'
__credits__ = 'Alex Urban <alexander.urban@ligo.org>'
from .core import * |
import logging
import logging.config
"""
Logging for the oVirt Node Dbus Backend. Since we're running from
systemd, send default messages there and let journald handle it. Debug
goes in /tmp if we're running in debug mode.
"""
DEBUG_LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': ... |
import unittest
import tqdm
from ieml.dictionary.script import Script
from ieml.ieml_database import IEMLDatabase, GitInterface
from ieml.usl import PolyMorpheme, Lexeme, Word
from ieml.usl.decoration.parser.parser import PathParser
from ieml.usl.decoration.path import PolymorphemePath, GroupIndex, FlexionPath, LexemeI... |
from gnuradio import gr
import usrp_options
import transmit_path
from pick_bitrate import pick_tx_bitrate
from gnuradio import eng_notation
def add_freq_option(parser):
"""
Hackery that has the -f / --freq option set both tx_freq and rx_freq
"""
def freq_callback(option, opt_str, value, parser):
... |
import os
from setuptools import setup
PROJECT_ROOT = os.path.dirname(__file__)
def read_file(filepath, root=PROJECT_ROOT):
"""
Return the contents of the specified `filepath`.
* `root` is the base path and it defaults to the `PROJECT_ROOT` directory.
* `filepath` should be a relative path, starting fro... |
import os
import sys
import urllib
import urllib2
import re
import shutil
import zipfile
import time
import xbmc
import xbmcgui
import xbmcaddon
import xbmcplugin
import plugintools
import json
import math
home = xbmc.translatePath(os.path.join('special://home/addons/plugin.video.arena+/', ''))
tools = xbmc.translatePa... |
{
'!langcode!': 'es',
'!langname!': 'Español',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN',
'%d days ago': 'hace %d días'... |
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class ReadOnlyRadioButton(QRadioButton):
def __init__(self, parent):
QRadioButton.__init__(self, parent)
self.setFocusPolicy(Qt.NoFocus)
self.clearFocus()
def mousePressEvent(self, e):
if e.button() == Qt.LeftButton:
... |
from __future__ import absolute_import
import logging
import os
from flask import Flask
from flask_pymongo import PyMongo
from raven.contrib.flask import Sentry
from heman.api import HemanAPI
api = HemanAPI(prefix='/api')
"""API object
"""
sentry = Sentry(logging=True, level=logging.ERROR)
"""Sentry object
"""
mongo = ... |
import requests
from PIL import Image, ImageEnhance, ImageChops, ImageFilter
from io import BytesIO, StringIO
import time
import sys, os
import codecs
url = 'http://d1222391-23d7-46de-abef-73cbb63c1862.levels.pathwar.net'
imgurl = url + '/captcha.php'
headers = { 'Host' : 'd1222391-23d7-46de-abef-73cbb63c1862.levels.pa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.