code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Arnaud Joly <a.joly@ulg.ac.be>
# License: BSD 3 clause
import numpy as np
from .base import BaseEstimator, ClassifierMixin, RegressorMixin
from .externals.six.moves import xrange
from .utils import check_random_state
from .utils.validation import safe_asarray... | johnowhitaker/bobibabber | sklearn/dummy.py | Python | mit | 11,519 |
"""
WSGI config for backbonejs_todos_with_Django project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "backbonejs_todos_... | ladder1984/backbonejs_todos_with_Django | backbonejs_todos_with_Django/wsgi.py | Python | mit | 431 |
import copy
import hyperchamber as hc
import inspect
import math
import operator
import os
import re
from functools import reduce
import pyparsing
import hypergan
import torch
import torch.nn as nn
from .gan_component import GANComponent
from hypergan.gan_component import ValidationException
from hypergan.layer_shape... | 255BITS/HyperGAN | hypergan/configurable_component.py | Python | mit | 32,342 |
import tensorflow as tf
import numpy as np
class TextCNN(object):
'''
A CNN for text classification
Uses and embedding layer, followed by a convolutional, max-pooling and softmax layer.
'''
def __init__(
self, sequence_length, num_classes,
embedding_size, filter_sizes, num_filters,... | imyeego/MLinPy | zh_cnn_text_classify/text_cnn.py | Python | mit | 3,414 |
""" Nodes that read files. """
from .base import Node
from pike.items import FileMeta
from pike.util import recursive_glob, resource_spec
class SourceNode(Node):
"""
Base class for source nodes.
Source nodes are nodes that read files from disk and inject them into a
graph.
"""
name = 'sour... | stevearc/python-pike | pike/nodes/source.py | Python | mit | 1,294 |
from django.db import models
from mptt2.models import MPTTModel
from mptt2.managers import TreeManager
class CustomTreeManager(TreeManager):
pass
class Category(MPTTModel):
name = models.CharField(max_length=50)
parent = models.ForeignKey('self', null=True, blank=True, related_name='children')
def... | sandow-digital/django-mptt-sandow | tests/myapp/models.py | Python | mit | 2,252 |
import matplotlib.pyplot as plt
import numpy as np
import os
from inference import error_fn, infer_interactions, choose_J_from_general_form, solve_true_covariance_from_true_J
from pitchfork_langevin import jacobian_pitchfork, gen_multitraj, steadystate_pitchfork
from settings import DEFAULT_PARAMS, FOLDER_OUTPUT, TAU
... | mattsmart/biomodels | transcriptome_clustering/baseline_reconstruction_error.py | Python | mit | 7,422 |
class Plugin(object):
pass
class ApplicationCommand(Plugin):
pass
class WindowCommand(Plugin):
pass
class TextCommand(Plugin):
pass
class EventListener(Plugin):
pass | SublimeText/Modelines | tests/sublime_plugin.py | Python | mit | 206 |
# -*- coding: utf-8 -*-
"""
Sticky
-------
Python + IPython + D3
"""
from __future__ import print_function
from __future__ import division
import json
from uuid import uuid4
from IPython.core.display import display, Javascript
from IPython.html import widgets
from IPython.utils.traitlets import Unicode
from jinja2 ... | wrobstory/sticky | sticky/core.py | Python | mit | 2,171 |
from . import accounting
from . import proc
from . import sessions
| borg-project/borg | borg/unix/__init__.py | Python | mit | 68 |
class Foo(object):
def run(self):
return 3
print(Foo().run())
| huan/Underscore | examples/class_method.py | Python | mit | 84 |
import re
import unittest
from simple_cipher import Cipher
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.0.0
class RandomKeyCipherTest(unittest.TestCase):
def test_can_encode(self):
cipher = Cipher()
plaintext = "aaaaaaaaaa"
self.assertEqual(cipher.encode(plaint... | behrtam/xpython | exercises/simple-cipher/simple_cipher_test.py | Python | mit | 2,258 |
from collections import defaultdict
n, m = map(int, input().strip().split(' '))
a = defaultdict(list)
b = []
for i in range(n):
char = input().strip()
a[char].append(str(i+1))
for j in range(m):
b.append(input().strip())
for k in b:
print(' '.join(a[k]) if k in a else -1)
| KoderDojo/hackerrank | python/challenges/python/collections-default-dict.py | Python | mit | 294 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter.py | Python | mit | 2,621 |
#!/usr/bin/env python3
__revision__ = "$Rev$"
try:
import configparser
except ImportError:
import ConfigParser as configparser
import pickle
import datetime
import time
import os.path
import sys
from optparse import OptionParser
import lj
"""
journal backup dictionary structure:
{ 'last_entry': timestamp... | zetasyanthis/myarchive | src/myarchive/libs/livejournal/backup.py | Python | mit | 7,193 |
__author__ = 'Călin Sălăgean'
from events.models.event import Event
from events.repositories.event import EventRepository
from events.repositories.person_event import PersonEventRepository
from events.repositories.person import PersonRepository
class EventController():
def __init__(self):
'''
Even... | dooma/Events | events/controllers/event.py | Python | mit | 6,395 |
import json
import urllib2
import time
import math
from pymongo import MongoClient
from pymongo import ASCENDING, DESCENDING
def debug(info):
print info
def log(info):
print info
def parseJson(url):
try:
data = json.load(urllib2.urlopen(url))
return data
except ValueError as e:
... | hethune/tutorials | pymongo/openweathermap.py | Python | mit | 1,579 |
import sys
import re
for lines in open(sys.argv[1], "rU"):
line = lines.strip()
lexemes = re.split(".out:", line)
oid = lexemes[0].split(".")[1]
ncbi = re.split("val=|'", lexemes[1])[2]
print oid + " \t" + ncbi
| fandemonium/code | parsers/img_oid_to_ncbi_from_html.py | Python | mit | 234 |
import json
from google.appengine.api import users
from raceways.handler import BaseHandler, using_template
from stravalib import unithelper
class HomepageHandler(BaseHandler):
@using_template('test.html')
def get(self):
# basic user login
strava_auth_uri = None
if self.user:
... | alecf/strava-raceways | raceways/handlers/homepage.py | Python | mit | 1,439 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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 limitation the
# rights to use, copy, modify, merge, publish... | rwl/PyCIM | CIM14/ENTSOE/Dynamics/IEC61970/Core/CorePSRType.py | Python | mit | 2,441 |
import os
import re
import asyncio
import tempfile
import os.path as osp
import asyncio.subprocess
from concurrent.futures import ThreadPoolExecutor
from PIL import Image
from ..utils import getLogger
from .mediaconfig import *
logger = getLogger('transcode.transcoder')
class Transcoder:
"Nice object-oriented ... | The-Fonz/adventure-track | backend/transcode/transcoder.py | Python | mit | 8,880 |
import unittest
import test.bst
import test.sorted_array_to_bst
import test.edit_distance
import test.binary_search
import test.print_level_order_test
import test.binary_add_test
import test.linked_list_test
suite = unittest.TestLoader()
suite = suite.loadTestsFromModule(test.bst)
suite.addTest(unittest.TestLoader().... | gsathya/dsalgo | run_tests.py | Python | mit | 834 |
# -*- coding: utf-8 -*-
import requests
import lxml
from lxml import html
main_url = "http://www.skoob.com.br"
def books_for_author(url=None):
"return the books of a given author"
print "acessing: %s" % url
books_found = []
r = requests.get(url)
root = lxml.html.fromstring(r.content)
... | arruda/rmr | rmr/scripts/skoob_crawler.py | Python | mit | 1,068 |
import os
from django.core import serializers, management
from topo import graph
from topo.models import ConceptRelationship
from django.conf import settings
from redis_cache import get_redis_connection
def load_table(fixture_file):
uber_dir = os.path.dirname(os.path.realpath(__file__))
fixture_path = "{}/fixtures/... | pramodliv1/conceptgrapher | server/cg/uber/data.py | Python | mit | 1,911 |
import logging
def setup_logging(logfile, level=logging.INFO):
log_args = {'level' : level,
'format' : '%(asctime)s %(message)s'}
if logfile:
log_args['filename'] = logfile
logging.basicConfig(**log_args)
| PythonSanSebastian/python-rtmbot | rtmbot/logger.py | Python | mit | 246 |
"""
This is for taking a json file and putting it into a shapefile.
It uses the generic functions written by mfoley.
"""
from geo_utils import get_data_from_geoserver
import json
import six
from fiona import collection
import pyproj
from shapely.geometry import Point, mapping
op_file = "museums.shp"
server = "mf2.d... | d15123601/geotinkering | make_shpfile.py | Python | mit | 1,216 |
# -*- coding: utf-8 -*-
"""
fudcon.modules.speakers.models
~~~~~~~~~~~~~~~~~~~~~
Speakers models
"""
from fudcon.database import db
class Speaker(db.Model):
"""
Model for listing all the attributes of
the speakers
"""
__tablename__ = 'speakers'
id = db.Column(db.Integer, primary_key=True)
... | echevemaster/fudcon | fudcon/modules/speakers/models.py | Python | mit | 461 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from pytest_ansible.utils import memoize
import threading
import os
class Facts(dict):
PREF = 'ansible_'
def __getattr__(self, attr):
try:
... | autostack/pytest-ansible | pytest_ansible/node.py | Python | mit | 1,681 |
# -*- coding: utf-8 -*-
"""
Contains any static and global variables for MythTV Python Bindings
"""
OWN_VERSION = (0,23,1,0)
SCHEMA_VERSION = 1254
MVSCHEMA_VERSION = 1032
NVSCHEMA_VERSION = 1004
PROTO_VERSION = 23056
PROGRAM_FIELDS = 47
BACKEND_SEP = '[]:[]'
| ekristen/mythboxee | mythtv/MythStatic.py | Python | mit | 261 |
import _plotly_utils.basevalidators
class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="hoverlabel", parent_name="scatterpolar", **kwargs):
super(HoverlabelValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_... | plotly/python-api | packages/python/plotly/plotly/validators/scatterpolar/_hoverlabel.py | Python | mit | 2,061 |
import os
from os import path
from ...exechelper import func_exec_run
from ...fileop import PosixFileSystem
from ....util import Utility
pear = path.join(path.abspath(path.dirname(__file__)), path.join('bin', 'pear'))
def run_pear(*args):
fs = PosixFileSystem(Utility.get_rootdir(2))
input1 = fs.normalize... | mainulhossain/phenoproc | app/biowl/libraries/pear/adapter.py | Python | mit | 1,170 |
from functools import reduce
from itertools import chain, combinations
import operator
def powerset(iterable):
"powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)"
s = list(iterable)
return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
# N = 996
N = 10685796
def brute(N... | msullivan/advent-of-code | 2018/19b.py | Python | mit | 724 |
# -*- coding:cp936 -*-
import os
import shutil
inws = r'D:\maplet_dvk\MapPicDir\raw\ÖйúÀúÊ·µØÍ¼¼¯_Ì·_8²á_dd006dd\ÖйúÀúÊ·µØÍ¼¼¯_·ÇÆ´½Ó\µÚ3²á\08Î÷½ú'
wfiles = os.listdir(inws)
for wfile in wfiles:
infile = os.path.join(inws, wfile)
if os.path.isfile(infile):
pass
else:
cont... | bukun/bkcase | script/mappad_script/script/place_file_by_sig.py | Python | mit | 563 |
import os
import time
from tesserocr import PSM, PyTessBaseAPI
import cv2
from constants import MODULE_CLASSIFIER_DIR, MODULE_SPECIFIC_DIR
from cv_helpers import apply_offset_to_locations, get_classifier_directories, inflate_classifier, ls, \
ls_debug
from modules import ModuleSolver, Type
from modules.whos_on_fi... | FuegoFro/KeepTalkingBot | src/modules/whos_on_first.py | Python | mit | 3,598 |
#!/usr/bin/env python2
# Copyright (c) 2016 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test MVF post fork retargeting
#
# on node 0, test pure block height trigger at height FORK_BLOCK
#
from test_f... | BTCfork/hardfork_prototype_1_mvf-core | qa/rpc-tests/mvf-core-retarget.py | Python | mit | 15,092 |
import os
from concourse_common import jsonutil
def post_successful_tests(filepath, payload, sc, total_string):
sc.api_call("chat.postMessage", as_user=True,
channel=jsonutil.get_params_value(payload, "channel"),
attachments=[{"fallback": "Test Results",
... | cosee-concourse/slack-upload-resource | opt/resource/slack_post.py | Python | mit | 3,302 |
import mimetypes
from typing import Optional, Sequence
import cgi
from requests import Response
from requests.structures import CaseInsensitiveDict
from requests_toolbelt.multipart.decoder import MultipartDecoder
from rets.errors import RetsApiError, RetsResponseError
from rets.http.data import Object
from rets.http.... | opendoor-labs/rets | rets/http/parsers/parse_object.py | Python | mit | 4,892 |
import unittest
from jira import Issue
from dymo_kanban_labels.lib import jira_api
class TestJiraAPI(unittest.TestCase):
def test_get_issue(self):
issue = jira_api.get_issue("DKL-2")
print issue
self.assertEqual(Issue, type(issue))
self.assertEqual(issue.key, "DKL-2")
if __name... | euphy/dymo-kanban-labels | dymo_kanban_labels/tests/test_jira_api.py | Python | mit | 358 |
import pynamics
import numpy
import logging
logger = logging.getLogger('pynamics.integration')
def integrate(*args,**kwargs):
if pynamics.integrator==0:
return integrate_odeint(*args,**kwargs)
elif pynamics.integrator==1:
newargs = args[0],args[2][0],args[1],args[2][-1]
return... | idealabasu/code_pynamics | python/pynamics/integration.py | Python | mit | 1,030 |
import unittest
from postie import Postie
from postie import create_parser
import os
class TestPostie(unittest.TestCase):
def setUp(self):
self.parser = create_parser()
def test_no_args(self):
with self.assertRaises(SystemExit):
self.parser.parse_args([])
def test_no_csv_arg... | raybesiga/postie | test_postie.py | Python | mit | 708 |
#! /usr/bin/env python3
if __name__ == '__main__':
message = "stressed"
l = list(message)
l.reverse()
print(''.join(l))
| TomoyoshiToyoda/language_processing | language_processing_100/python3/sect1/NLP00.py | Python | mit | 137 |
#!/usr/bin/env python3
from typing import NamedTuple
from ciphers import HexString
rijndael_s_box = (
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
0xb7, 0xfd... | 0x326/academic-code-portfolio | 2016-2021 Miami University/CSE 467 Computer and Network Security/2019-03-06 Homework 2.py | Python | mit | 3,384 |
#!/usr/bin/python
# System of three linear equations
# ax + by + cz = j
# dx + ey + fz = k
# gx + hy + iz = l
# System of three linear equations in matrix notation
# - - - - - -
# | a b c | | x | | j |
# | | | | | |
# | d e f | | y | = | k |
# | | | | |... | mikequentel/sarrus_cramer | sclinear.py | Python | mit | 4,841 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-09 14:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('find_a_pad_app', '0003_auto_20170709_1432'),
]
operations = [
migrations.Al... | findapad/find_a_pad | find_a_pad_app/migrations/0004_auto_20170709_1432.py | Python | mit | 653 |
VERSION = (1, 5, 0, 'alpha')
__version__ = VERSION
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
if VERSION[3] != 'final':
... | djangonauts/django-hstore | django_hstore/__init__.py | Python | mit | 443 |
# -*- coding: utf-8 -*-
import time
import unittest
from tracblockdiag import cache
class TestFunction(unittest.TestCase):
def test_is_obsolete(self):
entry = {'time': time.time()}
self.assertTrue(cache.is_obsolete(entry, 0))
self.assertFalse(cache.is_obsolete(entry, 3600))
def test... | yosisa/TracBlockdiag | tests/test_cache.py | Python | mit | 2,291 |
#encoding: utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf-8') #设置命令行为utf-8,让代码里面的中文正常显示
from flask import Flask #从flask包导入Flask类
from flask import render_template #从flask包导入render_template函数
from flask import request ... | 51reboot/actual_09_homework | 07/xq/app.py | Python | mit | 10,060 |
# =============================================================================
# Federal University of Rio Grande do Sul (UFRGS)
# Connectionist Artificial Intelligence Laboratory (LIAC)
# Renato de Pontes Pereira - rppereira@inf.ufrgs.br
# =============================================================================
... | renatopp/liac-chess | chess/__init__.py | Python | mit | 3,617 |
#PBS -N UnBalance
#PBS -m ae
#PBS -q long
#PBS -l nodes=1:opteron:ppn=2
"""Test handling of extreme load-unbalancing."""
from asap3 import *
from asap3.md import MDLogger
from ase.lattice.cubic import FaceCenteredCubic
import numpy as np
from asap3.mpi import world
#DebugOutput("UnBalance.%d.out")
#set_verbose(1)
pr... | auag92/n2dm | Asap-3.8.4/Debug/UnBalance.py | Python | mit | 1,763 |
# Implements the LifeGrid ADT for use with the game of life
from 2darray import Array2D
class LifeGrid():
# Defines constants to represent the cell states
DEAD_CELL = 0
LIVE_CELL = 1
# Creates the game grid and initializes the cells to dead
def __init__( self, numRows, numCols ):
# Allocat... | chenzhengchen200821109/github-python | life 2.py | Python | mit | 1,997 |
import os
import json
from google.appengine.api import urlfetch
from sirius.errors import APIError
API_BASE = 'https://app.getsentry.com/api/0'
class SentryError(APIError):
"""Raised when an error is received from Sentry."""
def create_project(name):
"""Creates a project in Sentry.
This assumes that sen... | bruxr/Sirius2 | sirius/services/sentry.py | Python | mit | 1,881 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
f... | twilio/twilio-python | twilio/rest/insights/v1/setting.py | Python | mit | 7,805 |
"""parse.py is a utility that allows simple checking for line continuations
to give the shell information about where text is commented and where it is
not and also how to appropriately break up a sequence of commands into
separate multi-line commands...
"""
__author__ = "David N. Mashburn <david.n.mashburn@gmai... | ktan2020/legacy-automation | win/Lib/site-packages/wx-3.0-msw/wx/py/parse.py | Python | mit | 5,270 |
from flask import Flask
import config
from db import db_from_config
from address_deduper.views import init_views
from address_normalizer.deduping.near_duplicates import *
def create_app(env, **kw):
app = Flask(__name__)
specified_config = kw.get('config')
if specified_config:
__import__('address_... | openvenues/address_deduper | address_deduper/__init__.py | Python | mit | 765 |
import numpy as np
import cPickle
import os
import sys
import time
from os.path import join as pjoin
import theano
import theano.tensor as T
from models.ss_StickBreaking_DGM import SS_StickBreaking_DGM
from models.neural_net.activation_fns import Sigmoid, Identity, Softmax
from models.neural_net.loss_fns import *
fro... | enalisnick/stick-breaking_dgms | train_scripts/train_stickBreaking_ssDGM.py | Python | mit | 11,669 |
#!/usr/bin/env python
# Script for measuring response time for redmine urls.
# It attempts to authenticate via html form which is it given on first GET.
# It should work generally for anything that forwards properly, and has
# "username" and "password" fields in the form.
#
# I tested it for CASino login and standard ... | forgeservicelab/forge.benchmark | cas_log_in_and_measure.py | Python | mit | 4,515 |
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.api.labs import taskqueue
from google.appengine.api import memcache
from lifestream import *
class LifeStreamQueueWorker(webapp.RequestHandler):
def get(self):
memcache.set('fresh_count', 0)
indexes = LifeSt... | billychow/simplelifestream | worker.py | Python | mit | 1,047 |
#----------------------------------------------------------------------
# Copyright (c) 2011-2016 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software... | MarshallBrinn/geni-ch | tools/MA_constants.py | Python | mit | 9,444 |
import renju
import sys
def wait_for_game_update():
data = sys.stdin.buffer.readline().rstrip()
return renju.Game.loads(data.decode())
def move(move):
sys.stdout.buffer.write(move.encode() + b'\n')
sys.stdout.flush()
| EterniusVGM/Renju | competition/backend.py | Python | mit | 235 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-12-20 17:51
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('webhooks', '0010_auto_20170129_1356'),
]
operations = [
migrations.RemoveField(
... | sourcelair/castor | castor/webhooks/migrations/0011_remove_delivery_docker_event.py | Python | mit | 402 |
# 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.
#----------------------------------------------------------------------... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/tests/test_cli_mgmt_network_endpoint.py | Python | mit | 15,915 |
# -*- coding: utf-8 -*-
"""
Created on Mon May 05 23:10:12 2014
@author: Sudeep Mandal
"""
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
def histfit(data, ax=None, **kwargs):
"""
Emulates MATLAB histfit() function. Plots histogram & Gaussian fit to data
Currently ... | HamsterHuey/py_matlab_funcs | histfit.py | Python | mit | 2,005 |
import hashlib
import importlib
import time
from django.conf import settings
from django.core.cache import caches
from django.core.exceptions import ImproperlyConfigured
from .conf import settings as rosetta_settings
cache = caches[rosetta_settings.ROSETTA_CACHE_NAME]
class BaseRosettaStorage(object):
def __in... | mbi/django-rosetta | rosetta/storage.py | Python | mit | 4,395 |
from ruffus import *
from seq_pipe import utils
@collate(input_files, formatter("([^/]+)_[12].fastq$"), ["{path[0]}/{1[0]}_1.fastq", "{path[0]}/{1[0]}_2.fastq"])
def collate_files(input_files, output_files):
log.info("Collating paired fastq files: \n\t{} \n\t{}\n".format(input_files[0], input_files[1]))
@transf... | mbiokyle29/pipelines | seq/tasks.py | Python | mit | 7,972 |
from __future__ import print_function, absolute_import, unicode_literals
import wormhole
from twisted.internet import reactor
from twisted.internet.defer import Deferred, inlineCallbacks, gatherResults
from twisted.internet.protocol import Protocol, Factory
from twisted.trial import unittest
from ..common import Serve... | warner/magic-wormhole | src/wormhole/test/dilate/test_full.py | Python | mit | 11,999 |
"""xscredit URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | czhouyi/xscredit | xscredit/urls.py | Python | mit | 966 |
"""
Notification utility.
"""
import logging
from gi.repository import GLib
from .async_ import run_bg
from .common import exc_message, DaemonBase, format_exc
from .mount import DeviceActions
from .locale import _
__all__ = ['Notify']
class Notify(DaemonBase):
"""
Notification tool.
Can be connecte... | pstray/udiskie | udiskie/notify.py | Python | mit | 9,495 |
'''
Copyright 2013 Cosnita Radu Viorel
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 limitation
the rights to use, copy, modify, merge, publish, distribute... | rcosnita/fantastico | fantastico/contrib/oauth2_idp/models/user_repository.py | Python | mit | 2,209 |
# The MIT License (MIT)
#
# Copyright (c) 2014 Steve Milner
#
# 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 limitation the
# rights to use, copy, modi... | pombredanne/flagon | src/flagon/status_api/__init__.py | Python | mit | 3,360 |
import json
import math
import sys
import threading
import traceback
import time
import uuid
from pika import BasicProperties
from pika.exceptions import ConnectionClosed, ChannelClosed, IncompatibleProtocolError
from ...helper import log, debug_mode_enabled
from ...model import Message, RemoteSignal
fro... | shiroyuki/vireo | vireo/drivers/amqp/consumer.py | Python | mit | 24,473 |
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# spec/fixtures/responses/whois.ax/status_available
#
# and regenerate the tests with the following script
#
# $ scripts/generate_tests.py
#
from nose.tools import *
from dateutil.parser import parse as ti... | huyphan/pyyawhois | test/record/parser/test_response_whois_ax_status_available.py | Python | mit | 1,334 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# numcodecs documentation build configuration file, created by
# sphinx-quickstart on Mon May 2 21:40:09 2016.
#
# 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
# ... | alimanfoo/numcodecs | docs/conf.py | Python | mit | 10,126 |
from utils.functions.models import rows_to_dict_list_lower, GradeQtd
def grade_estoque(
cursor, ref=None, dep=None, data_ini=None, tipo_grade=None,
modelo=None, referencia=None):
filtro_modelo = ''
filtro_modelo_mask = ''
if modelo is not None:
filtro_modelo_mask = f'''--
... | anselmobd/fo2 | src/estoque/queries/grade_estoque.py | Python | mit | 7,421 |
# encoding: utf-8
from django.contrib import auth
from django.contrib.auth import get_user_model
from django.core.exceptions import MultipleObjectsReturned
from django import forms
from django.utils.translation import ugettext_lazy as _
__all__ = ()
class SigninForm(forms.Form):
email = forms.EmailField(requir... | alexey-grom/django-userflow | userflow/forms/signin.py | Python | mit | 2,222 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from numpy.testing import assert_equal, assert_almost_equal
import abel
def test_circularize_image():
IM = abel.tools.analytical.sample_image(n=511, name='Ominus', sigma=2)
# flo... | DhrubajyotiDas/PyAbel | abel/tests/test_tools_circularize.py | Python | mit | 1,075 |
import logging
import configparser
import os
from utils import bool_query
class BreakRule(object):
def __init__(self, settings):
self.settings = settings
self.rules_record = configparser.ConfigParser()
self.rules_record.read("{}/tms/breakrules.ini".format(os.getcwd()))
self.rules... | marmstr93ng/TimeManagementSystem | tms/breakrule.py | Python | mit | 2,292 |
import bs4
from Entry import Entry
class HtmlParser(object):
def __init__(self, html, url):
self.html = html
self.url = url
def parse(self):
soup = bs4.BeautifulSoup(self.html, "lxml")
mainContent = soup.find(id='mw-content-text')
catagoryContent = soup.find(id="mw-no... | vinx13/WikiCrawler | HtmlParser.py | Python | mit | 982 |
import sys
import subprocess
import string
import random
import glob;
import os;
import shutil;
from subprocess import *
import resource
import signal
#
# set the default timeout to some value
#
DEFAULT_TIMEOUT = 10
DEFAULT_MEMORYLIMIT = 1024*1024*1024*2
#
# Set maximum CPU time to the global timeout
#
GLOBALTIMEO... | TimSchmittmann/HamiltonSAT | competition.py | Python | mit | 10,521 |
from root import *
version = 'v0.1'
| Strangemother/python-state-machine | scatter/__init__.py | Python | mit | 36 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-09-09 07:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pages', '0002_auto_20160829_1730'),
]
operations = [
migrations.AlterField(
... | fidals/refarm-site | pages/migrations/0003_auto_20160909_0747.py | Python | mit | 467 |
# flake8: noqa
__title__ = 'imagesoup'
__description__ = 'A Python library designed for quick search and downloading images.'
__url__ = 'https://github.com/rafpyprog/ImageSoup'
__version__ = '0.1.0'
__author__ = 'Rafael Alves Ribeiro'
__author_email__ = 'rafael.alves.ribeiro@gmail.com'
__license__ = 'MIT'
__copyright_... | rafpyprog/ImageSoup | imagesoup/__version__.py | Python | mit | 362 |
import collections
import math
from collections import OrderedDict
from concurrent import futures
from ordered_set import OrderedSet
from miniworld.Scenario import scenario_config
from miniworld.model.singletons.Resetable import Resetable
from miniworld.model.singletons.Singletons import singletons
from miniworld.uti... | miniworld-project/miniworld_core | miniworld/management/serialization/ShellCommandSerializer.py | Python | mit | 12,647 |
# -*- coding: utf-8 -*-
class ScrapeError(Exception):
"""scraping Failed"""
| abrenaut/waybackscraper | waybackscraper/exceptions.py | Python | mit | 82 |
from .commander import Commander
| jdepoix/goto_cloud | goto_cloud/commander/public.py | Python | mit | 33 |
#!/usr/bin/env python
"""
Copyright (c) 2020 Alex Forencich
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 limitation the rights
to use, copy, modify, merg... | alexforencich/verilog-ethernet | tb/eth_mac_1g_gmii_fifo/test_eth_mac_1g_gmii_fifo.py | Python | mit | 7,506 |
"""This Cloud Function leverages Looker Python SDK to manage user provision.
It takes an email address as an input, then checks if this email has been
associated with an existing Looker user. If a current user is found, then an
email to reset the password will be sent. Otherwise, a new user will be created,
and a s... | looker-open-source/sdk-codegen | examples/python/cloud-function-user-provision/main.py | Python | mit | 4,360 |
# -*- coding: utf-8 -*-
#main sirbot script
ON = 1
SPLASH = 1
##try:
import lib.sirbot.initialize as initialize
if(SPLASH == 1):
#display splash
splash = initialize.splashing()
root = splash.root()
#import configurations
from lib.sirbot.configloader import configloader
config = configloader()
#import ... | SirRujak/SirBot | dev/TOPSECRET/SirBot/SirBot.py | Python | mit | 1,743 |
from django.db import models
from django.utils import timezone
class Post(models.Model):
author = models.ForeignKey('auth.User')
title = models.CharField(max_length=200)
text = models.TextField()
created_date = models.DateTimeField(default=timezone.now)
published_date = models.DateTimeField(blank=... | mohamed-ali-affes/oojuba | src/blog/models.py | Python | mit | 476 |
import numpy as np
import os
from keras.callbacks import EarlyStopping
from keras.layers import Input, Dense
from keras.layers.advanced_activations import PReLU
from keras.layers.core import Activation, Dense, Dropout
from keras.layers.normalization import BatchNormalization
from keras.models import model_from_json
fro... | johnygomez/AtariRL | lib/NFQ/NFQ.py | Python | mit | 5,396 |
from FirmsLocations.Computers.precomputers import PrecomputerCollection
from FirmsLocations.Computers.computers import Directmodel, LocationOnlyModel,\
LocationGeneralModel
## Pathpameters
# Set path parameters
execfile('set_pathparameters.py')
# Set precomputation parameters
execfile('set_precomputationparamete... | tgquintela/Mscthesis | script_computation.py | Python | mit | 836 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "zhuzhidong"
| zhuzhidong/StaticAnalysisforCI | script/klocwork/__init__.py | Python | mit | 74 |
"""
Django settings for composersCouch project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ... | TimothyBest/Django_Boilerplate | mysite/mysite/settings.py | Python | mit | 6,250 |
#!/usr/bin/env python
import os
import subprocess
import sys
import zipfile
LINUX_BINARIES_TO_STRIP = [
'electron',
'libffmpeg.so',
'libnode.so'
]
def strip_binaries(target_cpu, dep):
for binary in LINUX_BINARIES_TO_STRIP:
if dep.endswith(binary):
strip_binary(dep, target_cpu)
def strip_binary(binar... | shiftkey/electron | build/zip.py | Python | mit | 1,544 |
import unittest
from grade_school import School
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
class GradeSchoolTest(unittest.TestCase):
def test_adding_a_student_adds_them_to_the_sorted_roster(self):
school = School()
school.add_student(name="Aimee", grade=2)
... | smalley/python | exercises/grade-school/grade_school_test.py | Python | mit | 2,435 |
"""Module for the Visualization of particle size distributions
Log plot"""
import os
import pyqtgraph as pg
from dataquick.qt import colors, uchars
from dataquick.qt import plotlist
from dataquick.qt.visualizations import base, register_visualizations
from dataquick.plugins.structures import psd
from dataquick.plugi... | vincentchevrier/dataquick | dataquick/plugins/visualizations/psd.py | Python | mit | 8,840 |
""" ToDo: document OpenStack driver on user level here.
"""
import json
from pebbles.services.openstack_service import OpenStackService
from pebbles.drivers.provisioning import base_driver
from pebbles.client import PBClient
from pebbles.models import Instance
from pebbles.utils import parse_ports_string
SLEEP_BETWEE... | CSC-IT-Center-for-Science/pouta-blueprints | pebbles/drivers/provisioning/openstack_driver.py | Python | mit | 6,069 |
from .activations import ActivationsPanel
from .experiments import ExperimentsPanel
from .occlusion import OcclusionPanel
| JarnoRFB/qtpyvis | qtgui/panels/__init__.py | Python | mit | 122 |
#!/usr/bin/env python3
from raptiformica.cli import spawn
if __name__ == '__main__':
spawn()
else:
raise RuntimeError("This script is an entry point and can not be imported")
| vdloo/raptiformica | bin/raptiformica_spawn.py | Python | mit | 184 |
"""
This module contains all serializers.
"""
| tommartensen/arion-backend | arionBackend/serializers/__init__.py | Python | mit | 49 |
import re
from typing import Optional
from django.contrib import messages
from django.db.models import (
Case,
When,
Value,
IntegerField,
Count,
Prefetch,
Q,
)
from django.shortcuts import render, redirect
from django.utils.html import format_html
from django.urls import reverse
from django... | swcarpentry/amy | amy/dashboard/views.py | Python | mit | 11,679 |