src stringlengths 721 1.04M |
|---|
# Copyright (c) 2015 Mirantis Inc.
#
# 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 writ... |
import os
import logging
import datetime
import sqlalchemy
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
from simplecoin import create_app, db, coinserv
app = create_app()
manager = Manager(app)
migrate = Migrate(app, db)
root = os.path.abspath(os.path.dirname(__fi... |
import os
import sys
import multiprocess.forking as forking
def patch_multiprocess():
if sys.platform.startswith('win'):
# First define a modified version of Popen.
class _Popen(forking.Popen):
def __init__(self, *args, **kw):
if hasattr(sys, 'frozen'):
... |
'''
Created on Apr 5, 2014
@author: Walker Armistead
'''
class ValueScoreObject(object):
_intrinsicValueToSharePrice = 0
_pe_ratio = 0
_peg = 0
_currentPrice = 0
_debtToEquityRatio = 0
_currentAssets = 0
_currentLiabilities = 0
_dividendYield = 0
_earningsGrowth = 0
d... |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... |
#!/usr/bin/env python
# by bl4de | github.com/bl4de | twitter.com/_bl4de | hackerone.com/bl4de
import socket
import sys
import threading
def usage():
print "IRC simple Python client | by bl4de | github.com/bl4de | twitter.com/_bl4de | hackerone.com/bl4de\n"
print "$ ./irc_client.py USERNAME CHANNEL\n"
prin... |
"""
sentry.plugins.sentry_mail.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import sentry
from django.conf import settings
from django.core.urlresolvers impo... |
# Copyright 2013 IBM 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
#
# Unless required by applicable law or agreed t... |
import importlib
import sys
from django.apps import apps
from django.core.management.base import BaseCommand
from webapp_health_monitor.verification_suit import VerificationSuit
class Command(BaseCommand):
SUBMODULE_NAME = 'verificators'
def add_arguments(self, parser):
parser.add_argument('--tag', ... |
import sys
sys.dont_write_bytecode = True
import string
from module_info import *
from module_presentations import *
from ID_meshes import *
from process_common import *
from process_operations import *
# Lav's export_dir tweak
export_dir = '%s/' % export_dir.replace('\\', '/').rstrip('/')
def save_... |
#!/usr/bin/env python
__author__ = "Mari Wahl"
__email__ = "marina.w4hl@gmail.com"
from itertools import combinations
from bisect import bisect
from memo import memo
from do_benchmark import benchmark
def naive_longest_inc_subseq(seq):
''' naive (exponential) solution to the longest increasing subsequence probl... |
#!/usr/bin/env python3
from collections import OrderedDict
import sqlalchemy as sa
from .namespaces import *
from .interwiki import *
from .lists.recentchanges import *
from .lists.logevents import *
from .lists.allpages import *
from .lists.protectedtitles import *
from .lists.allrevisions import *
from .lists.all... |
import cv2
import winsound
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')
cap = cv2.VideoCapture(0)
while 1:
ret, img = cap.read()
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gra... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from Channels.News_Channel import newsdownload, newsmake
from .newsdownload import News
from .newsmake import process_news
import sys
from utils import *
def main():
print("News Channel File Generator \nBy Larsen Vallecillo / www.rc24.xyz\n")
if len(sys.argv) > 1:
... |
# The examples will use several functions from `scipy.signal`.
from scipy import signal
import matplotlib.pyplot as plt
# First we create a one second signal that is the sum of two pure sine
# waves, with frequencies 5 Hz and 250 Hz, sampled at 2000 Hz.
t = np.linspace(0, 1.0, 2001)
xlow = np.sin(2 * np.pi * 5 * t)
... |
from __future__ import division, print_function
from physicsTable import *
from physicsTable.constants import *
from physicsTable.models import PointSimulation
import os, json, glob
KAP_V_NORM = 20 # simulation for conditions with motion (small noise in velocity)
KAP_V_NOMOT = 1e-10 # simulation for no motion conditio... |
#
# $Id: alc_Classes.py 876 2007-12-15 22:15:11Z Paradox $
#
# Copyright (C) 2005-2006 Alcugs pyprp Project Team
# See the file AUTHORS for more info about the team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published b... |
import logging
import os.path
from django.conf import settings
# public variable with the intent of referencing it in templates
# and allowing tests to easily adjust the values
loaded = {}
def install_components():
global loaded
root_dir = os.path.dirname(os.path.dirname(__file__))
component_dir = os.path.join... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
'''
Created on Jan 7, 2015
@author: busta
'''
import os
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import utils
from ft import FASTex
import pylab
import pandas
def draw_missed_letters(input_dir='/datagrid/personal/TextSpotter/FastTextEval/ICDAR-Train', color =... |
from allauth.socialaccount.app_settings import QUERY_EMAIL
from allauth.socialaccount.providers.google.provider import (GoogleAccount,
GoogleProvider,
Scope)
class TaarGoogleAccount(GoogleAccount)... |
"""
Relationship processor for artist entity.
"""
from urlparse import urlparse
from flask_babel import gettext
import urllib
def process(artist):
"""Handles processing supported relation lists."""
if 'artist-relation-list' in artist and artist['artist-relation-list']:
artist['band-members'] = _artist... |
import pygame
from nwgui.container import AbsoluteContainer
class AbstractGUI(object):
def __init__(self, game):
raise NotImplementedError
def getGameObject(self):
raise NotImplementedError
def get(self, widgetName):
raise NotImplementedError
def setName(self, name, widget... |
from BasePage import BasePage
from Equal_Experts.Constants import EE_Constants
from BasePage import IncorrectPageException
from Equal_Experts.UIMap import LoggedInPoductPageMap
from NewSnippetPage import NewSnippetPage
from UploadPage import UploadPage
class Logg... |
#!/usr/bin/python2
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2013 Marek Marczykowski <marmarek@invisiblethingslab.com>
#
# 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... |
# -*- coding: utf-8 -*-
"""
h2/stream
~~~~~~~~~
An implementation of a HTTP/2 stream.
"""
from enum import Enum, IntEnum
from hpack import HeaderTuple
from hyperframe.frame import (
HeadersFrame, ContinuationFrame, DataFrame, WindowUpdateFrame,
RstStreamFrame, PushPromiseFrame, AltSvcFrame
)
from .errors impo... |
#!/usr/bin/python
#encoding:utf-8
#
#author:xin.xin
#since:14-5-19上午10:35
#
#
from binascii import b2a_hex, a2b_hex
from Crypto.Cipher import AES
from application import app
class CipherUtils(object):
#加密函数,如果text不足16位就用空格补足为16位,
#如果大于16当时不是16的倍数,那就补足为16的倍数。
@staticmethod
def encrypt(text):
... |
from math import *
from cmath import exp as cexp
from frostsynth import *
from frostsynth.waveform import *
from frostsynth.filters import *
from frostsynth.envelope import *
from frostsynth.noise import *
from frostsynth.series import *
from frostsynth.additive import *
from frostsynth.analysis import *
from frostsyn... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 8 13:43:35 2015
@author: zah
"""
import sys
import os
import multiprocessing
import logging
import atexit
from logging.handlers import QueueHandler, QueueListener
from contextlib import contextmanager, redirect_stdout
import applwrap
@contextmanager
def _supress_stdou... |
from random import uniform
def calc_pi(n=100, r=1):
"""Function calculating approximation of pi number.
Based on Monte Carlo algorithm
Arguments are:
n - number of random numbers generated by uniform distribution
r - radius of a circle"""
circle_counter = 0
for i in range(n):
... |
# -*- coding: utf-8 -*-
#
# Copyrigt 2010 Aleksey Sergushichev <alsergbox@gmail.com>
#
# This file is part of pynlc.
# Pynlc 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, ... |
#!/usr/bin/env python
import requests
import sys
url = 'https://s3.amazonaws.com/'
name = sys.argv[1].strip()
common = ['test','dev','bucket','s3','aws','prd','prod','pub','public','production','development','testing','archive','backup','web','devops','sec','secure','hidden','secret','staging','download']
connectors ... |
""" Unit tests for ``wheezy.templates.ext.determined``.
"""
import unittest
class DeterminedTestCase(unittest.TestCase):
""" Test the ``DeterminedExtension``.
"""
def setUp(self):
from wheezy.template.ext.determined import DeterminedExtension
self.preprocess = DeterminedExtension(
... |
"""simple answers to interview questions"""
from collections import namedtuple
# 1. reverse an array
def test_reverse():
def reverse(a):
for index, value in enumerate(a):
if index >= len(a) / 2:
break
replace_index = len(a) - 1 - index
temp = a[replac... |
#!/usr/bin/env python
#
# Copyright (C) 2019, Luca Baldini.
#
# 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.
#
# This p... |
import pytest
import os
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException, NoSuchElementException
from .. import run_python_module
def _wait(brow... |
## Observation correction model
import numpy as np
import astropy.time
import astropy.coordinates
import astropy.units as u
import astropy.units.imperial
import astropy.units.cds
import bossdata
import specsim
import tpcorr.pointing
import tpcorr.guider
import tpcorr.acceptance_model
class Observation(object):
... |
from __future__ import absolute_import, print_function, unicode_literals
from ..signal import Signal, SignalEmitter
from ..util import logger
from distlib.compat import queue
import sys
import threading
import time
import traceback
# See `Service._worker()`. This is the sentinel that gently stops the iterator
# over ... |
from .struct import Struct
from .types import Array, Bytes, Int16, Schema, String
class ListGroupsResponse(Struct):
SCHEMA = Schema(
('error_code', Int16),
('groups', Array(
('group', String('utf-8')),
('protocol_type', String('utf-8'))))
)
class ListGroupsRequest(Str... |
#
# 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, software
# distributed under ... |
import paddle.v2.framework.core as core
import unittest
import numpy
class TestTensor(unittest.TestCase):
def test_int_tensor(self):
scope = core.Scope()
var = scope.var("test_tensor")
place = core.CPUPlace()
tensor = var.get_tensor()
tensor.set_dims([1000, 784])
... |
from django.contrib.auth.models import User
from django.db import models
from preferences.models import Preferences
class ContactPreferences(Preferences):
__module__ = 'preferences.models'
telephone = models.CharField(
max_length=24,
blank=True,
null=True,
)
fax = models.Char... |
from hermes2d import Mesh, H1Shapeset, PrecalcShapeset, H1Space, \
WeakForm, Solution, ScalarView, LinSystem, DummySolver, \
MeshView, set_verbose, plot_mesh_mpl_simple
from hermes2d.forms import set_forms
from hermes2d.mesh import read_hermes_format
def read_mesh(filename):
nodes, ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Huawei Technologies Co., Ltd.
# Copyright (c) 2012 OpenStack LLC.
# 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 co... |
import listenbrainz.webserver.rabbitmq_connection as rabbitmq_connection
import listenbrainz.webserver.redis_connection as redis_connection
import pika
import pika.exceptions
import sys
import time
import ujson
import uuid
from flask import current_app
from listenbrainz.listen import Listen
from listenbrainz.webserver... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
import os
import copy
import yaml
import numpy as np
from fermipy import utils
def get_function_par_names(name):
"""Get the list of parameters associated with a function.
Parameter... |
from copy import deepcopy
from datetime import datetime
from time import sleep
import numpy as np
from tests.helpers.utils import TestPyScanDal
# This is just a dummy GUI class.
class DummyClass:
def __init__(self):
self.Progress = 1 # For Thomas!!
def showPanel(self, s):
pass
def emi... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
import urlparse,re
from platformcode import config, logger
from core import scrapertools
from core.item import Item
from core import servertools
from core import httptools
host = 'https://www.sxyprn.com'
def mainlist(item):
log... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# coding=utf-8
# Copyright 2018 The DisentanglementLib Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
# -*- coding: utf-8 -*-
# (c) 2015 Andreas Motl, Elmyra UG <andreas.motl@elmyra.de>
import txmongo
from autobahn.twisted.wamp import ApplicationRunner, ApplicationSession
from twisted.internet.defer import inlineCallbacks
from twisted.internet.interfaces import ILoggingContext
from twisted.python import log
from zope.i... |
# Copyright (c) 2014 Luke Montalvo <lukemontalvo@gmail.com>
# This file adds a alternative commandline interface, feel free to critique and fork
#
# This has only been tested on Arch Linux and Linux Mint
# Dependencies:
# * from python2-pip
# * python2-pythondialog
# * dialog
import os
import sys
import StringI... |
# Copyright 2020 Cloudbase Solutions Srl
# All Rights Reserved.
import re
from coriolis import constants
from coriolis.osmorphing.osdetect import base
ORACLE_DISTRO_IDENTIFIER = "Oracle Linux"
class OracleOSDetectTools(base.BaseLinuxOSDetectTools):
def detect_os(self):
info = {}
oracle_releas... |
#!/usr/bin/env python3
"""
Created on 27 May 2019
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import sys
import time
from scs_dfe.gas.isi.elc_dsi_t1 import ElcDSIt1
from scs_dfe.interface.interface_conf import InterfaceConf
from scs_host.bus.i2c import I2C
from scs_host.sys.host import Host
# ... |
def kmp_table(p):
"""
Generates a partial match table (as a Python list) for a pattern.
"""
table = [0] * (len(p) + 1)
i = 2 # The position of table we are computing.
c = 0 # The index of the next character of the current candidate.
while i < len(p):
if p[i - 1] == p[c]:
... |
"""
The SMA-ROC-portfolio stategy.
This is SMA-ROC strategy applied to a portfolio.
SMA-ROC is a rate of change calculation smoothed by
a moving average.
This module allows us to examine this strategy and try different
period, stop loss percent, margin, and whether to use a regime filter
or not. We split up the tota... |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 20 16:20:03 2013
@author: utilizador
"""
import sys
from numpy import NaN, Inf, arange, isscalar, array, asarray
##############################################################################
########################### Peaks Detection ###################... |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... |
"""Security provisions."""
__copyright__ = "Copyright (C) 2014 Ivan D Vasin"
__docformat__ = "restructuredtext"
import abc as _abc
from functools import reduce as _reduce
from itertools import chain as _chain, combinations as _combinations
from operator import or_ as _or
from spruce.collections \
import frozenus... |
# -*- coding: utf-8 -*-
# import sqlite3 as sqlite
import sys
import uuid
from pysqlcipher3 import dbapi2 as sqlite
def main():
print("***************** Welcome to OSS DataMaster-Rigster System *******************")
print("* *")
pri... |
def str_xor(s1, s2):
# XOR between two strings
return "".join([chr(ord(c1) ^ ord(c2)) for (c1,c2) in zip(s1,s2)])
def check_string(string):
"""
This is a raw function that check if the string is in english
I'm too lazy to implement a real string analysis
"""
letters = "qwertyuiopasdfghjklzxcvbnm,.'?! "
... |
#!/usr/bin/env python
__revision__ = """$Id: test_Worksheet.py,v 1.12 2004/08/17 07:22:38 fufff Exp $"""
import os, os.path
import unittest
import testsupport
from testsupport import read_file
from pyXLWriter.Worksheet import Worksheet
from pyXLWriter.Format import Format
class WorksheetTest(unittest.TestCase):
... |
import time
from displays import Displays
from sensors import Sensors
class Track():
def __init__(self):
self.sensors = Sensors()
self.displays = Displays()
def startRace(self):
self.displays.clear()
self.sensors.start()
def stopRace(self):
# No need to keep sensi... |
#!/usr/bin/env python
import rospy
import smach
from smach_ros import SimpleActionState
import wm_supervisor.srv
from move_base_msgs.msg import MoveBaseAction
from geometry_msgs.msg import PoseStamped, PoseWithCovarianceStamped
import threading
from std_msgs.msg import Float64, String, Bool
class InitRobot(smach.Sta... |
#!/usr/bin/python2.4
import sys
import numpy
import pymbar # for MBAR analysis
import timeseries # for timeseries analysis
import os
import os.path
import pdb # for debugging
from optparse import OptionParser
import MBAR_pmfQz
import wham
import MBAR_pmfQ
import cPickle
def parse_args():
parser=OptionParser()
... |
import discord
from random import randint
import random
import random
from random import randint
import urllib.request
from html.parser import HTMLParser
from bs4 import BeautifulSoup
import nocontext
import requests
import datetime
import config
import asyncio
import csv
import time
import dateutil.relativedelta as re... |
##
# Copyright (c) 2005-2015 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
"""
Open Power System Data
Time series Datapackage
imputation.py : fill functions for imputation of missing data.
"""
from datetime import datetime, date, timedelta
import pandas as pd
import numpy as np
import logging
logger = logging.getLogger(__name__)
logger.setLevel('INFO')
def find_nan(df, res_key, headers... |
from gourmet.importers import importer, plaintext_importer
import re, os.path, string, array
from gourmet import convert, check_encodings
from gourmet.gdebug import debug,TimeAction
#from gourmet.gglobals import gt
from gettext import gettext as _
class mmf_constants:
def __init__ (self):
self.committed = ... |
from flask_sockets import Sockets
from flask import Flask
from redis import StrictRedis
from json import loads, dumps
from multiprocessing import Process
from gevent import sleep, Greenlet
from geventwebsocket.exceptions import WebSocketError
processes = {}
def enable_chutes(app, endpoint='/chutes'):
'''
Fact... |
from unittest import TestCase, TestSuite, makeSuite
import time
import zope.component
from zope.component.hooks import getSiteManager
from evelink.api import APICache
from mtj.eve.tracker.interfaces import IEvelinkCache
from mtj.eve.tracker.evelink import Helper, API, EvelinkSqliteCache
from mtj.evedb.tests.base im... |
import csv
def __positions_to_csv(positions, path):
with open(path, 'w') as csvfile:
writer = csv.writer(csvfile)
writer.writerows(positions)
def positions_to_csv(network, path):
view = network.get_first_view()
__positions_to_csv(view_to_positions(view), path)
def view_to_positions(vie... |
import datetime
from datetime import timedelta
from django.contrib import admin
from django.contrib.admin.filters import DateFieldListFilter
from django.db.models import Sum
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from import_export.admin import ImportExportActionModel... |
import random as rd
class Pile(list):
def creer_pile(self): # Renvoie une nouvelle pile vide.
return self
def empiler(self, e): # Empile l ’ élément ’ e ’ dans la pile ’P’.
self.append(e)
def depiler(self): # Dépile un élément de la pile ’P’ et renvoie cet élément .
return... |
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from django.core.urlresolvers import reverse
from horizon import tables
from horizon import exceptions
from crystal_dashboard.api import projects as api
class MyFilterAction(tables.FilterAction):
name = "... |
# -*- coding: utf-8 -*-
import os
import logging
import traceback
import contextlib
from click.testing import CliRunner
from hamcrest import (assert_that, all_of, has_property, has_properties,
anything)
from upversion import cli
logger = logging.getLogger('tests.cli')
class CommandTest(object... |
"""A model of a normally distributed random variable of known mean
sigma = k epsilon + c epsilon'
"""
import copy
import numpy as np
from ..Utils.PhysicsModel import GaussianModel
from ..Utils.Struc import Struc
class RandomVariable(GaussianModel):
"""A model of a normally distributed random variable of k... |
# -*- coding: utf-8 -*-
# (c) 2009-2021 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Implements a property manager based on CouchDB.
http://wiki.apache.org/couchdb/Reference
http://packages.python.o... |
# -*- coding: utf-8 -*-
"""
Django settings for example_site project.
For more information on this file, see
https://docs.djangoproject.com/en/<version>/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/<version>/ref/settings/
"""
import os
from dcolumn.dcolumns.m... |
#
# Copyright 2009 Huang Ying <huang.ying.caritas@gmail.com>
#
# 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.
#
import... |
#!/usr/bin/env python
__author__ = 'Sergei F. Kliver'
import os
import sys
import argparse
from MACE.Parsers.VCF import CollectionVCF
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input_file", action="store", dest="input", required=True,
help="Input vcf file with mutations.")
pa... |
"""Unit tests for bluesky.datetimeutils"""
__author__ = "Joel Dubowy"
from py.test import raises
from bluesky import datautils
from bluesky.models import activity
from bluesky.models.fires import Fire
# TODO: moke Fire class
class MockFiresManager(object):
def __init__(self, fires):
self.fires = [Fire... |
# coding=utf-8
"""A Fabric file for carrying out various administrative tasks with InaSAFE.
Usage for localhost commands::
fab -H localhost [command]
fab -H 188.40.123.80:8697 show_environment
To run on a vagrant vhost do::
fab vagrant [command]
e.g. ::
fab vagrant show_environment
.. note:: Vagr... |
#
# BigBrotherBot(B3) (www.bigbrotherbot.net)
# Copyright (C) 2005 Michael "ThorN" Thornton
#
# 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 opti... |
###############################################################################
# Copyright 2011-2014 The University of Texas at Austin #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #... |
# -*- coding: utf-8 -*-
#
# sefara documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 10 19:36:39 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
#!/usr/bin/env python3
import threading
import queue
import http.cookiejar
import urllib.request
import urllib.parse
import time
import pdb
from html.parser import HTMLParser
# general variables
threads = 1
username = 'admin'
wordlist_file = 'passwords.lst'
resume = None # password to resume from
# target variables
t... |
from __future__ import with_statement
from collections import defaultdict, namedtuple
from operator import methodcaller
import os
from pytest import raises
from schema import Schema, Use, And, Or, Optional, SchemaError, JSONSchema
try:
basestring
except NameError:
basestring = str # Python 3 does not have ... |
# coding=utf-8
# Copyright 2017 The DLT2T 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 ... |
# This library is a simple implementation of a function to convert textual
# numbers written in English into their integer representations.
#
# This code is open source according to the MIT License as follows.
#
# Copyright (c) 2008 Greg Hewgill
#
# Permission is hereby granted, free of charge, to any person obtaining ... |
import os
import time
import subprocess
import signal
import libqtile
import libqtile.layout
import libqtile.bar
import libqtile.command
import libqtile.widget
import libqtile.manager
import libqtile.config
import libqtile.hook
import libqtile.confreader
import nose
from nose.tools import assert_raises
from nose.plugi... |
"""
Django settings for django_with_angular_je project.
Generated by 'django-admin startproject' using Django 1.8.2.
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/
""... |
##########################################################################
# This file is part of libtrace
#
# Copyright (C) 2010 Nokia Corporation.
#
# This library 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 Softwar... |
from PySide import QtGui
from jukeboxcore.log import get_logger
log = get_logger(__name__)
from jukeboxcore import ostool
from jukeboxcore import djadapter
from jukeboxcore.gui.main import JB_MainWindow, JB_Dialog, dt_to_qdatetime
from jukeboxcore.gui import treemodel
from jukeboxcore.gui import djitemdata
from jukeb... |
#encoding: utf-8
import sys,os
reload(sys)
sys.setdefaultencoding( "utf-8" )
from flask import Flask
from flask import request
from flask import redirect
from flask import render_template
from flask import session
from flask import flash
from functools import wraps
import json
from user import app
import logan
from as... |
# -*- coding: utf-8 -*-
""" Data module
This module lets the program to download the data from the server.
"""
import os
import requests
import shutil
import sys
import zipfile
class Data(object):
""" Data collection.
"""
def __init__(self):
pass
def file_to_list(self, filename):
... |
'''
statfs.py - this file is part of S3QL (http://s3ql.googlecode.com)
Copyright (C) 2008-2009 Nikolaus Rath <Nikolaus@rath.org>
This program can be distributed under the terms of the GNU GPLv3.
'''
from __future__ import division, print_function, absolute_import
from .common import CTRL_NAME, QuietError, setup_logg... |
import itertools
class ComparerText():
"""This class compares the text of the list of ArticleCandidates and sends the result back to the Comparer."""
def extract(self, item, article_candidate_list):
"""Compares the extracted texts.
:param item: The corresponding NewscrawlerItem
:para... |
"""
nydus.db.base
~~~~~~~~~~~~~
:copyright: (c) 2011-2012 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
__all__ = ('LazyConnectionHandler', 'BaseCluster')
import collections
from nydus.db.map import DistributedContextManager
from nydus.db.routers import BaseRouter, routing_params
from nydus... |
"""
Scripts.
"""
import click
import logging
import platform
import six
from tornado.ioloop import (
IOLoop,
PeriodicCallback,
)
from .server import agent_application
@click.group()
@click.option('-d', '--debug/--no-debug', default=False)
@click.pass_context
def main_loaded(ctx, debug):
"""
Loaded ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.