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 |
|---|---|---|---|---|---|---|---|---|
ed463c7ea52bea26d724ee372fbd7319bfee8e1f | add preprocessor | LeeTZ/Yo,LeeTZ/Yo,LeeTZ/Yo | src/preprocessor.py | src/preprocessor.py | #! /usr/bin/python
import os
import re
import sys
try:
from cStringIO import StringIO
except:
from StringIO import StringIO
def process(input_file):
invalidchar = ('\t')
blockcomment = ['#{','}#']
stack = [0]
output = StringIO()
newindent = False
commented = False
linejoin = False
debug = Fal... | mit | Python | |
8fe5e768f20abfdd790870075950b6537c5cad6a | Add class containing test state and report + print methods | Mikko-Finell/ptest | ptest.py | ptest.py | #!/usr/bin/python3
from sys import exit
class Ptest(object):
def __init__(self, module_name):
self.module_name = module_name
self.passed = 0
self.failed = 0
print('\nRunning tests for module "', module_name, '"', sep='')
def report(self, test_name, test_result):
if t... | unlicense | Python | |
20375ca41cce0ee6a9a22bfe6faa766ab6db53fc | add tests for coordinate rounding and basic pen commands | googlefonts/fonttools,fonttools/fonttools | Lib/fontTools/pens/t2CharStringPen_test.py | Lib/fontTools/pens/t2CharStringPen_test.py | from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.pens.t2CharStringPen import T2CharStringPen
import unittest
class T2CharStringPenTest(unittest.TestCase):
def assertAlmostEqualProgram(self, expected, actual):
self.assertEqual(len(expected),... | mit | Python | |
1669f9a3a9fabc2ded8fa92542dca65036c201e5 | Create sizes.py | danforthcenter/plantcv,stiphyMT/plantcv,stiphyMT/plantcv,danforthcenter/plantcv,danforthcenter/plantcv,stiphyMT/plantcv | plantcv/plantcv/visualize/sizes.py | plantcv/plantcv/visualize/sizes.py | # Visualize an annotated image with object sizes
import os
import cv2
import random
import numpy as np
from plantcv.plantcv import params
from plantcv.plantcv import plot_image
from plantcv.plantcv import print_image
from plantcv.plantcv import find_objects
from plantcv.plantcv import color_palette
def sizes(img, ma... | mit | Python | |
e03ecf68055e820106172413967713f98f7905ac | copy api_util to client to make it self-contained | olebole/astrometry.net,olebole/astrometry.net,olebole/astrometry.net,olebole/astrometry.net,olebole/astrometry.net,olebole/astrometry.net,olebole/astrometry.net,olebole/astrometry.net | net/client/api_util.py | net/client/api_util.py | import simplejson
def json2python(json):
try:
return simplejson.loads(json)
except:
pass
return None
python2json = simplejson.dumps
| bsd-3-clause | Python | |
addc7f33af75070333369a01c71e8acd231376ba | Add FilterNotifier for keyword based notification filtering | flakas/reconbot | reconbot/notifiers/filter.py | reconbot/notifiers/filter.py | class FilterNotifier:
""" Filters notifications based on their type or keywords """
def __init__(self, notifier, keywords=[], ignore=[]):
self.notifier = notifier
self.keywords = keywords
self.ignore = ignore
def notify(self, text, options={}):
if len(self.ignore) > 0 and an... | mit | Python | |
b09b11de1a025196cceb1c8fd71bda5515437a10 | Add max31855 example driver | alvarop/silta,alvarop/silta,alvarop/silta | sw/examples/drivers/max31855.py | sw/examples/drivers/max31855.py | #!/usr/bin/env python
#
# SPI example (using the STM32F407 discovery board)
#
import sys
import time
import ctypes
from silta import stm32f407
def bytes_to_int(byte_list):
num = 0
for byte in range(len(byte_list)):
num += byte_list[byte] << ((len(byte_list) - 1 - byte) * 8)
return num
class MA... | bsd-2-clause | Python | |
a15e363718ab41c5e02b9eaa919fb689cd266af6 | Add common module for our tests | ptthiem/nose2,ojengwa/nose2,ezigman/nose2,ojengwa/nose2,leth/nose2,ezigman/nose2,ptthiem/nose2,little-dude/nose2,leth/nose2,little-dude/nose2 | nose2/tests/_common.py | nose2/tests/_common.py | """Common functionality."""
import os.path
import tempfile
import shutil
import sys
class TestCase(unittest2.TestCase):
"""TestCase extension.
If the class variable _RUN_IN_TEMP is True (default: False), tests will be
performed in a temporary directory, which is deleted afterwards.
"""
... | bsd-2-clause | Python | |
b802f1d5453840ea4b16113d5d03f6c27224ce0c | Add try/except example. | honeybadger-io/honeybadger-python,honeybadger-io/honeybadger-python | examples/try.py | examples/try.py | # Honeybadger for Python
# https://github.com/honeybadger-io/honeybadger-python
#
# This file is an example of how to catch an exception in Python and report it
# to Honeybadger without re-raising. To run this example:
# $ pip install honeybadger
# $ HONEYBADGER_API_KEY=your-api-key python try.py
from honeybadger impo... | mit | Python | |
6bbef11c982ddee4981318e6bca9fa85610f1cc8 | Increase revision content lenght | VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core | src/ggrc/migrations/versions/20170112112254_177a979b230a_update_revision_content_field.py | src/ggrc/migrations/versions/20170112112254_177a979b230a_update_revision_content_field.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Update revision content field.
Create Date: 2017-01-12 11:22:54.998164
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
import sqlalche... | apache-2.0 | Python | |
eb4fbb28ed06b223282b02bb31f5f91e1eeb3f9f | Add RenormalizeWeight callback | EderSantana/seya,berleon/seya | seya/callbacks.py | seya/callbacks.py | import numpy as np
from keras.callbacks import Callback
class RenormalizeWeight(Callback):
def __init__(self, W):
Callback.__init__(self)
self.W = W
self.W_shape = self.W.get_value().shape
def on_batch_start(self, batch, logs={}):
W = self.W.get_value()
if self.W_shape... | bsd-3-clause | Python | |
c575f030feb90d3c6383d11265fcf7f80414ce34 | Add an example hook script for checking valid commits | gerrit-review/gerrit,keerath/gerrit_newssh,TonyChai24/test,WANdisco/gerrit,sudosurootdev/gerrit,bootstraponline-archive/gerrit-mirror,quyixia/gerrit,jeblair/gerrit,anminhsu/gerrit,sudosurootdev/gerrit,quyixia/gerrit,austinchic/Gerrit,anminhsu/gerrit,qtproject/qtqa-gerrit,dwhipstock/gerrit,ckamm/gerrit,teamblueridge/ger... | contrib/check-valid-commit.py | contrib/check-valid-commit.py | #!/usr/bin/env python
import commands
import getopt
import sys
SSH_USER = 'bot'
SSH_HOST = 'localhost'
SSH_PORT = 29418
SSH_COMMAND = 'ssh %s@%s -p %d gerrit approve ' % (SSH_USER, SSH_HOST, SSH_PORT)
FAILURE_SCORE = '--code-review=-2'
FAILURE_MESSAGE = 'This commit message does not match the standard.' \
+ '... | apache-2.0 | Python | |
1f1d2df36a16b80c770974a9ac2bf48ccbebc3ab | add callable list | Cologler/py.jasily.cologler,Jasily/jasily-python | jasily/collection/funcs.py | jasily/collection/funcs.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2018~2999 - Cologler <skyoflw@gmail.com>
# ----------
#
# ----------
from functools import partial
class CallableList(list):
'''
a simple callable list.
'''
def __call__(self):
ret = None
for func in self:
ret = func()
retu... | mit | Python | |
467170482c97c3b586d58c4729d051c1b1b99f3d | Add sentence level classifier. | chiubaka/actionizer | actionizer_sentences.py | actionizer_sentences.py | #! /usr/bin/python
import numpy as np
import os
import re
from sklearn import datasets, cross_validation
from sklearn.base import TransformerMixin
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.metrics import classification_report
f... | mit | Python | |
44b6b0ff5efc6d9fcda4f886640663b68e7d6c14 | Add initial code for getting batting stats over a specified timeframe | jldbc/pybaseball | pybaseball/league_batting_stats.py | pybaseball/league_batting_stats.py |
"""
TODO
pull batting stats over specified time period
allow option to get stats for full seasons instead of ranges
"""
import requests
import pandas as pd
from bs4 import BeautifulSoup
def get_soup(start_dt, end_dt):
# get most recent standings if date not specified
if((start_dt is None) or (end_dt is None)):
... | mit | Python | |
072423365ad1c03dd593f5b8528a7b60c0c9bee9 | Add AuctionHouse table. | LegionXI/pydarkstar,AdamGagorik/pydarkstar | pydarkstar/tables/auction_house.py | pydarkstar/tables/auction_house.py | """
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
from sqlalchemy import Column, Integer, SmallInteger, String, text
from pydarkstar.tables.base import Base
class AuctionHouse(Base):
__tablename__ = 'auction_house'
id = Column(Integer, primary_key=True)
itemid = Column(SmallInt... | mit | Python | |
f85f6ba07c47a6ccbd38a9e7bc2e9a2c69ebd09a | read senor values from rpi | yopzolo/ArduinoI2CMoistureSensor | pythonLib/ArduinoMoistureSensor.py | pythonLib/ArduinoMoistureSensor.py | import smbus
import time
bus = smbus.SMBus(1)
address = int(sys.argv[1])
data = bus.read_i2c_block_data(address,0)
for i in range (0,6):
print (data[2*i] << 8)+ data[2*i+1]
| apache-2.0 | Python | |
47d7cfcd9db1a54e52532819895060527e1988b9 | update qlcoder | YcheLanguageStudio/PythonStudy | qlcoder/scheme_study/functional.py | qlcoder/scheme_study/functional.py | if __name__ == '__main__':
my_arr = [None] * 7654321
for i in range(0, 7654321):
my_arr[i]=i
| mit | Python | |
7618697cdb892388d7c5ddb731f5b9f138389ca4 | add A4 | rfdickerson/CS241,rfdickerson/cs241-data-structures,rfdickerson/CS241,rfdickerson/cs241-data-structures,rfdickerson/cs241-data-structures,rfdickerson/CS241 | A4/TestHashtable.py | A4/TestHashtable.py | #!/usr/bin/env python2
from hashtable import Hashtable, LinkedList, hashFunction
import unittest
import collections
class TestHashtable(unittest.TestCase):
def setUp(self):
buildings = {
"CSCI" : "McGlothlin-Street",
"GSWS" : "Tucker",
"ENGL" : "Tucker",
"... | mit | Python | |
c26b20a44c47474f88c8f155b36c8c6f0dcfd072 | Move packet processing into its own class | elliotta/hephaestus | innovate/packet.py | innovate/packet.py | """One data packet in Innovate Serial Protocol version 2 (ISP2).
For data format specifications, see
http://www.innovatemotorsports.com/support/downloads/Seriallog-2.pdf
"""
import struct
class InnovatePacket(object):
"""An packet in the Innovate Serial Protocol version 2 (ISP2).
ISP2 packets are composed ... | mit | Python | |
d635a60140c11c64db4ac887bc79396484bb55e3 | Add model_utils.print_graph_layer_shapes to handle Graph models. Also handle Merge layers | nehz/keras,ogrisel/keras,eulerreich/keras,DeepGnosis/keras,3dconv/keras,xurantju/keras,xiaoda99/keras,cheng6076/keras,JasonTam/keras,zhmz90/keras,keras-team/keras,nt/keras,Yingmin-Li/keras,jayhetee/keras,asampat3090/keras,zxytim/keras,dolaameng/keras,florentchandelier/keras,LIBOTAO/keras,zxsted/keras,navyjeff/keras,dxj... | keras/utils/model_utils.py | keras/utils/model_utils.py | from __future__ import print_function
import numpy as np
import theano
def print_graph_layer_shapes(graph, input_shapes):
"""
Utility function to print the shape of the output at each layer of a Graph
Arguments:
graph: An instance of models.Graph
input_shapes: A dict that gives a shape for... | from __future__ import print_function
import numpy as np
import theano
def print_layer_shapes(model, input_shape):
"""
Utility function that prints the shape of the output at each layer.
Arguments:
model: An instance of models.Model
input_shape: The shape of the input you will provide to ... | mit | Python |
f379160e56a94359d9571ea1b1db1f7544677a57 | Fix reference to `latestEvent` in tests. | gencer/sentry,jean/sentry,beeftornado/sentry,ifduyue/sentry,mvaled/sentry,looker/sentry,ifduyue/sentry,mvaled/sentry,beeftornado/sentry,looker/sentry,jean/sentry,gencer/sentry,beeftornado/sentry,gencer/sentry,gencer/sentry,looker/sentry,ifduyue/sentry,mvaled/sentry,jean/sentry,looker/sentry,gencer/sentry,mvaled/sentry,... | tests/sentry/api/serializers/test_grouphash.py | tests/sentry/api/serializers/test_grouphash.py | from __future__ import absolute_import
from sentry.api.serializers import serialize
from sentry.models import Event, GroupHash
from sentry.testutils import TestCase
class GroupHashSerializerTest(TestCase):
def test_no_latest_event(self):
user = self.create_user()
group = self.create_group()
... | from __future__ import absolute_import
from sentry.api.serializers import serialize
from sentry.models import Event, GroupHash
from sentry.testutils import TestCase
class GroupHashSerializerTest(TestCase):
def test_no_latest_event(self):
user = self.create_user()
group = self.create_group()
... | bsd-3-clause | Python |
db13f88055d5ea2357ecc4b996f80d3392655516 | Create parse.py | abbacode/ciscoconfparser | parse.py | parse.py | __version__ = "1.0"
import os
from ciscoconfparse import CiscoConfParse
# -----------------------------------------------
# Create the db dictionary to store all records
# -----------------------------------------------
db = {}
# ----------------------------------------------------------------
# Update the dictionary... | mit | Python | |
bee35885bb845ea77aa4586bca33da3e54b92ed2 | Add `albumtypes` plugin | beetbox/beets,beetbox/beets,beetbox/beets,beetbox/beets | beetsplug/albumtypes.py | beetsplug/albumtypes.py | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2021, Edgars Supe.
#
# 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... | mit | Python | |
f859eb67fdc66b930c3664a3586c454f5c9afe87 | Add files via upload | dionysius07/robot-vision | subunits/blink.py | subunits/blink.py | from nanpy import ArduinoApi
from nanpy import SerialManager
from time import sleep
link = SerialManager(device='/dev/ttyACM0')
A = ArduinoApi(connection=link)
led = 13
# SETUP:
A.pinMode(led, A.OUTPUT)
# LOOP:
while True:
A.digitalWrite(led, A.HIGH) # turn the LED on (HIGH is the voltage level)
... | mit | Python | |
a11cee952e1abc7e7310b760c8a4845c4f46fbae | add date_range.py | Impactstory/oadoi,Impactstory/oadoi,Impactstory/sherlockoa,Impactstory/oadoi,Impactstory/sherlockoa | date_range.py | date_range.py | from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.orm import deferred
from sqlalchemy import or_
from sqlalchemy import sql
from sqlalchemy import text
from sqlalchemy import orm
import requests
from time import sleep
from time import time
import datetime
import shortuuid
from urllib import quote
from a... | mit | Python | |
7d258bdb68119ad54a69e92ac7c7c1c2fc51e087 | Create scrap.py | shekhar-singh/scrap | scrap.py | scrap.py | #!usr/bin/env python
import requests
from bs4 import BeautifulSoup
uri = requests.get("http://video9.in/english/")
soup=BeautifulSoup(url.text)
for link in soup.find_all("div",{"class": "updates"}):
print link.text
| mit | Python | |
2aae4701fd98f560e7e112084f47f66515f6f574 | Add setup.py | matham/go_nogo,matham/sock_cond,matham/sniffer,matham/go_nogo,matham/forced_choice | setup.py | setup.py | from setuptools import setup, find_packages
import go_nogo_rig
setup(
name='Go-NoGo',
version=go_nogo_rig.__version__,
packages=find_packages(),
install_requires=['moa', 'pybarst', 'moadevs'],
author='Matthew Einhorn',
author_email='moiein2000@gmail.com',
url='https://cpl.cornell.edu/',
... | mit | Python | |
aef67e19a3494880620fd87a68ff581edaa9ce81 | Add unittest for madx.evaluate | pymad/jpymad,pymad/cpymad,pymad/cpymad,pymad/jpymad,pymad/jpymad | test/test_madx.py | test/test_madx.py | import unittest
from cern.madx import madx
from math import pi
class TestMadX(unittest.TestCase):
"""Test methods of the madx class."""
def setUp(self):
self.madx = madx()
def tearDown(self):
del self.madx
def testEvaluate(self):
self.madx.command("FOO = PI*3;")
val =... | apache-2.0 | Python | |
0a55f6f2bf49c679a422d44007df3f66c323e719 | mask unit test | bengranett/minimask | test/test_mask.py | test/test_mask.py | import numpy as np
from minimask.mask import Mask
from minimask.spherical_poly import spherical_polygon
def test_mask_sample():
""" """
vertices = [[0,0],[10,0],[10,10],[0,10]]
S = spherical_polygon(vertices)
M = Mask(polys=[S], fullsky=False)
x,y = M.sample(100)
assert len(x) == 1000
a... | mit | Python | |
25495d675c44a75d7dedfe123f30a858f9cd60be | Add minimal (no asserts) test for play plugin | MyTunesFreeMusic/privacy-policy,diego-plan9/beets,sampsyo/beets,sampsyo/beets,jcoady9/beets,swt30/beets,jcoady9/beets,LordSputnik/beets,jackwilsdon/beets,MyTunesFreeMusic/privacy-policy,parapente/beets,ibmibmibm/beets,ibmibmibm/beets,lengtche/beets,Freso/beets,xsteadfastx/beets,LordSputnik/beets,madmouser1/beets,lengtc... | test/test_play.py | test/test_play.py | # -*- coding: utf-8 -*-
"""Tests for the play plugin"""
from __future__ import (division, absolute_import, print_function,
unicode_literals)
from mock import patch, Mock
from test._common import unittest
from test.helper import TestHelper
from beetsplug.play import PlayPlugin
class PlayPl... | mit | Python | |
83d00fea8adf611984c3b56a63f080f144612c69 | Create data_tool.py | gu-yan/mlAlgorithms | data_tool.py | data_tool.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
import pickle
import random
def load_data():
with open('dataset.pkl', 'r') as file:
data_set = pickle.load(file)
return data_set
def feature_format(data_set):
features = []
labels = []
for item in data_set:
features.append(item[:-1])
... | apache-2.0 | Python | |
c488e446aee3d28fa84bb24d446ca22af20e461c | Add setup.py | bacher09/dynsupdate | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
def lt27():
import sys
v = sys.version_info
return (v[0], v[1]) < (2, 7)
tests_require = [
'nose>=1.0',
'mock',
]
if lt27():
tests_require.append('unittest2')
setup(
name='dynsupdate',
description='Dynamic DNS ... | bsd-3-clause | Python | |
6d3a9f41bec03405fa648ce169b9565f937e4598 | add setup.py | trehn/timekeeper | setup.py | setup.py | from setuptools import setup
setup(
name="timekeeper",
version="0.1.0",
description="Send runtime measurements of your code to InfluxDB",
author="Torsten Rehn",
author_email="torsten@rehn.email",
license="ISC",
url="https://github.com/trehn/timekeeper",
keywords=["profiling", "profile"... | isc | Python | |
bc9401da60e8f10827f37772af937d4fb11ca248 | Add PyPI setup.py file | import/component.py | setup.py | setup.py | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='component',
author='Daniel Chatfield',
author_email='chatfielddaniel@gmail.com',
version='0.0.1',
url='http://github.com/import/component',
py_modules=['component'],
description='A p... | mit | Python | |
1d7fa31d9f4ce42586fb33bea98d5af87bd95f3a | Allow setup.py install | cdw/multifil | setup.py | setup.py | from setuptools import setup
setup(name='multifil',
version='0.2',
description='A spatial half-sarcomere model and the means to run it',
url='https://github.com/cdw/multifil',
author='C David Williams',
author_email='cdave@uw.edu',
license='MIT',
packages=['multifil'],
i... | mit | Python | |
30220f57bc5052cb05ed5c7e3dc01c763152d175 | Add setup for python installation | jnez71/lqRRT | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='lqrrt',
version='1.0',
description='Kinodynamic RRT Implementation',
author='Jason Nezvadovitz',
packages=['lqrrt'],
)
| mit | Python | |
0c7ec853c97a71eacc838be925c46ac0c26d1518 | Create setup.py | daTokenizer/ratio-merge-python | setup.py | setup.py | from distutils.core import setup
setup(
name = 'ratio-merge',
packages = ['ratio-merge'],
version = '0.1',
description = 'A small utility function for merging two lists by some ratio',
author = 'Adam Lev-Libfeld',
author_email = 'adam@tamarlabs.com',
url = 'https://github.com/daTokenizer/ratio-merge-pytho... | apache-2.0 | Python | |
a29b7195af2550e5646f3aac581cbaf47244e8f4 | Create setup.py | david-hoffman/pyOTF | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# setup.py
"""
Setup files
Copyright (c) 2020, David Hoffman
"""
import setuptools
# read in long description
with open("README.md", "r") as fh:
long_description = fh.read()
# get requirements
with open("requirements.txt", "r") as fh:
requirements = [line.strip(... | apache-2.0 | Python | |
45d734cb495e7f61c5cbbac2958e220868033a9d | Add setup.py for RTD | westernx/mayatools,westernx/mayatools | setup.py | setup.py | from distutils.core import setup
setup(
name='mayatools',
version='0.1-dev',
description='Collection of general tools and utilities for working in and with Maya.',
url='https://github.com/westernx/mayatools',
packages=['mayatools'],
author='Mike Boers',
author_email='mayatools@mik... | bsd-3-clause | Python | |
1ac147a2a9f627cccd917006f61cdda7b25ccc06 | Add setup.py | szabba/applied-sims | setup.py | setup.py | from distutils.core import setup
setup(
name='applied-sims',
version='0.1',
classifiers=[
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Physics',
'Intended Audience :: Other Audie... | mpl-2.0 | Python | |
e6e96d9fa725ec28028b090c900086474e69cdb8 | Add basic setup.py | mikeboers/LiteMap,mikeboers/SerialView | setup.py | setup.py |
from distutils.core import setup
setup(
name='litemap',
version='1.0a',
description='Mapping class which stores in SQLite database.',
url='http://github.com/mikeboers/LiteMap',
py_modules=['litemap'],
author='Mike Boers',
author_email='litemap@mikeboers.com',
license='New BSD Lice... | bsd-3-clause | Python | |
479ff810c07ebe5c309bb4c9f712e689e831945e | Add setup.py | msabramo/ansible_role_apply,rajiteh/ansible_role_apply | setup.py | setup.py | import os
from setuptools import setup
this_dir = os.path.dirname(__file__)
long_description = "\n" + open(os.path.join(this_dir, 'README.rst')).read()
setup(
name='ansible_role_apply',
version='0.0.0',
description='Apply a single Ansible role to host(s) easily',
long_description=long_description,
... | mit | Python | |
9d12617170982fc1b6b01d109d986f5cd45e0552 | Update setup.py. | Bismarrck/pymatgen,ctoher/pymatgen,ctoher/pymatgen,Bismarrck/pymatgen,Dioptas/pymatgen,yanikou19/pymatgen,rousseab/pymatgen,migueldiascosta/pymatgen,yanikou19/pymatgen,Dioptas/pymatgen,Bismarrck/pymatgen,migueldiascosta/pymatgen,rousseab/pymatgen,Bismarrck/pymatgen,ctoher/pymatgen,sonium0/pymatgen,migueldiascosta/pymat... | setup.py | setup.py | from setuptools import setup,find_packages
setup (
name = 'pymatgen',
version = '1.0.1',
packages = find_packages(),
# Declare your packages' dependencies here, for eg:
install_requires = ['numpy','scipy','matplotlib','PyCIFRW'],
author = 'Shyue Ping Ong, Anubhav Jain, Michael Kocher, Dan Gunter',
aut... | from setuptools import setup,find_packages
setup (
name = 'pymatgen',
version = '1.0.1',
packages = find_packages(),
# Declare your packages' dependencies here, for eg:
install_requires = ['numpy','matplotlib','pymongo','PyCIFRW','psycopg2'],
author = 'Shyue Ping Ong, Anubhav Jain, Michael Kocher, Dan ... | mit | Python |
4a7234d4592166a1a13bc6b8e8b3b201019df23b | Create prims_minimum_spanning.py | keon/algorithms | algorithms/graph/prims_minimum_spanning.py | algorithms/graph/prims_minimum_spanning.py | import heapq # for priority queue
# input number of nodes and edges in graph
n, e = map (int,input().split())
# initializing empty graph as a dictionary (of the form {int:list})
g = dict (zip ([i for i in range(1,n+1)],[[] for i in range(n)]))
# input graph data
for i in range(e):
a, b, c = map (int,input().spl... | mit | Python | |
24f6cbdcf2f4261a651d058934c65c3696988586 | add setup.py to document deps | lowerquality/gentle,lowerquality/gentle,lowerquality/gentle,lowerquality/gentle | setup.py | setup.py | from setuptools import setup
setup(
name='gentle',
version='0.1',
description='Robust yet lenient forced-aligner built on Kaldi.',
url='http://lowerquality.com/gentle',
author='Robert M Ochshorn',
license='MIT',
packages=['gentle'],
install_requires=['twisted'],
)
| mit | Python | |
654bd46a8226ea97000a1263132a37f7bf130718 | ADD setup.py | jmetzen/kernel_regression | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='kernel_regression',
version='1.0',
description='Implementation of Nadaraya-Watson kernel regression with automatic bandwidth selection compatible with sklearn.',
author='Jan Hendrik Metzen',
author_email='jhm@informatik.uni-bre... | bsd-3-clause | Python | |
1707306cdee6442e78fe9eaee1d472a0248f75d5 | make license consistent | kislyuk/argcomplete,neizod/argcomplete,douglas-larocca/argcomplete,landonb/argcomplete,lisongmin/argcomplete,landonb/argcomplete,lisongmin/argcomplete,douglas-larocca/argcomplete,kislyuk/argcomplete,neizod/argcomplete | setup.py | setup.py | # -*- coding: utf-8 -*-
"""
argcomplete
~~~~
Argcomplete provides easy and extensible automatic tab completion of arguments and options for your Python script.
It makes two assumptions:
- You're using bash as your shell
- You're using argparse to manage your command line options
See AUTODOCS_LINK for more info.
""... | # -*- coding: utf-8 -*-
"""
argcomplete
~~~~
Argcomplete provides easy and extensible automatic tab completion of arguments and options for your Python script.
It makes two assumptions:
- You're using bash as your shell
- You're using argparse to manage your command line options
See AUTODOCS_LINK for more info.
""... | apache-2.0 | Python |
1f1096046e11067c4d42235d3b1aadbfec869bff | Remove setuptools from install_requires | ixc/django_polymorphic,chrisglass/django_polymorphic,pombredanne/django_polymorphic,skirsdeda/django_polymorphic,skirsdeda/django_polymorphic,chrisglass/django_polymorphic,pombredanne/django_polymorphic,ixc/django_polymorphic,pombredanne/django_polymorphic,skirsdeda/django_polymorphic,ixc/django_polymorphic | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
from os import path
import codecs
import os
import re
import sys
def read(*parts):
file_path = path.join(path.dirname(__file__), *parts)
return codecs.open(file_path, encoding='utf-8').read()
def find_version(*parts):
version_file = read(... | #!/usr/bin/env python
from setuptools import setup, find_packages
from os import path
import codecs
import os
import re
import sys
def read(*parts):
file_path = path.join(path.dirname(__file__), *parts)
return codecs.open(file_path, encoding='utf-8').read()
def find_version(*parts):
version_file = read(... | bsd-3-clause | Python |
260911a0a46601092aa75882c806ca921a0cbf6d | Add setup.py file so we can install | ocefpaf/pyaxiom,axiom-data-science/pyaxiom,axiom-data-science/pyaxiom,ocefpaf/pyaxiom | setup.py | setup.py | from __future__ import with_statement
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
version = "0.0.1-dev"
def readme():
with open('README.md') as f:
return f.read()
reqs = [line.strip() for line in open('requirements.txt')]
class PyTest... | mit | Python | |
b1d87a8f96fb6a019bc7ebab71fe8e0c5921d80f | Include setup.py | emedvedev/attention-ocr | setup.py | setup.py | from setuptools import find_packages
from setuptools import setup
REQUIRED_PACKAGES = ['distance', 'tensorflow', 'numpy', 'six']
setup(
name='attentionocr',
url='https://github.com/emedvedev/attention-ocr',
author_name='Ed Medvedev',
version='0.1',
install_requires=REQUIRED_PACKAGES,
packages=... | mit | Python | |
6ded510fa9c694e8a836302131157604859d40b1 | add setup settings | mrpatiwi/uc-numero-alumno-python | setup.py | setup.py | from setuptools import setup
setup(name='uc-numero-alumno',
version='0.1.0',
description='Valida un número de alumno de la UC ',
url='https://github.com/mrpatiwi/uc-numero-alumno-python',
author='Patricio López',
author_email='patricio@lopezjuri.com',
license='MIT',
packages=[... | mit | Python | |
414c5d0f9e7e92772cf65be976791889e96e2799 | Package with setuptools | mtearle/npyscreenreactor | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
classifiers = [
'Development Status :: 5 - Production/Stable',
'Framework :: Twisted',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: P... | mit | Python | |
8aada38d951d039e11e03a6bae9445c784bb4cce | Write a brief demo using nltk | alexander-bauer/syllabus-summary | parse-demo.py | parse-demo.py | #!/usr/bin/python3
import sys, os
import nltk
if len(sys.argv) < 2:
print("Please supply a filename.")
sys.exit(1)
filename = sys.argv[1]
with open(filename, 'r') as f:
data = f.read()
# Break the input down into sentences, then into words, and position tag
# those words.
sentences = [nltk.pos_tag(nltk... | mit | Python | |
89fa937d218bef113d2bcc681cb4dbd547940c45 | Add setup.py | koofr/python-koofr | setup.py | setup.py | from distutils.core import setup
setup(
name = 'koofr',
packages = ['koofr'], # this must be the same as the name above
install_requires=['requests'],
version = '0.1',
description = 'Python SDK for Koofr',
author = 'Andraz Vrhovec',
author_email = 'andraz@koofr.net',
url = 'https://github.com/koofr/pyth... | mit | Python | |
8ecfe73916fbca42b9a1b47fb2758bb561b76eec | Remove print. | Dioptas/pymatgen,Bismarrck/pymatgen,ctoher/pymatgen,Bismarrck/pymatgen,yanikou19/pymatgen,Bismarrck/pymatgen,sonium0/pymatgen,yanikou19/pymatgen,sonium0/pymatgen,yanikou19/pymatgen,rousseab/pymatgen,Dioptas/pymatgen,Bismarrck/pymatgen,sonium0/pymatgen,ctoher/pymatgen,migueldiascosta/pymatgen,Bismarrck/pymatgen,rousseab... | setup.py | setup.py | import os
from setuptools import setup, find_packages
README = os.path.join(os.path.dirname(__file__), 'README.md')
long_description = open(README).read() + '\n\n'
setup (
name = 'pymatgen',
version = '1.2.4',
packages = find_packages(),
install_requires = ['numpy', 'scipy', 'matplotlib', 'PyCIFRW'],
packa... | import os
from setuptools import setup, find_packages
README = os.path.join(os.path.dirname(__file__), 'README.md')
long_description = open(README).read() + '\n\n'
print find_packages()
setup (
name = 'pymatgen',
version = '1.2.4',
packages = find_packages(),
install_requires = ['numpy', 'scipy', 'matplotli... | mit | Python |
fe8cc65832b389314ee6e83c76371809e40cc5d1 | Bump to 0.1.1 | kivy-garden/garden,kivy-garden/garden,kivy-garden/garden,mohammadj22/garden | setup.py | setup.py | from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='Kivy Garden',
version='0.1.1',
license='MIT',
packages=['garden'],
scripts=['bin/garden', 'bin/garden.bat'],
install_requires=['requests'],
)
| from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='Kivy Garden',
version='0.1',
license='MIT',
packages=['garden'],
scripts=['bin/garden', 'bin/garden.bat'],
install_requires=['requests'],
)
| mit | Python |
ce7914dd35e66820248cb82760b50a31bc8a625b | Add setup.py script to install whip-neustar cli script | wbolster/whip-neustar | setup.py | setup.py | from setuptools import setup
setup(
name='whip-neustar',
version='0.1',
packages=['whip_neustar'],
entry_points={
'console_scripts': [
'whip-neustar = whip_neustar.cli:main',
],
}
)
| bsd-3-clause | Python | |
a72bc73aab4b696113bee16f5f7f9da1540bc02f | Create playerlist.py | Myselfminer/N | playerlist.py | playerlist.py | import config
class players:
def __init__(self):
self.path=config.install_path+"reg\\N_NOW_RUNNING\\PLAYERS\\LIST.nreg"
def get_names_str(self,level):
a=open(self.path,"r")
b=a.readlines()
string=""
for i in b:
string=string+i
a.close()
return ... | apache-2.0 | Python | |
7fa6d8beb2637bed6b31cf1cea5fdafffc6049bf | add tests | schieb/angr,haylesr/angr,chubbymaggie/angr,f-prettyland/angr,angr/angr,iamahuman/angr,iamahuman/angr,iamahuman/angr,schieb/angr,tyb0807/angr,angr/angr,chubbymaggie/angr,f-prettyland/angr,schieb/angr,axt/angr,angr/angr,chubbymaggie/angr,axt/angr,f-prettyland/angr,axt/angr,tyb0807/angr,tyb0807/angr,haylesr/angr | tests/test_dfg.py | tests/test_dfg.py | #!/usr/bin/env python
import logging
import time
import sys
from os.path import join, dirname, realpath
l = logging.getLogger("angr.tests.test_dfg")
l.setLevel(logging.DEBUG)
import nose
import angr
import pyvex
test_location = str(join(dirname(realpath(__file__)), "../../binaries/tests"))
def perform_one(binary_... | bsd-2-clause | Python | |
d7a0962a817e1a7e530fcd84a11dc51be82574a6 | Create get_qpf_f012.py | wfclark/hamlet,wfclark/hamlet | get_qpf_f012.py | get_qpf_f012.py | import sys
import os
import urllib2
import datetime
import time
import psycopg2
from subprocess import call, Popen
# pull the last hours worth of precip data
os.system("wget http://www.srh.noaa.gov/ridge2/Precip/qpfshp/latest/latest_rqpf_f012.tar.gz -O latest_rqpf_f012.tar.gz")
os.system("mv latest_rqpf_f012.tar.gz l... | bsd-3-clause | Python | |
504612eb0c3c6ec210dd6e555941c13523333f12 | install without cython | hickford/primesieve-python,anirudhjayaraman/primesieve-python,jakirkham/primesieve-python | setup.py | setup.py | from setuptools import setup, Extension
from glob import glob
library = ('primesieve', dict(
sources=glob("lib/primesieve/src/primesieve/*.cpp"),
include_dirs=["lib/primesieve/include"],
language="c++",
))
try:
from Cython.Build import cythonize
except ImportError:
cythonize = None
extension ... | from setuptools import setup, Extension
from Cython.Build import cythonize
from glob import glob
library = ('primesieve', dict(
sources=glob("lib/primesieve/src/primesieve/*.cpp"),
include_dirs=["lib/primesieve/include"],
language="c++",
))
extension = Extension(
"primesieve",
["primes... | mit | Python |
42ca323888dc13246fa7f6a01a6e29efcdb2d5c5 | Add setup.py | mcs07/MolVS | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
import molvs
if os.path.exists('README.rst'):
long_description = open('README.rst').read()
else:
long_description = ''''''
setup(
name='MolVS',
version=molvs.__version__,
author=molvs.__author__,
author_ema... | mit | Python | |
e91b1c56b252ddc3073a15209e38e73424911b62 | Remove unused import. | DVegaCapital/zipline,jimgoo/zipline-fork,DVegaCapital/zipline,nborggren/zipline,MonoCloud/zipline,florentchandelier/zipline,aajtodd/zipline,wilsonkichoi/zipline,aajtodd/zipline,kmather73/zipline,bartosh/zipline,ChinaQuants/zipline,alphaBenj/zipline,jimgoo/zipline-fork,iamkingmaker/zipline,michaeljohnbennett/zipline,joe... | setup.py | setup.py | #!/usr/bin/env python
#
# Copyright 2014 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | #!/usr/bin/env python
#
# Copyright 2014 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 | Python |
d139ced0b482fa65720a3c8f268d71dbf25119fb | add jsonsoup plugin | melmothx/jsonbot,melmothx/jsonbot,melmothx/jsonbot | commonplugs/jsonsoup.py | commonplugs/jsonsoup.py | # commonplugs/jsonsoup.py
#
#
## gozerlib imports
from gozerlib.callbacks import callbacks
from gozerlib.utils.url import posturl, getpostdata
from gozerlib.persistconfig import PersistConfig
from gozerlib.commands import cmnds
from gozerlib.socket.irc.monitor import outmonitor
from gozerlib.socket.rest.server import... | mit | Python | |
52cd79d7045a69ff5073af7ed14e9ed774de7a39 | Add setup.py. | pySUMO/pysumo,pySUMO/pysumo | setup.py | setup.py | from setuptools import setup
setup(
name='pySUMO',
version='0.0.0a1',
description='A graphical IDE for Ontologies written in SUO-Kif',
long_description='A graphical IDE for Ontologies written in SUO-Kif',
url='',
author='',
author_email='',
license='',
classifiers=['Development Stat... | bsd-2-clause | Python | |
7354dc674a4551169fb55bfcec208256e956d14e | Add skeleton class for conditions | lnishan/SQLGitHub | components/condition.py | components/condition.py | """A class to store conditions (eg. WHERE [cond])."""
class SgConditionSimple:
"""
A class to store a simple condition.
A simple condition is composed of 2 operands and 1 operator.
"""
def __init__(self, operand-l, operator, operand-r):
self._op-l = operand-l
self._op = operat... | mit | Python | |
a0607d0f9b7c08ddcf81459868b33761d8ed5bb2 | Set up the dependency | keras-team/keras-nlp,keras-team/keras-nlp | setup.py | setup.py | # Copyright 2021 The KerasNLP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 | Python | |
d9be2b8a61a88f0ee228c08d1f277770602840b1 | Add python version for compress | armiller/puzzles,armiller/puzzles | compression/compress.py | compression/compress.py |
def compress(uncompressed):
count = 1
compressed = ""
if not uncompressed:
return compressed
letter = uncompressed[0]
for nx in uncompressed[1:]:
if letter == nx:
count = count + 1
else:
compressed += "{}{}".format(letter, count)
count =... | apache-2.0 | Python | |
d480c2738bb4d0ae72643fc9bc1f911cb630539c | add 12-list.py | weizhenwei/tech-docs-2016,weizhenwei/tech-docs-2016,weizhenwei/tech-docs-2016,weizhenwei/tech-docs-2016,weizhenwei/tech-docs-2016,weizhenwei/tech-docs-2016 | python/12-list.py | python/12-list.py | #!/usr/bin/env python
import math
list = ['physics', 'chemistry', 1997, 2001];
print "list[2] = ", list[2]
print "list[1:3] = ", list[1:3]
list[2] = "math";
print "update, list[2] = ", list[2]
del list[2]
print "delete, list[2] = ", list[2]
print "length of delete:", len(list)
if ('physics' in list):
print... | bsd-2-clause | Python | |
240b22d0b078951b7d1f0df70156b6e2041a530f | fix setup.py dor pypi. | h4ki/couchapp,couchapp/couchapp,benoitc/erica,flimzy/couchapp,perplexes/couchapp,benoitc/erica,couchapp/couchapp,diderson/couchapp,couchapp/couchapp,dustin/couchapp,perplexes/couchapp,couchapp/couchapp,diderson/couchapp,h4ki/couchapp,perplexes/couchapp,dustin/couchapp,flimzy/couchapp,diderson/couchapp,flimzy/couchapp,d... | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Benoit Chesneau <benoitc@e-engura.org>
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import os
import sys
from setuptools import setup
data_files = []
root_dir = os.path.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Benoit Chesneau <benoitc@e-engura.org>
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import os
import sys
from setuptools import setup
data_files = []
root_dir = os.path.... | apache-2.0 | Python |
3ada80358a059b3a5ee4dd4ceed572f933a1ec67 | Create setup.py | guettli/compare-with-remote | setup.py | setup.py | from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
... | apache-2.0 | Python | |
606853d904c1967b41b30d828940c4aa7ab4c0ab | add setup.py | kgiusti/pyngus,kgiusti/pyngus | setup.py | setup.py | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | apache-2.0 | Python | |
90ec011ebec93f4c0b0e93fc831b0f782be1b13e | Add the setup.py PIP install config file. | Legilibre/SedLex | setup.py | setup.py | from setuptools import setup
setup(
name='SedLex',
version='0.1',
install_requires=[
'html5lib',
'beautifulsoup4',
'requests',
'jinja2',
'python-gitlab'
]
)
| agpl-3.0 | Python | |
fa88dac9c35fc473ebfea05926e0200926251d9d | Create setup.py | FlaminMad/RPiProcessRig,FlaminMad/RPiProcessRig | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='RPiProcessRig',
version='1.0',
description='A simple industrial rig that can be used for experimentation with a variety of different control algortithms',
author='Alexander Leech',
author_email='alex.leech@talktalk.net',
... | mit | Python | |
c0989ce01ee62367a92eb48855a42c3c4986de84 | Add setup.py. | djkartsa/django-add-another,djkartsa/django-add-another,djkartsa/django-add-another | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import os
from setuptools import find_packages, setup
def read(file_name):
file_path = os.path.join(os.path.dirname(__file__), file_name)
return codecs.open(file_path, encoding='utf-8').read()
PACKAGE = "ad... | mit | Python | |
7634b58b1bd0fc2eee121bad2a20b61077a48d7b | Update setup.py | typemytype/defconAppKit,typesupply/defconAppKit | setup.py | setup.py | #!/usr/bin/env python
import sys
from distutils.core import setup
try:
import fontTools
except:
print "*** Warning: defcon requires FontTools, see:"
print " fonttools.sf.net"
try:
import robofab
except:
print "*** Warning: defcon requires RoboFab, see:"
print " robofab.com"
#if "sdist"... | #!/usr/bin/env python
import sys
from distutils.core import setup
try:
import fontTools
except:
print "*** Warning: defcon requires FontTools, see:"
print " fonttools.sf.net"
try:
import robofab
except:
print "*** Warning: defcon requires RoboFab, see:"
print " robofab.com"
#if "sdist"... | mit | Python |
3c5802bda34ed9c772f7bb2e33b29f265440f286 | Add a simple setup.py. | dwaiter/django-goodfields | setup.py | setup.py | import os
from setuptools import setup, find_packages
README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.markdown')
description = 'django-goodfields makes creating good form fields easy.'
long_description = os.path.exists(README_PATH) and open(README_PATH).read() or description
setup(
... | mit | Python | |
26cc1c4ff2b5c0de8b83bb9bd088d80f5650dda1 | Create setup.py | albertcuesta/PEACHESTORE | setup.py | setup.py | __author__ = 'Alumne'
from distutils.core import setup
setup(name='PEACHESTORE',
version='python 3',
author='albert cuesta',
author_email='albert_cm_91@hotmail.com',
url='https://github.com/albertcuesta/PEACHESTORE',
description='es una tienda online de aplicaciones moviles similar a goo... | mit | Python | |
d64367eda03772997af21792e82a2825848c1ae6 | add tests for splat utils | imbasimba/astroquery,ceb8/astroquery,imbasimba/astroquery,ceb8/astroquery | astroquery/splatalogue/tests/test_utils.py | astroquery/splatalogue/tests/test_utils.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from ... import splatalogue
from astropy import units as u
import numpy as np
from .test_splatalogue import patch_post
from .. import utils
def test_clean(patch_post):
x = splatalogue.Splatalogue.query_lines(114*u.GHz,116*u.GHz,chemical_name=' CO ')
... | bsd-3-clause | Python | |
b72f8a9b0d9df7d42c43c6a294cc3aab2cb91641 | Add missing migrations for limit_choices_to on BlogPage.author | thelabnyc/wagtail_blog,thelabnyc/wagtail_blog | blog/migrations/0002_auto_20190605_1104.py | blog/migrations/0002_auto_20190605_1104.py | # Generated by Django 2.2.2 on 2019-06-05 08:04
import blog.abstract
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_squashed_0006_auto_20180206_2239'),
]
operations... | apache-2.0 | Python | |
7fdf796440c3a4ed84ffcb4343cd92f0013c8b1f | add current client, supports basic chatting | AlexKavourias/slackline | slack.py | slack.py | from slackclient import SlackClient
def get_client(token='4577027817.4577075131'):
return SlackClient(token)
print get_client().api_call('api.test')
| mit | Python | |
f1c1206af29ee0f7be8b7477cd409f2844c816b3 | add Todo generator | secreek/todo | todo/generator.py | todo/generator.py | # coding=utf8
"""
Generator from todo object to todo format string
"""
from models import Task
from models import Todo
class Generator(object):
"""
Generator from todo object to readable string.
"""
newline = "\n"
def gen_task_id(self, task_id):
"""
int => str e.g. 12 => ... | mit | Python | |
3c290803bbd6d7401903506b3a27cf2c9ebad0b4 | Add ChatInfoFormatter | alvarogzp/telegram-bot,alvarogzp/telegram-bot | bot/action/standard/info/formatter/chat.py | bot/action/standard/info/formatter/chat.py | from bot.action.standard.info.formatter import ApiObjectInfoFormatter
from bot.action.util.format import ChatFormatter
from bot.api.api import Api
from bot.api.domain import ApiObject
class ChatInfoFormatter(ApiObjectInfoFormatter):
def __init__(self, api: Api, chat: ApiObject, bot_user: ApiObject, user: ApiObjec... | agpl-3.0 | Python | |
1ad56e631c29869d127931b555d0b366f7e75641 | Add test for fftpack. | nbeaver/numpy,MSeifert04/numpy,ViralLeadership/numpy,behzadnouri/numpy,charris/numpy,hainm/numpy,seberg/numpy,rmcgibbo/numpy,ahaldane/numpy,astrofrog/numpy,KaelChen/numpy,pelson/numpy,gfyoung/numpy,Yusa95/numpy,ssanderson/numpy,joferkington/numpy,dwf/numpy,anntzer/numpy,brandon-rhodes/numpy,sigma-random/numpy,AustereCu... | numpy/fft/tests/test_fftpack.py | numpy/fft/tests/test_fftpack.py | import sys
from numpy.testing import *
set_package_path()
from numpy.fft import *
restore_path()
class test_fftshift(NumpyTestCase):
def check_fft_n(self):
self.failUnlessRaises(ValueError,fft,[1,2,3],0)
if __name__ == "__main__":
NumpyTest().run()
| bsd-3-clause | Python | |
ab6fa9717b092f3b8eea4b70920a1d7cef042b69 | Return disappeared __main__ | tsiang/certchecker | certchecker/__main__.py | certchecker/__main__.py | import click
from certchecker import CertChecker
@click.command()
@click.option(
'--profile',
default='default',
help="Section name in your boto config file"
)
def main(profile):
cc = CertChecker(profile)
print(cc.result)
if __name__ == "__main__":
print(main())
| apache-2.0 | Python | |
b9feeb2a37f0596b48f9582e8953d29485167fc8 | Add an event-driven recording tool | cyliustack/sofa,cyliustack/sofa,cyliustack/sofa,cyliustack/sofa,cyliustack/sofa | tools/sofa-edr.py | tools/sofa-edr.py | #!/usr/bin/env python3
import subprocess
import time
import argparse
if __name__ == '__main__':
bwa_is_recorded = False
smb_is_recorded = False
htvc_is_recorded = False
parser = argparse.ArgumentParser(description='A SOFA wrapper which supports event-driven recording.')
parser.add_argument('--trac... | apache-2.0 | Python | |
0bd65e0e20911e7ac87aba3ef076b327f57b2f6f | Add get-aixdzs.py | changyuheng/bin,changyuheng/bin | get-aixdzs.py | get-aixdzs.py | #!/usr/bin/env python3
import argparse
import html.parser
from typing import List, Tuple
import urllib.request
class AixdzsHTMLParser(html.parser.HTMLParser):
def __init__(self):
super().__init__()
self.last_url: str = ''
self.next_url: str = ''
self.is_in_content_tag: bool = Fal... | mpl-2.0 | Python | |
42ab52b6d077443fac20ea872b503589f6ddb3f7 | Create pyPostings.py | domarps/Spatial_Hashing | pyPostings.py | pyPostings.py | import re
import string
def posting(corpus):
posting = []
tokens = tokenize(corpus)
for index, token in enumerate(tokens):
posting.append([token, (index+1)])
return posting
def posting_list(corpus):
posting_list = {}
tokens = tokenize(corpus)
for index, token in enumerat... | mit | Python | |
ee39e69fe5d6e93844f47eaff0d9547622600fa7 | make parsing times easier | bloomberg/phabricator-tools,cs-shadow/phabricator-tools,kjedruczyk/phabricator-tools,cs-shadow/phabricator-tools,kjedruczyk/phabricator-tools,aevri/phabricator-tools,aevri/phabricator-tools,cs-shadow/phabricator-tools,bloomberg/phabricator-tools,valhallasw/phabricator-tools,valhallasw/phabricator-tools,valhallasw/phabr... | py/phlsys_strtotime.py | py/phlsys_strtotime.py | #!/usr/bin/env python
# encoding: utf-8
"""A poor substitute for PHP's strtotime function."""
import datetime
def describeDurationStringToTimeDelta():
return str('time can be specified like "5 hours 20 minutes", use '
'combinations of seconds, minutes, hours, days, weeks. '
'each u... | apache-2.0 | Python | |
2cf2a89bf3c7ccf667e4bcb623eeb6d0e1ea37bb | print sumthing pr1 | fly/euler,bsdlp/euler | python/py1.py | python/py1.py | #!/usr/bin/env python3
"""
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
"""
thing = []
for urmom in range(1,1000):
if urmom % 5 == 0 or urmom % 3 == 0:
thing.appen... | bsd-3-clause | Python | |
784fd8b08ee0f268350a2003a9c06522c0678874 | Add python code for doing tensor decomposition with scikit-tensor. | monsendag/goldfish,ntnu-smartmedia/goldfish,monsendag/goldfish,ntnu-smartmedia/goldfish,monsendag/goldfish,ntnu-smartmedia/goldfish | python/run.py | python/run.py | import logging
import numpy
from numpy import genfromtxt
from sktensor import sptensor, cp_als
# Set logging to DEBUG to see CP-ALS information
logging.basicConfig(level=logging.DEBUG)
data = genfromtxt('../datasets/movielens-synthesized/ratings-synthesized-50k.csv', delimiter=',')
# we need to convert data into two ... | mit | Python | |
00413958a12607aab942c98581b1a9e6d682ef28 | Create Single-Prime.py | isabellemao/Hello-World,isabellemao/Hello-World,isabellemao/Hello-World | python/Single-Prime.py | python/Single-Prime.py | #By Isabelle.
#Checks a single number and lists all of its factors (except 1 and itself)
import math
num = int(input("Pick a number to undergo the primality test!\n"))
root = int(round(math.sqrt(num)))
prime = True
for looper in range(2,root + 1): #53225 should normally be 3
if num % 2 == 0 or num % 3 == 0 or num % ... | apache-2.0 | Python | |
1cb8df64d4f6f257d0bd03caaaddb33ad11a5c2c | Add or_gate | yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program | python/ch02/or_gate.py | python/ch02/or_gate.py | import numpy as np
def OR(x1, x2):
x = np.array([x1, x2])
w = np.array([0.5, 0.5])
b = -0.2
tmp = np.sum(w * x) + b
if tmp <= 0:
return 0
else:
return 1
if __name__ == '__main__':
for xs in [(0, 0), (1, 0), (0, 1), (1, 1)]:
y = OR(xs[0], xs[1])
print(str(x... | mit | Python | |
a58a31a6037babdc607593196da2841f13791bfa | Revert "去掉camelcase和underscore的转换, 直接用三方的" | nypisces/railguns,nypisces/railguns,nypisces/railguns | railguns/utils/text.py | railguns/utils/text.py | """
https://github.com/tomchristie/django-rest-framework/issues/944
"""
import re
first_cap_re = re.compile('(.)([A-Z][a-z]+)')
all_cap_re = re.compile('([a-z0-9])([A-Z])')
def camelcase_to_underscore(name):
s1 = first_cap_re.sub(r'\1_\2', name)
return all_cap_re.sub(r'\1_\2', s1).lower()
def underscore_t... | mit | Python | |
a723c70a0ae9da0f2207dd9278c619be323bda4a | move test parts to avnav_test | wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav | avnav_test/avn_debug.py | avnav_test/avn_debug.py | import sys
sys.path.append(r'/home/pi/avnav/pydev')
import pydevd
from avnav_server import *
pydevd.settrace(host='10.222.10.45',stdoutToServer=True, stderrToServer=True)
main(sys.argv)
| mit | Python | |
aa1b39b455f7145848c287ee9ee85507f5b66de0 | Add Meduza | andre487/news487,andre487/news487,andre487/news487,andre487/news487 | collector/rss/meduza.py | collector/rss/meduza.py | # coding=utf-8
import feedparser
import logging
from util import date, tags
SOURCE_NAME = 'Meduza'
FEED_URL = 'https://meduza.io/rss/all'
log = logging.getLogger('app')
def parse():
feed = feedparser.parse(FEED_URL)
data = []
for entry in feed['entries']:
data.append({
'title': ent... | mit | Python | |
d50814603217ca9ea47324a0ad516ce7418bc9bf | Add script to generate a standalone timeline view. | sahiljain/catapult,danbeam/catapult,catapult-project/catapult-csm,scottmcmaster/catapult,sahiljain/catapult,catapult-project/catapult-csm,0x90sled/catapult,benschmaus/catapult,catapult-project/catapult-csm,0x90sled/catapult,zeptonaut/catapult,danbeam/catapult,catapult-project/catapult-csm,SummerLW/Perf-Insight-Report,b... | build/generate_standalone_timeline_view.py | build/generate_standalone_timeline_view.py | #!/usr/bin/env python
# Copyright (c) 2012 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 optparse
import parse_deps
import sys
import os
srcdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../src"))
... | bsd-3-clause | Python | |
93df464ec396774cb161b51d4988773e4ce95e44 | Create lfu-cache.py | yiwen-luo/LeetCode,kamyu104/LeetCode,yiwen-luo/LeetCode,yiwen-luo/LeetCode,yiwen-luo/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,yiwen-luo/LeetCode,kamyu104/LeetCode,kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-2... | Python/lfu-cache.py | Python/lfu-cache.py | # Time: O(1), per operation
# Space: O(k), k is the capacity of cache
# Design and implement a data structure for Least Frequently Used (LFU) cache.
# It should support the following operations: get and put.
#
# get(key) - Get the value (will always be positive) of the key
# if the key exists in the cache, otherwise... | mit | Python | |
f6ef8e0c31163f95fa0c62873a7195ab51f65cf1 | Add cw_are_they_the_same.py | bowen0701/algorithms_data_structures | cw_are_they_the_same.py | cw_are_they_the_same.py | """Codewars: Are they the "same"?
6 kyu
URL: https://www.codewars.com/kata/550498447451fbbd7600041c
Given two arrays a and b write a function comp(a, b) (compSame(a, b) in Clojure)
that checks whether the two arrays have the "same" elements, with the same
multiplicities. "Same" means, here, that the elements in b are... | bsd-2-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.