content stringlengths 4 20k |
|---|
from __future__ import unicode_literals
import datetime
import os
import threading
import sickrage
import sickrage.subtitles
from sickrage.core.common import dateTimeFormat
from sickrage.core.helpers import findCertainShow
class SubtitleSearcher(object):
"""
The SubtitleSearcher will be executed every hour ... |
import Ice, Test, sys, TestI
def test(b):
if not b:
raise RuntimeError('test assertion failed')
def allTests(communicator):
ref = "factory:default -p 12010 -t 10000"
factory = Test.RemoteCommunicatorFactoryPrx.checkedCast(communicator.stringToProxy(ref))
sys.stdout.write("testing thread hook... |
from odoo import api, fields, models
class MaintenanceEquipment(models.Model):
_inherit = 'maintenance.equipment'
asset_id = fields.Many2one('account.asset.asset', string='Asset')
equipment_scrap_template_id = fields.Many2one(
'mail.template',
string='Equipment Scrap Email Template',
... |
from testtools import matchers
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest import config
from tempest import test
CONF = config.CONF
class VolumesGetTestJSON(base.BaseV2ComputeTest):
@classmethod
def skip_checks(cls):
super(VolumesGetTestJSON, cls)... |
"""
Utility function to load a variety of python objects into glue
"""
# Note: this is imported with Glue. We want
# to minimize imports so that utilities like glue-deps
# can run on systems with missing dependencies
from __future__ import absolute_import, division, print_function
from contextlib import contextmanag... |
from datetime import datetime
from sqlalchemy import Column, ForeignKey, MetaData, Table, Float
from sqlalchemy import Boolean, DateTime, Integer, Unicode, UnicodeText
from sqlalchemy import func, or_
meta = MetaData()
def upgrade(migrate_engine):
meta.bind = migrate_engine
user_table = Table('user', meta, a... |
"""
Django settings for COMP204P project.
Generated by 'django-admin startproject' using Django 1.8.5.
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 pat... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Functions to calculate quality metrics of units after spike sorting
(SNR, ISIvr, etc), and to exclude trials / units not meeting QC criteria.
@author: David Samu
"""
import numpy as np
import scipy as sp
import pandas as pd
from quantities import s, ms
import elep... |
from threading import Thread
from ..action import StopAction
from ..bus import Bus
from ..bus.event_bus import EventBus, Bus
from ..event import Event
class Component(object):
"""
Base class for components
Fabio Manganiello, 2015 <<EMAIL>>
"""
def __init__(self, instance, name, n_events=None, con... |
#!/usr/bin/python
###############################################################################
#
# THE BASIL MESSAGE HANDLING LIBRARY
#
###############################################################################
#
# PROJECT CONTEXT:
#
# generate_subtype.py generates an ads file to represent each... |
import unittest
from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
from PyFoam.RunDictionary.TimeDirectory import TimeDirectory
from PyFoam.RunDictionary.SolutionFile import SolutionFile
from PyFoam.RunDictionary.FileBasis import FileBasis
from PyFoam.FoamInformation import oldTutorialStructure,foam... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygame
import math
import random
import constants
from spritesheet_functions import SpriteSheet
class Gallinazo(pygame.sprite.Sprite):
change_x = 0
change_y = 0
centrar_x = 0
centrar_y = 0
# Ángulo actual en radianes
angulo = 0
... |
"""Fichier contenant le paramètre 'déplacer' de la commande 'familier'."""
from primaires.interpreteur.masque.parametre import Parametre
class PrmDeplacer(Parametre):
"""Commande 'familier deplacer'."""
def __init__(self):
"""Constructeur du paramètre"""
Parametre.__init__(self, "déplacer", ... |
# encoding:utf-8
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
# SECURITY... |
from __future__ import absolute_import, print_function, division
from io import BytesIO
import textwrap
from mock import Mock
from netlib.exceptions import HttpException, HttpSyntaxException, HttpReadDisconnect, TcpDisconnect
from netlib.http import Headers
from netlib.http.http1.read import (
read_request, read_re... |
import os
import tempfile
from git.objects import IndexObject
from git.refs import (
RefLogEntry,
RefLog
)
from test.lib import (
TestBase,
fixture_path
)
from git.util import Actor, rmtree, hex_to_bin
import os.path as osp
class TestRefLog(TestBase):
def test_reflogentry(self):
nullhex... |
# encoding: utf-8
"""
Test suite for pptx.dml.fill module
"""
from __future__ import absolute_import
import pytest
from pptx.dml.color import ColorFormat
from pptx.dml.fill import FillFormat
from pptx.enum.dml import MSO_FILL
from ..oxml.unitdata.dml import (
a_blipFill, a_gradFill, a_grpFill, a_noFill, a_patt... |
#!/usr/bin/env python
# --!-- coding: utf8 --!--
from PyQt5.QtCore import pyqtSignal, Qt, QTimer, QRect
from PyQt5.QtGui import QBrush, QCursor, QPalette, QFontMetrics, QColor
from PyQt5.QtWidgets import QWidget, QListWidgetItem, QToolTip, QStyledItemDelegate, QStyle
from manuskript.enums import Character
from manuskr... |
import purchase_request_line_make_purchase_order |
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import abc
from qsrlib_qsrs.qsr_dyadic_abstractclass import QSR_Dyadic_1t_Abstractclass
class QSR_Arg_Relations_Abstractclass(QSR_Dyadic_1t_Abstractclass):
__metaclass__ = abc.ABCMeta
def __init__(self):
super(QSR_Arg_Relations_A... |
import itertools
from llvmlite import ir
from numba.core import cgutils
from .cudadrv import nvvm
from .api import current_context
def declare_atomic_cas_int(lmod, isize):
fname = '___numba_atomic_i' + str(isize) + '_cas_hack'
fnty = ir.FunctionType(ir.IntType(isize),
(ir.PointerTyp... |
from __future__ import unicode_literals
import frappe, copy
from frappe.utils import cstr, flt, getdate
from frappe import _
from frappe.utils.file_manager import save_file
from .default_website import website_maker
import install_fixtures
from .sample_data import make_sample_data
from erpnext.accounts.utils import Fi... |
from inc import *
modFunc.addCommand('suggest', 'suggest', 'suggest')
modFunc.addCommand('sug', 'suggest', 'suggest')
modFunc.addCommand('issue', 'suggest', 'suggest')
modFunc.addCommand('sug-read', 'suggest', 'read')
modFunc.addCommand('sug-clear', 'suggest', 'clear')
def suggest(line, irc):
message, username, m... |
import json
import logging
import os
import platform
import subprocess
import dns.exception
import dns.resolver
import kazoo.client
import pytest
import requests
from test_helpers import get_expanded_config
__maintainer__ = 'mnaboka'
__contact__ = '<EMAIL>'
@pytest.mark.first
@pytest.mark.supportedwindows
def test... |
"""This module represents the Northern Sotho language.
.. seealso:: http://en.wikipedia.org/wiki/Northern_Sotho_language
"""
from __future__ import unicode_literals
from translate.lang import common
class nso(common.Common):
"""This class represents Northern Sotho."""
specialchars = "šŠ" |
from search_rex.recommendations.neighbourhood.item_based import\
KNearestRecordNeighbourhood
from search_rex.recommendations.neighbourhood.item_based import\
InMemoryRecordNeighbourhood
from search_rex.recommendations.neighbourhood.item_based import\
AbstractRecordNeighbourhood
from search_rex.recommendatio... |
from typing import Callable
import numpy as np
from python_speech_features import mfcc, fbank, logfbank, ssc, delta
from neuralmonkey.readers.audio_reader import Audio
# pylint: disable=invalid-name
def SpeechFeaturesPreprocessor(feature_type: str = 'mfcc',
delta_order: int = 0,
... |
"""
Copyright (C) 2016 Quinn D Granfor <<EMAIL>>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WI... |
import logging
import pytest
from testdata.common import widetable
from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
from tests.common.test_dimensions import create_exec_option_dimension
# TODO: Add Gzip back. IMPALA-424... |
import logging
log = logging.getLogger("racer-telemetry")
logging.basicConfig(level=logging.NOTSET, format="%(asctime)s %(name)s %(levelname)-5s: %(message)s")
import os
import sys
import time
__version__ = "0.1.0"
if sys.hexversion < 0x2070000:
print "python version >=2.7 required. you have", sys.version
sys.exit... |
import matplotlib
#matplotlib.use('WXAgg') ## Seems to be the only backend to work without complaints.
from pylab import *
from color_block import gucci_dict
from fit_mapping import IntrinsicParameters, ExtrinsicParameters, PinholeCamera, quaternion_to_matrix
##########################################################... |
# -*- coding: utf-8 -*-
import bpy
class FnMorph(object):
def __init__(self, morph, model):
self.__morph = morph
self.__rig = model
@classmethod
def storeShapeKeyOrder(cls, obj, shape_key_names):
if len(shape_key_names) < 1:
return
assert(bpy.context.scene... |
#******************************************************************************#
#
# viesolver.py
#
# Python 3 (multiprocessing) version of VIE solver
# (pure solver, all input data, including object, is inside input file)
#
# Neil Budko (c) 2012-2016
# <EMAIL>
#
#**************************************************... |
import pyproj
import os
import warnings
import numpy as np
from pysheds.grid import Grid
from pysheds.rfsm import RFSM
# TODO: Major todo's
# - self.mask should be a raster
# - grid.clip_to should be able to take a raster (use _input_handler)
current_dir = os.path.dirname(os.path.realpath(__file__))
data_dir = os.pat... |
import fixtures
import mock
from nova import test
from nova.virt.disk.mount import loop
from nova.virt.image import model as imgmodel
def _fake_noop(*args, **kwargs):
return
class LoopTestCase(test.NoDBTestCase):
def setUp(self):
super(LoopTestCase, self).setUp()
self.file = imgmodel.Local... |
from __future__ import print_function
from string import Template
from os import path
import sys,cmath,glob
import re
"""
Helper functions for the Herwig Feynrules converter
"""
class CheckUnique:
"""Uniqueness checker.
An object of this class remembers the value it was called with first.
Any subsequent ... |
import os
import SConfig
class SVNRevision(SConfig.Node):
def __init__(self, scons_env, scons_opts, required=False):
SConfig.Node.__init__(self, scons_env, scons_opts, required)
self.checks = [self.extract_revision]
self.define_name = 'VERSION'
self.checkout_path = os.getcwd()
... |
"""Tests for audit functionality.
:Requirement: Audit
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: AuditLog
:Assignee: rplevka
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
from nailgun import entities
from robottelo.datafactory import gen_string
@pytest.mar... |
#!/usr/bin/python
"""
Filter the results of munki's MANAGED_INSTALL_REPORT.plist
to these items: 'EndTime', 'StartTime', 'ManifestName', 'ManagedInstallVersion'
'Errors', 'Warnings', 'RunType'
"""
import plistlib
import sys
import os
import CoreFoundation
DEBUG = False
# Path to the default munki install dir
default... |
"""Provide the WikiPage class."""
from ...const import API_PATH
from ..listing.generator import ListingGenerator
from .base import RedditBase
from .redditor import Redditor
class WikiPage(RedditBase):
"""An individual WikiPage object."""
@staticmethod
def _revision_generator(subreddit, url, generator_kwa... |
from litex.build.generic_platform import *
from litex.build.altera import AlteraPlatform
from litex.build.altera.programmer import USBBlaster
# IOs ----------------------------------------------------------------------------------------------
_io = [
# Clk / Rst
("clk10", 0, Pins("N5"), IOStandard("3.3-V LVT... |
import os
import sys
from autopilot import prefs
from autopilot.core.networking import Net_Node
from autopilot.hardware import Hardware
from autopilot.hardware.cameras import Camera
import threading
import time
import struct
from datetime import datetime
import numpy as np
from itertools import product
from scipy.inte... |
import pytest
from hpe_test_utils import OneViewBaseFactsTest
from oneview_module_loader import NetworkSetFactsModule
ERROR_MSG = 'Fake message error'
PARAMS_GET_ALL = dict(
config='config.json',
name=None
)
PARAMS_GET_ALL_WITHOUT_ETHERNET = dict(
config='config.json',
name=None,
options=['witho... |
"""
Django settings for config project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# Bu... |
#!/usr/bin/python2.7
from pymongo import MongoClient
import json
# Calcule le pourcentage d'appartion des criteres de tout les films
# : retourne un dictionnaire ("Genre", %)
# param : type de parametre (Genre, Language, Year etc) sauf actors
def calculate_percentages_of_criteria(user, param):
movies = get_movies(us... |
# def fib(n):
# if n > 1:
# return fib(n - 1) + fib(n - 2)
# else:
# return n
# def fib(n):
# assert n > 0
# i = 1
# bunny, rabby = 1, 0
# while i < n:
# i += 1
# bunny, rabby = rabby, bunny + rabby
# return bunny + rabby
# def fib(n):
# assert n > 0
# ... |
from __future__ import unicode_literals
import datetime
import itertools
import time
import django
import six
from django.utils import timezone
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
__all__ = ("parse_date", "parse_time", "try_parse_date", "try_parse_time", ... |
from odoo import api, fields, models
class StockLocationRoute(models.Model):
_inherit = "stock.location.route"
sale_selectable = fields.Boolean("Selectable on Sales Order Line")
class StockMove(models.Model):
_inherit = "stock.move"
to_refund_so = fields.Boolean(
"To Refund in SO", default... |
from http import client as http_client
from ironic_lib import metrics_utils
from oslo_utils import uuidutils
from pecan import rest
from ironic import api
from ironic.api.controllers import link
from ironic.api.controllers.v1 import collection
from ironic.api.controllers.v1 import node
from ironic.api.controllers.v1 ... |
import time
import datetime
import collections
import zephyr
class FastTime:
def __init__(self, speed):
self.start_time = time.time()
self.speed = speed
def __call__(self):
seconds_since_start = time.time() - self.start_time
now = self.start_time + seconds_since_start * s... |
import unittest
import os
import tempfile
import copy
# internal modules:
from yotta.lib.fsutils import mkDirP, rmRf
from yotta.lib.detect import systemDefaultTarget
from . import cli
Test_Tests = {
'module.json':'''{
"name": "test-tests",
"version": "0.0.0",
"description": "Test yotta's compilation of tests."... |
import os.path
import shutil
import tempfile
import unittest
import uuid
import zipfile
from py.buck.zip import append_with_copy
class TestAppend(unittest.TestCase):
def setUp(self):
self.test_dir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.test_dir)
def test_file_includ... |
import ujson as json
from oslo_log import log
from monasca_persister.repositories.influxdb import abstract_repository
from monasca_persister.repositories.influxdb import line_utils
from monasca_persister.repositories.utils import parse_alarm_state_hist_message
LOG = log.getLogger(__name__)
class AlarmStateHistInfl... |
import getopt
import sys
from get_alleles import get_nth_allele
help_message = "Given a file containing lines of the form 'ACCESSION=W[X/Y]Z', this script creates a FASTA file\n" \
+ "where the header identifiers are 'ACCESSION' and the sequence is the major allele, i.e. 'WXZ'"
usage_message = "[-h help ... |
# based on the snippet from https://github.com/gabrielfalcao/HTTPretty/issues/387
import httpretty
import requests
from sure import expect
@httpretty.activate(allow_net_connect=False, verbose=True)
def test_match_with_port_no_slashes():
"Reproduce #387 registering host:port without trailing slash"
httpretty.r... |
# -*- coding: utf-8 -*-
'''
The MIT License (MIT)
Copyright (c) 2017 Wolfgang Almeida <<EMAIL>>
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 li... |
"""
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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.
CVXPY is distributed i... |
#!/usr/bin/env python
import StringIO
from InventoryFilter import InventoryFilter
class DummyInventory(InventoryFilter):
def get_hostnames(self, topo):
hostnames = []
for group in topo['dummy_res']:
for host in group['hosts']:
hostnames.append(host)
return ho... |
#!/usr/bin/env python3
#################################
# Email: arisa.kubota at cern.ch
# Project: Local Database for YARR
#################################
import os
from copy import copy
from logging import getLogger, getLoggerClass, Formatter, FileHandler, StreamHandler, addLevelName, DEBUG, INFO, WARNING, ERROR,... |
import pysphere.ZSI as ZSI
from pysphere.ZSI import TC, TCcompound
from pysphere.ZSI.TC import TypeCode
from pysphere.ZSI import EvaluateException
from pysphere.ZSI.wstools.Utility import SplitQName
from pysphere.ZSI.wstools.Namespaces import SOAP, SCHEMA
###############################################################... |
from pants.backend.codegen.thrift.java.java_thrift_library import JavaThriftLibrary
from pants.subsystem.subsystem import Subsystem
class ThriftDefaults(Subsystem):
"""Tracks defaults for java thrift target attributes that influence code generation."""
options_scope = "thrift-defaults"
# TODO: These exi... |
import sys
sys.path.insert(0, "../../python/")
import mxnet as mx
import numpy as np
import numpy.random as rnd
import time
def check_diff_to_scalar(A, x, rank=None):
""" assert A == x"""
assert(np.sum(np.abs((A - x).asnumpy())) == 0), (rank, A.asnumpy(), x)
# setup
keys = ['3', '5', '7']
init_test_keys = [st... |
from sys import argv, exit
from argparse import ArgumentParser, FileType, REMAINDER, Action
from textwrap import dedent
import bfd
from bfd_archs import *
from bfd_base import *
from opcodes import *
from section import *
from symbol import SYMBOL_FLAGS_NAMES_SHORT
__author__ = "Groundworks Technologies OSS Team... |
""" Test the cogapp.makefiles modules
http://nedbatchelder.com/code/cog
Copyright 2004-2015, Ned Batchelder.
"""
from __future__ import absolute_import
import unittest # This is a unittest, so this is fundamental.
import shutil, os, random, types, tempfile # We need these... |
from msrest.serialization import Model
class ApplicationUpdateParameters(Model):
"""Parameters for an update application request.
:param allow_updates: A value indicating whether packages within the
application may be overwritten using the same version string.
:type allow_updates: bool
:param de... |
import logging
from oslo.config import cfg
from oslo.log.openstack.common import notifier
class PublishErrorsHandler(logging.Handler):
def emit(self, record):
if ('openstack.common.notifier.log_notifier' in
cfg.CONF.notification_driver):
return
notifier.api.notify(Non... |
# coding: utf-8
from data import *
from bronker_bosch2 import bronker_bosch2
MIN_SIZE = 3
def bronker_bosch3(clique, candidates, excluded, reporter):
'''Bron–Kerbosch algorithm with pivot and degeneracy ordering'''
reporter.inc_count()
if not candidates and not excluded:
if len(clique) >= MIN_SIZ... |
import json
import pytz
import re
import uuid
from datetime import datetime, timedelta
from dateutil.tz import tzoffset
from sklearn.cluster import DBSCAN
from sklearn.preprocessing import StandardScaler
from math import sqrt
def utc_to_local(utc_dt, tz_info, utc_offset):
# get integer timestamp to avoid precision... |
import socket
import time
import re
import json
# import datetime
from util import hook, user, database, formatting
socket.setdefaulttimeout(10)
nick_re = re.compile(":(.+?)!")
# Identify to NickServ (or other service)
@hook.event('004')
def onjoin(paraml, conn=None, bot=None):
nickserv_password = conn.conf.ge... |
from urllib.parse import urlparse, parse_qs
import lxml.html
import requests
from sqlalchemy.exc import UnboundExecutionError
from storage.file_listing import FDICFiling
class FDICOwnFilingScraper():
BASE_URL = 'http://www2.fdic.gov/efr/instdetail.asp'
def __init__(self):
self.existing_filings = []
... |
# -*- coding: utf-8 -*-
u"""Test sirepo.auth
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
from pykern import pkcollections
from sirepo import srunit
@sru... |
#!/bin/env python
# mainly for sys.argv[], sys.argv[0] is the name of the program
import sys
# mainly for arrays
import numpy as np
def bsearchrec(alist, item, imin, imax):
if imin > imax:
return
else:
imid = imin + ((imax - imin) / 2)
if alist[imid] > item:
return bsearch... |
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext as _
class TagPageForm(forms.Form):
CREATED = u'-create_date'
TITLE = u'title'
UPDATED = u'-update_date'
RATING = u'-rating'
ORDER_OPTIONS = (
(CREATED, _(u'Create date')),
... |
"""This script is trying to fixup errors where images weren't properly marked public
This happened b/c sometimes there was an error in between uploading it
and making it public in the derivatives script.
While we're workin on it we were trying to update the mime type, but
the k.put request ended up erasing the object... |
# -*- coding:utf-8 -*-
from ...errors.saklientexception import SaklientException
from ..client import Client
from .resource import Resource
from .swytch import Swytch
from ...util import Util
import saklient
# module saklient.cloud.resources.iface
class Iface(Resource):
## インタフェースの実体1つに対応し、属性の取得や操作を行うためのクラス。
... |
# -*- coding: utf-8 -*-
from model.contact import Contact
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 5
f = "dat... |
from __future__ import absolute_import, print_function
from epymc import events
def DBG(msg):
# print('INPUT_EVENTS: %s' % msg)
pass
STANDARD_EVENTS = """
UP DOWN LEFT RIGHT OK BACK EXIT
PLAY STOP PAUSE TOGGLE_PAUSE
FORWARD BACKWARD FAST_FORWARD FAST_BACKWARD
PLAYLIST_NEXT PLAYLIST_PREV PLAYLIST_CHANGED
VO... |
"""Unit tests for `iris.fileformats.grib.grib_save_rules.identification`."""
from __future__ import (absolute_import, division, print_function)
# Import iris.tests first so that some things can be initialised before
# importing anything else.
import iris.tests as tests
import gribapi
import mock
import iris.filefor... |
from __future__ import division
import numpy as np
import sys, StringIO, inspect, os, functools, time, collections
### use @timed for really basic timing
_timings = collections.defaultdict(list)
def timed(func):
@functools.wraps(func)
def wrapped(*args,**kwargs):
tic = time.time()
out = func(... |
from akvo.rsr.tests.base import BaseTestCase
class PartnershipTest(BaseTestCase):
def setUp(self):
super(PartnershipTest, self).setUp()
self.org = self.create_organisation('Org')
self.project = self.create_project('Project')
self.email = self.password = '<EMAIL>'
self.user... |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import channels
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = channels.__version__
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
print("You probably want t... |
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
"""
Tables cannot have data deleted from them and be altered in a single transaction,
but we need the DELETEs to be atomic together. So we set atomic=False for the migration
in general, and... |
import procrunner
def test(dials_data, tmp_path):
experiments = dials_data("centroid_test_data") / "experiments.json"
result = procrunner.run(
[
"dials.background",
"output.plot=background.png",
"image=1",
str(experiments),
],
working_di... |
'''apport package hook for mariadb-10.0
(c) 2009 Canonical Ltd.
Author: Mathias Gug <<EMAIL>>
'''
import os, os.path
from apport.hookutils import *
def _add_my_conf_files(report, filename):
key = 'MySQLConf' + path_to_key(filename)
report[key] = ""
for line in read_file(filename).split('\n'):
tr... |
# -*- mode: python; -*-
##
## Pack MISO output into an SQL database
##
import os
import csv
import time
import sys
import subprocess
import shutil
from collections import defaultdict
import pysam
import misopy
import misopy.gff_utils as gff_utils
import misopy.as_events as as_events
import misopy.run_miso as run_miso... |
import codecs
import re
import time
import warnings
import requests
import six
import six.moves.http_client
# Technically, we should support streams that mix line endings. This regex,
# however, assumes that a system will provide consistent line endings.
end_of_field = re.compile(r'\r\n\r\n|\r\r|\n\n')
class SSECl... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 21 23:22:04 2016
@author: Santiago
"""
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 19 10:18:36 2016
@author: SLG
"""
import keras
from keras.models import Sequential
from keras.preprocessing.image import ImageDataGenerator
from keras.layers.core import Dense, Dropout... |
from distutils.core import setup, Extension
import sys
import commands
long_description = """
This package is a fork of PyKerberos package.
"""
setup (
name = "pymoonshot",
version = "0.1.0-1",
description = "GSS-API high-level interface for Janet Moonshot",
long_description=long_description,
cla... |
#!/usr/bin/env python
__all__ = ['qq_download']
from ..common import *
import uuid
#QQMUSIC
#SINGLE
#1. http://y.qq.com/#type=song&mid=000A9lMb0iEqwN
#2. http://y.qq.com/#type=song&id=4754713
#3. http://s.plcloud.music.qq.com/fcgi-bin/fcg_yqq_song_detail_info.fcg?songmid=002NqCeX3owQIw
#4. http://s.plcloud.music.qq.c... |
from __future__ import division
import random
import math
from .base import Element
from .fields import (ChoiceField, IntegerField, BooleanField,
StructField, StringField, ListField)
__all__ = ['Img', 'Rectangle', "Circle", "Arrow", "Line", "Bar"]
class Svg(Element):
tag = "svg"
colors ... |
# encoding: utf-8
import 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 'App.productivity'
db.add_column('mobile_apps_app', 'productivity', self.gf('django.db.mode... |
import json
import uuid
import mock
from oslo_config import fixture as config_fixture
from oslotest import base
from oslotest import mockpatch
import requests
import six.moves.urllib.parse as urlparse
import tempfile
import testscenarios
import yaml
from ceilometer.dispatcher import gnocchi
from ceilometer import ser... |
# -*- coding: utf-8 -*-
"""Functional-style utilties."""
from __future__ import absolute_import, print_function, unicode_literals
import inspect
import sys
from functools import partial
from itertools import chain, islice
from kombu.utils.functional import (LRUCache, dictfilter, is_list, lazy,
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import urllib2
import simplejson
import os.path
import random
import sys
from lib import eueuser
from lib import euemongo
""" for user retrieval """
sex = ["male", "female"]
targetbase = "static/images/users"
urlbase = "http://api.randomuser.me/0.2/"
""" for m... |
from typing import List, Optional, Tuple
from pants.backend.python.lint.isort.rules import IsortFieldSet, IsortFieldSets
from pants.backend.python.lint.isort.rules import rules as isort_rules
from pants.backend.python.target_types import PythonLibrary
from pants.base.specs import FilesystemLiteralSpec, OriginSpec, Sin... |
#!/usr/bin/env python
import requests
URLS = (
('2017_candidates_presidency.csv',
'https://docs.google.com/a/mysociety.org/spreadsheets/d/10RBG4fIluYn2jBgCRBBQ--6yHTtppYrB2ef-zpmVxhE/export?format=csv'),
('2017_candidates_senate.csv',
'https://docs.google.com/a/mysociety.org/spreadsheets/d/1x3_otOE... |
import sys
import string
import re
import rctalk
import rcformat
import rccommand
import ximian_xmlrpclib
entity_dict = { "copy":"(C)",
"reg":"(R)" }
entity_regex = re.compile("\&\w+\;")
def textify_entities(in_str):
s = in_str
while 1:
x = entity_regex.search(s)
if not x:
... |
import io
import aiohttp
from aiohttp.streams import DataQueue
from molotov.api import get_fixture
_UNREADABLE = "***WARNING: Molotov can't display this body***"
_BINARY = "**** Binary content ****"
_FILE = "**** File content ****"
_COMPRESSED = ("gzip", "compress", "deflate", "identity", "br")
class BaseListener(... |
# pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-instance-attributes
class OCStorageClass(OpenShiftCLI):
''' Class to wrap the oc command line tools '''
kind = 'storageclass'
# pylint allows 5
# pylint: disable=too-many-arguments
def __init__(self,
config,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.