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
############################################################ # # Autogenerated by the KBase type compiler - # any changes made here will be overwritten # ############################################################ try: import json as _json except ImportError: import sys sys.path.append('simplejson-2.3.3')...
mdejongh/ModelComparison
lib/ModelComparison/ModelComparisonClient.py
Python
mit
7,099
import json class JSONSerializer(object): def serialize(self, data): return json.dumps(data, indent=2)
yellottyellott/chat-parser
chat_parser/serializers.py
Python
mit
117
""" RenderPipeline Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com> 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...
eswartz/RenderPipeline
rpplugins/pssm/pssm_scene_shadow_stage.py
Python
mit
4,436
from __future__ import unicode_literals from netmiko.base_connection import BaseConnection class CheckPointGaiaSSH(BaseConnection): """ Implements methods for communicating with Check Point Gaia firewalls. """ def session_preparation(self): """ Prepare the session after the connect...
michaelrosejr/pyaos6
netmiko/checkpoint/checkpoint_gaia_ssh.py
Python
mit
774
from cerberus import Validator # validators for various field class MyValidator(Validator): # constructor for the class def __init__(self, *args, **kwargs): if 'additional_context' in kwargs: self.additional_context = kwargs['additional_context'] super(MyValidator, self).__init__(*a...
CampfireBros/Fitness-Tracker
app/utils/validators.py
Python
mit
540
#!/usr/bin/python # _*_ coding: utf-8 _*_ import zlib s = b'witch which has which witches wrist watch' print len(s) t = zlib.compress(s) print len(t) print t print zlib.decompress(t) print zlib.crc32(s)
louistin/thinkstation
a_byte_of_python/unit_15_standard_library/compress_test.py
Python
mit
207
#!/usr/bin/python2.7 from app import app if __name__ == '__main__': app.run(debug=True)
mrcl/HakketyYaks
run.py
Python
mit
94
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-07-21 06:05 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('profiles', '0002_auto_20170721_1129'), ] operations = [ migrations.RemoveField( ...
sunilsm7/django_resto
profiles/migrations/0003_remove_profile_following.py
Python
mit
398
import sys file_name = sys.argv[1] with open(file_name, "r") as f: num = int(f.readline()) for i in range(num): first_row = int(f.readline()) - 1 first_board = list() for x in range(4): raw_line = f.readline() line = [int(x) for x in raw_line.split(" ")] first_board.append(line) second_row = int(...
daniel-bell/google-codejam-2014
qualification/a_magic_trick.py
Python
mit
802
def main(): f = open("test.txt","w") f.write("A"*10000000) main()
mrinalpande/Music_Encrypt
misc/text.py
Python
mit
73
from playhouse.tests.base import compiler from playhouse.tests.base import database_initializer from playhouse.tests.base import ModelTestCase from playhouse.tests.base import PeeweeTestCase from playhouse.tests.base import skip_if from playhouse.tests.base import test_db from playhouse.tests.models import * class Te...
mackjoner/peewee
playhouse/tests/test_keys.py
Python
mit
15,919
# # This file is based on emoji (https://github.com/kyokomi/emoji). # # The MIT License (MIT) # # Copyright (c) 2014 kyokomi # # 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 restr...
Miserlou/Emo
emo/code.py
Python
mit
46,810
from importlib import import_module DEFAULT_ELEMENT_TYPES = set(['form', 'input', 'radio', 'checkbox', 'button', 'table']) BOOTSTRAP3_ELEMENT_TYPES = DEFAULT_ELEMENT_TYPES | set(['panel', 'modal']) SUPPORTED_ELEMENT_TYPES = { 'default': DEFAULT_ELEMENT_TYPES, 'bootstrap3': BOOTSTRAP3_ELEMENT_TYPES, ...
rfancn/y2h
y2h/parser/factory.py
Python
mit
2,247
#!/usr/bin/python import json, os, re, string, sys, traceback from bs4 import BeautifulSoup f = open('pubs-2017-12-27.html') # f = open('blah.html') content = f.read() soup = BeautifulSoup(content, 'html.parser') pubs = { 'selected': [], 'most-cited': [], 'selected-reviews': [], 'publications': [] } def proces...
meyer-group/meyer-group.github.io
_legacy/scrape-pubs.py
Python
mit
2,235
__author__ = 'saintdragon2' import pygame import time import random pygame.init() display_width = 800 display_height = 600 black = (0, 0, 0) white = (255, 255, 255) red = (255, 0, 0) green = (0, 255, 0) block_color = (53, 115, 255) carImg = pygame.image.load('car.png') car_width = carImg.get_rect().size[0] game...
saintdragon2/python-3-lecture-2015
pygame_study/first_race_game.py
Python
mit
3,830
from __future__ import annotations from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.migrations.operations.base import Operation from django.db.migrations.state import ModelState from django.utils.functional import cached_property class InstallPlugin(Operation): reduces_to_sql = ...
adamchainz/django-mysql
src/django_mysql/operations.py
Python
mit
5,386
""" Contains the database connection tools and sqlalchemy models for iom database Created by adam on 11/11/15 In order to use this, import the module and create a sqlalchemy engine named 'engine' then do: # connect to db from sqlalchemy.orm import sessionmaker # ORM's handle to database at global level Session = ses...
PainNarrativesLab/IOMNarratives
IomDataModels.py
Python
mit
13,627
from flask import Flask, jsonify from flask_restplus import Api, Resource, fields app = Flask(__name__) api = Api(app) @app.route("/") def index(): return "" if __name__ == "__main__": app.run(debug=True)
JaeGyu/PythonEx_1
flask21_for_angular.py
Python
mit
217
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph # Title: Uniflex Wifi Transceiver # Generated: Fri Mar 10 14:35:04 2017 ################################################## import os import sys sys.path.append(os.environ.get('GRC_HIER_PATH',...
uniflex/module_wifi_gnuradio
gr_scripts/uniflex_wifi_transceiver.py
Python
mit
8,326
from decimal import Decimal as DecimalDecoder try: from bson import ObjectId as ObjectIdEncoder except ImportError: def ObjectIdEncoder(*args): raise ImportWarning('`bson` module not found') from pyschema.bases import BaseNode __all__ = [ 'Node', 'Str', 'Unicode', 'Int', 'Bool', ...
cordis/pyschema
pyschema/nodes.py
Python
mit
2,017
from keyman.interface import app
sahabi/keyman
main.py
Python
mit
33
from config import settings from flask import render_template, url_for import urllib def abs_base_url(): return settings.BASE_URL + settings.BASE_PREFIX def url_for_with_prefix(endpoint, **values): if settings.BASE_PROTOCOL == 'https://': values['_scheme'] = 'https' return url_for(endpoint, _ext...
sunlightlabs/the-phantom-mask
app/helpers.py
Python
mit
2,518
#!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import division import random import os import math import pickle import stimulus WIN_SIZE = (1280, 1024) FPS = 60 N_RANDOM_TRIALS = 25 def create_random_items(): """ Creates pickle files with lists of random positions for RandomWalk and R...
derNarr/synchronicity
experiment/generate_sessionfiles.py
Python
mit
3,446
import logging from requests.exceptions import HTTPError from pp_api import utils as u from pp_api import pp_calls module_logger = logging.getLogger(__name__) class GraphSearch: timeout = None def __init__(self, server, auth_data=None, session=None, timeout=None): self.server = server ses...
artreven/pp_api
pp_api/gs_calls.py
Python
mit
11,664
""" Lights sample This sample shows how to setup multiple lights and load them from a .bam file. """ # Disable the "xxx has no yyy member" error, pylint seems to be unable to detect # the properties of a nodepath # pylint: disable=no-member from __future__ import print_function import os import sys import math fr...
tobspr/RenderPipeline-Samples
03-Lights/main.py
Python
mit
5,332
# This file is part of h5py, a Python interface to the HDF5 library. # # http://www.h5py.org # # Copyright 2008-2013 Andrew Collette and contributors # # License: Standard 3-clause BSD; see "license.txt" for full license terms # and contributor agreement. from __future__ import absolute_import import tempf...
ryfeus/lambda-packs
HDF4_H5_NETCDF/source2.7/h5py/tests/old/test_h5f.py
Python
mit
2,360
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-17 11:53 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('learn', '0001_initial'), ] operations = [ migrations.RenameField( model_...
Aigrefin/py3learn
learn/migrations/0002_auto_20160517_1353.py
Python
mit
427
import os import channels.asgi os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'art.settings') channel_layer = channels.asgi.get_channel_layer()
memnonila/art
art/asgi.py
Python
mit
146
import numpy as np class Node(object): """ Base class for nodes in the network. Arguments: `inbound_nodes`: A list of nodes with edges into this node. """ def __init__(self, inbound_nodes=[]): """ Node's constructor (runs when the object is instantiated). Sets pro...
nehal96/Deep-Learning-ND-Exercises
MiniFlow/5 - Cost/miniflow.py
Python
mit
4,928
"""Module which contains all spells that check something in a cgf file.""" # -------------------------------------------------------------------------- # ***** BEGIN LICENSE BLOCK ***** # # Copyright (c) 2007-2012, NIF File Format Library and Tools. # All rights reserved. # # Redistribution and use in source and binar...
griest024/PokyrimTools
pyffi-develop/pyffi/spells/cgf/check.py
Python
mit
9,081
""" WSGI config for brogue 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.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTI...
PaulWGraham/ExampleSite
brogue/brogue/wsgi.py
Python
mit
390
# -*- coding:utf-8 -*- # This code is automatically transpiled by Saklient Translator import six from ..client import Client from .model import Model from ..resources.resource import Resource from ..resources.routerplan import RouterPlan from ...util import Util import saklient str = six.text_type # module saklient....
sakura-internet/saklient.python
saklient/cloud/models/model_routerplan.py
Python
mit
3,430
from os import fork, execvp def launch(cmd): args = cmd.split() def launcher(): if not fork(): execvp(args[0], args) return launcher
tadfisher/rama
rama/actions.py
Python
mit
166
""" This file is part of the tractor library. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Created on Jan 06, 2012. """ __docformat__ = 'reStructuredText en' __all__ = ['create_wrapper_for_ticket_creation', 'create_wrapper_for_ticket_update', 'TicketWrapper' ...
helixyte/tractor
tractor/ticket.py
Python
mit
15,619
from flask_restplus import Resource, Namespace, reqparse, fields, marshal_with from .gpio import GPIO api = Namespace('version') version_model = api.model('version', { 'product': fields.String, 'rev': fields.String }) version_list = api.model('version_list', { 'host': fields.Nested(version_model), }) ...
uSpike/raspberry-api-server
raspberry_api/server/version.py
Python
mit
531
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-29 01:58 from __future__ import unicode_literals import django.contrib.postgres.fields.jsonb from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('magic', '0006_auto_20170928_2238'), ] o...
Angoreher/xcero
magic/migrations/0007_auto_20170928_2258.py
Python
mit
2,691
# -*- coding: utf-8 -*- """ Task 803 """ import math def catprob(bayes, cat): """ oblicza logarytm prawodpodobieństwa P(C=c) """ if cat not in bayes.class_count: return -1e300 return math.log(bayes.class_count[cat] \ / float(sum(bayes.class_count.values())))
katzoo/amu
isi/classifier/Task803.py
Python
mit
291
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Invenio error handlers.""" from __future__ import absolute_import, print_function...
inveniosoftware/invenio-theme
invenio_theme/views.py
Python
mit
1,481
import json from django.contrib.auth.decorators import login_required from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.http import (HttpResponse, HttpResponseBadRequest, HttpResponseForbidden) from django.shortcuts import get_object_or_404, render from djang...
rg3915/spark
spark/feeds/views.py
Python
mit
6,435
import pygame from pygame.locals import * class Food(pygame.sprite.Sprite): def __init__(self, tile, x, y): super(Food, self).__init__() self.tile = tile self.energy = 1000 w = self.w = 9 h = self.h = 5 self.image = pygame.Surface((w, h), SRCALPHA).convert_alpha()...
flexo/evolutron
evolutron/food.py
Python
mit
1,376
from flex.constants import ( STRING, OBJECT, EMAIL, URI ) from flex.validation.common import ( generate_object_validator, ) info_schema = { 'required': [ 'title', ], 'properties': { 'title': { 'type': STRING, }, 'description': {'type': STRING}, '...
pipermerriam/flex
flex/loading/schema/info.py
Python
mit
933
#!env/bin/python """Create the database""" from migrate.versioning import api from config import SQLALCHEMY_DATABASE_URI from config import SQLALCHEMY_MIGRATE_REPO from app import db import os.path db.create_all() if not os.path.exists(SQLALCHEMY_MIGRATE_REPO): api.create(SQLALCHEMY_MIGRATE_REPO, 'database reposit...
dianvaltodorov/happy-commas
db_create.py
Python
mit
566
#!/usr/bin/env python # -*- coding:utf-8 -*- """ .. note:: This module is not designed to be used by user. """ import contextlib import distutils.spawn import fcntl import os import pty import select import subprocess class Process(object): """ A class representing a background *Vim* process. """ de...
manicmaniac/headlessvim
headlessvim/process.py
Python
mit
3,571
#!/usr/bin/env python description = ">> make final magnitude" usage = "%prog image [options] " import os import string import re import sys from optparse import OptionParser import time import math import agnkey import numpy as np if __name__ == "__main__": start_time = time.time() parser = OptionParser(usag...
svalenti/agnkey
trunk/bin/agnmag.py
Python
mit
19,750
import itertools import random from hb_res.explanation_source import sources_registry, ExplanationSource __author__ = 'moskupols' ALL_SOURCES = sources_registry.sources_registered() ALL_SOURCES_NAMES_SET = frozenset(sources_registry.names_registered()) all_words_list = [] words_list_by_source_name = dict() for s i...
hatbot-team/hatbot
explanator/_explanator.py
Python
mit
2,930
SBINDIR="/usr/sbin" BINDIR="/usr/bin" LIBEXEC="/usr/lib/xen/bin" LIBDIR="/usr/lib64" SHAREDIR="/usr/share" PRIVATE_BINDIR="/usr/lib64/xen/bin" XENFIRMWAREDIR="/usr/lib/xen/boot" XEN_CONFIG_DIR="/etc/xen" XEN_SCRIPT_DIR="/etc/xen/scripts" XEN_LOCK_DIR="/var/lock" XEN_RUN_DIR="/var/run/xen" XEN_PAGING_DIR="/var/lib/xen/x...
Hearen/OnceServer
pool_management/bn-xend-core/util/path.py
Python
mit
330
import unittest class TestSuite(unittest.TestSuite): """ """
epimodels/Zeke
zeke/tests.py
Python
mit
71
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup from distutils.core import setup from Cython.Build import cythonize from distutils.extension import Extension from Cython.Distutils import build_ext with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.r...
ukurumba/epidemic_network_modelling
setup.py
Python
mit
2,161
"""Helperfunctions for pagination.""" import collections import math from six.moves import http_client from six.moves.urllib import parse as urlparse from flask import url_for, current_app from atilla import exceptions PageResponse = collections.namedtuple('PageResponse', 'content,count') def parse_current_page(pa...
paylogic/atilla
atilla/pagination.py
Python
mit
3,235
import itertools from pycket import config from pycket import values from pycket import vector as values_vector from pycket.arity import Arity from pycket.base import SingleResultMixin, UnhashableType from pycket.cont import continuation, label from pycket.error import SchemeException from pycket.prims.expose import d...
magnusmorton/pycket
pycket/values_struct.py
Python
mit
45,589
#!/usr/bin/env python3 import sys import os import unittest import logging import inspect # Extend PYTHONPATH with local 'lib' folder if __name__ == "__main__": jasyroot = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), os.pardir, os.pardir, os.pardir, os.pardir)) sys.path.insert(0, jasyroot) ...
sebastian-software/jasy
jasy/test/style/strings.py
Python
mit
1,663
# -*- coding: utf-8 -*- from __future__ import with_statement import sys from setuptools import setup, find_packages from kraftwerk import __version__ requires = [ "apache-libcloud>=0.7.1", "Jinja2>=2.6", "PyYAML>=3.10", "virtualenv>=1.7", "certifi>=0.0.7", ] if sys.version_info < (2, 7): ...
jokull/kraftwerk
setup.py
Python
mit
920
import os from flask import Flask from twilio import twiml import requests # Declare and configure application app = Flask(__name__, static_url_path='/static') app.config.from_pyfile('local_settings.py') app.config['API_PATH'] = \ "http://api.nytimes.com/svc/mostpopular/v2/"\ "mostviewed/all-sections/1.jso...
RobSpectre/New-York-Times-Conference-Room
app.py
Python
mit
2,630
# This is a script that scrapes all the data from espncricinfo.com, based on user's input of class (Tests, ODI's, T20's, # etc.) for all types (Batting, Bowling, Fielding, etc.), and dumps all the data into separate CSV files. import requests import os from bs4 import BeautifulSoup classes = { 'tests': 1, 'od...
thedespicableknight/web_crawlers
espncricinfo_stats_all.py
Python
mit
2,174
#!/usr/bin/env python3 import itertools, random from pokerHands import * # create deck deck = getDeck() fred = OrderedCards() al = OrderedCards() burn = OrderedCards() community = OrderedCards() deck.deal(2, al, fred) print("Fred's hand: " + str(fred)) print("Al's hand: " + str(al)) deck.deal(1,burn) deck.deal(3,c...
Altoidnerd/cards
game.py
Python
mit
845
""" file: loco.py author: Ben Shaner created: April 2017 """ import time def addrH(addr): return 0xC0 + (addr >> 8) def addrL(addr): return addr & 0xFF class loco(object): def __init__(self, num, serial): self.locoH = addrH(num) self.locoL = addrL(num) self.serial = serial self.speed = 0 def sleepTim...
bens545/train-control
loco.py
Python
mit
1,043
# Age-rotation relations. from teff_bv import teff2bv class gyro_age(object): def __init__(self, p, teff=None, feh=None, logg=None, bv=None): self.p = p self.bv = bv if not self.bv: self.bv = teff2bv(teff, logg, feh) self.teff = teff self.feh = feh sel...
RuthAngus/turnip
turnip/gyro.py
Python
mit
892
""" Django settings for api_server project. Generated by 'django-admin startproject' using Django 1.11.2. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import...
wangjinyu/api_server
api_server/settings.py
Python
mit
3,284
from hypothesis import given, strategies as st import numpy as np from pysaliency.numba_utils import auc_for_one_positive from pysaliency.roc import general_roc def test_auc_for_one_positive(): assert auc_for_one_positive(1, [0, 2]) == 0.5 assert auc_for_one_positive(1, [1]) == 0.5 assert auc_for_one_pos...
matthias-k/pysaliency
tests/test_numba_utils.py
Python
mit
762
# # Copyright (c), 2016-2020, SISSA (International School for Advanced Studies). # All rights reserved. # This file is distributed under the terms of the MIT License. # See the file 'LICENSE' in the root directory of the present # distribution, or http://opensource.org/licenses/MIT. # # @author Davide Brunato <brunato@...
sissaschool/xmlschema
xmlschema/namespaces.py
Python
mit
10,509
from hubcheck.pageobjects.basepagewidget import BasePageWidget from hubcheck.pageobjects.basepageelement import Button from hubcheck.pageobjects.basepageelement import Checkbox from hubcheck.pageobjects.basepageelement import Text from hubcheck.pageobjects.basepageelement import Link class AdminLogin1(BasePageWidget):...
codedsk/hubcheck
hubcheck/pageobjects/widgets/admin_login.py
Python
mit
1,776
import pathlib import meshio import numpy as np import pytest import meshplex this_dir = pathlib.Path(__file__).resolve().parent @pytest.mark.parametrize( "points,cells,ref", [ # line ([[0.0], [0.35]], [[0, 1]], [0.35]), ([[0.0], [0.35]], [[1, 0]], [-0.35]), # triangle ...
nschloe/voropy
tests/test_signed_area.py
Python
mit
1,654
import os from conans.client.file_copier import FileCopier, report_copied_files from conans.model.manifest import FileTreeManifest from conans.paths import CONANINFO from conans.util.files import mkdir, save def export_pkg(conanfile, package_id, src_package_folder, hook_manager, conanfile_path, ref): # NOTE: Th...
conan-io/conan
conans/client/packager.py
Python
mit
1,979
from pycket import values from pycket.error import SchemeException from pycket.hash.base import ( W_MutableHashTable, W_ImmutableHashTable, w_missing, get_dict_item) from pycket.hash.persistent_hash_map import make_persistent_hash_type from rpy...
magnusmorton/pycket
pycket/hash/simple.py
Python
mit
6,811
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- __author__ = 'RemiZOffAlex' __copyright__ = '(c) RemiZOffAlex' __license__ = 'MIT' __email__ = 'remizoffalex@mail.ru' __url__ = 'http://remizoffalex.ru' from flask import session, request from .. import app, models def get_user(): """ Получить текущего пользоват...
RemiZOffAlex/specialistoff.net
Python/crm/crmapp/lib/info.py
Python
mit
868
#!/usr/bin/env python # Copyright (c) 2014 Eugene Zhuk. # Use of this source code is governed by the MIT license that can be found # in the LICENSE file. """Checks EC2 Instance status. Displays the current status of one or more EC2 Instances. Usage: ./check_instance_status.py <options> """ import boto.ec2 impor...
ezhuk/aws-tools
ec2/check_instance_status.py
Python
mit
1,240
from project import app if __name__ == '__main__': app.run()
wolfram74/flask_exploration
run.py
Python
mit
66
# Copyright (c) 2014 Evalf # # 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, s...
nutils/nutils
nutils/topology.py
Python
mit
101,558
#!c:\users\adebayo\myedge\myvenv\scripts\python.exe # # The Python Imaging Library # $Id$ # # this demo script illustrates pasting into an already displayed # photoimage. note that the current version of Tk updates the whole # image every time we paste, so to get decent performance, we split # the image into a set of ...
tadebayo/myedge
myvenv/Scripts/painter.py
Python
mit
2,141
# demonstration of fitting a function to data from math import sqrt, pi import numpy from scipy.optimize import leastsq from numpy.polynomial import Polynomial from numpy.polynomial.chebyshev import Chebyshev from numpy.random import normal, uniform from matplotlib import pyplot colors='bgrcmy'*100 def fit_example(...
bamford/astrobamf
osiris_leastsq_demo.py
Python
mit
4,729
import string import random import time from collections import namedtuple import redis # Python 3 compatibility string_type = getattr(__builtins__, 'basestring', str) try: basestring except NameError: basestring = str Lock = namedtuple("Lock", ("validity", "resource", "key")) class CannotObtainLock(Exce...
idjaw/redlock-py
redlock/__init__.py
Python
mit
3,073
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import, unicode_literals __all__ = ['_ladder', 'get_acf', 'get_integrated_act', 'thermodynamic_integration_log_evidence'] import numpy as np def _ladder(betas): """ Convert an arbitrary iterable of float...
willvousden/ptemcee
ptemcee/util.py
Python
mit
4,906
"""An example server using the CherryPy web framework. To run the example execute the command: python cp_server.py """ import os import optparse import logging import sys import cherrypy import amfast from amfast.remoting.cherrypy_channel import CherryPyChannelSet, StreamingCherryPyChannel class App(CherryPyCha...
limscoder/amfast
examples/streaming/python/cp_server.py
Python
mit
1,741
# -*- coding: utf-8 -*- # # pyhamtools documentation build configuration file, created by # sphinx-quickstart on Thu Apr 24 01:00:39 2014. # # 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. # ...
dh1tw/pyhamtools
docs/source/conf.py
Python
mit
8,402
""" VerseBot for Reddit By Matthieu Grieger Continued By Team VerseBot regex.py Copyright (c) 2015 Matthieu Grieger (MIT License) """ import re def find_verses(message_body): """ Uses regex to search comment body for verse quotations. Returns a list of matches if found, None otherwise. :param message_bo...
Matthew-Arnold/slack-versebot
versebot/regex.py
Python
mit
2,107
'''Rest4 response helpers Response helper functions for Rest4 ''' import functools import json from flask import current_app, make_response, request from . import settings def output_json(func): @functools.wraps(func) def decorate(*args, **kwargs): result = func(*args, **kwargs) data, sta...
SquirrelMajik/flask_rest4
flask_rest4/response.py
Python
mit
2,232
import os from typing import List, Tuple import psycopg2 from psycopg2.extensions import AsIs from slackclient import SlackClient api_token = os.environ.get('POINTY_APP_TOKEN') def check_all_scores(conn, team_id: str, retry: bool = True) -> List[Tuple[str, int]]: with conn.cursor() as cur: try: ...
AlexLloyd1/pointy-mcpointface
pointy/database/team.py
Python
mit
3,151
#!/usr/bin/env python # Metarunlog, experiment management tool. # Author: Tom Sercu # Date: 2015-01-23 from metarunlog import cfg # NOTE cfg is modified by MetaRunLog._loadBasedirConfig() with custom configuration. from metarunlog.exceptions import * from metarunlog.util import nowstring, sshify, _decode_dict, _decode...
tomsercu/metarunlog
metarunlog/__init__.py
Python
mit
22,170
#!/usr/bin/env python3 import xcdat import os # Prepare the dataset of keywords keyset = xcdat.Keyset() keyset.append('AirPods') keyset.append('AirTag') keyset.append('Mac') keyset.append('MacBook') keyset.append('MacBook_Air') keyset.append('MacBook_Pro') keyset.append('Mac_Mini') keyset.append('Mac_Pro') keyset.app...
kamp78/xcdat
pybind/sample.py
Python
mit
1,957
''' Created on 27 Sep 2015 @author: matt ''' from __future__ import absolute_import from future.utils import iteritems import logging import math from suds import WebFault from .constants import (AUTOTASK_API_QUERY_RESULT_LIMIT, AUTOTASK_API_TIMEZONE, LOCAL_TIMEZONE, ...
MattParr/python-atws
atws/helpers.py
Python
mit
9,052
#!/usr/bin/env python """ Read BED file and extend each record to the specified minimum length. If chromosome size information is provided trim extended intervals. usage: %prog amount [ chrom_file ] < bed_file """ import sys from bx.intervals.io import GenomicIntervalReader length = int(sys.argv[1]) chrom_len = No...
bxlab/bx-python
scripts/bed_extend_to.py
Python
mit
1,068
import re import math as maths from typing import Iterable, Dict from base64 import b64encode from flask import Response, render_template, make_response, current_app from peewee import SelectQuery from htmlmin.minify import html_minify from .models import Entry PAGE_GROUP_SIZE = 5 ENTRIES_PER_PAGE = 10 class Pagin...
elcr/muhblog
muhblog/utils.py
Python
mit
3,071
# coding=utf-8 from __future__ import unicode_literals import os from hashlib import md5 import nose from django.conf import settings from kgb import SpyAgency from reviewboard.diffviewer.diffutils import patch from reviewboard.scmtools.core import (Branch, Commit, Revision, HEAD, ...
brennie/reviewboard
reviewboard/scmtools/tests/test_svn.py
Python
mit
22,242
import random from django.test import TestCase from .models import TechType, Tech, Component # shared data across the tests types = [ { "name": "framework", "description": "to do web stuff" }, { "name": "database", "description": "to store stuff" }, { "nam...
sharestack/sharestack-api
sharestackapi/techs/test_models.py
Python
mit
8,113
class Solution(): def sortColors(nums): """ :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. """ store = [[],[],[]] for i in nums: store[i].append(i) return store[0]+store[1]+store[2] class Solution1(): ...
euccas/CodingPuzzles-Python
leet/source/twopointers/sort_colors.py
Python
mit
3,224
import requests import logging from datetime import * from requests_toolbelt.utils import dump from awsauth import S3Auth # host = 'yuliyangdebugwebjewel.tunnel.qydev.com' host = 'yuliyangdebugweb68.tunnel.qydev.com' host = '10.254.9.20:7480' host = '127.0.0.1:7480' logging.basicConfig(level=logging.DEBUG) access_key =...
wzyuliyang/ceph-note
aws2/python/usage_count/putCurrentBucket.py
Python
mit
656
import enum import google.cloud.storage as gcloud_storage import sqlalchemy from . import config class CompileStatus(enum.Enum): """The compilation status of a bot.""" UPLOADED = "Uploaded" IN_PROGRESS = "InProgress" SUCCESSFUL = "Successful" FAILED = "Failed" DISABLED = "Disabled" class C...
HaliteChallenge/Halite-II
apiserver/apiserver/model.py
Python
mit
10,268
"""CMS Plugins for the ``cmsplugin_redirect`` app.""" from django.utils.translation import ugettext_lazy as _ from django.http import HttpResponseRedirect from cms.plugins.link.forms import LinkForm from cms.plugin_pool import plugin_pool from cms.plugin_base import CMSPluginBase from .models import ForceRedirectPlug...
bitmazk/cmsplugin-redirect
cmsplugin_redirect/cms_plugins.py
Python
mit
1,251
import rb import rhythmdb import dbus import gconf from xchat_music_channel.conf import gconf_keys, ConfDialog from dbus.mainloop.glib import DBusGMainLoop DBusGMainLoop(set_as_default=True) class XChatMusicChannelPlugin(rb.Plugin): def activate(self, shell): gc = gconf.client_get_default() ...
jlecker/rhythmbox-xchat-music-channel
xchat_music_channel/__init__.py
Python
mit
2,960
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") os.environ.setdefault("DJANGO_CONFIGURATION", "Production") from configurations.management import execute_from_command_line execute_from_command_line(sys.argv)
oscarmcm/AlzoMiVoz
alzomivoz/manage.py
Python
mit
316
# -*- coding: utf-8 -*- from .base import * from .utils import * from .distributions import * from .autoincrement import * from .date import * from .series import * from .timeseries import * from .trigonometric import *
Dubrzr/dsfaker
dsfaker/generators/__init__.py
Python
mit
220
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # TileDB documentation build configuration file, created by # sphinx-quickstart on Mon Feb 5 10:08:37 2018. # # -- Imports configuration ------------------------------------------------- import os import subprocess import sys from os.path import abspath, join, dirname...
TileDB-Inc/TileDB
doc/source/conf.py
Python
mit
6,868
class LegacyRouter(object): def db_for_read(self, model, **hints): if model._meta.app_label == "legacy": return "legacy" return None def db_for_write(self, model, **hints): if model._meta.app_label == "legacy": return "legacy" return None def allow_r...
daGrevis/daGrevis.lv
dagrevis_lv/legacy/routers.py
Python
mit
438
from __future__ import unicode_literals from frappe import _ from frappe.desk.moduleview import add_setup_section def get_data(): data = [ { "label": _("Users"), "icon": "fa fa-group", "items": [ { "type": "doctype", "name": "User", "description": _("System and Website Users") }, ...
manassolanki/frappe
frappe/config/setup.py
Python
mit
6,596
#!/usr/bin/python # Copyright 2013 Russell Heilling # pylint: disable=C0103 '''Sort a toread list against publication dates from the calibre database.''' import logging import subprocess import sys import args from streams import StreamClassifier import calibredb import logs args.add_argument('--infile', '-i', help='...
xchewtoyx/comicmgt
sort-readlist.py
Python
mit
1,359
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-04-16 06:55 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('ims_app', '0014_auto_20170416_0425'), ] operations =...
FarhadurFahim/ims
ims_app/migrations/0015_auto_20170416_1255.py
Python
mit
898
from . import base from grow.common import utils from protorpc import messages import logging import os import re if utils.is_appengine(): sass = None # Unavailable on Google App Engine. else: import sass SUFFIXES = frozenset(['sass', 'scss']) SUFFIX_PATTERN = re.compile('[.](' + '|'.join(map(re.escape, SUFF...
denmojo/pygrow
grow/preprocessors/sass_preprocessor.py
Python
mit
3,649
from __future__ import absolute_import # Copyright (c) 2010-2016 openpyxl from warnings import warn from .numbers import BUILTIN_FORMATS, BUILTIN_FORMATS_REVERSE from .proxy import StyleProxy from .cell_style import StyleArray class StyleDescriptor(object): def __init__(self, collection, key): self.col...
aragos/tichu-tournament
python/openpyxl/styles/styleable.py
Python
mit
2,984
"""settings.py - LOB Demo Center settings file Defines databases and other resources for the operation of the LOB Demo Center (LDC) application. Note: The paramters in the settings module must adhere to the normal Python syntax otherwise errors will be reported from the interpreter $Date: 2008-08-22 19:52:28 +...
flavio-casacurta/Nat2Py
Adabas/demo/LobDemoCenter/settings.py
Python
mit
4,386
#!/usr/bin/env python # -*- coding: utf-8 -*- from .version import __version__ from .core import *
barentsen/k2flix
k2flix/__init__.py
Python
mit
99