commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
604fd681291772abe78793e993427b31b01b4b0e
Create wp_and_moe.py
Xi-Plus/Xiplus-Wikipedia-Bot,Xi-Plus/Xiplus-Wikipedia-Bot
my-ACG/transform-property/wp_and_moe.py
my-ACG/transform-property/wp_and_moe.py
# -*- coding: utf-8 -*- import argparse import os os.environ['PYWIKIBOT_DIR'] = os.path.dirname(os.path.realpath(__file__)) import pywikibot from pywikibot.data.api import Request site = pywikibot.Site() site.login() datasite = site.data_repository() zhsite = pywikibot.Site('zh', 'wikipedia') def converttitle(sit...
mit
Python
312be464937491a97b89c358c68227e69a917abc
add a script that compares Python and C++ implemetations.
hungpham2511/toppra,hungpham2511/toppra,hungpham2511/toppra
integration_tests/with_pinocchio.py
integration_tests/with_pinocchio.py
import pinocchio import numpy as np from toppra.cpp import Interpolation def torque_constraint(robot, scale=1.): from toppra.constraint import JointTorqueConstraint def inv_dyn (q, v, a): return pinocchio.rnea(robot.model, robot.data, q, v, a) return JointTorqueConstraint (inv_dyn, np.vstac...
mit
Python
dcb211dd8e63970e5994981f31eb4f51413ba1c2
Test for issue #154
dbs/rdflib,yingerj/rdflib,marma/rdflib,ssssam/rdflib,yingerj/rdflib,armandobs14/rdflib,armandobs14/rdflib,avorio/rdflib,ssssam/rdflib,ssssam/rdflib,yingerj/rdflib,marma/rdflib,avorio/rdflib,ssssam/rdflib,marma/rdflib,dbs/rdflib,marma/rdflib,dbs/rdflib,yingerj/rdflib,RDFLib/rdflib,avorio/rdflib,RDFLib/rdflib,armandobs14...
test/test_issue154.py
test/test_issue154.py
from StringIO import StringIO from unittest import TestCase from rdflib.graph import ConjunctiveGraph, URIRef class EntityTest(TestCase): def test_html_entity_xhtml(self): g = ConjunctiveGraph() html = \ """ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W...
bsd-3-clause
Python
5a1fb3fb0e084c4631609043663ce0c73bdd337b
Create 1.py
YYMaker/PythonStarter
1.py
1.py
print 'hello'
cc0-1.0
Python
105e5bee6cf6b37e8762c72216ed2d1d05744224
Create 5.py
shashankp/projecteuler
5.py
5.py
#232792560 #lcm n = 20 def lcm(a,b): c = a*b while b>0: a,b = b,a%b return c/a l = set() for i in xrange(2, n): if i%2 != 0: l.add(2*i) else: l.add(i) c = 1 for i in l: c = lcm(c,i) print c
mit
Python
27d510e5fc2fc9f0cc7f9c5bd87b2c49b6bc410b
Add export_tarball tool.
gavinp/chromium,yitian134/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,ropik/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium...
tools/export_tarball/export_tarball.py
tools/export_tarball/export_tarball.py
#!/usr/bin/python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This tool creates a tarball with all the sources, but without .svn directories. It can also remove files which are not strictly re...
bsd-3-clause
Python
296325b86e2ab0427372bc5bdca42d3d693cdf56
add t.py to store some flash code from my brain
ymcagodme/Norwalk-Judo,ymcagodme/Norwalk-Judo
t.py
t.py
import hashlib class Login_record(models.Model): account = models.ForeignKey() date = models.DateTimeField(auto_now=True) ip_addr = models.IPAddressField() successfully_login = models.BooleanField() class Account(models): username = models.CharField(max_length=50) password = models.CharFie...
bsd-3-clause
Python
b971226fc1949e22f9b19d272b23c6964343c68e
Create phrase_preservation.py
AWNystrom/PhraseTokenizer
phrase_preservation.py
phrase_preservation.py
class TrieNode(object): def __init__(self, val): self.val = val self.kids = {} self.val_has_call = hasattr(val, '__call__') self.terminal = False def __call__(self, x): if self.val is None: return None if self.val_has_caller: return self.val.__call__(x) if type(self.val) in (str, unicode): ...
apache-2.0
Python
774692a07edacc206d20000cecf1896463d44919
Test for prev commit (r5249, fix for #2702).
andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons
test/MSVS/CPPPATH-Dirs.py
test/MSVS/CPPPATH-Dirs.py
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, ...
mit
Python
24ba638d16433ce298fca9dfd4e12cad01c86728
Add scrit to finish preprocessing
davidgasquez/kaggle-airbnb
scripts/one_hot_encoding.py
scripts/one_hot_encoding.py
import sys import pandas as pd sys.path.append('..') from utils.preprocessing import one_hot_encoding path = '../datasets/processed/' train_users = pd.read_csv(path + 'semi_processed_train_users.csv') test_users = pd.read_csv(path + 'semi_processed_test_users.csv') # Join users users = pd.concat((train_users, test_us...
mit
Python
41575f88fbc4c2424c161f437696733c6f9933cf
Add fantasyland EV calculator.
session-id/pineapple-ai
fantasyland.py
fantasyland.py
import numpy as np import random import game as g import hand_optimizer game = g.PineappleGame1() NUM_ITERS = 1000 utilities = [] for iter_num in xrange(NUM_ITERS): print "{:5} / {:5}".format(iter_num, NUM_ITERS), '\r', draw = random.sample(game.cards, 14) utilities += [hand_optimizer.optimize_hand([[], [], [...
mit
Python
e4952ef6b83b18d2c9651bf8f3999056ba719878
test run_workflow cli
SCM-NV/qmworks-namd,SCM-NV/qmworks-namd
test/test_run_workflow.py
test/test_run_workflow.py
"""Test the CLI to run a workflow.""" import os import shutil from pathlib import Path from subprocess import PIPE, Popen import yaml from .utilsTest import PATH_TEST def copy_files(tmp_path: Path) -> None: """Copy the input and the hdf5 file to the tmp folder.""" # Read original input path = PATH_TEST...
mit
Python
8a437e899a342be4e1bf3207f31a7abb81479e3e
Fix wsgi issue.
mozilla/mozillians,mozilla/mozillians,mozilla/mozillians,fxa90id/mozillians,akatsoulas/mozillians,mozilla/mozillians,fxa90id/mozillians,johngian/mozillians,johngian/mozillians,johngian/mozillians,akatsoulas/mozillians,johngian/mozillians,akatsoulas/mozillians,akatsoulas/mozillians,fxa90id/mozillians,fxa90id/mozillians
wsgi/playdoh.wsgi
wsgi/playdoh.wsgi
import os import site try: import newrelic.agent except ImportError: newrelic = False if newrelic: newrelic_ini = os.getenv('NEWRELIC_PYTHON_INI_FILE', False) if newrelic_ini: newrelic.agent.initialize(newrelic_ini) else: newrelic = False os.environ.setdefault('DJANGO_SETTINGS_MOD...
import os import site try: import newrelic.agent except ImportError: newrelic = False if newrelic: newrelic_ini = os.getenv('NEWRELIC_PYTHON_INI_FILE', False) if newrelic_ini: newrelic.agent.initialize(newrelic_ini) else: newrelic = False os.environ.setdefault('DJANGO_SETTINGS_MOD...
bsd-3-clause
Python
06dbfafa7a217cbf4780b2e8a898726037e8db61
Fix typo in wsgi file.
akatsoulas/mozillians,mozilla/mozillians,fxa90id/mozillians,mozilla/mozillians,akatsoulas/mozillians,johngian/mozillians,fxa90id/mozillians,johngian/mozillians,akatsoulas/mozillians,johngian/mozillians,akatsoulas/mozillians,johngian/mozillians,fxa90id/mozillians,fxa90id/mozillians,mozilla/mozillians,mozilla/mozillians
wsgi/playdoh.wsgi
wsgi/playdoh.wsgi
import os import site try: import newrelic.agent except ImportError: newrelic = False if newrelic: newrelic_ini = os.getenv('NEWRELIC_PYTHON_INI_FILE', False) if newrelic_ini: newrelic.agent.initialize(newrelic_ini) else: newrelic = False os.environ.setdefault('DJANGO_SETTINGS_MOD...
import os import site try: import newrelic.agent except ImportError: newrelic = False if newrelic: newrelic_ini = os.getenv('NEWRELIC_PYTHON_INI_FILE', False) if newrelic_ini: newrelic.agent.initialize(newrelic_ini) else: newrelic = False os.environ.setdefault('DJANGO_SETTINGS_MOD...
bsd-3-clause
Python
9ba54eab7aab27788ac7493ac4dc7b3a626d244a
Make sure ALL middleware returns a response
primepix/django-sentry,Kronuz/django-sentry,1tush/sentry,fotinakis/sentry,fotinakis/sentry,daevaorn/sentry,mitsuhiko/sentry,daikeren/opbeat_python,mitsuhiko/raven,vperron/sentry,lepture/raven-python,johansteffner/raven-python,ewdurbin/sentry,jean/sentry,songyi199111/sentry,ronaldevers/raven-python,pauloschilling/sentry...
sentry/client/middleware.py
sentry/client/middleware.py
from sentry.client.models import sentry_exception_handler class Sentry404CatchMiddleware(object): def process_response(self, request, response): if response.status_code != 404: return response sentry_exception_handler(sender=Sentry404CatchMiddleware, request=request) return resp...
from sentry.client.models import sentry_exception_handler class Sentry404CatchMiddleware(object): def process_response(self, request, response): if response.status_code != 404: return sentry_exception_handler(sender=Sentry404CatchMiddleware, request=request) return response cla...
bsd-3-clause
Python
8ddbb1a1374c2137a0cb9dc5582e71f172d58c7e
add jinja2.py with pyjade extension
samitnuk/urlsaver_django,samitnuk/urlsaver_django
website/jinja2.py
website/jinja2.py
from django.contrib.staticfiles.storage import staticfiles_storage from django.core.urlresolvers import reverse from jinja2 import Environment def environment(**options): pyjade_extension = ['pyjade.ext.jinja.PyJadeExtension'] env = Environment(extensions=pyjade_extension, **options) env.globals.update({...
mit
Python
f8b40455099b75f89dd10e256569aee61ea8fed9
Add test for bucky.helpers.FileMonitor
Hero1378/bucky,ewdurbin/bucky,dimrozakis/bucky,JoseKilo/bucky,trbs/bucky,dimrozakis/bucky,trbs/bucky,ewdurbin/bucky,Hero1378/bucky,JoseKilo/bucky,jsiembida/bucky3
tests/004-test-helpers.py
tests/004-test-helpers.py
import time import t import bucky.helpers def test_file_monitor(): path = t.temp_file('asd') monitor = bucky.helpers.FileMonitor(path) t.eq(monitor.modified(), False) with open(path, 'w') as f: f.write('bbbb') time.sleep(.1) t.eq(monitor.modified(), True) t.eq(monitor.modified(), ...
apache-2.0
Python
8a412da5e955ed0671009a4d7096e6820ccf2f9f
make neuroimaging.visualization.tests into a package
yarikoptic/NiPy-OLD,yarikoptic/NiPy-OLD
lib/visualization/tests/__init__.py
lib/visualization/tests/__init__.py
import test_visualization import unittest def suite(): return unittest.TestSuite([test_visualization.suite()])
bsd-3-clause
Python
8f1f101830d5ae03e4620555a81b0dd4bb33ba93
add simple test for authorisation
Fahreeve/aiovk,Fahreeve/aiovk,Fahreeve/aiovk
tests/authsession_test.py
tests/authsession_test.py
import asyncio from src.authorisation import AuthSession from tests.test_auth_data import USER_LOGIN, USER_PASSWORD, APP_ID async def test_auth(): s = AuthSession(USER_LOGIN, USER_PASSWORD, APP_ID) b = await s.authorize() loop = asyncio.get_event_loop() loop.run_until_complete(test_auth())
mit
Python
8e7ac2d9b4c281520c2a5d65d6d10cc39f64181d
Add in single instance task file
edx/edx-ora,edx/edx-ora,edx/edx-ora,edx/edx-ora
controller/single_instance_task.py
controller/single_instance_task.py
import functools from django.core.cache import cache def single_instance_task(timeout): def task_exc(func): @functools.wraps(func) def wrapper(*args, **kwargs): lock_id = "celery-single-instance-" + func.__name__ acquire_lock = lambda: cache.add(lock_id, "true", timeout) ...
agpl-3.0
Python
47ed64d83247251018d3aba626e0d89e507ddb1f
Create __init__.py
sevenbigcat/wthen
wthen/__init__.py
wthen/__init__.py
from .runner import * def run_all(file, scope=None): runner = RuleRunner() return runner.run_file(file, scope = scope) def run(text, scope=None): runner = RuleRunner() return runner.run_text(text, scope = scope)
mit
Python
3522ef505900955fa9337055059ebb6c2cd72946
Create fastani_parser.py
widdowquinn/pyani
pyani/scripts/parsers/fastani_parser.py
pyani/scripts/parsers/fastani_parser.py
"""Provides parser for fastani subcommand.""" from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, _SubParsersAction from pathlib import Path from typing import List, Optional from pyani import pyani_config from pyani.scripts import subcommands def build( subps: _SubParsersAction, parents: Option...
mit
Python
6531d93647faf84bf831090fb064d41bf9540700
create Article models abstract
jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,opps/opps,williamroot/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,opps/opps,jeanmask/opps,opps/opps,williamroot/opps,YACOWS/opps,YACOWS/opps
opps/core/models/article.py
opps/core/models/article.py
# -*- coding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ValidationError, ObjectDoesNotExist from opps.core.models.published import Published from opps.core.models.date import Date from opps.core.models.channel import Channel from ...
mit
Python
0bda1db9327eda8455ecb0c090244439c7ece770
Add example script
jni/gala,janelia-flyem/gala
tests/example-data/example.py
tests/example-data/example.py
# imports from gala import imio, classify, features, agglo, evaluate as ev # read in training data gt_train, pr_train, ws_train = (map(imio.read_h5_stack, ['train-gt.lzf.h5', 'train-p1.lzf.h5', 'train-ws.lzf.h5'])) # create a feature manager fm = featur...
bsd-3-clause
Python
27778f17d7a403a7ca62cf8930d90cfe57b401a2
add remove by name test
eevee/cocos2d-mirror
test/test_remove_add_by_name.py
test/test_remove_add_by_name.py
# This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # import cocos from cocos.director import director from cocos.layer import * if __name__ == "__main__": director.init( resizable=True ) main_scene ...
bsd-3-clause
Python
8f2bcbfccbd6b208ea1cc8ea0d6ec7c7ed547cf8
Add a script for creating the iOS SDK (#2655)
mpcomplete/flutter_engine,chinmaygarde/flutter_engine,jason-simmons/flutter_engine,jason-simmons/sky_engine,mpcomplete/engine,chinmaygarde/flutter_engine,mikejurka/engine,mikejurka/engine,aam/engine,flutter/engine,rmacnak-google/engine,krisgiesing/sky_engine,jason-simmons/sky_engine,jamesr/flutter_engine,chinmaygarde/s...
sky/tools/create_ios_sdk.py
sky/tools/create_ios_sdk.py
#!/usr/bin/env python # Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import subprocess import shutil import sys import os def main(): parser = argparse.ArgumentParser(description='Crea...
bsd-3-clause
Python
354e8c4b6b6fe85b35b8df8223252c27499a87bb
Add classes section
HKuz/Test_Code
classes.py
classes.py
#!/Applications/anaconda/envs/Python3/bin def main(): '''Examples Using Classes in Python''' return 0 if __name__ == '__main__': main()
mit
Python
17f14574a35d985571e71023587ddb858a8b3ba2
Add tests for engines package.
blubberdiblub/eztemplate
tests/test_engines.py
tests/test_engines.py
#!/usr/bin/env python from __future__ import print_function import unittest try: from unittest import mock except ImportError: import mock import imp import os.path import engines class TestInit(unittest.TestCase): def test_init(self): mock_engines = {} mock_listdir = mock.Mock(ret...
mit
Python
528614fac62554519f2962bf9efc08cf32328efa
Create OpenmrsClasses.py
BambooL/jeeves,BambooL/jeeves,BambooL/jeeves,jonathanmarvens/jeeves,jonathanmarvens/jeeves,jonathanmarvens/jeeves,jeanqasaur/jeeves,jonathanmarvens/jeeves,BambooL/jeeves
demo/openmrs/openmrs/OpenmrsClasses.py
demo/openmrs/openmrs/OpenmrsClasses.py
from abc import ABCMeta, abstractmethod import uuid #import org.python.google.common.base.objects as objects #not sure if this is the same as com.google.common.base.Objects in JAVA code from datetime import datetime, date import pickle #Interfaces class OpenmrsObject: """This is the base interface for all OpenMR...
mit
Python
b136bed0577a18f4e1d66c3f1edde3a78caf2887
add tests for pastas.Project
pastas/pasta,gwtsa/gwtsa,pastas/pastas
tests/test_project.py
tests/test_project.py
from pandas import read_csv import pastas as ps ps.set_log_level("ERROR") def test_create_project(): pr = ps.Project(name="test") return pr def test_project_add_oseries(): pr = test_create_project() obs = read_csv("tests/data/obs.csv", index_col=0, parse_dates=True, squeeze=True)...
mit
Python
c2b8caed3f75bb7f52065bf21226f8a41ac76519
fix test test_article_with_metadata
douglaskastle/pelican,avaris/pelican,GiovanniMoretti/pelican,janaurka/git-debug-presentiation,alexras/pelican,kennethlyn/pelican,51itclub/pelican,douglaskastle/pelican,ls2uper/pelican,ls2uper/pelican,GiovanniMoretti/pelican,getpelican/pelican,Rogdham/pelican,douglaskastle/pelican,deved69/pelican-1,jvehent/pelican,ionel...
tests/test_readers.py
tests/test_readers.py
# coding: utf-8 try: import unittest2 except ImportError, e: import unittest as unittest2 import datetime import os from pelican import readers CUR_DIR = os.path.dirname(__file__) CONTENT_PATH = os.path.join(CUR_DIR, 'content') def _filename(*args): return os.path.join(CONTENT_PATH, *args) class RstRe...
# coding: utf-8 try: import unittest2 except ImportError, e: import unittest as unittest2 import datetime import os from pelican import readers CUR_DIR = os.path.dirname(__file__) CONTENT_PATH = os.path.join(CUR_DIR, 'content') def _filename(*args): return os.path.join(CONTENT_PATH, *args) class RstRe...
agpl-3.0
Python
bf7e24f6347c038499c2a2649a3781f0dc5d3468
Add a .ycm_extra_conf.py for the project.
husseinhazimeh/meta,husseinhazimeh/meta,gef756/meta,saq7/MeTA,saq7/MeTA,esparza83/meta,husseinhazimeh/meta,husseinhazimeh/meta,esparza83/meta,gef756/meta,esparza83/meta,saq7/MeTA,husseinhazimeh/meta,esparza83/meta,gef756/meta,gef756/meta,esparza83/meta,gef756/meta
.ycm_extra_conf.py
.ycm_extra_conf.py
import os import ycm_core from clang_helpers import PrepareClangFlags # Set this to the absolute path to the folder (NOT the file!) containing the # compilation_database.json file to use that instead of 'flags'. See here for # more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html # Most projects will N...
mit
Python
41ebf7cbb3c23ddbd47ef0259490d6669538faa1
Add unit test for task settings
acreations/rockit-server,acreations/rockit-server,acreations/rockit-server,acreations/rockit-server
rockit/core/tests/test_task_settings.py
rockit/core/tests/test_task_settings.py
from django.test import TestCase from rockit.core import holders from rockit.core import tasks class TaskSettingsTestCase(TestCase): def test_it_should_be_able_to_call_task(self): holder = holders.SettingsHolder() holder = tasks.settings(holder) self.assertNotEqual(0, len(holder.get_cont...
mit
Python
7f01e6386094bf1b213d5aee86108c7742eb1cf7
Create regular_falsi.py
ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs...
root_finding_technique/regular_falsi.py
root_finding_technique/regular_falsi.py
#python3 #program to calculate roots of a polynomial with error of .0001 def f(x): return x*x - x - 1 print("Enter values of a and b on separate line ") a = float(input()) b = float(input()) e = .0001 if f(a)*f(b)>0: print("Invalid internal, Root does not exist in it") else: m = (a*f(b)-b*f(a))/(f(b)-f(a)) i...
cc0-1.0
Python
1a645c1a35237c1da726bbc1776ed7b90b3ced82
add send_udp.py for certification (#840)
openthread/ot-br-posix,openthread/borderrouter,openthread/ot-br-posix,openthread/borderrouter,openthread/borderrouter,openthread/ot-br-posix,openthread/borderrouter,openthread/borderrouter,openthread/ot-br-posix,openthread/ot-br-posix,openthread/ot-br-posix,openthread/borderrouter
script/reference-device/send_udp.py
script/reference-device/send_udp.py
#!/usr/bin/env python3 # # Copyright (c) 2021, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
bsd-3-clause
Python
60aed71e01e443837c90b98690d44ececc72e38a
Add the import_module function
prabhuramachandran/pymetabiosis,rguillebert/pymetabiosis
pymetabiosis/module.py
pymetabiosis/module.py
from pymetabiosis.bindings import ffi, lib from pymetabiosis.wrapper import MetabiosisWrapper def import_module(name): module_object = lib.PyImport_ImportModule(name) if module_object == ffi.NULL: exc = lib.PyErr_Print() raise Exception() return MetabiosisWrapper(ffi.gc(module_object, lib.P...
mit
Python
d50b67c5e16775861f251e794f75daecab64223b
Add tests for (un)claiming issues
afuna/ghi-assist
tests/test_assigned_labels.py
tests/test_assigned_labels.py
from ghi_assist.hooks.assigned_label_hook import AssignedLabelHook def test_assign(): """Test successful assignment.""" hook = AssignedLabelHook() payload = {"action": "assigned", "issue": {"labels": [{"name": "alpha"}, {"name": "beta"}, ...
agpl-3.0
Python
aebc4e21b75b550aa0b8d3a467d82e6c4b4c958c
Add module and test
cashlo/asciichart
asciichart.py
asciichart.py
def bar_chart(data, bar_char='=', width=80): """Return an horizontal bar chart >>> print bar_chart({ ... 'one': '1', ... 'two': '2', ... 'three': '3', ... 'four': '4', ... 'five': '5', ... }) five ===== four ==== one = three === two == >>> print bar_chart({ ... '1/1': 1/1....
mit
Python
e055639ec9b152fbdec211364e01ed865e1c6032
Add index on tenant_id
openstack/neutron-vpnaas,openstack/neutron-vpnaas
neutron_vpnaas/db/migration/alembic_migrations/versions/3ea02b2a773e_add_index_tenant_id.py
neutron_vpnaas/db/migration/alembic_migrations/versions/3ea02b2a773e_add_index_tenant_id.py
# Copyright 2015 OpenStack Foundation # # 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 ...
apache-2.0
Python
bdcdf3d30633470247a15bbc21d4a783eabae7d6
Integrate LLVM at llvm/llvm-project@22b6a4fcac12
tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,karllessard/tenso...
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "22b6a4fcac1296646ce647295141ab71845348d1" LLVM_SHA256 = "a4784f9ada777f940b7ecb30f95da0573e1338cb16a90e8f378f7ac2c5059f3a" tf_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "961fd77687d27089acf0a09ea29a87fb8ccd7522" LLVM_SHA256 = "7c225e465ae120daa639ca68339fe7f43796ab08ff0ea893579a067b8f875078" tf_http_archive( ...
apache-2.0
Python
a5c2bcc9008f6be2c675155d9a37893e61b522f2
Add neighborhood class.
microy/PyMeshToolkit,microy/MeshToolkit,microy/PyMeshToolkit,microy/MeshToolkit
PyMeshToolkit/Core/Neighborhood.py
PyMeshToolkit/Core/Neighborhood.py
# -*- coding:utf-8 -*- # # External dependencies # import numpy as np # # Define a class to store neighborhood informations # of a given mesh # class Neighborhood( object ) : # # Initialisation # def __init__( self, mesh ) : # Register the mesh self.mesh = mesh # Collect neighborhood informations s...
mit
Python
31333d9fca25348312e4631b6977de43be701b1f
add base sso test
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/sso/tests/base_tests.py
corehq/apps/sso/tests/base_tests.py
from django.test import TestCase from django_prbac.models import Role from corehq.apps.accounting.tests import generator class BaseSSOTest(TestCase): @classmethod def setUpClass(cls): super().setUpClass() Role.get_cache().clear() billing_contact = generator.create_arbitrary_web_use...
bsd-3-clause
Python
255fbf8b88b7ad3f7ed588a83aac2ddfc3d0960f
Create days-diff.py
Pouf/CodingCompetition,Pouf/CodingCompetition
CiO/days-diff.py
CiO/days-diff.py
def days_diff(date1, date2): def days(date): y, m, d = date correction = m <= 2 y -= correction; m += 12*correction - 3 return d + (153*m + 2)//5 + \ 365*y + y//4 - y//100 + y//400 return abs(days(date1) - days(date2))
mit
Python
7ef014cb99dd5c7f3bab8a514d4f926f371aad1e
add wu.py
ayst123/mooc,ayst123/mooc
wu.py
wu.py
a = 'wu' print a
bsd-2-clause
Python
efcd92f1e3bb7ec73c464f88757f10596b45f020
Add tags validation
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
polyaxon_client/tracking/utils/tags.py
polyaxon_client/tracking/utils/tags.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import six from polyaxon_client.exceptions import PolyaxonException from polyaxon_client.schemas.utils import to_list def validate_tags(tags): if not tags: return None if isinstance(tags, six.string_types): ...
apache-2.0
Python
8db5a289d3555dfbc30ac211cb394093e9c033de
Solve task #520
Zmiecer/leetcode,Zmiecer/leetcode
520.py
520.py
class Solution(object): def detectCapitalUse(self, word): """ :type word: str :rtype: bool """ k = 0 for ch in word: if ch.isupper(): k += 1 if k == 1 and word[0].isupper(): return True ...
mit
Python
61df4c6b93d413da655663be58481195520c1aec
Create reformat_mags_to_CSV_SDSS.py
DESatAPSU/DAWDs,DESatAPSU/DAWDs
python/reformat_mags_to_CSV_SDSS.py
python/reformat_mags_to_CSV_SDSS.py
#!/usr/bin/env python # This script takes the SDSS synthetic photometry calcphot results (fits files) from the WD models and organizes the data in a CSV file. # This should be run in a directory contaning subdirectores of the WDs organized by name. For example: # jacobs-air-2:DirContainingSubDirectories jacob$ ls # SS...
mit
Python
a076904eadb5588db4bf9bd19f195e77c13dbef0
add a top-coder challenge
py-in-the-sky/challenges,py-in-the-sky/challenges,py-in-the-sky/challenges
top-coder/RepeatStringEasy.py
top-coder/RepeatStringEasy.py
""" Single Round Match 698 Sponsored by Google (17 Sept 2016) https://arena.topcoder.com/#/u/practiceCode/16811/53337/14390/2/329254 """ def memo(f): """memoization decorator, taken from Peter Norvig's Design of Computer Programs course on Udacity.com""" cache = {} def _f(*args): try: ...
mit
Python
a905b0d5986e20d8347eb89dbdd37e9039f58760
Create 11.py
ezralalonde/cloaked-octo-sansa
02/qu/11.py
02/qu/11.py
# Modify the get_next_target procedure so that # if there is a link it behaves as before, but # if there is no link tag in the input string, # it returns None, 0. # Note that None is not a string and so should # not be enclosed in quotes. # Also note that your answer will appear in # parentheses if you print it. def...
bsd-2-clause
Python
d71ef8e0bd667c117b8d39c8a6fe33253350a7b9
Add program to create a speaker-specific codebook with VQ using LBG algorithm
orchidas/Speaker-Recognition
LBG.py
LBG.py
# -*- coding: utf-8 -*- """ Created on Thu Feb 25 00:34:54 2016 @author: ORCHISAMA """ #speaker specific Vector Quantization codebook using LBG algorithm from __future__ import division import numpy as np def EUDistance(d,c): # np.shape(d)[0] = np.shape(c)[0] n = np.shape(d)[1] p = np.shape(c)[1] ...
mit
Python
09c6f9a0ac4441383659645f936ebe07491e2d5e
create Analyzer.py
Amos94/PythonRecapForSemanticAnalysis
Analyzer.py
Analyzer.py
import re from heapq import nlargest class Analyzer(): file = None words = [] freq = [] pairs = [] def __init__(self): try: self.file = open("corpus.txt", "r") except: print("Couldn't load the corpus") def analyzeFreq(self): for line in self.fi...
apache-2.0
Python
04418a86742778c611eeeb36e2f8d7f76755c918
Create PID.py
Dronolab/antenna-tracking
PID.py
PID.py
import time class PID: def __init__(self, P=0.51, I=0.0, D=0.00, Ts = 0.015): self.Kp = P self.Ki = I self.Kd = D self.windup_guard = 5.0 self.sample_time = Ts self.set_point = 0.0 self.last_valid_output = 0.0 self.current_time = time.ti...
mit
Python
d9a522df5827867897e4a2bbaf680db563fb983e
Add script to tile images
JIC-Image-Analysis/senescence-in-field,JIC-Image-Analysis/senescence-in-field,JIC-Image-Analysis/senescence-in-field
scripts/tile_images.py
scripts/tile_images.py
"""Tile images.""" import os import random import argparse from collections import defaultdict import dtoolcore import numpy as np from jicbioimage.core.image import Image from skimage.transform import downscale_local_mean from dtoolutils import ( temp_working_dir, stage_outputs ) from image_utils impor...
mit
Python
f1fae52d87831bb7f29635c6728e7761de2f5660
Create bluetooth_ping_test.py
daveol/Fedora-Test-Laptop,daveol/Fedora-Test-Laptop
tests/bluetooth_ping_test.py
tests/bluetooth_ping_test.py
#!/usr/bin/env python import os import subprocess as subp from subprocess import * from avocado import Test class WifiScanAP(Test): def test(): targetDeviceMac = '8C:1A:BF:0D:31:A9' bluetoothChannel = '2' port = 1 print("Bluetooth ping test: testing " + targetDeviceMac) p = subp.Pope...
mit
Python
b89ebf21cbff40d3f245a1a740b2bf8f6e2b035f
Create addresult_wally.py
vortex610/mos,vortex610/mos,vortex610/mos,vortex610/mos
run_tests/shaker_run/addresult_wally.py
run_tests/shaker_run/addresult_wally.py
import ConfigParser import base64 import json import urllib2 # Testrail API class APIClient: def __init__(self, base_url): self.user = '' self.password = '' if not base_url.endswith('/'): base_url += '/' self.__url = base_url + 'index.php?/api/v2/' def send_get(sel...
apache-2.0
Python
93482980205f0026bff8feca05df8754f93fd6d2
add program to rename files to be Unix friendly
mlcdf/dotfiles,mlcdf/dotfiles,mlcdf/dotfiles
bin/rename.py
bin/rename.py
#!/usr/bin/env python import os """ Renames the filenames within the same directory to be Unix friendly (1) Changes spaces to hyphens (2) Makes lowercase (not a Unix requirement, just looks better ;) Usage: (python) rename.py """ path = os.getcwd() filenames = os.listdir(path) for filename in filenames: os.ren...
mit
Python
3bf5269578e419a3d294240dd722bdb950d9fc44
Implement channel mode +t
Heufneutje/txircd,ElementalAlchemist/txircd
txircd/modules/rfc/cmode_t.py
txircd/modules/rfc/cmode_t.py
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.module_interface import IMode, IModuleData, Mode, ModuleData from txircd.utils import ModeType from zope.interface import implements class TopicLockMode(ModuleData, Mode): implements(IPlugin, IModuleData, IMode) name = ...
bsd-3-clause
Python
1cf65e29c7e0b340c9650e672af7db959d7e97c2
add middle_notfound middleware
wwfifi/uliweb,wwfifi/uliweb,limodou/uliweb,limodou/uliweb,limodou/uliweb,wwfifi/uliweb,limodou/uliweb,wwfifi/uliweb
uliweb/orm/middle_notfound.py
uliweb/orm/middle_notfound.py
from uliweb import Middleware, error from uliweb.orm import NotFound class ORMNotfoundMiddle(Middleware): ORDER = 110 def __init__(self, application, settings): pass def process_exception(self, request, exception): if isinstance(exception, NotFound): error("%s(%s) ...
bsd-2-clause
Python
85261569d9eb6adc636f4f28bc49b71392319380
Create app.py
benno16/UCD-Python
app.py
app.py
from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello World!" if __name__ == "__main__": app.run()
mit
Python
dbe232bbd2ecb3aa1623073130e2b5fe6d82d769
Add Tinkoff
andre487/news487,andre487/news487,andre487/news487,andre487/news487
rss/tinkoff_journal.py
rss/tinkoff_journal.py
import feedparser from datetime import datetime feed_url = 'https://journal.tinkoff.ru/feed/atom/' def parse(): feed = feedparser.parse(feed_url) data = [] for entry in feed['entries']: pb = entry['published_parsed'] pb_date = datetime(year=pb.tm_year, month=pb.tm_mon, day=pb.tm_mday, h...
mit
Python
ccc0905a9b6f9846ef57ac51ad7cef9cd7a10e04
Add code around gettin/setting names + rudimentary state info
MontyPrek/bcslib,beckjake/bcslib
bcs.py
bcs.py
def get_bcs(address, filename, params=None): """Get the "Open interface file" specified""" url = '{}/{}'.format(address, filename) result = requests.get(url, params=params) if not result.ok: raise RequestError(result) return result.text def put_bcs(address, filename, data, params): "...
mit
Python
0038d282a94a9e7cd38756e02e19c28aaba6c9ac
move one server to another
hinesmr/mica,hinesmr/mica,hinesmr/mica,hinesmr/mica,hinesmr/mica,hinesmr/mica
util/migrate.py
util/migrate.py
#!/usr/bin/env python from couchdb import Server from optparse import OptionParser import os import sys import re import argparse from time import sleep import couchdb parser = OptionParser() parser = argparse.ArgumentParser(description='Replicate one server to another.') parser.add_argument('--source', type=str, he...
apache-2.0
Python
1e400e4533cc043fe1be5cfb10e5150fa50e38c9
add debug script
codeskyblue/AutomatorX,NetEaseGame/AutomatorX,NetEaseGame/ATX,codeskyblue/AutomatorX,NetEaseGame/AutomatorX,codeskyblue/AutomatorX,NetEaseGame/AutomatorX,NetEaseGame/ATX,NetEaseGame/ATX,codeskyblue/AutomatorX,NetEaseGame/ATX,codeskyblue/AutomatorX,NetEaseGame/AutomatorX,NetEaseGame/ATX,NetEaseGame/AutomatorX
scripts/100-lines-tcp-proxy.py
scripts/100-lines-tcp-proxy.py
#!/usr/bin/python # This is a simple port-forward / proxy, written using only the default python # library. If you want to make a suggestion or fix something you can contact-me # at voorloop_at_gmail.com # Distributed over IDC(I Don't Care) license import socket import select import time import sys # Changing the buff...
apache-2.0
Python
e2c0f63dc61ea9712c0307e50c1dd0c6791410cf
add schwa.dr.processing to aid distributed/stream tagging
schwa-lab/libschwa-python,schwa-lab/libschwa-python,schwa-lab/libschwa-python,schwa-lab/libschwa-python
schwa/dr/processing.py
schwa/dr/processing.py
import sys import threading import argparse try: import zmq except ImportError: zmq = None from StringIO import StringIO from .reader import Reader from .writer import Writer def stream_coroutine(istream, ostream, doc_class=None): writer = Writer(ostream) for doc in Reader(doc_class).stream(istream): res =...
mit
Python
7ce2259931607e086dfde3b8dba85e930ee7ccb0
add class sharelist for sharing shopping lists
AndersonMasese/Myshop,AndersonMasese/Myshop,AndersonMasese/Myshop
app/sharelist.py
app/sharelist.py
class ShareList: '''class contains lists which are shared''' shared_shopping_list_container = [] shareditemsdictionary={} def shared_shopping_list_container(self): return self.shared_shopping_list_container def shareditemsdictionary(self): return self.shareditemsdictionary def...
mit
Python
44fce763d2a8a81b7fda13490291bc9f625ae928
add python script to convert LRIS DEM to the simpler format expected by generate_blend.py
UoA-eResearch/earthquake-viz,UoA-eResearch/earthquake-viz
ascii_to_flat.py
ascii_to_flat.py
#!/usr/bin/env python import sys import time inputs = sys.argv[1:] matrix = {} s = time.time() for filename in inputs: with open(filename) as f: stats = {} while True: bits = f.readline().split() if len(bits) == 2: v = float(bits[1]) if '.' in bits[1] else int(bits[1]) stats[bi...
mit
Python
8dd6853fcb6a416a6ad4359d8512e9c8e4a38f64
Create __init__.py
epnev/SPGL1_python_port
__init__.py
__init__.py
lgpl-2.1
Python
45fc2ae6c3ca3371ec143cb3813ce3bfa9a245e4
Allow to use `python -m dg` instead of `python -m dg.run`.
pyos/dg
__main__.py
__main__.py
from .run.__main__ import *
mit
Python
6a46aca5d837b5ab93bfd71847326a10271a2cdc
Add .ycm_extra_conf.py that allows its use here
shepheb/fcc,shepheb/fcc,shepheb/fcc
portable/.ycm_extra_conf.py
portable/.ycm_extra_conf.py
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
apache-2.0
Python
cb989b47f8f16f570d376ed24f20951c21dfdb2e
add _version.py
lcdb/lcdblib,lcdb/lcdblib
_version.py
_version.py
import os import subprocess as sp def get_version(): try: res = sp.check_output(['git', 'describe'], stdout=sp.PIPE, stderr=sp.STDOUT, universal_newlines=True) except sp.CalledProcessError as e: # probably no tag to use as a reference # "fatal: No names found, cannot describe anything" ...
mit
Python
92bfa9a199284bf20826fac849d609b1af6f55c1
Create a.py
y-sira/atcoder,y-sira/atcoder
abc106/a.py
abc106/a.py
a, b = map(int, input().split()) print((a - 1) * (b - 1))
mit
Python
a0de339fca985a5cbafafbf41f79c1857926190d
Create analysis.py
alexjj/money-scripts,alexjj/money-scripts
analysis.py
analysis.py
import pandas as pd import numpy as np import datetime import matplotlib.pyplot as plt # read Excel df = pd.read_excel('xacts.xlsx', sheetname='All Transactions') # Sort types df['Date'] = pd.to_datetime(df['Date']) df['Inflow'] = pd.to_numeric(df['Inflow']) df['Outflow'] = pd.to_numeric(df['Outflow']) df['Net'] = pd...
bsd-2-clause
Python
7af557a6c40508e758c020539647e6578c779018
Add dev env for malcolm
pkimber/crm,pkimber/crm,pkimber/crm
example_crm/dev_malcolm.py
example_crm/dev_malcolm.py
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from .base import * DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'temp.db', # Or path to databas...
apache-2.0
Python
56583a6e15bc4dbfb1c80739e3942eed733b91e3
Add the script for people to download
rmunn/version-numbers-from-git,rmunn/version-numbers-from-git,rmunn/version-numbers-from-git
get-version-from-git.py
get-version-from-git.py
#!/usr/bin/env python from __future__ import print_function # Edit these constants if desired. NOTE that if you change DEFAULT_TAG_FORMAT, # you'll need to change the .lstrip('v") part of parse_tag() as well. DEFAULT_TAG_FORMAT="v[0-9]*" # Shell glob format, not regex DEFAULT_VERSION_IF_NO_TAGS="0.0.0" import subpr...
mit
Python
7b18fd4e2f4b975e891d31994f15e30d7fd50d1b
Add script to test search speed
blairck/jaeger
ply_speed.py
ply_speed.py
import cProfile import time from res import types from src import ai from src import coordinate from src import historynode plyNum = 5 aiObject = ai.AI() game = historynode.HistoryNode() game.setState(coordinate.Coordinate(3, 7), types.GOOSE) game.setState(coordinate.Coordinate(4, 7), types.GOOSE) game.setState(coor...
mit
Python
2b1b8983e69a0a7a2d467217d5fd12a6ee5bb55d
fix fixtures discovery
skybird6672/python-pdfkit,Geosyntec/python-pdfkit,lucashtnguyen/python-pdfkit,Geosyntec/python-pdfkit,lucashtnguyen/python-pdfkit,dongguangming/python-pdfkit,dongguangming/python-pdfkit,JazzCore/python-pdfkit,skybird6672/python-pdfkit,JazzCore/python-pdfkit,phobson/python-pdfkit,phobson/python-pdfkit
setup.py
setup.py
import codecs from distutils.core import setup from setuptools.command.test import test as TestCommand import re import os import sys import pdfkit class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = ['pdfkit-tests.py'] self.test_suite ...
import codecs from distutils.core import setup from setuptools.command.test import test as TestCommand import re import sys import pdfkit class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = ['tests/pdfkit-tests.py'] self.test_suite = Tr...
mit
Python
5a870dfd325612eba05bbe6342c5f501163b04c4
Bump for 1.9.9-05
ad-m/cookiecutter-django,pydanny/cookiecutter-django,hackebrot/cookiecutter-django,schacki/cookiecutter-django,webyneter/cookiecutter-django,aleprovencio/cookiecutter-django,schacki/cookiecutter-django,luzfcb/cookiecutter-django,pydanny/cookiecutter-django,topwebmaster/cookiecutter-django,ddiazpinto/cookiecutter-django...
setup.py
setup.py
#!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup # Our version ALWAYS matches the version of Django we support # If Django has a new release, we branch, tag, then update this setting after the tag. version = '1.9.9-05' if sys.a...
#!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup # Our version ALWAYS matches the version of Django we support # If Django has a new release, we branch, tag, then update this setting after the tag. version = '1.9.9-04' if sys.a...
bsd-3-clause
Python
7ec6134ad982df6b88504564c5f039fef7d1e289
Create setup.py
pjhamilton4/optimization-queuer
setup.py
setup.py
""" Testing for optimization-queuer ------------- Links ````` """ import sys from setuptools import setup tests_require = [ 'blinker' ] setup( name='optimization-tests' )
mit
Python
efb20ae9efe325b855338fd06de0c53a9dbe1dd9
Update setup files
ArnaudCassan/microlensing
setup.py
setup.py
name = 'microlensing' import sys import os from distutils.core import setup pjoin = os.path.join here = os.path.abspath(os.path.dirname(__file__)) packages = [] for d, _, _ in os.walk(pjoin(here, name)): if os.path.exists(pjoin(d, '__init__.py')): packages.append(d[len(here)+1:].replace(os.path.sep, '.'...
mit
Python
8b6ddeaf83367dadb4d37a092a4e9a7855fc19a3
add base setup.py
tombiasz/django-hibpwned
setup.py
setup.py
from setuptools import setup setup( name='django-hibpwned', version='0.1', description='Django password validator based on haveibeenpwned.com API', url='', author='tombiasz', author_email='', license='MIT', packages=['haveibeenpwned'], zip_safe=False, install_requires=[ ...
mit
Python
dbe08024d28b545e304b4dde2128e36734148807
Modify setup.py
brutasse/graphite-web,DanCech/graphite-web,Invoca/graphite-web,Squarespace/graphite-web,disqus/graphite-web,Aloomaio/graphite-web,cosm0s/graphite-web,brutasse/graphite-web,AICIDNN/graphite-web,pu239ppy/graphite-web,section-io/graphite-web,drax68/graphite-web,atnak/graphite-web,dhtech/graphite-web,goir/graphite-web,DanC...
setup.py
setup.py
#!/usr/bin/env python import os from glob import glob from collections import defaultdict if os.environ.get('USE_SETUPTOOLS'): from setuptools import setup setup_kwargs = dict(zip_safe=0) else: from distutils.core import setup setup_kwargs = dict() storage_dirs = [] for subdir in ('whisper', 'ceres', 'rrd...
#!/usr/bin/env python import os from glob import glob if os.environ.get('USE_SETUPTOOLS'): from setuptools import setup setup_kwargs = dict(zip_safe=0) else: from distutils.core import setup setup_kwargs = dict() storage_dirs = [] for subdir in ('whisper', 'ceres', 'rrd', 'log', 'log/webapp'): storage_d...
apache-2.0
Python
1119fc45a0b61a8d9611bdd390af2a69a23a7c2d
Create setup.py
mspiez/napalm-sros
setup.py
setup.py
"""setup.py file.""" import uuid from setuptools import setup, find_packages from pip.req import parse_requirements __author__ = 'Michal Spiez <mspiez@gmail.com>' install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1()) reqs = [str(ir.req) for ir in install_reqs] setup( name="napalm-sros", ...
apache-2.0
Python
153fd9e9c0b9e251c423b811f3d67522d469d9bc
Solve first problem for Cracking the coding interview
arvinsim/hackerrank-solutions
all-domains/tutorials/cracking-the-coding-interview/arrays-left-rotation/solution.py
all-domains/tutorials/cracking-the-coding-interview/arrays-left-rotation/solution.py
# https://www.hackerrank.com/challenges/ctci-array-left-rotation # Python 3 def array_left_rotation(a, n, k): # Convert generator to a list arr = list(a) for _ in range(k): temp = arr.pop(0) arr.append(temp) # Return a generator from the list return (x for x in arr) n, k = map(int...
mit
Python
f0a2f28d8e4558348009c846b4b469685df40cb3
bump version for release 2.1.0
blade2005/zdesk,fprimex/zdgen,laythun/zdesk,fprimex/zdesk
setup.py
setup.py
from setuptools import setup import sys setup( # Basic package information. name = 'zdesk', author = 'Brent Woodruff', version = '2.1.0', author_email = 'brent@fprimex.com', packages = ['zdesk'], include_package_data = True, install_requires = ['httplib2', 'simplejson'], license='LI...
from setuptools import setup import sys setup( # Basic package information. name = 'zdesk', author = 'Brent Woodruff', version = '2.0.3', author_email = 'brent@fprimex.com', packages = ['zdesk'], include_package_data = True, install_requires = ['httplib2', 'simplejson'], license='LI...
mit
Python
21679505684c3d2f3c4ada51f2b3222750214053
Add a setup.py file.
streamr/marvin,streamr/marvin,streamr/marvin
setup.py
setup.py
#!/usr/bin/env python # coding: utf-8 from setuptools import setup, find_packages from os import path setup( name='marvin', version='0.1.0', author='Tarjei Husøy', author_email='tarjei@roms.no', url='https://github.com/streamr/marvin', description='API endpoints for streamr', packages=find...
mit
Python
ea83896675e8178c88549eb1d34c793da0ab9d40
Fix typos in setup.py
mehdipourfar/django-breadcrumbs,chronossc/django-breadcrumbs,iris-edu/django-breadcrumbs,mehdipourfar/django-breadcrumbs,iris-edu-int/django-breadcrumbs,iris-edu-int/django-breadcrumbs,chronossc/django-breadcrumbs,iris-edu/django-breadcrumbs,iris-edu-int/django-breadcrumbs,iris-edu/django-breadcrumbs,chronossc/django-b...
setup.py
setup.py
from setuptools import setup, find_packages setup( name="django-breadcrumbs", version="1.1.3", packages=find_packages(exclude=('breadcrumbs_sample*', 'sample_d14*')), author="Felipe 'chronos' Prenholato", author_email="philipe.rp@gmail.com", maintainer="Felipe 'chronos' Prenholato", maintain...
from setuptools import setup, find_packages setup( name="django-breadcrumbs", version="1.1.3", packages=find_packages(exclude=('breadcrumbs_sample*', 'sample_d14*')), author="Felipe 'chronos' Prenholato", author_email="philipe.rp@gmail.com", mainteiner="Felipe 'chronos' Prenholato", maintein...
bsd-3-clause
Python
a846a92f343ed056433b1dc861fc45c040b374d9
add setup.py.
google-code-export/django-pyodbc,google-code-export/django-pyodbc
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup setup(name='sql_server.pyodbc', version='1.0', description='Django MS SQL Server backends using pyodbc', author='django-pyodbc team', url='http://code.google.com/p/django-pyodbc', packages=['sql_server', 'sql_server.pyodbc',...
bsd-3-clause
Python
b8f87299faa1610187e1a63ee5e6d05372eb0394
move to just flask config for app
total-impact/total-impact-core,Impactstory/total-impact-core,Impactstory/total-impact-core,Impactstory/total-impact-core,total-impact/total-impact-core,Impactstory/total-impact-core,total-impact/total-impact-core,total-impact/total-impact-core
totalimpact/default_settings.py
totalimpact/default_settings.py
## ALL KEYS HAVE TO BE UPPERCASE TO BE STORED IN APP SETTINGS SECRET_KEY = 'default-key' BASE_DIR = "/Users/richard/Code/External/total-impact/" # During HTTP requests, the User-Agent string to use USER_AGENT = "TotalImpact/0.2.0" # TI version VERSION = "jean-claude" # Database information DB_NAME = 'ti' DB_URL = "h...
mit
Python
19f850e19b4e432e0faed630b748e58069214300
Declare dependencies in setup.py for automatic installation.
lsanotes/tornado,wechasing/tornado,eXcomm/tornado,Fydot/tornado,wxhzk/tornado-1,lilydjwg/tornado,Windsooon/tornado,arthurdarcet/tornado,frtmelody/tornado,anjan-srivastava/tornado,ovidiucp/tornado,coderhaoxin/tornado,elelianghh/tornado,eklitzke/tornado,304471720/tornado,anjan-srivastava/tornado,0x73/tornado,AlphaStaxLLC...
setup.py
setup.py
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
apache-2.0
Python
0771e26c35910e9f43715e436e73c08a85cd5ec7
add setup.py but could not be installed
tochikuji/pyPyrTools,tochikuji/pyPyrTools
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup install_requirements = [ 'six>=1.9.0', 'numpy>=1.9.0', 'pillow>=4.2.0' ] setup( name='pyrtools', version='0.0.1', description="tools for multi-scale image processing", author='Eero Simoncelli, Rob Young, Aiga SUZUKI', author_email='a...
mit
Python
469d7f8681cb8eaf6ae344d86e22069698e21b52
add setuptools
Gawen/parikstra
setup.py
setup.py
#!/usr/bin/env python try: from setuptools import setup except: from distutils.core import setup setup( name = "parikstra", description = "Parisian transport system API client", py_modules = ["parikstra"], test_suite = "tests", install_requires = [ "beautifulsoup4", ...
mit
Python
f6f9a01b0a79acbdabbc05c2a667278d8fb64bfc
Add a setup.py
notro/pydrm
setup.py
setup.py
from setuptools import setup setup( name = "pydrm", version = "0.1.0", author = "Noralf Trønnes", author_email = "noralf@tronnes.org", description = ("a pure python drm library which can present the framebuffer as a PIL.Image object"), license = "MIT", keywords = "drm framebuffer dumb buffe...
mit
Python
c5e21cb94e8b154789950a1b0e18cde2e27f7525
use shorter variable name
sandervandorsten/pycosat,ContinuumIO/pycosat,sandervandorsten/pycosat,ContinuumIO/pycosat
setup.py
setup.py
import sys from distutils.core import setup, Extension version = '0.2.0' ext_kwds = dict( name = "pycosat", sources = ["pycosat.c"], define_macros = [] ) if sys.platform != 'win32': ext_kwds['define_macros'].append(('PYCOSAT_VERSION', '"%s"' % version)) if '--inplace' in sys.argv: ext_kwds['defi...
import sys from distutils.core import setup, Extension version = '0.2.0' ext_kwargs = dict( name = "pycosat", sources = ["pycosat.c"], define_macros = [] ) if sys.platform != 'win32': ext_kwargs['define_macros'].append(( 'PYCOSAT_VERSION', '"%s"' % version)) if '--inplace' in sys.argv: ...
mit
Python
43efbf39259e6836a85dce98e0d2c883d3715ddc
Add setup.py
dwhswenson/annotated_trajectories,dwhswenson/annotated_trajectories
setup.py
setup.py
""" Modified from the OpenPathSampling setup.py """ #from distutils.sysconfig import get_config_var from distutils.core import setup, Extension from setuptools import setup, Extension import numpy import glob import os import subprocess ########################## VERSION = "0.1.0" ISRELEASED = False __version__ = VERS...
lgpl-2.1
Python
b23c9103359416041de7153d088da9152a13363f
Improve build script
brahaney/nessrest,attritionorg/nessrest,xychix/nessrest
setup.py
setup.py
# Copyright (c) 2014, Tenable Network Security, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # - Redistributions of source code must retain the above copyright notice, # this list of...
# Copyright (c) 2014, Tenable Network Security, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # - Redistributions of source code must retain the above copyright notice, # this list of...
bsd-3-clause
Python
bdbfdfe8a227874a59c2ac8eb1c6d92e39db0da0
ADD fabfile
artinnok/django-default-skeleton,artinnok/django-default-skeleton,artinnok/django-default-skeleton
django-default-skeleton/fabfile.py
django-default-skeleton/fabfile.py
from fabric.api import env, run, sudo, prefix env.user = '' env.hosts = [] env.supervisor_group = '' env.cwd = '' def git_pull(): run("git pull") def backend(): sudo("find . -name '*.pyc' -delete") with prefix("source ../env/bin/activate"): run("pip install -r requirements/production.txt") ...
mit
Python
94bfab72fc6e9e0a419e54a47d2fcca0100a27da
Add more comments
CharlesJonah/bucket_list_api,CharlesJonah/bucket_list_api
application/models.py
application/models.py
from flask_sqlalchemy import SQLAlchemy from sqlalchemy.orm import relationship from itsdangerous import (TimedJSONWebSignatureSerializer as Serializer, BadSignature, SignatureExpired) from passlib.apps import custom_app_context as pwd_context from .config import Config db = SQLAlchemy() #this is the creation of a s...
mit
Python
19784f6d25ced739c14e19582af45ab0d478228f
add a setup.py file.
cournape/Bento,cournape/Bento,abadger/Bento,abadger/Bento,abadger/Bento,abadger/Bento,cournape/Bento,cournape/Bento
setup.py
setup.py
from distutils.core import setup DESCR = """\ Toydist is a toy distribution tool for python packages, The goal are extensibility, flexibility, and easy interoperation with external tools. As its name indicate, that's a toy packaging tool, which is only used as a 'straw' man for experimentation """ CLASSIFIERS = [ ...
bsd-3-clause
Python
671e7aee284d24ba4be3f1bf758258c77f0ec81f
Revert moving setup.py outside repository
ciex/souma,ciex/souma,ciex/souma
setup.py
setup.py
""" Script to install Souma on OsX, Windows, and Unix Usage: python setup.py py2app """ import ez_setup ez_setup.use_setuptools() import sys from setuptools import setup APP = ['run.py'] if sys.platform == 'darwin': extra_options = dict( setup_requires=['py2app'], app=APP, options=di...
apache-2.0
Python
5bb5f2a3c7db238b83f616a6e9a4012a8988aa19
Add setup.py
Jc2k/pysyncthing
setup.py
setup.py
#!/usr/bin/python # Copyright 2014 John Carr # # 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 Software Foundation; either # version 2.1 of the License, or (at your option) any later version. from distutils....
lgpl-2.1
Python