commit
stringlengths
40
40
old_file
stringlengths
4
264
new_file
stringlengths
4
264
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
624
message
stringlengths
15
4.7k
lang
stringclasses
3 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
c9ca274a1a5e9596de553d2ae16950a845359321
examples/plotting/file/geojson_points.py
examples/plotting/file/geojson_points.py
from bokeh.io import output_file, show from bokeh.models import GeoJSONDataSource from bokeh.plotting import figure from bokeh.sampledata.sample_geojson import geojson output_file("geojson_points.html", title="GeoJSON Points") p = figure() p.circle(line_color=None, fill_alpha=0.8, source=GeoJSONDataSource(geojson=geojson)) show(p)
from bokeh.io import output_file, show from bokeh.models import GeoJSONDataSource, HoverTool from bokeh.plotting import figure from bokeh.sampledata.sample_geojson import geojson output_file("geojson_points.html", title="GeoJSON Points") p = figure() p.circle(line_color=None, fill_alpha=0.8, size=20, source=GeoJSONDataSource(geojson=geojson)) p.add_tools(HoverTool(tooltips=[("Organisation Name", "@OrganisationName")])) show(p)
Add HoverTool to show off properties availability
Add HoverTool to show off properties availability
Python
bsd-3-clause
draperjames/bokeh,bokeh/bokeh,timsnyder/bokeh,dennisobrien/bokeh,maxalbert/bokeh,phobson/bokeh,jakirkham/bokeh,stonebig/bokeh,jakirkham/bokeh,bokeh/bokeh,DuCorey/bokeh,justacec/bokeh,dennisobrien/bokeh,clairetang6/bokeh,azjps/bokeh,timsnyder/bokeh,aiguofer/bokeh,timsnyder/bokeh,ericmjl/bokeh,DuCorey/bokeh,rs2/bokeh,bokeh/bokeh,jakirkham/bokeh,justacec/bokeh,Karel-van-de-Plassche/bokeh,azjps/bokeh,mindriot101/bokeh,philippjfr/bokeh,aiguofer/bokeh,timsnyder/bokeh,draperjames/bokeh,clairetang6/bokeh,percyfal/bokeh,stonebig/bokeh,philippjfr/bokeh,DuCorey/bokeh,schoolie/bokeh,ptitjano/bokeh,mindriot101/bokeh,schoolie/bokeh,jakirkham/bokeh,aiguofer/bokeh,stonebig/bokeh,percyfal/bokeh,phobson/bokeh,phobson/bokeh,dennisobrien/bokeh,azjps/bokeh,quasiben/bokeh,clairetang6/bokeh,draperjames/bokeh,ericmjl/bokeh,aavanian/bokeh,msarahan/bokeh,aiguofer/bokeh,ericmjl/bokeh,philippjfr/bokeh,htygithub/bokeh,dennisobrien/bokeh,ericmjl/bokeh,rs2/bokeh,percyfal/bokeh,quasiben/bokeh,ptitjano/bokeh,KasperPRasmussen/bokeh,timsnyder/bokeh,dennisobrien/bokeh,maxalbert/bokeh,aavanian/bokeh,msarahan/bokeh,percyfal/bokeh,htygithub/bokeh,rs2/bokeh,DuCorey/bokeh,msarahan/bokeh,ptitjano/bokeh,philippjfr/bokeh,clairetang6/bokeh,draperjames/bokeh,maxalbert/bokeh,azjps/bokeh,aiguofer/bokeh,Karel-van-de-Plassche/bokeh,ptitjano/bokeh,mindriot101/bokeh,KasperPRasmussen/bokeh,jakirkham/bokeh,rs2/bokeh,bokeh/bokeh,schoolie/bokeh,phobson/bokeh,KasperPRasmussen/bokeh,draperjames/bokeh,aavanian/bokeh,phobson/bokeh,Karel-van-de-Plassche/bokeh,htygithub/bokeh,philippjfr/bokeh,justacec/bokeh,rs2/bokeh,Karel-van-de-Plassche/bokeh,quasiben/bokeh,aavanian/bokeh,DuCorey/bokeh,stonebig/bokeh,ericmjl/bokeh,schoolie/bokeh,msarahan/bokeh,justacec/bokeh,Karel-van-de-Plassche/bokeh,KasperPRasmussen/bokeh,KasperPRasmussen/bokeh,htygithub/bokeh,mindriot101/bokeh,azjps/bokeh,bokeh/bokeh,maxalbert/bokeh,percyfal/bokeh,schoolie/bokeh,aavanian/bokeh,ptitjano/bokeh
a0fc801130fa9068c5acc0a48d389f469cdb4bb2
tasks.py
tasks.py
""" Automation tasks, aided by the Invoke package. """ import os import webbrowser from invoke import task, run DOCS_DIR = 'docs' DOCS_OUTPUT_DIR = os.path.join(DOCS_DIR, '_build') @task def docs(show=True): """Build the docs and show them in default web browser.""" run('sphinx-build docs docs/_build') if show: webbrowser.open_new_tab(os.path.join(DOCS_OUTPUT_DIR, 'index.html'))
""" Automation tasks, aided by the Invoke package. """ import os import webbrowser from invoke import task, run DOCS_DIR = 'docs' DOCS_OUTPUT_DIR = os.path.join(DOCS_DIR, '_build') @task def docs(output='html', rebuild=False, show=True): """Build the docs and show them in default web browser.""" build_cmd = 'sphinx-build -b {output} {all} docs docs/_build'.format( output=output, all='-a -E' if rebuild else '') run(build_cmd) if show: webbrowser.open_new_tab(os.path.join(DOCS_OUTPUT_DIR, 'index.html'))
Add more options to the `docs` task
Add more options to the `docs` task
Python
bsd-3-clause
Xion/callee
704439e7ae99d215948c94a5dfa61ee1f3f57971
fireplace/cards/tgt/neutral_legendary.py
fireplace/cards/tgt/neutral_legendary.py
from ..utils import * ## # Minions # Confessor Paletress class AT_018: inspire = Summon(CONTROLLER, RandomMinion(rarity=Rarity.LEGENDARY)) # Skycap'n Kragg class AT_070: cost = lambda self, i: i - len(self.controller.field.filter(race=Race.PIRATE))
from ..utils import * ## # Minions # Confessor Paletress class AT_018: inspire = Summon(CONTROLLER, RandomMinion(rarity=Rarity.LEGENDARY)) # Skycap'n Kragg class AT_070: cost = lambda self, i: i - len(self.controller.field.filter(race=Race.PIRATE)) # Gormok the Impaler class AT_122: play = Hit(TARGET, 4) # Chillmaw class AT_123: deathrattle = HOLDING_DRAGON & Hit(ALL_MINIONS, 3) # Nexus-Champion Saraad class AT_127: inspire = Give(CONTROLLER, RandomSpell()) # The Skeleton Knight class AT_128: deathrattle = JOUST & Bounce(SELF) # Fjola Lightbane class AT_129: events = Play(CONTROLLER, SPELL, SELF).on(SetTag(SELF, {GameTag.DIVINE_SHIELD: True})) # Eydis Darkbane class AT_131: events = Play(CONTROLLER, SPELL, SELF).on(Hit(RANDOM_ENEMY_CHARACTER, 3))
Implement more TGT Neutral Legendaries
Implement more TGT Neutral Legendaries
Python
agpl-3.0
Ragowit/fireplace,liujimj/fireplace,oftc-ftw/fireplace,amw2104/fireplace,amw2104/fireplace,beheh/fireplace,smallnamespace/fireplace,smallnamespace/fireplace,NightKev/fireplace,liujimj/fireplace,oftc-ftw/fireplace,jleclanche/fireplace,Ragowit/fireplace,Meerkov/fireplace,Meerkov/fireplace
d86a4b75b1d8b4d18aadbb2bc98387b5ce78f939
tests/web/splinter/test_view_album.py
tests/web/splinter/test_view_album.py
from __future__ import unicode_literals from tests import with_settings from tests.web.splinter import TestCase from catsnap import Client from catsnap.table.image import Image from catsnap.table.album import Album from nose.tools import eq_ class TestUploadImage(TestCase): @with_settings(bucket='humptydump') def test_view_an_album(self): session = Client().session() album = Album(name="photo sesh") session.add(album) session.flush() silly = Image(album_id=album.album_id, filename="silly") serious = Image(album_id=album.album_id, filename="serious") session.add(silly) session.add(serious) session.flush() self.visit_url('/album/{0}'.format(album.album_id)) images = self.browser.find_by_tag('img') eq_(map(lambda i: i['src'], images), [ 'https://s3.amazonaws.com/humptydump/silly', 'https://s3.amazonaws.com/humptydump/serious', ]) eq_(map(lambda i: i['alt'], images), ['silly', 'serious']) assert self.browser.is_text_present('silly') assert self.browser.is_text_present('serious')
from __future__ import unicode_literals from tests import with_settings from tests.web.splinter import TestCase from catsnap import Client from catsnap.table.image import Image from catsnap.table.album import Album from nose.tools import eq_ class TestViewAlbum(TestCase): @with_settings(bucket='humptydump') def test_view_an_album(self): session = Client().session() album = Album(name="photo sesh") session.add(album) session.flush() silly = Image(album_id=album.album_id, filename="silly") serious = Image(album_id=album.album_id, filename="serious") session.add(silly) session.add(serious) session.flush() self.visit_url('/album/{0}'.format(album.album_id)) images = self.browser.find_by_tag('img') eq_(map(lambda i: i['src'], images), [ 'https://s3.amazonaws.com/humptydump/silly', 'https://s3.amazonaws.com/humptydump/serious', ]) eq_(map(lambda i: i['alt'], images), ['silly', 'serious']) assert self.browser.is_text_present('silly') assert self.browser.is_text_present('serious')
Fix a test class name
Fix a test class name
Python
mit
ErinCall/catsnap,ErinCall/catsnap,ErinCall/catsnap
eac78bcb95e2c34a5c2de75db785dd6532306819
ibei/main.py
ibei/main.py
# -*- coding: utf-8 -*- import numpy as np from astropy import constants from astropy import units from sympy.mpmath import polylog def uibei(order, energy_lo, temp, chem_potential): """ Upper incomplete Bose-Einstein integral. """ kT = temp * constants.k_B reduced_energy_lo = energy_lo / kT reduced_chem_potential = chem_potential / kT prefactor = (2 * np.pi * np.math.factorial(order) * kT**(order + 1)) / \ (constants.h**3 * constants.c**2) summand = 0 for indx in range(1, order + 2): expt = (reduced_chem_potential - reduced_energy_lo).decompose() term = reduced_energy_lo**(order - indx + 1) * polylog(indx, np.exp(expt)) / np.math.factorial(order - indx + 1) summand += term return summand def bb_rad_power(temp): """ Blackbody radiant power (Stefan-Boltzmann). """ return constants.sigma_sb * temp**4
# -*- coding: utf-8 -*- import numpy as np from astropy import constants from astropy import units from sympy.mpmath import polylog def uibei(order, energy_lo, temp, chem_potential): """ Upper incomplete Bose-Einstein integral. """ kT = temp * constants.k_B reduced_energy_lo = energy_lo / kT reduced_chem_potential = chem_potential / kT prefactor = (2 * np.pi * np.math.factorial(order) * kT**(order + 1)) / \ (constants.h**3 * constants.c**2) summand = 0 for indx in range(1, order + 2): expt = (reduced_chem_potential - reduced_energy_lo).decompose() term = reduced_energy_lo**(order - indx + 1) * polylog(indx, np.exp(expt)) / np.math.factorial(order - indx + 1) summand += term return summand def bb_rad_power(temp): """ Blackbody radiant power (Stefan-Boltzmann). """ return constants.sigma_sb * temp**4 def devos_power(bandgap, temp_sun, temp_planet, voltage): """ Power calculated according to DeVos Eq. 6.4. """ sun = uibei(2, bandgap, temp_sun, 0) solar_cell = uibei(2, bandgap, temp_sun, constants.q * voltage) return voltage * constants.e * (sun - solar_cell)
Add draft of DeVos solar cell power function
Add draft of DeVos solar cell power function
Python
mit
jrsmith3/tec,jrsmith3/ibei,jrsmith3/tec
8377bbca8b49a7a973d5521795d6df238774db8b
codenamegenerator/__init__.py
codenamegenerator/__init__.py
from typing import List import csv import os import random DICT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "dicts") def dictionary_sample(name: str, sample: int = 1) -> List[str]: # TODO: Cache counting, and use file.seek to speed file reading. fname = os.path.join(DICT_DIR, f"{name}.csv") if not os.path.exists(fname): raise ValueError(f"{name} dictionary does not exists.") with open(fname, "rt") as csvfile: csvreader = csv.DictReader( csvfile, fieldnames=["NAME"], delimiter=",", quotechar='"' ) names = [row["NAME"] for row in csvreader] return random.sample(names, sample) def generate_codenames( prefix: str = "adjectives", suffix: str = "mobi_notable_scientists_and_hackers", num: int = 1, ) -> List[str]: prefixes = dictionary_sample(prefix, num) suffixes = dictionary_sample(suffix, num) return [f"{prefix} {suffix}" for prefix, suffix in zip(prefixes, suffixes)]
from typing import List import csv import os import random DICT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "dicts") def dictionary_sample(name: str, sample: int = 1) -> List[str]: # TODO: Cache counting, and use file.seek to speed file reading. fname = os.path.join(DICT_DIR, f"{name}.csv") if not os.path.exists(fname): raise ValueError(f"{name} dictionary does not exists.") with open(fname, "rt") as csvfile: csvreader = csv.DictReader( csvfile, fieldnames=["NAME"], delimiter=",", quotechar='"' ) names = [row["NAME"] for row in csvreader if row["NAME"].strip() != ""] return random.sample(names, sample) def generate_codenames( prefix: str = "adjectives", suffix: str = "mobi_notable_scientists_and_hackers", num: int = 1, ) -> List[str]: prefixes = dictionary_sample(prefix, num) suffixes = dictionary_sample(suffix, num) return [f"{prefix} {suffix}" for prefix, suffix in zip(prefixes, suffixes)]
Fix for empty lines in data sets
Fix for empty lines in data sets
Python
mit
mariocesar/namegenerator
1650c9d9620ba9b9262598d3a47208c6c8180768
app/views.py
app/views.py
from flask import render_template, jsonify from app import app from models import Show, Episode @app.route('/') @app.route('/index') def index(): return render_template('index.html') @app.route("/api/new-episodes/") def new_episodes(): data = { "items": [] } for episode in Episode.query.filter_by(showcase=True).all(): d = episode.to_api_dict() d['show'] = episode.getShow() d['show_slug'] = episode.getShowSlug() d['image'] = episode.getImage() data["items"].append(d) return jsonify(data) @app.route("/api/shows/") def shows(): shows_dict = { "shows": [] } for show in Show.query.order_by('name').all(): shows_dict["shows"].append(show.to_api_dict()) return jsonify(shows_dict) @app.route("/api/shows/<slug>") def episodes(slug): show = Show.query.filter_by(slug=slug).first() show_dict = show.to_api_dict() show_dict['episodes'] = [] for episode in show.get_episodes(): show_dict['episodes'].append(episode.to_api_dict()) return jsonify(show_dict)
from flask import render_template, jsonify from app import app from models import Show, Episode @app.route('/') @app.route('/index') def index(): return render_template('index.html') @app.route("/api/new-episodes/") def new_episodes(): # Return all episodes with showcase set to True. data = { "items": [] } for episode in Episode.query.filter_by(showcase=True).all(): d = episode.to_api_dict() d['show'] = episode.getShow() d['show_slug'] = episode.getShowSlug() d['image'] = episode.getImage() data["items"].append(d) return jsonify(data) @app.route("/api/shows/") def shows(): shows_dict = { "shows": [] } for show in Show.query.order_by('name').all(): if show.published: shows_dict["shows"].append(show.to_api_dict()) return jsonify(shows_dict) @app.route("/api/shows/<slug>") def episodes(slug): show = Show.query.filter_by(slug=slug).first() show_dict = show.to_api_dict() show_dict['episodes'] = [] for episode in show.get_episodes(): if show.published: show_dict['episodes'].append(episode.to_api_dict()) return jsonify(show_dict)
Make shows and episodes only appear if published is true.
Make shows and episodes only appear if published is true.
Python
mit
frequencyasia/website,frequencyasia/website
f32685ef4ad847bd237845da6b5b8c44dac0ea9b
tests/skipif_markers.py
tests/skipif_markers.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ skipif_markers -------------- Contains pytest skipif markers to be used in the suite. """ import pytest import os try: travis = os.environ[u'TRAVIS'] except KeyError: travis = False try: no_network = os.environ[u'DISABLE_NETWORK_TESTS'] except KeyError: no_network = False # For some reason pytest incorrectly uses the first reason text regardless of # which condition matches. Using a unified message for now # travis_reason = 'Works locally with tox but fails on Travis.' # no_network_reason = 'Needs a network connection to GitHub.' reason = 'Fails on Travis or else there is no network connection to GitHub' skipif_travis = pytest.mark.skipif(travis, reason=reason) skipif_no_network = pytest.mark.skipif(no_network, reason=reason)
#!/usr/bin/env python # -*- coding: utf-8 -*- """ skipif_markers -------------- Contains pytest skipif markers to be used in the suite. """ import pytest import os try: os.environ[u'TRAVIS'] except KeyError: travis = False else: travis = True try: os.environ[u'DISABLE_NETWORK_TESTS'] except KeyError: no_network = False else: no_network = True # For some reason pytest incorrectly uses the first reason text regardless of # which condition matches. Using a unified message for now # travis_reason = 'Works locally with tox but fails on Travis.' # no_network_reason = 'Needs a network connection to GitHub.' reason = 'Fails on Travis or else there is no network connection to GitHub' skipif_travis = pytest.mark.skipif(travis, reason=reason) skipif_no_network = pytest.mark.skipif(no_network, reason=reason)
Fix travis, make sure skipif condition resolves to a bool
Fix travis, make sure skipif condition resolves to a bool
Python
bsd-3-clause
audreyr/cookiecutter,dajose/cookiecutter,kkujawinski/cookiecutter,hackebrot/cookiecutter,venumech/cookiecutter,vintasoftware/cookiecutter,pjbull/cookiecutter,lucius-feng/cookiecutter,ramiroluz/cookiecutter,venumech/cookiecutter,0k/cookiecutter,christabor/cookiecutter,hackebrot/cookiecutter,Vauxoo/cookiecutter,Springerle/cookiecutter,moi65/cookiecutter,pjbull/cookiecutter,agconti/cookiecutter,audreyr/cookiecutter,cguardia/cookiecutter,letolab/cookiecutter,terryjbates/cookiecutter,luzfcb/cookiecutter,vincentbernat/cookiecutter,takeflight/cookiecutter,letolab/cookiecutter,Vauxoo/cookiecutter,nhomar/cookiecutter,janusnic/cookiecutter,benthomasson/cookiecutter,stevepiercy/cookiecutter,vintasoftware/cookiecutter,foodszhang/cookiecutter,Springerle/cookiecutter,benthomasson/cookiecutter,dajose/cookiecutter,atlassian/cookiecutter,0k/cookiecutter,vincentbernat/cookiecutter,takeflight/cookiecutter,janusnic/cookiecutter,terryjbates/cookiecutter,nhomar/cookiecutter,agconti/cookiecutter,jhermann/cookiecutter,willingc/cookiecutter,luzfcb/cookiecutter,tylerdave/cookiecutter,lucius-feng/cookiecutter,ionelmc/cookiecutter,willingc/cookiecutter,moi65/cookiecutter,michaeljoseph/cookiecutter,atlassian/cookiecutter,jhermann/cookiecutter,lgp171188/cookiecutter,sp1rs/cookiecutter,stevepiercy/cookiecutter,drgarcia1986/cookiecutter,foodszhang/cookiecutter,tylerdave/cookiecutter,michaeljoseph/cookiecutter,ramiroluz/cookiecutter,ionelmc/cookiecutter,christabor/cookiecutter,cguardia/cookiecutter,cichm/cookiecutter,cichm/cookiecutter,kkujawinski/cookiecutter,lgp171188/cookiecutter,sp1rs/cookiecutter,drgarcia1986/cookiecutter
114a6eb827c0e3dd4557aee8f76fde1bbd111bb9
archalice.py
archalice.py
#!/usr/bin/env python import os import re import time import sys from threading import Thread class testit(Thread): def __init__ (self,ip): Thread.__init__(self) self.ip = ip self.status = -1 self.responsetime = -1 def run(self): pingaling = os.popen("ping -q -c2 "+self.ip,"r") while 1: line = pingaling.readline() if not line: break igot = re.findall(testit.lifeline,line) if igot: self.status = int(igot[0]) line = pingaling.readline() restime = re.search(testit.response, line) if restime: self.responsetime = restime.group(1) testit.lifeline = re.compile(r"(\d) received") testit.response = re.compile(r'((\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?) ms') report = ("No response","Partial Response","Alive") print time.ctime() pinglist = [] for host in range(1,10): ip = "192.168.11."+str(host) current = testit(ip) pinglist.append(current) current.start() for pingle in pinglist: pingle.join() print "Status from ",pingle.ip,"is",report[pingle.status],"time:",pingle.responsetime print time.ctime()
#!/usr/bin/env python import os import re import time import sys from threading import Thread class testit(Thread): def __init__ (self,ip): Thread.__init__(self) self.ip = ip self.status = -1 self.responsetime = -1 def run(self): pingaling = os.popen("ping -q -c2 "+self.ip,"r") while 1: line = pingaling.readline() if not line: break igot = re.findall(testit.lifeline,line) if igot: self.status = int(igot[0]) line = pingaling.readline() restime = re.search(testit.response, line) if restime: self.responsetime = restime.group(1) testit.lifeline = re.compile(r"(\d) received") testit.response = re.compile(r'((\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?) ms') report = ("No response","Partial Response","Alive") print time.ctime() pinglist = [] for host in range(1,10): ip = "192.168.11."+str(host) current = testit(ip) pinglist.append(current) current.start() for pingle in pinglist: pingle.join() print "Status from ",pingle.ip,"is",report[pingle.status],"time:",pingle.responsetime print time.ctime()
Update indentation to 4 spaces
Update indentation to 4 spaces
Python
mit
imrehg/archalice
b63bda37aa2e9b5251cf6c54d59785d2856659ca
tests/python/unittest/test_random.py
tests/python/unittest/test_random.py
import os import mxnet as mx import numpy as np def same(a, b): return np.sum(a != b) == 0 def check_with_device(device): with mx.Context(device): a, b = -10, 10 mu, sigma = 10, 2 shape = (100, 100) mx.random.seed(128) ret1 = mx.random.normal(mu, sigma, shape) un1 = mx.random.uniform(a, b, shape) mx.random.seed(128) ret2 = mx.random.normal(mu, sigma, shape) un2 = mx.random.uniform(a, b, shape) assert same(ret1.asnumpy(), ret2.asnumpy()) assert same(un1.asnumpy(), un2.asnumpy()) assert abs(np.mean(ret1.asnumpy()) - mu) < 0.1 assert abs(np.std(ret1.asnumpy()) - sigma) < 0.1 assert abs(np.mean(un1.asnumpy()) - (a+b)/2) < 0.1 def test_random(): check_with_device(mx.cpu()) if __name__ == '__main__': test_random()
import os import mxnet as mx import numpy as np def same(a, b): return np.sum(a != b) == 0 def check_with_device(device): with mx.Context(device): a, b = -10, 10 mu, sigma = 10, 2 for i in range(5): shape = (100 + i, 100 + i) mx.random.seed(128) ret1 = mx.random.normal(mu, sigma, shape) un1 = mx.random.uniform(a, b, shape) mx.random.seed(128) ret2 = mx.random.normal(mu, sigma, shape) un2 = mx.random.uniform(a, b, shape) assert same(ret1.asnumpy(), ret2.asnumpy()) assert same(un1.asnumpy(), un2.asnumpy()) assert abs(np.mean(ret1.asnumpy()) - mu) < 0.1 assert abs(np.std(ret1.asnumpy()) - sigma) < 0.1 assert abs(np.mean(un1.asnumpy()) - (a+b)/2) < 0.1 def test_random(): check_with_device(mx.cpu()) if __name__ == '__main__': test_random()
Update random number generator test
Update random number generator test
Python
apache-2.0
sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet
221413b5715286bb7b61e18f8e678f2ca097a5e1
rover.py
rover.py
class Rover: compass = ['N', 'E', 'S', 'W'] def __init__(self, x=0, y=0, direction='N'): self.x = x self.y = y self.direction = direction @property def position(self): return self.x, self.y, self.direction
class Rover: compass = ['N', 'E', 'S', 'W'] def __init__(self, x=0, y=0, direction='N'): self.x = x self.y = y self.direction = direction @property def position(self): return self.x, self.y, self.direction def set_position(self, x, y, direction): self.x = x self.y = y self.direction = direction
Add set_position method to Rover
Add set_position method to Rover
Python
mit
authentik8/rover
64038fad35e7a1b9756921a79b6b13d59925e682
tests/test_endpoints.py
tests/test_endpoints.py
import unittest from soccermetrics.rest import SoccermetricsRestClient class ClientEndpointTest(unittest.TestCase): """ Test endpoints of API resources in client. """ def setUp(self): self.client = SoccermetricsRestClient(account="APP_ID",api_key="APP_KEY") def test_service_root(self): self.assertEqual(self.client.root.endpoint, "/v1/")
import unittest from soccermetrics.rest import SoccermetricsRestClient class ClientEndpointTest(unittest.TestCase): """ Test endpoints of API resources in client. """ def setUp(self): self.client = SoccermetricsRestClient(account="APP_ID",api_key="APP_KEY") def test_service_root(self): self.assertEqual(self.client.root.endpoint, "/v1/") def test_base_endpoints(self): self.assertEqual(self.client.validation.phases.endpoint, "/v1/phases") self.assertEqual(self.client.validation.groupRounds.endpoint, '/v1/grouprounds') self.assertEqual(self.client.validation.knockoutRounds.endpoint, '/v1/knockoutrounds') self.assertEqual(self.client.validation.confederations.endpoint, '/v1/confederations') self.assertEqual(self.client.validation.countries.endpoint, '/v1/countries') self.assertEqual(self.client.validation.seasons.endpoint, '/v1/seasons') self.assertEqual(self.client.validation.teams.endpoint, '/v1/teams') self.assertEqual(self.client.validation.venues.endpoint, '/v1/venues') self.assertEqual(self.client.validation.timezones.endpoint, '/v1/timezones') self.assertEqual(self.client.validation.persons.endpoint, '/v1/persons') self.assertEqual(self.client.validation.positions.endpoint, '/v1/positions') self.assertEqual(self.client.validation.fouls.endpoint, '/v1/fouls') self.assertEqual(self.client.validation.cards.endpoint, '/v1/cards') self.assertEqual(self.client.validation.bodyparts.endpoint, '/v1/bodyparts') self.assertEqual(self.client.validation.shotevents.endpoint, '/v1/shotevents') self.assertEqual(self.client.validation.penaltyOutcomes.endpoint, '/v1/penalty_outcomes') self.assertEqual(self.client.validation.weather.endpoint, '/v1/weather') self.assertEqual(self.client.validation.surfaces.endpoint, '/v1/surfaces') def test_personnel_endpoints(self): self.assertEqual(self.client.players.endpoint, '/v1/personnel/players') self.assertEqual(self.client.managers.endpoint, '/v1/personnel/managers') self.assertEqual(self.client.referees.endpoint, '/v1/personnel/referees')
Expand test on URL endpoints in API client
Expand test on URL endpoints in API client
Python
mit
soccermetrics/soccermetrics-client-py
238494a1323d82a791b244a84af64eda3d9be750
tests/services/test_reverse_proxy.py
tests/services/test_reverse_proxy.py
from unittest.mock import Mock from jupyterhub import orm from remoteappmanager.services.reverse_proxy import ReverseProxy from tornado import gen, testing class TestReverseProxy(testing.AsyncTestCase): @testing.gen_test def test_reverse_proxy_operations(self): coroutine_out = None @gen.coroutine def mock_api_request(self, *args, **kwargs): nonlocal coroutine_out yield gen.sleep(0.1) coroutine_out = dict(args=args, kwargs=kwargs) reverse_proxy = ReverseProxy("http://fake/api", "token") reverse_proxy._reverse_proxy = Mock(spec=orm.Proxy) reverse_proxy._reverse_proxy.api_request = mock_api_request yield reverse_proxy.register("/hello/from/me/", "http://localhost:12312/") self.assertEqual(coroutine_out["kwargs"]["method"], "POST") yield reverse_proxy.unregister("/hello/from/me/") self.assertEqual(coroutine_out["kwargs"]["method"], "DELETE")
from unittest.mock import Mock from jupyterhub import orm from remoteappmanager.services.reverse_proxy import ReverseProxy from tornado import gen, testing class TestReverseProxy(testing.AsyncTestCase): @testing.gen_test def test_reverse_proxy_operations(self): coroutine_out = None @gen.coroutine def mock_api_request(self, *args, **kwargs): nonlocal coroutine_out yield gen.sleep(0.1) coroutine_out = dict(args=args, kwargs=kwargs) reverse_proxy = ReverseProxy( endpoint_url="http://fake/api", auth_token="token") reverse_proxy._reverse_proxy = Mock(spec=orm.Proxy) reverse_proxy._reverse_proxy.api_request = mock_api_request yield reverse_proxy.register("/hello/from/me/", "http://localhost:12312/") self.assertEqual(coroutine_out["kwargs"]["method"], "POST") yield reverse_proxy.unregister("/hello/from/me/") self.assertEqual(coroutine_out["kwargs"]["method"], "DELETE")
Solve deprecation warning from Traitlets
Solve deprecation warning from Traitlets
Python
bsd-3-clause
simphony/simphony-remote,simphony/simphony-remote,simphony/simphony-remote,simphony/simphony-remote
dac770314da39c5494ff6c1ccd46d507ff1b2540
tests/test_errorware.py
tests/test_errorware.py
from tg.error import ErrorReporter def simple_app(environ, start_response): status = '200 OK' headers = [('Content-type', 'text/plain')] start_response(status, headers) return ['HELLO'] class TestErrorReporterConfig(object): def test_disable_all(self): app = ErrorReporter(simple_app, {}) reporters = [r.__class__.__name__ for r in app.reporters] assert 'EmailReporter' not in reporters assert 'SentryReporter' not in reporters def test_enable_email(self): app = ErrorReporter(simple_app, {}, error_email='[email protected]') reporters = [r.__class__.__name__ for r in app.reporters] assert 'EmailReporter' in reporters def test_enable_sentry(self): app = ErrorReporter(simple_app, {}, sentry_dsn='http://public:[email protected]/1') reporters = [r.__class__.__name__ for r in app.reporters] assert 'SentryReporter' in reporters
from tg.error import ErrorReporter from tg.error import SlowReqsReporter def simple_app(environ, start_response): status = '200 OK' headers = [('Content-type', 'text/plain')] start_response(status, headers) return ['HELLO'] class TestErrorReporterConfig(object): def test_disable_all(self): app = ErrorReporter(simple_app, {}) reporters = [r.__class__.__name__ for r in app.reporters] assert 'EmailReporter' not in reporters assert 'SentryReporter' not in reporters def test_enable_email(self): app = ErrorReporter(simple_app, {}, error_email='[email protected]') reporters = [r.__class__.__name__ for r in app.reporters] assert 'EmailReporter' in reporters def test_enable_sentry(self): app = ErrorReporter(simple_app, {}, sentry_dsn='http://public:[email protected]/1') reporters = [r.__class__.__name__ for r in app.reporters] assert 'SentryReporter' in reporters class TestSlowReqsReporterConfig(object): def test_disable_all(self): app = SlowReqsReporter(simple_app, {}) reporters = [r.__class__.__name__ for r in app.reporters] assert 'EmailReporter' not in reporters assert 'SentryReporter' not in reporters def test_enable_email(self): app = SlowReqsReporter(simple_app, {}, error_email='[email protected]') reporters = [r.__class__.__name__ for r in app.reporters] assert 'EmailReporter' in reporters def test_enable_sentry(self): app = SlowReqsReporter(simple_app, {}, sentry_dsn='http://public:[email protected]/1') reporters = [r.__class__.__name__ for r in app.reporters] assert 'SentryReporter' in reporters
Add tests for slow requests reporting configuration
Add tests for slow requests reporting configuration
Python
mit
lucius-feng/tg2,lucius-feng/tg2
6b9cc519deaecd093087d5190888b97b7b7eaf02
icekit/project/settings/_production.py
icekit/project/settings/_production.py
from ._base import * SITE_PUBLIC_PORT = None # Default: SITE_PORT # DJANGO ###################################################################### CACHES['default'].update({ # 'BACKEND': 'django_redis.cache.RedisCache', 'BACKEND': 'redis_lock.django_cache.RedisCache', 'LOCATION': 'redis://redis:6379/1', }) # EMAIL_HOST = '' # EMAIL_HOST_USER = '' LOGGING['handlers']['logfile']['backupCount'] = 100 # CELERY EMAIL ################################################################ CELERY_EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' # STORAGES #################################################################### # AWS_ACCESS_KEY_ID = '' # AWS_STORAGE_BUCKET_NAME = '' ENABLE_S3_MEDIA = True
from ._base import * SITE_PUBLIC_PORT = None # Default: SITE_PORT # DJANGO ###################################################################### CACHES['default'].update({ # 'BACKEND': 'django_redis.cache.RedisCache', 'BACKEND': 'redis_lock.django_cache.RedisCache', 'LOCATION': 'redis://redis:6379/1', }) LOGGING['handlers']['logfile']['backupCount'] = 100 # CELERY EMAIL ################################################################ CELERY_EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' # STORAGES #################################################################### ENABLE_S3_MEDIA = True
Remove vestigial hard coded production settings. These should be defined in a dotenv file, now.
Remove vestigial hard coded production settings. These should be defined in a dotenv file, now.
Python
mit
ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit
96d798685c53f4568edaaf990b0bbe8e2e10e24a
tests_tf/test_mnist_tutorial_jsma.py
tests_tf/test_mnist_tutorial_jsma.py
import unittest class TestMNISTTutorialJSMA(unittest.TestCase): def test_mnist_tutorial_jsma(self): from tutorials import mnist_tutorial_jsma # Run the MNIST tutorial on a dataset of reduced size # and disable visualization. jsma_tutorial_args = {'train_start': 0, 'train_end': 10000, 'test_start': 0, 'test_end': 1666, 'viz_enabled': False, 'source_samples': 1, 'nb_epochs': 2} report = mnist_tutorial_jsma.mnist_tutorial_jsma(**jsma_tutorial_args) print(report.clean_train_adv_eval) # Check accuracy values contained in the AccuracyReport object self.assertTrue(report.clean_train_clean_eval > 0.75) self.assertTrue(report.clean_train_adv_eval < 0.05) # There is no adversarial training in the JSMA tutorial self.assertTrue(report.adv_train_clean_eval == 0.) self.assertTrue(report.adv_train_adv_eval == 0.) if __name__ == '__main__': unittest.main()
import unittest class TestMNISTTutorialJSMA(unittest.TestCase): def test_mnist_tutorial_jsma(self): from tutorials import mnist_tutorial_jsma # Run the MNIST tutorial on a dataset of reduced size # and disable visualization. jsma_tutorial_args = {'train_start': 0, 'train_end': 1000, 'test_start': 0, 'test_end': 1666, 'viz_enabled': False, 'source_samples': 1, 'nb_epochs': 2} report = mnist_tutorial_jsma.mnist_tutorial_jsma(**jsma_tutorial_args) # Check accuracy values contained in the AccuracyReport object self.assertTrue(report.clean_train_clean_eval > 0.75) self.assertTrue(report.clean_train_adv_eval < 0.05) # There is no adversarial training in the JSMA tutorial self.assertTrue(report.adv_train_clean_eval == 0.) self.assertTrue(report.adv_train_adv_eval == 0.) if __name__ == '__main__': unittest.main()
Update JSMA test tutorial constant
Update JSMA test tutorial constant
Python
mit
cleverhans-lab/cleverhans,cleverhans-lab/cleverhans,openai/cleverhans,carlini/cleverhans,cihangxie/cleverhans,cleverhans-lab/cleverhans,carlini/cleverhans,fartashf/cleverhans
e19b11c8598fe7a7e68640638a3489c05002f968
tests/test_supercron.py
tests/test_supercron.py
#!/usr/bin/env python import sys import os import unittest from subprocess import Popen, PIPE ROOT_DIR = os.path.join(os.path.dirname(__file__), "..") sys.path.append(ROOT_DIR) from supercron import SuperCron class RunTests(unittest.TestCase): """class that tests supercron for behavior correctness""" def setUp(self): pass def get_crontab(self): p = Popen(["crontab", "-l"], stdout=PIPE) crontab_out, crontab_err = p.communicate() return crontab_out def test_midnight(self): entry1 = b"@daily ls # ls" entry2 = b"0 0 * * * ls # ls" SuperCron.add_job("ls", "ls", "midnight") user_crontab = self.get_crontab() self.assertTrue(entry1 in user_crontab or entry2 in user_crontab) def test_every_x_minutes(self): hour, minute = SuperCron.get_time_now() entry = b"*/5 {} * * * ls # ls".format(hour) SuperCron.add_job("ls", "ls", "once every 5 minutes") user_crontab = self.get_crontab() self.assertTrue(entry in user_crontab) if __name__ == "__main__": unittest.main()
#!/usr/bin/env python import sys import os import unittest from subprocess import Popen, PIPE ROOT_DIR = os.path.join(os.path.dirname(__file__), "..") sys.path.append(ROOT_DIR) from supercron import SuperCron class RunTests(unittest.TestCase): """class that tests supercron for behavior correctness""" def setUp(self): pass def tearDown(self): SuperCron.delete_job("ls") def get_crontab(self): p = Popen(["crontab", "-l"], stdout=PIPE, stderr=PIPE) crontab_out, crontab_err = p.communicate() return crontab_out def test_midnight(self): entry1 = b"@daily ls # ls" entry2 = b"0 0 * * * ls # ls" SuperCron.add_job("ls", "ls", "midnight") user_crontab = self.get_crontab() self.assertTrue(entry1 in user_crontab or entry2 in user_crontab) def test_every_x_minutes(self): hour, minute = SuperCron.get_time_now() entry = b"*/5 {} * * * ls # ls".format(hour) SuperCron.add_job("ls", "ls", "once every 5 minutes") user_crontab = self.get_crontab() self.assertTrue(entry in user_crontab) if __name__ == "__main__": unittest.main()
Delete the jobs in tearDown() in tests
Delete the jobs in tearDown() in tests
Python
bsd-3-clause
linostar/SuperCron
b0b2c03f04a5f29e11dc01558d272e27665555ce
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='django-append-url-to-sql', description="Appends the request URL to SQL statements in Django.", version='1.0.1', url='https://chris-lamb.co.uk/projects/django-append-url-to-sql', author='Chris Lamb', author_email='[email protected]', license='BSD', packages=find_packages(), )
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='django-append-url-to-sql', description="Appends the request URL to SQL statements in Django.", version='1.0.1', url='https://chris-lamb.co.uk/projects/django-append-url-to-sql', author='Chris Lamb', author_email='[email protected]', license='BSD', packages=find_packages(), install_requires=( 'Django>=1.8', ), )
Update Django requirement to latest LTS
Update Django requirement to latest LTS
Python
bsd-3-clause
lamby/django-append-url-to-sql
566fa441f3864be4f813673dbaf8ffff87d28e17
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup, Extension elp_srcs = ['src/periodic.c', 'src/prdic_math.c', \ 'src/prdic_fd.c', \ 'src/prdic_pfd.c', \ 'src/prdic_main_fd.c', 'src/prdic_main_pfd.c', \ 'src/prdic_main.c', \ 'src/prdic_recfilter.c', 'src/prdic_shmtrig.c', \ 'src/prdic_sign.c'] module1 = Extension('_elperiodic', sources = elp_srcs, \ extra_link_args = ['-Wl,--version-script=src/Symbol.map',]) kwargs = {'name':'ElPeriodic', 'version':'1.0', 'description':'Phase-locked userland scheduling library', 'author':'Maksym Sobolyev', 'author_email':'[email protected]', 'url':'https://github.com/sobomax/libelperiodic', 'packages':['elperiodic',], 'package_dir':{'elperiodic':'python'}, 'ext_modules': [module1] } if __name__ == '__main__': setup(**kwargs)
#!/usr/bin/env python from distutils.core import setup, Extension import os elp_srcs = ['src/periodic.c', 'src/prdic_math.c', \ 'src/prdic_fd.c', \ 'src/prdic_pfd.c', \ 'src/prdic_main_fd.c', 'src/prdic_main_pfd.c', \ 'src/prdic_main.c', \ 'src/prdic_recfilter.c', 'src/prdic_shmtrig.c', \ 'src/prdic_sign.c'] module1 = Extension('_elperiodic', sources = elp_srcs, \ extra_link_args = ['-Wl,--version-script=src/Symbol.map',]) def get_ex_mod(): if 'NO_PY_EXT' in os.environ: return None return [module1] kwargs = {'name':'ElPeriodic', 'version':'1.0', 'description':'Phase-locked userland scheduling library', 'author':'Maksym Sobolyev', 'author_email':'[email protected]', 'url':'https://github.com/sobomax/libelperiodic', 'packages':['elperiodic',], 'package_dir':{'elperiodic':'python'}, 'ext_modules': get_ex_mod() } if __name__ == '__main__': setup(**kwargs)
Add NO_PY_EXT environment variable to disable compilation of the C module, which is not working very well in cross-compile mode.
Add NO_PY_EXT environment variable to disable compilation of the C module, which is not working very well in cross-compile mode.
Python
bsd-2-clause
sobomax/libelperiodic,sobomax/libelperiodic,sobomax/libelperiodic,sobomax/libelperiodic
9ffd929e200fd5b292a24d990cb549beaef20379
setup.py
setup.py
from setuptools import setup setup(name='sobol_seq', version='0.1.2', description='Sobol sequence generator', url='https://github.com/naught101/sobol_seq', author='naught101', author_email='[email protected]', license='MIT', packages=['sobol_seq'], zip_safe=False)
from setuptools import setup setup(name='sobol_seq', version='0.1.2', description='Sobol sequence generator', url='https://github.com/naught101/sobol_seq', author='naught101', author_email='[email protected]', license='MIT', packages=['sobol_seq'], install_requires=[ 'scipy', 'numpy' ], zip_safe=False)
Add the "scipy" and "numpy" packages as dependencies.
Add the "scipy" and "numpy" packages as dependencies. By specifying the dependencies of a package we allow the user to install "sobol_seq" with a single `pip install` command, even in a clean environment.
Python
mit
naught101/sobol_seq
5ce630f820652c4d4e984e14cf93a4ac49b297aa
setup.py
setup.py
try: from setuptools import setup except ImportError: from distutils.core import setup settings = dict() settings.update( name="pykwalify", version="0.1.2", description='Python lib/cli for JSON/YAML schema validation', long_description='Python lib/cli for JSON/YAML schema validation', author="Grokzen", author_email="[email protected]", packages=['pykwalify'], scripts=['scripts/pykwalify'], install_requires=[ 'docopt==0.6.1', 'PyYAML==3.11', ], classifiers=( 'Development Status :: 1 - Alpha', 'Environment :: Console', 'Operating System :: POSIX', 'Operating System :: Microsoft :: Windows', 'Programming Language :: Python', 'Programming Language :: Python :: 3.1', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', ) ) setup(**settings)
try: from setuptools import setup except ImportError: from distutils.core import setup settings = dict() settings.update( name="pykwalify", version="0.1.3", description='Python lib/cli for JSON/YAML schema validation', long_description='Python lib/cli for JSON/YAML schema validation', author="Grokzen", author_email="[email protected]", packages=['pykwalify'], scripts=['scripts/pykwalify'], install_requires=[ 'docopt==0.6.1', 'PyYAML==3.11', ], classifiers=( 'Development Status :: 1 - Alpha', 'Environment :: Console', 'Operating System :: POSIX', 'Operating System :: Microsoft :: Windows', 'Programming Language :: Python', 'Programming Language :: Python :: 3.1', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', ) ) setup(**settings)
Test trigger for Travis CI
Test trigger for Travis CI
Python
mit
grokzen/pykwalify
1e817a833ae0f86338199635ab2e43c592331d08
setup.py
setup.py
import os from setuptools import setup PACKAGE_VERSION = '0.3' def version(): def version_file(mode='r'): return open(os.path.join(os.path.dirname(os.path.abspath(__file__), 'version.txt')), mode) if os.getenv('TRAVIS'): with version_file('w') as verfile: verfile.write('{0}.{1}'.format(PACKAGE_VERSION, os.getenv('TRAVIS_BUILD_NUMBER'))) with version_file() as verfile: data = verfile.readlines() return data[0].strip() setup( name='osaapi', version=version(), author='apsliteteam, oznu', author_email='[email protected]', packages=['osaapi'], url='https://aps.odin.com', license='Apache License', description='A python client for the Odin Service Automation (OSA) and billing APIs.', long_description=open('README.md').read(), )
import os from setuptools import setup PACKAGE_VERSION = '0.3' def version(): def version_file(mode='r'): return open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'version.txt'), mode) if os.getenv('TRAVIS'): with version_file('w') as verfile: verfile.write('{0}.{1}'.format(PACKAGE_VERSION, os.getenv('TRAVIS_BUILD_NUMBER'))) with version_file() as verfile: data = verfile.readlines() return data[0].strip() setup( name='osaapi', version=version(), author='apsliteteam, oznu', author_email='[email protected]', packages=['osaapi'], url='https://aps.odin.com', license='Apache License', description='A python client for the Odin Service Automation (OSA) and billing APIs.', long_description=open('README.md').read(), )
Fix issue with path variable
Fix issue with path variable
Python
apache-2.0
odin-public/osaAPI
a6b13f81ce7e39462ec188fad998755a2b66d26c
setup.py
setup.py
#! /usr/bin/env python from distutils.core import setup from youtube_dl_gui import version setup(name='Youtube-DLG', version=version.__version__, description='Youtube-dl GUI', long_description='A cross platform front-end GUI of the popular youtube-dl written in wxPython.', license='UNLICENSE', platforms='cross-platform', author='Sotiris Papadopoulos', author_email='[email protected]', url='https://github.com/MrS0m30n3/youtube-dl-gui', packages=['youtube_dl_gui'], data_files=[('icons', ['youtube_dl_gui/icons/youtube-dl-gui.png'])])
#! /usr/bin/env python from distutils.core import setup from youtube_dl_gui import version name = 'Youtube-DLG' desc = 'Youtube-dl GUI' ldesc = 'A cross platform front-end GUI of the popular youtube-dl written in wxPython' license = 'UNLICENSE' platform = 'Cross-Platform' author = 'Sotiris Papadopoulos' author_email = '[email protected]' project_url = 'http://mrs0m30n3.github.io/youtube-dl-gui/' packages = ['youtube_dl_gui'] data_files = [('lib/python2.7/site-packages/youtube_dl_gui/icons', ['youtube_dl_gui/icons/youtube-dl-gui.png'])] setup(name=name, version=version.__version__, description=desc, long_description=ldesc, license=license, platforms=platform, author=author, author_email=author_email, url=project_url, packages=packages, data_files=data_files)
Add icons on package install
Add icons on package install
Python
unlicense
Sofronio/youtube-dl-gui,pr0d1r2/youtube-dl-gui,dstftw/youtube-dl-gui,dstftw/youtube-dl-gui,pr0d1r2/youtube-dl-gui,MrS0m30n3/youtube-dl-gui,Sofronio/youtube-dl-gui,ukazap/youtube-dl-gui,MrS0m30n3/youtube-dl-gui,ukazap/youtube-dl-gui
c2297672afff206bdae91aa479cb946b932a35e9
setup.py
setup.py
from setuptools import setup, find_packages with open('README.md') as readme: long_description = readme.read() with open('requirements.txt') as requirements: dependencies = [line.strip() for line in requirements] setup( name='nbtlib', version='1.2.2', license='MIT', description='A python package to read and edit nbt data', long_description=long_description, long_description_content_type='text/markdown', author='Valentin Berlier', author_email='[email protected]', url='https://github.com/vberlier/nbtlib', platforms=['any'], python_requires='>=3.6', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], keywords='nbt schema minecraft package library parser reader module', packages=find_packages(), install_requires=dependencies, entry_points={ 'console_scripts': [ 'nbt=nbtlib.cli:main', ], } )
from setuptools import setup, find_packages with open('README.md') as readme: long_description = readme.read() with open('requirements.txt') as requirements: dependencies = [line.strip() for line in requirements] setup( name='nbtlib', version='1.2.2', license='MIT', description='A python package to read and edit nbt data', long_description=long_description, long_description_content_type='text/markdown', author='Valentin Berlier', author_email='[email protected]', url='https://github.com/vberlier/nbtlib', platforms=['any'], python_requires='>=3.6', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], keywords='nbt schema minecraft package library parser reader module', packages=find_packages(), install_requires=dependencies, entry_points={ 'console_scripts': [ 'nbt=nbtlib.cli:main', ], } )
Switch to the "Stable" development status classifier
Switch to the "Stable" development status classifier
Python
mit
vberlier/nbtlib
e7ea098a4700c6f338fc7ef223b696aaed448629
test/test_gn.py
test/test_gn.py
''' GotoNewest tests ''' import unittest import sys sys.path.append('../src/') import gn TEST_DIR = '/tmp/test' class TestGotoNewest(unittest.TestCase): ''' Test class for GotoNewest ''' def test_empty_base_dir(self): ''' If the base directory is empty, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, None) def test_base_dir_with_no_subdirs(self): ''' If the base directory has no subdirectories, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, TEST_DIR) if __name__ == '__main__': unittest.main()
''' GotoNewest tests ''' import unittest import sys sys.path.append('../src/') import gn TEST_DIR = '/tmp/test' class TestGotoNewest(unittest.TestCase): ''' Test class for GotoNewest ''' def test_empty_base_dir(self): ''' If the base directory is empty, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, None) def test_base_dir_with_no_subdirs(self): ''' If the base directory has no subdirectories, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, TEST_DIR) def test_one_subdirectory(self): ''' If there is only one subdirectory in the base directory, return the directory ''' self.assertRaises('temp', gn.transfer, TEST_DIR) if __name__ == '__main__': unittest.main()
Add test for one subdirectory
Add test for one subdirectory
Python
bsd-2-clause
ambidextrousTx/GotoNewest
cc55521c1e2af71893eff701bebc51acc112fa75
setup.py
setup.py
from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='[email protected]', version='1.1.1', packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.24', 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9', ], extras_require={ 'testing': [ 'mock>=2.0,<4.1', ], 'docs': [ 'sphinx', ], ':python_version == "2.7"': ['futures'], } )
from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='[email protected]', version='1.1.1', packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.25', 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9', ], extras_require={ 'testing': [ 'mock>=2.0,<4.1', ], 'docs': [ 'sphinx', ], ':python_version == "2.7"': ['futures'], } )
Update requests requirement from <2.24,>=2.4.2 to >=2.4.2,<2.25
Update requests requirement from <2.24,>=2.4.2 to >=2.4.2,<2.25 Updates the requirements on [requests](https://github.com/psf/requests) to permit the latest version. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.4.2...v2.24.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
Python
apache-2.0
zooniverse/panoptes-python-client
28460d76d483e47b6faa63f5b9c3013031a68dea
setup.py
setup.py
#!/usr/bin/env python import os import sys from setuptools import setup if sys.argv[-1] == 'publish': os.system('python setup.py register sdist bdist_wheel upload') sys.exit() setup( name='sentry-sso-google', version='1.1', description='Google SSO support for Sentry', author='Educreations Engineering', author_email='[email protected]', url='https://github.com/educreations/sentry-sso-google', install_requires=['sentry>=7.5'], packages=["sentry_sso_google"], license="MIT", )
#!/usr/bin/env python import os import sys from setuptools import setup if sys.argv[-1] == 'publish': os.system('python setup.py register sdist bdist_wheel upload') sys.exit() with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f: readme = f.read() setup( name='sentry-sso-google', version='1.1', description='Google SSO support for Sentry', long_description=readme, author='Educreations Engineering', author_email='[email protected]', url='https://github.com/educreations/sentry-sso-google', install_requires=['sentry>=7.5'], packages=["sentry_sso_google"], license="MIT", )
Use new README.rst as package long_description
Use new README.rst as package long_description
Python
mit
educreations/sentry-sso-google
9e88d6eb6d6d97ea9046dbf842cdc0b5beb62b90
src/main.py
src/main.py
import tweepy, time, random def main(): CONSUMER_KEY = 'your_consumer_key' CONSUMER_SECRET = 'your_consumer_secret' ACCESS_KEY = 'your_access_key' ACCESS_SECRET = 'your_access_secret' auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) api = tweepy.API(auth) while True: minion_tweets = api.search(q="minions") answers_file = open('custom/answers/answers.txt', 'r') minion_answers = answers_file.read().splitlines() answers_file.close() for minion_tweet in minion_tweets: sn = minion_tweet.user.screen_name minion_answer = "@%s %s" % (sn, random.choice(minion_answers)) api.update_status(status=minion_answer, in_reply_to_status_id=minion_tweet.id) time.sleep(900) if __name__ == '__main__': main()
import tweepy, time, random def main(): CONSUMER_KEY = 'your_consumer_key' CONSUMER_SECRET = 'your_consumer_secret' ACCESS_KEY = 'your_access_key' ACCESS_SECRET = 'your_access_secret' auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) api = tweepy.API(auth) while True: minion_tweets = api.search(q="minions") try: answers_file = open('custom/answers/answers.txt', 'r') minion_answers = answers_file.read().splitlines() answers_file.close() except IOError: print "Oops, something went wrong. Could not find answers.txt file." for minion_tweet in minion_tweets: sn = minion_tweet.user.screen_name minion_answer = "@%s %s" % (sn, random.choice(minion_answers)) api.update_status(status=minion_answer, in_reply_to_status_id=minion_tweet.id) time.sleep(900) if __name__ == '__main__': main()
Add better error support for answers file
Add better error support for answers file
Python
mit
djangokillen/minion-hate-bot
daa004f214956ee0e906540313bdb84b8e31a3e8
setup.py
setup.py
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) with open('README.md') as readme: long_description = readme.read() setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', long_description=long_description, long_description_content_type='text/markdown', keywords='arcgis,fgdc,iso,ISO-19115,ISO-19139,gis,metadata,parser,xml,gis_metadata,gis_metadata_parser', version='1.2.1', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'frozendict>=1.2', 'parserutils>=1.1', 'six>=1.9.0' ], tests_require=['mock'], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) with open('README.md') as readme: long_description = readme.read() setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', long_description=long_description, long_description_content_type='text/markdown', keywords='arcgis,fgdc,iso,ISO-19115,ISO-19139,gis,metadata,parser,xml,gis_metadata,gis_metadata_parser', version='1.2.2', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'frozendict>=1.2', 'parserutils>=1.1', 'six>=1.9.0' ], tests_require=['mock'], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
Increment version after making parser properties non-private
Increment version after making parser properties non-private
Python
bsd-3-clause
consbio/gis-metadata-parser
4f1124c7526ee1d30f0de180d459f42d716ad2c8
setup.py
setup.py
#from distutils.core import setup from setuptools import setup descr = """Tree representations and algorithms for Python. Viridis is named after the green tree python, Morelia viridis. """ DISTNAME = 'viridis' DESCRIPTION = 'Tree data structures and algorithms' LONG_DESCRIPTION = descr MAINTAINER = 'Juan Nunez-Iglesias' MAINTAINER_EMAIL = '[email protected]' URL = 'https://github.com/jni/viridis' LICENSE = 'BSD 3-clause' DOWNLOAD_URL = 'https://github.com/jni/viridis' VERSION = '0.2-dev' PYTHON_VERSION = (2, 7) INST_DEPENDENCIES = {} if __name__ == '__main__': setup(name=DISTNAME, version=VERSION, url=URL, description=DESCRIPTION, long_description=LONG_DESCRIPTION, author=MAINTAINER, author_email=MAINTAINER_EMAIL, license=LICENSE, packages=['viridis'], package_data={}, install_requires=INST_DEPENDENCIES, scripts=[] )
#from distutils.core import setup from setuptools import setup descr = """Tree representations and algorithms for Python. Viridis is named after the green tree python, Morelia viridis. """ DISTNAME = 'viridis' DESCRIPTION = 'Tree data structures and algorithms' LONG_DESCRIPTION = descr MAINTAINER = 'Juan Nunez-Iglesias' MAINTAINER_EMAIL = '[email protected]' URL = 'https://github.com/jni/viridis' LICENSE = 'BSD 3-clause' DOWNLOAD_URL = 'https://github.com/jni/viridis' VERSION = '0.3-dev' PYTHON_VERSION = (2, 7) INST_DEPENDENCIES = {} if __name__ == '__main__': setup(name=DISTNAME, version=VERSION, url=URL, description=DESCRIPTION, long_description=LONG_DESCRIPTION, author=MAINTAINER, author_email=MAINTAINER_EMAIL, license=LICENSE, packages=['viridis'], package_data={}, install_requires=INST_DEPENDENCIES, scripts=[] )
Update master version to 0.3-dev
Update master version to 0.3-dev
Python
mit
jni/viridis
045b8add1a2e45e120f1353f5412b8047dfa1a81
setup.py
setup.py
__doc__ = """ Manipulate audio with an simple and easy high level interface. See the README file for details, usage info, and a list of gotchas. """ from setuptools import setup setup( name='pydub', version='0.6.3', author='James Robert', author_email='[email protected]', description='Manipulate audio with an simple and easy high level interface', license='MIT', keywords='audio sound high-level', url='http://pydub.com', packages=['pydub'], long_description=__doc__, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Intended Audience :: Developers', 'Operating System :: OS Independent', "Topic :: Multimedia :: Sound/Audio", "Topic :: Multimedia :: Sound/Audio :: Analysis", "Topic :: Multimedia :: Sound/Audio :: Conversion", "Topic :: Multimedia :: Sound/Audio :: Editors", "Topic :: Multimedia :: Sound/Audio :: Mixers", "Topic :: Software Development :: Libraries", 'Topic :: Utilities', ] )
__doc__ = """ Manipulate audio with an simple and easy high level interface. See the README file for details, usage info, and a list of gotchas. """ from setuptools import setup setup( name='pydub', version='0.7.0', author='James Robert', author_email='[email protected]', description='Manipulate audio with an simple and easy high level interface', license='MIT', keywords='audio sound high-level', url='http://pydub.com', packages=['pydub'], long_description=__doc__, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Intended Audience :: Developers', 'Operating System :: OS Independent', "Topic :: Multimedia :: Sound/Audio", "Topic :: Multimedia :: Sound/Audio :: Analysis", "Topic :: Multimedia :: Sound/Audio :: Conversion", "Topic :: Multimedia :: Sound/Audio :: Editors", "Topic :: Multimedia :: Sound/Audio :: Mixers", "Topic :: Software Development :: Libraries", 'Topic :: Utilities', ] )
Increment version number for release of new features and bug fixes to pypi
Increment version number for release of new features and bug fixes to pypi
Python
mit
lepinsk/pydub,cbelth/pyMusic,joshrobo/pydub,miguelgrinberg/pydub,jiaaro/pydub,Geoion/pydub,sgml/pydub
a0d17f10dd269aa0a1be97276c312f3f522787f5
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name='isystem-to-mqtt', version='0.1.0', author='Nicolas Graziano', author_email='[email protected]', packages= find_packages(), scripts=['bin/poll_isystem_mqtt.py', 'bin/dump_isystem.py'], url='https://github.com/ngraziano/isystem-to-mqtt', install_requires=['MinimalModbus', 'paho-mqtt'], license='LICENSE', description='Request Isystem boiler and send value to mqtt', # long_description=open('README.md').read(), )
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name='isystem-to-mqtt', version='0.2.0', author='Nicolas Graziano', author_email='[email protected]', packages= find_packages(), scripts=['bin/poll_isystem_mqtt.py', 'bin/dump_isystem.py'], url='https://github.com/ngraziano/isystem-to-mqtt', install_requires=['MinimalModbus', 'paho-mqtt'], license='LICENSE', description='Request Isystem boiler and send value to mqtt', classifiers=['Programming Language :: Python :: 3'] # long_description=open('README.md').read(), )
Increase version and add python 3 classifier
Increase version and add python 3 classifier
Python
mit
ngraziano/isystem-to-mqtt
b0dda121e03f593afb6ee1b3959b71b615df2b39
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup from Registry import _version_ setup(name='python-registry', version=_version_, description='Read access to Windows Registry files.', author='Willi Ballenthin', author_email='[email protected]', url='http://www.williballenthin.com/registry/', license='Apache License (2.0)', packages=['Registry'], classifiers = ["Programming Language :: Python", "Programming Language :: Python :: 3", "Operating System :: OS Independent", "License :: OSI Approved :: Apache Software License"], install_requires=['enum34','unicodecsv'] )
#!/usr/bin/env python from setuptools import setup from Registry import _version_ setup(name='python-registry', version=_version_, description='Read access to Windows Registry files.', author='Willi Ballenthin', author_email='[email protected]', url='http://www.williballenthin.com/registry/', license='Apache License (2.0)', packages=['Registry'], classifiers = ["Programming Language :: Python", "Programming Language :: Python :: 3", "Operating System :: OS Independent", "License :: OSI Approved :: Apache Software License"], install_requires=['enum-compat','unicodecsv'] )
Replace enum34 with enum-compat to allow use with Py3.6+
Replace enum34 with enum-compat to allow use with Py3.6+
Python
apache-2.0
williballenthin/python-registry
0ff0389d017de119053b3cd38e503eb3d8bdadff
setup.py
setup.py
from setuptools import find_packages, setup setup( name='jupyter-notebook-gist', version='0.4.0', description='Create a gist from the Jupyter Notebook UI', author='Mozilla Firefox Data Platform', author_email='[email protected]', packages=find_packages(where='src'), package_dir={'': 'src'}, include_package_data=True, license='MPL2', install_requires=[ 'ipython >= 4', 'notebook >= 4.2', 'jupyter', 'requests', 'widgetsnbextension', ], url='https://github.com/mozilla/jupyter-notebook-gist', zip_safe=False, )
from setuptools import find_packages, setup setup( name='jupyter-notebook-gist', version='0.4.0', description='Create a gist from the Jupyter Notebook UI', author='Mozilla Firefox Data Platform', author_email='[email protected]', packages=find_packages(where='src'), package_dir={'': 'src'}, include_package_data=True, license='MPL2', install_requires=[ 'ipython >= 4', 'notebook >= 4.2', 'jupyter', 'requests', 'six', 'widgetsnbextension', ], url='https://github.com/mozilla/jupyter-notebook-gist', zip_safe=False, )
Add six to the explicit dependencies
Add six to the explicit dependencies
Python
mpl-2.0
mozilla/jupyter-notebook-gist,mreid-moz/jupyter-notebook-gist,mozilla/jupyter-notebook-gist,mreid-moz/jupyter-notebook-gist
52609334bdd25eb89dbc67b75921029c37babd63
setup.py
setup.py
import os import sys from setuptools import setup __author__ = 'Ryan McGrath <[email protected]>' __version__ = '2.10.0' packages = [ 'twython', 'twython.streaming' ] if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() setup( # Basic package information. name='twython', version=__version__, packages=packages, # Packaging options. include_package_data=True, # Package dependencies. install_requires=['requests==1.2.2', 'requests_oauthlib==0.3.2'], # Metadata for PyPI. author='Ryan McGrath', author_email='[email protected]', license='MIT License', url='http://github.com/ryanmcgrath/twython/tree/master', keywords='twitter search api tweet twython', description='An easy (and up to date) way to access Twitter data with Python.', long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Communications :: Chat', 'Topic :: Internet' ] )
import os import sys from setuptools import setup __author__ = 'Ryan McGrath <[email protected]>' __version__ = '2.10.0' packages = [ 'twython', 'twython.streaming' ] if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() setup( # Basic package information. name='twython', version=__version__, packages=packages, # Packaging options. include_package_data=True, # Package dependencies. install_requires=['requests==1.2.2', 'requests_oauthlib==0.3.2'], # Metadata for PyPI. author='Ryan McGrath', author_email='[email protected]', license='MIT License', url='http://github.com/ryanmcgrath/twython/tree/master', keywords='twitter search api tweet twython stream', description='Actively maintained, pure Python wrapper for the Twitter API. Supports both normal and streaming Twitter APIs', long_description=open('README.rst').read() + '\n\n' + open('HISTORY.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Communications :: Chat', 'Topic :: Internet' ] )
Update description and long description
Update description and long description [ci skip]
Python
mit
joebos/twython,Oire/twython,fibears/twython,Devyani-Divs/twython,Hasimir/twython,akarambir/twython,ping/twython,vivek8943/twython,ryanmcgrath/twython,Fueled/twython
ea30858852815043fd95888add674778893bac42
setup.py
setup.py
from setuptools import setup, find_packages setup( name="go_auth", version="0.1.0a", url='http://github.com/praekelt/go_auth', license='BSD', description="Authentication services and utilities for Vumi Go APIs.", long_description=open('README.rst', 'r').read(), author='Praekelt Foundation', author_email='[email protected]', packages=find_packages(), include_package_data=True, install_requires=[ 'cyclone', 'oauthlib', 'go_api', ], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Internet :: WWW/HTTP', ], )
from setuptools import setup, find_packages setup( name="go_auth", version="0.1.0a", url='http://github.com/praekelt/go_auth', license='BSD', description="Authentication services and utilities for Vumi Go APIs.", long_description=open('README.rst', 'r').read(), author='Praekelt Foundation', author_email='[email protected]', packages=find_packages(), include_package_data=True, install_requires=[ 'cyclone', 'oauthlib', 'go_api', 'PyYAML', ], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Internet :: WWW/HTTP', ], )
Add PyYAML as a direct dependency for tests.
Add PyYAML as a direct dependency for tests.
Python
bsd-3-clause
praekelt/go-auth,praekelt/go-auth
81fc515539474e720a9b96ef1bc5679e053952f9
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='bettercache', version='0.5.3', description = "A suite of better cache tools for Django.", license = "MIT", author='Calvin Spealman', author_email='[email protected]', url='http://github.com/ironfroggy/django-better-cache', packages = find_packages(), )
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='bettercache', version='0.5.3', description = "A suite of better cache tools for Django.", license = "MIT", author='Calvin Spealman', author_email='[email protected]', url='http://github.com/ironfroggy/django-better-cache', packages = find_packages(), install_requires = [ 'celery >= 2.4.2', 'httplib2 >= 0.6.0', ], )
Add new requirements from CMG middleware
Add new requirements from CMG middleware
Python
mit
ironfroggy/django-better-cache,ironfroggy/django-better-cache
f7aedd45ad103e66621bad04bfcbbba7d30b4e35
tv_namer.py
tv_namer.py
#!/usr/bin/python3 # tv_namer.py - Renames passed media files of TV shows import shutil import os import sys import logging import videoLister import scrapeTVDB import regSplit logger = logging.getLogger(__name__) logging.basicConfig(filename='tv_namer.log',level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') in_path = ' '.join(sys.argv[1:]) for item in videoLister.videoDir(in_path): logger.info("Working on: ", item) reg_dict = regSplit.Split(item) ext = os.path.splitext(item)[1] if reg_dict['type'] == 'tv': med_info = scrapeTVDB.theTVDB(reg_dict['title'], reg_dict['season'], reg_dict['episode']) new_name = (reg_dict['title'] + ' S' + reg_dict['season'].zfill(2) + 'E' + reg_dict['episode'].zfill(2) + ' - ' + med_info['data'][0]['episodeName'] + ext) logger.info("Renaming: %s, as: %s" % (item, new_name)) shutil.move(item, (os.path.join(os.path.dirname(item), new_name))) else: logger.info("File not renamed: ", item)
#!/usr/bin/python3 # tv_namer.py - Renames passed media files of TV shows import shutil import os import sys import logging import videoLister import scrapeTVDB import regSplit logger = logging.getLogger(__name__) logging.basicConfig(filename='tv_namer.log',level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') in_path = ' '.join(sys.argv[1:]) for item in videoLister.videoDir(in_path): logger.info("Working on: ", item) reg_dict = regSplit.Split(item) ext = os.path.splitext(item)[1] if reg_dict['type'] == 'tv': med_info = scrapeTVDB.theTVDB(reg_dict['title'], reg_dict['season'], reg_dict['episode']) new_name = (reg_dict['title'] + ' S' + reg_dict['season'].zfill(2) + 'E' + reg_dict['episode'].zfill(2) + ' - ' + med_info['data'][0]['episodeName'] + ext) logger.info("Renaming: %s, as: %s" % (item, new_name)) shutil.move(item, (os.path.join(os.path.dirname(item), new_name))) else: logger.warning("File not renamed: ", item)
Change info to warning if files not renamed
Change info to warning if files not renamed
Python
mit
samcheck/PyMedia,samcheck/PyMedia,samcheck/PyMedia
ab417052f3d41ee5b140e3044a6a925c3895d1ee
setup.py
setup.py
# -*- coding: utf-8 -*- from distutils.core import setup import ibei setup(name = "ibei", version = ibei.__version__, author = "Joshua Ryan Smith", author_email = "[email protected]", packages = ["ibei"], url = "https://github.com/jrsmith3/ibei", description = "Calculator for incomplete Bose-Einstein integral", classifiers = ["Programming Language :: Python", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering :: Physics", "Natural Language :: English",], install_requires = ["numpy", "sympy", "astropy"],)
# -*- coding: utf-8 -*- from distutils.core import setup import ibei setup(name = "ibei", version = ibei.__version__, author = "Joshua Ryan Smith", author_email = "[email protected]", packages = ["ibei", "physicalproperty"], url = "https://github.com/jrsmith3/ibei", description = "Calculator for incomplete Bose-Einstein integral", classifiers = ["Programming Language :: Python", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering :: Physics", "Natural Language :: English",], install_requires = ["numpy", "sympy", "astropy"],)
Add 'physicalproperty' to pkg list for install
Add 'physicalproperty' to pkg list for install
Python
mit
jrsmith3/ibei
ca38e933f4dd43fc3fdcc4db27564b5e1559edf1
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup( name="sigseekr", version="0.2.0", packages=find_packages(), scripts=['sigseekr/sigseekr.py'], author="Andrew Low", author_email="[email protected]", url="https://github.com/lowandrew/SigSeekr", install_requires=['biopython', 'OLCTools', 'pytest', 'primer3-py'] )
#!/usr/bin/env python from setuptools import setup, find_packages setup( name="sigseekr", version="0.2.1", packages=find_packages(), scripts=['sigseekr/sigseekr.py'], author="Andrew Low", author_email="[email protected]", url="https://github.com/lowandrew/SigSeekr", install_requires=['biopython', 'OLCTools', 'pytest', 'primer3-py'] )
Increment version to 0.2.1 - now with primer3 function
Increment version to 0.2.1 - now with primer3 function
Python
mit
OLC-Bioinformatics/SigSeekr
1780c1d6230669922c9fef2798fdfccf56bbe294
setup.py
setup.py
# coding: utf-8 -*- # # Setup file for geocluster # from setuptools import setup, find_packages import os # Get the description file here = os.path.dirname(os.path.abspath(__file__)) long_description = open(os.path.join(here, "DESCRIPTION.rst"), 'r').read() setup( name='geocluster', author=u'Régis FLORET', author_email='[email protected]', version='1.0.0', description='GeoCluster is a framework agnostic library to help map clusterization', long_description=long_description, license='MIT', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: Scientific/Engineering :: Visualization', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: Localization' ], keywords='Geocoding map cluster', packages=find_packages('.', exclude=['CModule', 'tests']) )
# coding: utf-8 -*- # # Setup file for geocluster # from setuptools import setup, find_packages import os # Get the description file here = os.path.dirname(os.path.abspath(__file__)) long_description = open(os.path.join(here, "DESCRIPTION.rst"), 'r').read() setup( name='geocluster', author=u'Régis FLORET', author_email='[email protected]', version='1.0.1', url='http://www.regisblog.fr/geocluster/', download_url='https://github.com/regisf/geocluster', platforms=['any',], description='GeoCluster is a framework agnostic library to help map clusterization', long_description=long_description, license='MIT', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: Scientific/Engineering :: Visualization', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: Localization' ], keywords='Geocoding map cluster', packages=find_packages('.', exclude=['CModule', 'tests']) )
Add information (url, download url, ...) for packaging
Add information (url, download url, ...) for packaging
Python
mit
regisf/geocluster
16e2d0180cc48c2d3be238ebe17797d8c0acbf62
setup.py
setup.py
from setuptools import setup setup( name='devour', version='0.4', url='', author='http://github.com/brandoshmando', author_email='[email protected]', license='MIT', packages=['devour',], install_requires=[ 'pykafka', 'kazoo' ], include_package_data=True, test_suite='nose.collector', tests_require=['nose'], zip_safe=False, entry_points={ 'console_scripts': [ 'devour = devour.bin.devour_commandst:main' ] }, keywords = ['kafka', 'django', 'pykafka', 'python', 'devour'] )
from setuptools import setup setup( name='devour', version='0.4', url='', author='http://github.com/brandoshmando', author_email='[email protected]', license='MIT', packages=['devour',], install_requires=[ 'pykafka', 'kazoo' ], include_package_data=True, test_suite='nose.collector', tests_require=['nose'], zip_safe=False, entry_points={ 'console_scripts': [ 'devour = devour.bin.devour_commands:main' ] }, keywords = ['kafka', 'django', 'pykafka', 'python', 'devour'] )
Fix typo for cli entrypoint
Fix typo for cli entrypoint
Python
mit
brandoshmando/devour
c92fe387725ee16ba7d452454fea65aacfe429b4
setup.py
setup.py
from setuptools import setup, find_packages CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Internationalization', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: Localization', 'Topic :: Text Processing :: Linguistic', ] LONG_DESC = open('README.rst', 'rt').read() + '\n\n' + open('CHANGES.rst', 'rt').read() setup( name='num2words', version='0.5.0', description='Modules to convert numbers to words. Easily extensible.', license='LGPL', author='Taro Ogawa <tso at users sourceforge net>', author_email='[email protected]', maintainer='Savoir-faire Linux inc.', maintainer_email='[email protected]', keywords=' number word numbers words convert conversion i18n localisation localization internationalisation internationalization', url='https://github.com/savoirfairelinux/num2words', packages=find_packages(), )
from setuptools import setup, find_packages CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Internationalization', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: Localization', 'Topic :: Text Processing :: Linguistic', ] LONG_DESC = open('README.rst', 'rt').read() + '\n\n' + open('CHANGES.rst', 'rt').read() setup( name='num2words', version='0.5.0', description='Modules to convert numbers to words. Easily extensible.', license='LGPL', author='Taro Ogawa <tso at users sourceforge net>', author_email='[email protected]', maintainer='Savoir-faire Linux inc.', maintainer_email='[email protected]', keywords=' number word numbers words convert conversion i18n localisation localization internationalisation internationalization', url='https://github.com/savoirfairelinux/num2words', packages=find_packages(), use_2to3=True, )
Enable Python 3 compatibility using 2to3.
Enable Python 3 compatibility using 2to3.
Python
lgpl-2.1
kszys/num2words,savoirfairelinux/num2words
8fed7f136912fecf8dfb223807b818f37ee306e8
setup.py
setup.py
# Copyright 2019 The Empirical Calibration 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 writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ """Setup for empirical calibration package.""" from setuptools import find_packages from setuptools import setup setup( name='empirical_calibration', version='0.1', description='Package for empirical calibration', author='Google LLC', author_email='[email protected]', url='https://github.com/google/empirical_calibration', license='Apache 2.0', packages=find_packages(), install_requires=[ 'enum', 'numpy >= 1.11.1', 'pandas', 'patsy', 'scipy', 'six', 'sklearn', 'typing', ], )
# Copyright 2019 The Empirical Calibration 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 writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ """Setup for empirical calibration package.""" from setuptools import find_packages from setuptools import setup setup( name='empirical_calibration', version='0.1', description='Package for empirical calibration', author='Google LLC', author_email='[email protected]', url='https://github.com/google/empirical_calibration', license='Apache 2.0', packages=find_packages(), install_requires=[ 'absl-py', 'numpy >= 1.11.1', 'pandas', 'patsy', 'scipy', 'six', 'sklearn', ], )
Remove enum and add absl-py.
Remove enum and add absl-py. PiperOrigin-RevId: 256969582
Python
apache-2.0
google/empirical_calibration
7fb2155a7884bbebe3b29c1580b37354309c0d1e
setup.py
setup.py
from setuptools import find_packages import os try: from setuptools import setup except ImportError: from distutils.core import setup # Get version and release info, which is all stored in AFQ/version.py ver_file = os.path.join('AFQ', 'version.py') with open(ver_file) as f: exec(f.read()) REQUIRES = [] with open('requirements.txt') as f: l = f.readline()[:-1] while l: REQUIRES.append(l) l = f.readline()[:-1] opts = dict(name=NAME, maintainer=MAINTAINER, maintainer_email=MAINTAINER_EMAIL, description=DESCRIPTION, long_description=LONG_DESCRIPTION, url=URL, download_url=DOWNLOAD_URL, license=LICENSE, classifiers=CLASSIFIERS, author=AUTHOR, author_email=AUTHOR_EMAIL, platforms=PLATFORMS, version=VERSION, packages=find_packages(), requires=REQUIRES, scripts=SCRIPTS) if __name__ == '__main__': setup(**opts)
from setuptools import find_packages import os try: from setuptools import setup except ImportError: from distutils.core import setup # Get version and release info, which is all stored in AFQ/version.py ver_file = os.path.join('AFQ', 'version.py') with open(ver_file) as f: exec(f.read()) REQUIRES = [] with open('requirements.txt') as f: l = f.readline()[:-1] while l: REQUIRES.append(l) l = f.readline()[:-1] opts = dict(name=NAME, maintainer=MAINTAINER, maintainer_email=MAINTAINER_EMAIL, description=DESCRIPTION, long_description=LONG_DESCRIPTION, url=URL, download_url=DOWNLOAD_URL, license=LICENSE, classifiers=CLASSIFIERS, author=AUTHOR, author_email=AUTHOR_EMAIL, platforms=PLATFORMS, version=VERSION, packages=find_packages(), install_requires=REQUIRES, requires=REQUIRES, scripts=SCRIPTS) if __name__ == '__main__': setup(**opts)
Use install_requires to install the requirements.
Use install_requires to install the requirements.
Python
bsd-2-clause
arokem/pyAFQ,yeatmanlab/pyAFQ,arokem/pyAFQ,yeatmanlab/pyAFQ
82b24bde5a681a0630056c2649ebece7c5b35686
setup.py
setup.py
import setuptools def read_long_description(): with open('README') as f: data = f.read() return data setup_params = dict( name="irc", description="IRC (Internet Relay Chat) protocol client library for Python", long_description=read_long_description(), use_hg_version=True, packages=setuptools.find_packages(), author="Joel Rosdahl", author_email="[email protected]", maintainer="Jason R. Coombs", maintainer_email="[email protected]", url="http://python-irclib.sourceforge.net", classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", ], setup_requires=[ 'hgtools', ], use_2to3=True, use_2to3_exclude_fixers=[ 'lib2to3.fixes.fix_import', 'lib2to3.fixes.fix_next', 'lib2to3.fixes.fix_print', ], ) if __name__ == '__main__': setuptools.setup(**setup_params)
import sys import setuptools def read_long_description(): with open('README') as f: data = f.read() return data importlib_req = ['importlib'] if sys.version_info < (2,7) else [] setup_params = dict( name="irc", description="IRC (Internet Relay Chat) protocol client library for Python", long_description=read_long_description(), use_hg_version=True, packages=setuptools.find_packages(), author="Joel Rosdahl", author_email="[email protected]", maintainer="Jason R. Coombs", maintainer_email="[email protected]", url="http://python-irclib.sourceforge.net", classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", ], install_requires=[ ] + importlib_req, setup_requires=[ 'hgtools', ], use_2to3=True, use_2to3_exclude_fixers=[ 'lib2to3.fixes.fix_import', 'lib2to3.fixes.fix_next', 'lib2to3.fixes.fix_print', ], ) if __name__ == '__main__': setuptools.setup(**setup_params)
Declare importlib requirement on Python 2.6
Declare importlib requirement on Python 2.6
Python
lgpl-2.1
sim0629/irc
e9ac75d7f3f023bb0116446a2d358faa36fa90e2
setup.py
setup.py
import sys from setuptools import find_packages, setup VERSION = '2.0.dev0' install_requires = [ 'django-local-settings>=1.0a12', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU-OIT-ARC/django-arcutils', author='PSU - OIT - ARC', author_email='[email protected]', description='Common utilities used in ARC Django projects', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, extras_require={ 'ldap': [ 'certifi>=2015.11.20.1', 'ldap3>=1.0.3', ], 'dev': [ 'django>=1.7,<1.9', 'djangorestframework>3.3', 'flake8', 'ldap3', ], }, entry_points=""" [console_scripts] arcutils = arcutils.__main__:main """, classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], )
import sys from setuptools import find_packages, setup VERSION = '2.0.dev0' install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU-OIT-ARC/django-arcutils', author='PSU - OIT - ARC', author_email='[email protected]', description='Common utilities used in ARC Django projects', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, extras_require={ 'ldap': [ 'certifi>=2015.11.20.1', 'ldap3>=1.0.3', ], 'dev': [ 'django>=1.7,<1.9', 'djangorestframework>3.3', 'flake8', 'ldap3', ], }, entry_points=""" [console_scripts] arcutils = arcutils.__main__:main """, classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], )
Upgrade django-local-settings 1.0a12 => 1.0a13
Upgrade django-local-settings 1.0a12 => 1.0a13
Python
mit
PSU-OIT-ARC/django-arcutils,wylee/django-arcutils,PSU-OIT-ARC/django-arcutils,wylee/django-arcutils
983bdcc48c8feef5e65280e02a83a1f3721bce70
setup.py
setup.py
#!/usr/bin/env python ############################################################################ # # # Copyright 2014 Prelert Ltd # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # # You may obtain a copy of the License at # # # # http://www.apache.org/licenses/LICENSE-2.0 # # # # Unless required by applicable law or agreed to in writing, software # # distributed under the License is distributed on an "AS IS" BASIS, # # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # # limitations under the License. # # # ############################################################################ """ Prelert Python packages """ from distutils.core import setup setup(name='Prelert', description='Python packages for Prelert', version='1.3', license='Apache License, Version 2.0', url='https://github.com/prelert/engine-python', packages=['prelert', 'prelert.engineApiClient'], )
#!/usr/bin/env python ############################################################################ # # # Copyright 2014 Prelert Ltd # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # # You may obtain a copy of the License at # # # # http://www.apache.org/licenses/LICENSE-2.0 # # # # Unless required by applicable law or agreed to in writing, software # # distributed under the License is distributed on an "AS IS" BASIS, # # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # # limitations under the License. # # # ############################################################################ """ Prelert Python packages """ from distutils.core import setup setup(name='Prelert', description='Python packages for Prelert', version='1.4', license='Apache License, Version 2.0', url='https://github.com/prelert/engine-python', packages=['prelert', 'prelert.engineApiClient'], )
Change version number to 1.4
Change version number to 1.4
Python
apache-2.0
pemontto/engine-python,prelert/engine-python
330f4a6829f39684b7a37961f6f2ee5f692c536d
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup import os import sys if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() setup( name='Flask-Simon', version='0.3.0', description='Simple MongoDB Models for Flask', long_description=open('README.rst').read(), author='Andy Dirnberger', author_email='[email protected]', url='https://github.com/dirn/Flask-Simon', packages=['flask_simon'], package_data={'': ['LICENSE', 'README.rst']}, include_package_data=True, install_requires=['flask>=0.8', 'pymongo>=2.1', 'simon>=0.5'], tests_require=['coverage', 'mock', 'nose'], license=open('LICENSE').read(), classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
#!/usr/bin/env python from setuptools import setup import os import sys if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() setup( name='Flask-Simon', version='0.3.0', description='Simple MongoDB Models for Flask', long_description=open('README.rst').read(), author='Andy Dirnberger', author_email='[email protected]', url='https://github.com/dirn/Flask-Simon', packages=['flask_simon'], package_data={'': ['LICENSE', 'README.rst']}, include_package_data=True, install_requires=['flask>=0.8', 'pymongo>=2.1', 'simon>=0.5'], tests_require=['coverage', 'mock', 'nose'], license=open('LICENSE').read(), classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
Add Python 3 to supported languages
Add Python 3 to supported languages Closes #8
Python
bsd-3-clause
dirn/Flask-Simon,dirn/Flask-Simon
66581c78e4abf9ff94b954ba0500e6f93fda1d35
setup.py
setup.py
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='windpowerlib', version='0.1.2dev', description='Creating time series of wind power plants.', url='http://github.com/wind-python/windpowerlib', author='oemof developer group', author_email='[email protected]', license=None, packages=['windpowerlib'], package_data={ 'windpowerlib': [os.path.join('data', '*.csv')]}, long_description=read('README.rst'), zip_safe=False, install_requires=['pandas >= 0.19.1', 'requests'])
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='windpowerlib', version='0.1.2dev', description='Creating time series of wind power plants.', url='http://github.com/wind-python/windpowerlib', author='oemof developer group', author_email='[email protected]', license=None, packages=['windpowerlib'], package_data={ 'windpowerlib': [os.path.join('data', '*.csv')]}, long_description=read('README.rst'), zip_safe=False, install_requires=['pandas >= 0.19.1', 'requests'], extras_require={ 'dev': ['sphinx_rtd_theme', 'pytest']})
Add installation requirements for developers
Add installation requirements for developers
Python
mit
wind-python/windpowerlib
a6147357f93295e5b363f36da1c14fd3db7dc062
setup.py
setup.py
"""Millipede installation script https://github.com/evadot/millipede """ from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name="millipede", version="0.1", description="A millipede generator", long_description=long_description, url="https://github.com/evadot/millipede" author="The millipede fan club" license="MIT" classifiers=[ 'Development Status :: 4 - Alpha', 'Intended Audience :: Religion', 'Topic :: Religion' 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], keywords="millipede", entry_points={ 'console_scripts': [ 'millipede=millipede:main', ], }, )
"""Millipede installation script https://github.com/evadot/millipede """ from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name="millipede", version="0.1", description="A millipede generator", long_description=long_description, url="https://github.com/evadot/millipede", author="The millipede fan club", author_email="[email protected]", license="MIT", classifiers=[ 'Development Status :: 4 - Alpha', 'Intended Audience :: Religion', 'Topic :: Religion' 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], packages=find_packages(exclude=['contrib', 'docs', 'tests*']), keywords="millipede", entry_points={ 'console_scripts': [ 'millipede=millipede:main', ], }, )
Add email (required) and packages
Add email (required) and packages
Python
bsd-3-clause
evadot/millipede-python,evadot/millipede-python,getmillipede/millipede-python,moul/millipede-python,EasonYi/millipede-python,moul/millipede-python,EasonYi/millipede-python,getmillipede/millipede-python
213b6303eba6edb4ebb0f9f5101ab2a1e76acfaf
setup.py
setup.py
# -*- coding: utf-8 -*- import io from setuptools import setup, find_packages setup( name='django-pipeline', version='1.5.2', description='Pipeline is an asset packaging library for Django.', long_description=io.open('README.rst', encoding='utf-8').read() + '\n\n' + io.open('HISTORY.rst', encoding='utf-8').read(), author='Timothée Peignier', author_email='[email protected]', url='https://github.com/cyberdelia/django-pipeline', license='MIT', packages=find_packages(exclude=['tests', 'tests.tests']), zip_safe=False, install_requires=[ 'futures>=2.1.3', ], include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Topic :: Utilities', ] )
# -*- coding: utf-8 -*- import io from setuptools import setup, find_packages import sys install_requires = [] if (sys.version_info[0], sys.version_info[1]) < (3, 2): install_requires.append('futures>=2.1.3') setup( name='django-pipeline', version='1.5.2', description='Pipeline is an asset packaging library for Django.', long_description=io.open('README.rst', encoding='utf-8').read() + '\n\n' + io.open('HISTORY.rst', encoding='utf-8').read(), author='Timothée Peignier', author_email='[email protected]', url='https://github.com/cyberdelia/django-pipeline', license='MIT', packages=find_packages(exclude=['tests', 'tests.tests']), zip_safe=False, install_requires=install_requires, include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Topic :: Utilities', ] )
Remove useless requirement on Python 3.2+
Remove useless requirement on Python 3.2+
Python
mit
perdona/django-pipeline,chipx86/django-pipeline,cyberdelia/django-pipeline,kronion/django-pipeline,cyberdelia/django-pipeline,skolsuper/django-pipeline,kronion/django-pipeline,beedesk/django-pipeline,sideffect0/django-pipeline,lexqt/django-pipeline,jazzband/django-pipeline,theatlantic/django-pipeline,chipx86/django-pipeline,perdona/django-pipeline,leonardoo/django-pipeline,sideffect0/django-pipeline,leonardoo/django-pipeline,sideffect0/django-pipeline,simudream/django-pipeline,theatlantic/django-pipeline,perdona/django-pipeline,leonardoo/django-pipeline,lexqt/django-pipeline,beedesk/django-pipeline,skolsuper/django-pipeline,lexqt/django-pipeline,simudream/django-pipeline,skolsuper/django-pipeline,jazzband/django-pipeline,botify-labs/django-pipeline,beedesk/django-pipeline,d9pouces/django-pipeline,d9pouces/django-pipeline,cyberdelia/django-pipeline,simudream/django-pipeline,botify-labs/django-pipeline,chipx86/django-pipeline,botify-labs/django-pipeline,theatlantic/django-pipeline,jazzband/django-pipeline,kronion/django-pipeline,d9pouces/django-pipeline
88f241b77438ae59912be6df75b66260a39c7c12
setup.py
setup.py
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name = "ucldc-iiif", version = "0.0.1", description = ("International Image Interoperability Framework (IIIF) implementation code for the UCLDC project"), long_description=read('README.md'), author='Barbara Hui', author_email='[email protected]', dependency_links=[ 'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux', 'https://github.com/barbarahui/nuxeo-calisphere/archive/master.zip#egg=UCLDC-Deep-Harvester' ], install_requires=[ 'boto', 'pynux', 'python-magic', 'UCLDC-Deep-Harvester' ], packages=['s3'], test_suite='tests' )
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name = "ucldc-iiif", version = "0.0.1", description = ("International Image Interoperability Framework (IIIF) implementation code for the UCLDC project"), long_description=read('README.md'), author='Barbara Hui', author_email='[email protected]', dependency_links=[ 'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux', 'https://github.com/barbarahui/nuxeo-calisphere/archive/master.zip#egg=UCLDC-Deep-Harvester' ], install_requires=[ 'boto', 'pynux', 'python-magic', 'UCLDC-Deep-Harvester' ], packages=['ucldc_iiif'], test_suite='tests' )
Change package name from 's3' to 'ucldc_iiif'.
Change package name from 's3' to 'ucldc_iiif'.
Python
bsd-3-clause
barbarahui/ucldc-iiif,mredar/ucldc-iiif,mredar/ucldc-iiif,barbarahui/ucldc-iiif
efacef78764f9b74d57adb3e092fdd8ac24939b3
setup.py
setup.py
from setuptools import setup, find_packages setup( name='panya', version='0.1.6', description='Panya base app.', long_description = open('README.rst', 'r').read() + open('AUTHORS.rst', 'r').read() + open('CHANGELOG.rst', 'r').read(), author='Praekelt Foundation', author_email='[email protected]', license='BSD', url='http://github.com/praekelt/panya', packages = find_packages(), dependency_links = [ 'http://dist.plone.org/thirdparty/', 'http://github.com/praekelt/django-photologue/tarball/2.6.praekelt#egg=django-photologue-2.6.praekelt', ], install_requires = [ 'PIL', 'django-category', 'django-photologue==2.6.praekelt', 'django-publisher', 'django-secretballot', ], include_package_data=True, classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: BSD License", "Development Status :: 4 - Beta", "Operating System :: OS Independent", "Framework :: Django", "Intended Audience :: Developers", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", ], zip_safe=False, )
from setuptools import setup, find_packages setup( name='panya', version='0.1.6', description='Panya base app.', long_description = open('README.rst', 'r').read() + open('AUTHORS.rst', 'r').read() + open('CHANGELOG.rst', 'r').read(), author='Praekelt Foundation', author_email='[email protected]', license='BSD', url='http://github.com/praekelt/panya', packages = find_packages(), dependency_links = [ 'http://dist.plone.org/thirdparty/', 'http://github.com/praekelt/django-photologue/tarball/2.6.praekelt#egg=django-photologue-2.6.praekelt', 'http://github.com/praekelt/django-photologue/tarball/2.7.praekelt#egg=django-photologue-2.7.praekelt', ], install_requires = [ 'PIL', 'django-category', 'django-photologue>=2.6.praekelt', 'django-publisher', 'django-secretballot', ], include_package_data=True, classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: BSD License", "Development Status :: 4 - Beta", "Operating System :: OS Independent", "Framework :: Django", "Intended Audience :: Developers", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", ], zip_safe=False, )
Allow use of newer django-photologue
Allow use of newer django-photologue
Python
bsd-3-clause
praekelt/panya
a8163b0da1da0c303f4b7427473360ddddf982e8
setup.py
setup.py
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md'), encoding='utf-8') as f: readme = f.read() setup( name='manuale', version='1.0.1.dev0', license='MIT', description="A fully manual Let's Encrypt/ACME client", long_description=readme, url='https://github.com/veeti/manuale', author="Veeti Paananen", author_email='[email protected]', classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT License', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3 :: Only', ], packages=['manuale'], install_requires=[ 'cryptography >= 1.0', 'requests', ], entry_points={ 'console_scripts': [ 'manuale = manuale.cli:main', ], }, )
import subprocess from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) readme = path.join(here, 'README.md') # Convert the README to reStructuredText for PyPI if pandoc is available. # Otherwise, just read it. try: readme = subprocess.check_output(['pandoc', '-f', 'markdown', '-t', 'rst', readme]).decode('utf-8') except: with open(readme, encoding='utf-8') as f: readme = f.read() setup( name='manuale', version='1.0.1.dev0', license='MIT', description="A fully manual Let's Encrypt/ACME client", long_description=readme, url='https://github.com/veeti/manuale', author="Veeti Paananen", author_email='[email protected]', classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT License', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3 :: Only', ], packages=['manuale'], install_requires=[ 'cryptography >= 1.0', 'requests', ], entry_points={ 'console_scripts': [ 'manuale = manuale.cli:main', ], }, )
Convert the README to rst if pandoc is installed
Convert the README to rst if pandoc is installed
Python
mit
veeti/manuale
a84102f0736105fb6fb257c1feddc40633d11fcb
setup.py
setup.py
from setuptools import setup from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md')) as f: jgo_long_description = f.read() setup( name='jgo', version='0.1.0', author='Philipp Hanslovsky, Curtis Rueden', author_email='[email protected]', description='Launch Java code from Python and the CLI, installation-free.', long_description=jgo_long_description, long_description_content_type='text/markdown', license='Public domain', url='https://github.com/scijava/jgo', packages=['jgo'], entry_points={ 'console_scripts': [ 'jgo=jgo.jgo:jgo_main' ] }, python_requires='>=3', )
from setuptools import setup from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md')) as f: jgo_long_description = f.read() setup( name='jgo', version='0.1.1.dev0', author='Philipp Hanslovsky, Curtis Rueden', author_email='[email protected]', description='Launch Java code from Python and the CLI, installation-free.', long_description=jgo_long_description, long_description_content_type='text/markdown', license='Public domain', url='https://github.com/scijava/jgo', packages=['jgo'], entry_points={ 'console_scripts': [ 'jgo=jgo.jgo:jgo_main' ] }, python_requires='>=3', )
Bump to next development cycle
Bump to next development cycle
Python
unlicense
ctrueden/jrun,ctrueden/jrun
001f9a3520daefdc64e16e7c29887d27e68d9f4b
setup.py
setup.py
from setuptools import setup, find_packages import sys, os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() version = '0.1' setup(name='nested_formset', version=version, description="", long_description=README, classifiers=[ 'License :: OSI Approved :: BSD License', ], keywords='', url='https://github.com/nyergler/nested-formset', license='BSD', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=True, install_requires=[ 'Django>=1.5', 'django-discover-runner', 'rebar', ], )
from setuptools import setup, find_packages import sys, os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() version = '0.1' setup(name='nested_formset', version=version, description="", long_description=README, classifiers=[ 'License :: OSI Approved :: BSD License', ], keywords='', url='https://github.com/nyergler/nested-formset', license='BSD', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, install_requires=[ 'Django>=1.5', 'django-discover-runner', 'rebar', ], )
Mark the package not zipsafe so test discovery finds directories.
Mark the package not zipsafe so test discovery finds directories.
Python
bsd-3-clause
nyergler/nested-formset
4a601336ee5fccfe2cb4ebf50bd7fdfe127f3a61
setup.py
setup.py
from setuptools import setup import io import os here = os.path.abspath(os.path.dirname(__file__)) def read(*filenames, **kwargs): encoding = kwargs.get('encoding', 'utf-8') sep = kwargs.get('sep', '\n') buf = [] for filename in filenames: with io.open(filename, encoding=encoding) as f: buf.append(f.read()) return sep.join(buf) long_description = read('README.md') setup( name='mongo-pool', version='0.4.2', url='http://github.com/ubervu/mongo-pool/', description='The tool that keeps all your mongos in one place', long_description=long_description, license='Apache Software License', author='UberVU', author_email="[email protected]", install_requires=['pymongo>=3.0.3'], packages=['mongo_pool'], include_package_data=True, platforms='any', test_suite='nose.collector', tests_require=['nose', 'mock'], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Database', 'Topic :: Software Development :: Libraries :: Python Modules', ], extras_require={ 'testing': ['nose'], } )
from setuptools import setup import io import os here = os.path.abspath(os.path.dirname(__file__)) def read(*filenames, **kwargs): encoding = kwargs.get('encoding', 'utf-8') sep = kwargs.get('sep', '\n') buf = [] for filename in filenames: with io.open(filename, encoding=encoding) as f: buf.append(f.read()) return sep.join(buf) long_description = read('README.md') setup( name='mongo-pool', version='0.5.0', url='http://github.com/ubervu/mongo-pool/', description='The tool that keeps all your mongos in one place', long_description=long_description, license='Apache Software License', author='UberVU', author_email="[email protected]", install_requires=['pymongo>=3.6.1', 'six>=1.15.0'], packages=['mongo_pool'], include_package_data=True, platforms='any', test_suite='nose.collector', tests_require=['nose', 'mock'], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Database', 'Topic :: Software Development :: Libraries :: Python Modules', ], extras_require={ 'testing': ['nose', 'mock'], } )
Update deps and bump version. ANL-10319
Update deps and bump version. ANL-10319
Python
apache-2.0
uberVU/mongo-pool,uberVU/mongo-pool
758c80b543bfe095718082673901533c2603e69f
setup.py
setup.py
#!/usr/bin/env python """Setup script for The Coverage Space CLI.""" import setuptools from coveragespace import __project__, __version__, CLI try: README = open("README.rst").read() CHANGES = open("CHANGES.rst").read() except IOError: DESCRIPTION = "<placeholder>" else: DESCRIPTION = README + '\n' + CHANGES setuptools.setup( name=__project__, version=__version__, description="Command-line client for The Coverage Space.", url='https://github.com/jacebrowning/coverage-space-cli', author='Jace Browning', author_email='[email protected]', packages=setuptools.find_packages(), entry_points={'console_scripts': [ CLI + ' = coveragespace.cli:main', ]}, long_description=(DESCRIPTION), license='MIT', classifiers=[ # TODO: update this list to match your application: https://pypi.python.org/pypi?%3Aaction=list_classifiers 'Development Status :: 1 - Planning', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ], install_requires=open("requirements.txt").readlines(), )
#!/usr/bin/env python """Setup script for The Coverage Space CLI.""" import setuptools from coveragespace import __project__, __version__, CLI try: README = open("README.rst").read() CHANGES = open("CHANGES.rst").read() except IOError: DESCRIPTION = "<placeholder>" else: DESCRIPTION = README + '\n' + CHANGES setuptools.setup( name=__project__, version=__version__, description="A place to track your code coverage metrics.", url='https://github.com/jacebrowning/coverage-space-cli', author='Jace Browning', author_email='[email protected]', packages=setuptools.find_packages(), entry_points={'console_scripts': [ CLI + ' = coveragespace.cli:main', ]}, long_description=(DESCRIPTION), license='MIT', classifiers=[ # TODO: update this list to match your application: https://pypi.python.org/pypi?%3Aaction=list_classifiers 'Development Status :: 1 - Planning', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ], install_requires=open("requirements.txt").readlines(), )
Use the same headline as the API
Use the same headline as the API
Python
mit
jacebrowning/coverage-space-cli
e2cdf1be3a9f1e9eb501332a4f2358f037dea0bd
setup.py
setup.py
from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='crane', version='0.1.0', description="A simple tool for building Dockerfiles", author='Victor Lin', author_email='[email protected]', keywords='docker dockerfile build', url='http://github.com/victorlin/crane', license='Apache 2.0', packages=find_packages(), install_requires=[ 'jinja2', 'click', ], entry_points={ 'console_scripts': ['crane = crane.commands:build'] }, )
from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='docker-crane', version='0.1.0', description="A simple tool for building Dockerfiles", author='Victor Lin', author_email='[email protected]', keywords='docker dockerfile build', url='http://github.com/victorlin/crane', license='Apache 2.0', packages=find_packages(), install_requires=[ 'jinja2', 'click', ], entry_points={ 'console_scripts': ['crane = crane.commands:build'] }, )
Use docker-crane for pypi name, since somebody already took crane
Use docker-crane for pypi name, since somebody already took crane
Python
apache-2.0
victorlin/crane
dcae89428a6d1e1f003fe029f8220a0b382ec2c9
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup(packages=find_packages())
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='debian-devel-changes-bot', packages=find_packages())
Use a name= kwarg to avoid UNKNOWN.
Use a name= kwarg to avoid UNKNOWN. Signed-off-by: Chris Lamb <[email protected]>
Python
agpl-3.0
xtaran/debian-devel-changes-bot,lamby/debian-devel-changes-bot,lamby/debian-devel-changes-bot,lamby/debian-devel-changes-bot,sebastinas/debian-devel-changes-bot,xtaran/debian-devel-changes-bot
64c4c3329f25ed4ee565ce8cbd2db1b3141605b2
setup.py
setup.py
import sys import setuptools py26_reqs = ['argparse', 'importlib'] if sys.version_info < (2,7) else [] setuptools.setup( name='librarypaste', use_hg_version=dict(increment='0.1'), author='Jamie Turner', author_email='[email protected]', url='http://bitbucket.org/chmullig/librarypaste/', description='Simple pastebin', long_description='Simple pastebin', license='MIT', packages=['librarypaste'], package_dir={'librarypaste': 'librarypaste'}, include_package_data=True, entry_points={ 'console_scripts': [ 'librarypaste=librarypaste.librarypaste:main', ], }, install_requires=[ 'pygments', 'Mako', 'cherrypy', 'PyYAML', ] + py26_reqs, setup_requires=[ 'hgtools', ], zip_safe=False, )
import sys import setuptools py26_reqs = ['argparse', 'importlib'] if sys.version_info < (2,7) else [] setuptools.setup( name='librarypaste', use_hg_version=dict(increment='0.1'), author='Jamie Turner', author_email='[email protected]', url='http://bitbucket.org/chmullig/librarypaste/', description='Simple pastebin', long_description='Simple pastebin', license='MIT', packages=['librarypaste'], package_dir={'librarypaste': 'librarypaste'}, include_package_data=True, entry_points={ 'console_scripts': [ 'librarypaste=librarypaste.librarypaste:main', ], }, install_requires=[ 'pygments', 'Mako', 'cherrypy', 'PyYAML', ] + py26_reqs, setup_requires=[ 'hgtools', 'pytest-runner', ], tests_require=[ 'pytest', ], zip_safe=False, )
Configure to run tests under pytest runner
Configure to run tests under pytest runner
Python
mit
yougov/librarypaste,yougov/librarypaste
6bfcfaffcb1695f142c11b6864951f9471e52d60
setup.py
setup.py
#!/usr/bin/env python """Setup file and install script SciLife python scripts. """ from setuptools import setup, find_packages try: with open("requirements.txt", "r") as f: install_requires = [x.strip() for x in f.readlines()] except IOError: install_requires = [] setup(name="status", author="Science For Life Laboratory", author_email="[email protected]", description="Webapp for keeping track of metadata status at SciLifeLab", license="MIT", scripts=["status_app.py"], install_requires=install_requires, packages=find_packages() )
#!/usr/bin/env python """Setup file and install script SciLife python scripts. """ from setuptools import setup, find_packages try: with open("requirements.txt", "r") as f: install_requires = [x.strip() for x in f.readlines()] except IOError: install_requires = [] setup(name="status", author="Science For Life Laboratory", author_email="[email protected]", description="Webapp for keeping track of metadata status at SciLifeLab", license="MIT", scripts=["status_app.py", "scripts/update_suggestion_box"], install_requires=install_requires, packages=find_packages() )
Add suggestion box script to PATH
Add suggestion box script to PATH
Python
mit
remiolsen/status,remiolsen/status,ewels/genomics-status,ewels/genomics-status,SciLifeLab/genomics-status,SciLifeLab/genomics-status,Galithil/status,Galithil/status,remiolsen/status,ewels/genomics-status,Galithil/status,kate-v-stepanova/genomics-status,kate-v-stepanova/genomics-status,kate-v-stepanova/genomics-status,SciLifeLab/genomics-status
db76777575162aab69aec9429455f2e7d841a605
lambdas/dynamo_to_sns/dynamo_to_sns.py
lambdas/dynamo_to_sns/dynamo_to_sns.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ """ import json import os from sns_utils import publish_sns_message def main(event, _): print(f'Received event:\n{event}') stream_topic_map = json.loads(os.environ["STREAM_TOPIC_MAP"]) new_image = event['Records'][0]['dynamodb']['NewImage'] topic_arn = stream_topic_map[event['Records'][0]['eventSourceARN']] publish_sns_message(topic_arn,new_image)
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ """ import os from sns_utils import publish_sns_message def main(event, _): print(f'Received event:\n{event}') stream_topic_map = os.environ["STREAM_TOPIC_MAP"] new_image = event['Records'][0]['dynamodb']['NewImage'] topic_arn = stream_topic_map[event['Records'][0]['eventSourceARN']] publish_sns_message(topic_arn,new_image)
Fix loading of map from environment variables
Fix loading of map from environment variables
Python
mit
wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api
4bc1810f6f04a639726f68b06273722b5fc6e87f
setup.py
setup.py
try: from setuptools import setup except ImportError: from distutils.core import setup setup( name='pandas-profiling', version='0.1.0', author='Jos Polfliet', author_email='[email protected]', packages=['pandas_profiling'], url='http://github.com/jospolfliet/pandas-profiling', license='LICENSE', description='Generate profile report for pandas DataFrame', long_description=open('README.md').read(), install_requires=[ "pandas", "matplotlib" ], )
try: from setuptools import setup except ImportError: from distutils.core import setup setup( name='pandas-profiling', version='0.1.0', author='Jos Polfliet', author_email='[email protected]', packages=['pandas_profiling'], url='http://github.com/jospolfliet/pandas-profiling', license='LICENSE', description='Generate profile report for pandas DataFrame', long_description=open('README.md').read(), install_requires=[ "pandas", "matplotlib" ], include_package_data = True, package_data={'pandas_profiling': ['pandas_profiling.mplstyle']}, )
Add *.mplstyle as package data
Add *.mplstyle as package data
Python
mit
JosPolfliet/pandas-profiling,JosPolfliet/pandas-profiling
8e7eb5dec20ee75d34b566341af3c22b57503dcb
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup setup( name="setquery", version="0.1", description="Set arithmetic evaluator", author="Paul Scott", author_email="[email protected]", url="https://github.com/icio/setquery", download_url="https://github.com/icio/setquery/tarball/0.1", setup_requires=["nose", "rednose"], py_modules=["setquery"], license="MIT", keywords=['set', 'expression', 'eval', 'evaluate'], classifiers=[], )
#!/usr/bin/env python from setuptools import setup setup( name="setquery", version="0.1", description="Set arithmetic evaluator", author="Paul Scott", author_email="[email protected]", url="https://github.com/icio/setquery", download_url="https://github.com/icio/setquery/tarball/0.1", setup_requires=["nose", "rednose"], py_modules=["setquery", "test_setquery"], license="MIT", keywords=['set', 'expression', 'eval', 'evaluate'], classifiers=[], )
Include test_setquery module in distribution
Include test_setquery module in distribution
Python
mit
icio/evil
c1ce60a964a1ef46b7d971fe91f007f3cf94d558
setup.py
setup.py
#!/usr/bin/env python3 # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup setup( name='autoprop', version='0.0.0', author='Kale Kundert', author_email='[email protected]', long_description=open('README.rst').read(), url='https://github.com/kalekundert/autoprop', license='MIT', py_modules=[ 'autoprop', ], keywords=[ 'property', 'properties', 'accessor', 'accessors', 'getter', 'setter' ], classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries', ], )
#!/usr/bin/env python3 # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup setup( name='autoprop', version='0.0.0', author='Kale Kundert', author_email='[email protected]', long_description=open('README.rst').read(), url='https://github.com/kalekundert/autoprop', license='MIT', py_modules=[ 'autoprop', ], keywords=[ 'property', 'properties', 'accessor', 'accessors', 'getter', 'setter' ], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 3.3', 'Topic :: Software Development :: Libraries', ], )
Upgrade the development status to beta.
Upgrade the development status to beta.
Python
mit
kalekundert/autoprop
270c9e61646f4fe45e01b06e45dde15ea0856106
setup.py
setup.py
from distutils.core import setup version = __import__('shopify_auth').__version__ setup( name = 'django-shopify-auth', version = version, description = 'An simple package for adding Shopify authentication to Django apps.', long_description = open('README.md').read(), author = 'Gavin Ballard', author_email = '[email protected]', url = 'https://github.com/discolabs/django-shopify-auth', license = 'MIT', packages = [ 'shopify_auth' ], package_dir = { 'shopify_auth': 'shopify_auth', }, requires = [ 'django', 'shopify', ], install_requires = [ 'django', ], zip_safe = True, classifiers = [], )
from distutils.core import setup version = __import__('shopify_auth').__version__ setup( name = 'django-shopify-auth', version = version, description = 'An simple package for adding Shopify authentication to Django apps.', long_description = open('README.md').read(), author = 'Gavin Ballard', author_email = '[email protected]', url = 'https://github.com/discolabs/django-shopify-auth', license = 'MIT', packages = [ 'shopify_auth' ], package_dir = { 'shopify_auth': 'shopify_auth', }, requires = [ 'django', 'shopify', ], install_requires = [ 'django', 'shopify', ], zip_safe = True, classifiers = [], )
Add the ShopifyAPI package as a dependency.
Add the ShopifyAPI package as a dependency.
Python
mit
discolabs/django-shopify-auth,funkybob/django-shopify-auth,discolabs/django-shopify-auth,RafaAguilar/django-shopify-auth,RafaAguilar/django-shopify-auth,funkybob/django-shopify-auth
fbd1407608505a1107042c14b8fc5cc6017d9e78
setup.py
setup.py
from setuptools import setup from os import path with open(path.join(path.abspath(path.dirname(__file__)), 'README.rst')) as f: readme = f.read() setup( name='ghstats', version='1.2.0', packages=['ghstats'], description='GitHub Release download count and other statistics.', long_description=readme, author='Alexander Gorishnyak', author_email='[email protected]', license='MIT', url='https://github.com/kefir500/ghstats', keywords='github release download count stats statistics', entry_points={ 'console_scripts': [ 'ghstats = ghstats.ghstats:main_cli' ] }, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Utilities' ] )
from setuptools import setup from os import path with open(path.join(path.abspath(path.dirname(__file__)), 'README.rst')) as f: readme = f.read() setup( name='ghstats', version='1.2.0', packages=['ghstats'], description='GitHub Release download count and other statistics.', long_description=readme, author='Alexander Gorishnyak', author_email='[email protected]', license='MIT', url='https://github.com/kefir500/ghstats', keywords='github release download count stats statistics', entry_points={ 'console_scripts': [ 'ghstats = ghstats.ghstats:main_cli' ] }, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Topic :: Utilities' ] )
Add Python 3.7 to the list of supported versions
Add Python 3.7 to the list of supported versions
Python
mit
kefir500/ghstats
644a25e2b61bec8847af2f6d64b9b41b8798092d
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages VERSION = '0.4.2' def readme(): with open('README.rst') as f: return f.read() setup( name='django-backupdb', version=VERSION, description='Management commands for backing up and restoring databases in Django.', long_description=readme(), author='Fusionbox programmers', author_email='[email protected]', keywords='django database backup', url='https://github.com/fusionbox/django-backupdb', packages=find_packages(exclude=('tests',)), platforms='any', license='BSD', test_suite='nose.collector', setup_requires=[ 'nose==1.2.1', 'mock==1.0.1', ], tests_require=[ 'nose==1.2.1', 'mock==1.0.1', ], install_requires=[ 'django>=1.3', ], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', ], )
#!/usr/bin/env python from setuptools import setup, find_packages VERSION = '0.4.2' def readme(): with open('README.rst') as f: return f.read() setup( name='django-backupdb', version=VERSION, description='Management commands for backing up and restoring databases in Django.', long_description=readme(), author='Fusionbox programmers', author_email='[email protected]', keywords='django database backup', url='https://github.com/fusionbox/django-backupdb', packages=find_packages(exclude=('tests',)), platforms='any', license='BSD', test_suite='nose.collector', setup_requires=[ 'nose==1.2.1', 'mock==1.0.1', 'coverage==3.6', ], tests_require=[ 'nose==1.2.1', 'mock==1.0.1', 'coverage==3.6', ], install_requires=[ 'django>=1.3', ], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', ], )
Add coverage as a testing requirement
Add coverage as a testing requirement
Python
bsd-2-clause
fusionbox/django-backupdb
2adfcea14f292bacfbae906a70d6395304acf607
addons/bestja_volunteer_pesel/models.py
addons/bestja_volunteer_pesel/models.py
# -*- coding: utf-8 -*- from operator import mul from openerp import models, fields, api, exceptions class Volunteer(models.Model): _inherit = 'res.users' pesel = fields.Char(string=u"PESEL") def __init__(self, pool, cr): super(Volunteer, self).__init__(pool, cr) self._add_permitted_fields(level='owner', fields={'pesel'}) @api.one @api.constrains('pesel') def _check_pesel(self): if not self.pesel: return try: digits = map(int, self.pesel) except ValueError: raise exceptions.ValidationError("Numer PESEL może składać się wyłącznie z cyfr!") weights = (1, 3, 7, 9, 1, 3, 7, 9, 1, 3) control_sum = -(sum(map(mul, digits[:-1], weights))) % 10 if len(digits) != 11 or control_sum != digits[-1]: raise exceptions.ValidationError("Niepoprawny numer PESEL.")
# -*- coding: utf-8 -*- from operator import mul from openerp import models, fields, api, exceptions class Volunteer(models.Model): _inherit = 'res.users' pesel = fields.Char(string=u"PESEL") def __init__(self, pool, cr): super(Volunteer, self).__init__(pool, cr) self._add_permitted_fields(level='owner', fields={'pesel'}) @api.one @api.constrains('pesel') def _check_pesel(self): if not self.pesel: return try: digits = map(int, self.pesel) except ValueError: raise exceptions.ValidationError("Numer PESEL może składać się wyłącznie z cyfr!") if len(digits) != 11: raise exceptions.ValidationError("Numer PESEL musi składać się z 11 cyfr!") weights = (1, 3, 7, 9, 1, 3, 7, 9, 1, 3) control_sum = -(sum(map(mul, digits[:-1], weights))) % 10 if control_sum != digits[-1]: raise exceptions.ValidationError("Niepoprawny numer PESEL.")
Fix a problem with PESEL validation
Fix a problem with PESEL validation
Python
agpl-3.0
KrzysiekJ/bestja,ludwiktrammer/bestja,EE/bestja,ludwiktrammer/bestja,EE/bestja,EE/bestja,KrzysiekJ/bestja,ludwiktrammer/bestja,KrzysiekJ/bestja
f6b818222d8e6eb9bb6ad3a0d8ab55513eb90673
gui/driver.py
gui/driver.py
from __future__ import print_function, division from sys import argv, stderr def run_gui(): '''Start the event loop to calucate spectra interactively''' # Import Qt functions. Do so here to handle errors better try: from PyQt4.QtGui import QApplication except ImportError: print("Cannot find PyQt4", file=stderr) print("You must install this to run the GUI", file=stderr) return 1 # For good measure, try to find PyQwt5 now as a check try: import PyQt4.Qwt5 except ImportError: print("Cannot find PyQwt5", file=stderr) print("You must install this to run the GUI", file=stderr) return 1 from mainwindow import MainWindow # The actual event loop app = QApplication(argv) window = MainWindow() window.show() return app.exec_()
from __future__ import print_function, division from sys import argv, stderr def run_gui(): '''Start the event loop to calucate spectra interactively''' # Import Qt functions. Do so here to handle errors better try: from PyQt4.QtGui import QApplication except ImportError: print("Cannot find PyQt4", file=stderr) print("You must install this to run the GUI", file=stderr) return 1 # For good measure, try to find PyQwt5 now as a check try: import PyQt4.Qwt5 except ImportError: print("Cannot find PyQwt5", file=stderr) print("You must install this to run the GUI", file=stderr) return 1 from mainwindow import MainWindow # The actual event loop app = QApplication(argv) window = MainWindow() window.show() window.raise_() return app.exec_()
Raise window to focus on Mac
Raise window to focus on Mac
Python
mit
jensengrouppsu/rapid,jensengrouppsu/rapid
f8e800219ac2c2c76bb5ac10b2dfdac038edbb5d
circuits/tools/__init__.py
circuits/tools/__init__.py
# Module: __init__ # Date: 8th November 2008 # Author: James Mills, prologic at shortcircuit dot net dot au """Circuits Tools circuits.tools contains a standard set of tools for circuits. These tools are installed as executables with a prefix of "circuits." """ try: from cStringIO import StringIO except ImportError: from StringIO import StringIO def graph(x): s = StringIO() d = 0 i = 0 done = False stack = [] visited = set() children = list(x.components) while not done: if x not in visited: if d: s.write("%s%s\n" % (" " * d, "|")) s.write("%s%s%s\n" % (" " * d, "|-", x)) else: s.write(" .%s\n" % x) if x.components: d += 1 visited.add(x) if i < len(children): x = children[i] i += 1 if x.components: stack.append((i, d, children)) children = list(x.components) i = 0 else: if stack: i, d, children = stack.pop() else: done = True return s.getvalue()
# Module: __init__ # Date: 8th November 2008 # Author: James Mills, prologic at shortcircuit dot net dot au """Circuits Tools circuits.tools contains a standard set of tools for circuits. These tools are installed as executables with a prefix of "circuits." """ def graph(x): s = [] d = 0 i = 0 done = False stack = [] visited = set() children = list(x.components) while not done: if x not in visited: if d: s.append("%s%s\n" % (" " * d, "|")) s.append("%s%s%s\n" % (" " * d, "|-", x)) else: s.append(" .%s\n" % x) if x.components: d += 1 visited.add(x) if i < len(children): x = children[i] i += 1 if x.components: stack.append((i, d, children)) children = list(x.components) i = 0 else: if stack: i, d, children = stack.pop() else: done = True return "".join(s)
Remove StringIO import. Use a simple list to build up the output and return .join(s)
tools: Remove StringIO import. Use a simple list to build up the output and return .join(s)
Python
mit
treemo/circuits,eriol/circuits,eriol/circuits,treemo/circuits,treemo/circuits,nizox/circuits,eriol/circuits
ec24e051e9d10b4cb24d135a3c08e9e9f87c6b8c
social/apps/django_app/utils.py
social/apps/django_app/utils.py
from functools import wraps from django.conf import settings from django.core.urlresolvers import reverse from social.utils import setting_name, module_member from social.strategies.utils import get_strategy BACKENDS = settings.AUTHENTICATION_BACKENDS STRATEGY = getattr(settings, setting_name('STRATEGY'), 'social.strategies.django_strategy.DjangoStrategy') STORAGE = getattr(settings, setting_name('STORAGE'), 'social.apps.django_app.default.models.DjangoStorage') Strategy = module_member(STRATEGY) Storage = module_member(STORAGE) def load_strategy(*args, **kwargs): return get_strategy(BACKENDS, STRATEGY, STORAGE, *args, **kwargs) def strategy(redirect_uri=None): def decorator(func): @wraps(func) def wrapper(request, backend, *args, **kwargs): uri = redirect_uri if uri and not uri.startswith('/'): uri = reverse(redirect_uri, args=(backend,)) request.strategy = load_strategy(request=request, backend=backend, redirect_uri=uri, *args, **kwargs) return func(request, backend, *args, **kwargs) return wrapper return decorator def setting(name, default=None): try: return getattr(settings, setting_name(name)) except AttributeError: return getattr(settings, name, default) class BackendWrapper(object): def get_user(self, user_id): return Strategy(storage=Storage).get_user(user_id)
from functools import wraps from django.conf import settings from django.core.urlresolvers import reverse from social.utils import setting_name, module_member from social.strategies.utils import get_strategy BACKENDS = settings.AUTHENTICATION_BACKENDS STRATEGY = getattr(settings, setting_name('STRATEGY'), 'social.strategies.django_strategy.DjangoStrategy') STORAGE = getattr(settings, setting_name('STORAGE'), 'social.apps.django_app.default.models.DjangoStorage') Strategy = module_member(STRATEGY) Storage = module_member(STORAGE) def load_strategy(*args, **kwargs): return get_strategy(BACKENDS, STRATEGY, STORAGE, *args, **kwargs) def strategy(redirect_uri=None, load_strategy=load_strategy): def decorator(func): @wraps(func) def wrapper(request, backend, *args, **kwargs): uri = redirect_uri if uri and not uri.startswith('/'): uri = reverse(redirect_uri, args=(backend,)) request.strategy = load_strategy(request=request, backend=backend, redirect_uri=uri, *args, **kwargs) return func(request, backend, *args, **kwargs) return wrapper return decorator def setting(name, default=None): try: return getattr(settings, setting_name(name)) except AttributeError: return getattr(settings, name, default) class BackendWrapper(object): def get_user(self, user_id): return Strategy(storage=Storage).get_user(user_id)
Allow to override strategy getter
Allow to override strategy getter
Python
bsd-3-clause
fearlessspider/python-social-auth,MSOpenTech/python-social-auth,clef/python-social-auth,JJediny/python-social-auth,firstjob/python-social-auth,muhammad-ammar/python-social-auth,henocdz/python-social-auth,ariestiyansyah/python-social-auth,python-social-auth/social-app-django,falcon1kr/python-social-auth,lamby/python-social-auth,joelstanner/python-social-auth,rsteca/python-social-auth,falcon1kr/python-social-auth,lneoe/python-social-auth,wildtetris/python-social-auth,mchdks/python-social-auth,ononeor12/python-social-auth,frankier/python-social-auth,michael-borisov/python-social-auth,ariestiyansyah/python-social-auth,jameslittle/python-social-auth,mark-adams/python-social-auth,wildtetris/python-social-auth,garrett-schlesinger/python-social-auth,jameslittle/python-social-auth,lamby/python-social-auth,jeyraof/python-social-auth,rsalmaso/python-social-auth,bjorand/python-social-auth,Andygmb/python-social-auth,mark-adams/python-social-auth,VishvajitP/python-social-auth,fearlessspider/python-social-auth,JerzySpendel/python-social-auth,garrett-schlesinger/python-social-auth,mathspace/python-social-auth,rsteca/python-social-auth,nirmalvp/python-social-auth,python-social-auth/social-core,henocdz/python-social-auth,lneoe/python-social-auth,S01780/python-social-auth,jneves/python-social-auth,barseghyanartur/python-social-auth,tobias47n9e/social-core,bjorand/python-social-auth,wildtetris/python-social-auth,msampathkumar/python-social-auth,bjorand/python-social-auth,yprez/python-social-auth,lawrence34/python-social-auth,daniula/python-social-auth,jeyraof/python-social-auth,JJediny/python-social-auth,Andygmb/python-social-auth,hsr-ba-fs15-dat/python-social-auth,MSOpenTech/python-social-auth,DhiaEddineSaidi/python-social-auth,hsr-ba-fs15-dat/python-social-auth,tutumcloud/python-social-auth,chandolia/python-social-auth,jameslittle/python-social-auth,noodle-learns-programming/python-social-auth,imsparsh/python-social-auth,mark-adams/python-social-auth,Andygmb/python-social-auth,lawrence34/python-social-auth,barseghyanartur/python-social-auth,daniula/python-social-auth,jeyraof/python-social-auth,falcon1kr/python-social-auth,tkajtoch/python-social-auth,mathspace/python-social-auth,contracode/python-social-auth,lawrence34/python-social-auth,mathspace/python-social-auth,ononeor12/python-social-auth,robbiet480/python-social-auth,iruga090/python-social-auth,fearlessspider/python-social-auth,webjunkie/python-social-auth,clef/python-social-auth,mrwags/python-social-auth,chandolia/python-social-auth,rsteca/python-social-auth,muhammad-ammar/python-social-auth,jneves/python-social-auth,SeanHayes/python-social-auth,S01780/python-social-auth,webjunkie/python-social-auth,ByteInternet/python-social-auth,nvbn/python-social-auth,ononeor12/python-social-auth,S01780/python-social-auth,merutak/python-social-auth,ByteInternet/python-social-auth,noodle-learns-programming/python-social-auth,JerzySpendel/python-social-auth,cmichal/python-social-auth,mchdks/python-social-auth,drxos/python-social-auth,JerzySpendel/python-social-auth,cmichal/python-social-auth,joelstanner/python-social-auth,python-social-auth/social-app-cherrypy,alrusdi/python-social-auth,mrwags/python-social-auth,python-social-auth/social-storage-sqlalchemy,cjltsod/python-social-auth,cjltsod/python-social-auth,degs098/python-social-auth,python-social-auth/social-app-django,contracode/python-social-auth,DhiaEddineSaidi/python-social-auth,imsparsh/python-social-auth,clef/python-social-auth,firstjob/python-social-auth,degs098/python-social-auth,michael-borisov/python-social-auth,lneoe/python-social-auth,nvbn/python-social-auth,drxos/python-social-auth,san-mate/python-social-auth,msampathkumar/python-social-auth,nirmalvp/python-social-auth,rsalmaso/python-social-auth,iruga090/python-social-auth,tkajtoch/python-social-auth,tutumcloud/python-social-auth,python-social-auth/social-core,degs098/python-social-auth,VishvajitP/python-social-auth,mrwags/python-social-auth,michael-borisov/python-social-auth,robbiet480/python-social-auth,henocdz/python-social-auth,barseghyanartur/python-social-auth,hsr-ba-fs15-dat/python-social-auth,ariestiyansyah/python-social-auth,frankier/python-social-auth,joelstanner/python-social-auth,MSOpenTech/python-social-auth,yprez/python-social-auth,yprez/python-social-auth,muhammad-ammar/python-social-auth,alrusdi/python-social-auth,VishvajitP/python-social-auth,webjunkie/python-social-auth,cmichal/python-social-auth,jneves/python-social-auth,tkajtoch/python-social-auth,JJediny/python-social-auth,nirmalvp/python-social-auth,noodle-learns-programming/python-social-auth,lamby/python-social-auth,iruga090/python-social-auth,alrusdi/python-social-auth,merutak/python-social-auth,mchdks/python-social-auth,SeanHayes/python-social-auth,drxos/python-social-auth,ByteInternet/python-social-auth,msampathkumar/python-social-auth,contracode/python-social-auth,daniula/python-social-auth,python-social-auth/social-docs,firstjob/python-social-auth,duoduo369/python-social-auth,san-mate/python-social-auth,robbiet480/python-social-auth,python-social-auth/social-app-django,imsparsh/python-social-auth,merutak/python-social-auth,duoduo369/python-social-auth,DhiaEddineSaidi/python-social-auth,chandolia/python-social-auth,san-mate/python-social-auth
04f7f28ef3123452d8eb06ab1f3cbfa6dded8be4
go_metrics/metrics/tests/test_dummy.py
go_metrics/metrics/tests/test_dummy.py
from twisted.trial.unittest import TestCase from go_metrics.metrics.dummy import Fixtures, DummyMetrics, DummyBackend DummyBackend, DummyMetrics class TestFixtures(TestCase): def test_add(self): fixtures = Fixtures() fixtures.add(foo='bar', result={'baz': 'quux'}) self.assertEqual(fixtures.items, [{ 'foo': 'bar', 'result': {'baz': 'quux'} }]) def test_add_no_result(self): fixtures = Fixtures() fixtures.add(foo='bar') self.assertEqual(fixtures.items, [{ 'foo': 'bar', 'result': {} }]) def test_match(self): fixtures = Fixtures() fixtures.add(foo='bar', result={'baz': 'quux'}) fixtures.add(corge='grault', result={'garply': 'waldo'}) self.assertEqual(fixtures.match(foo='bar'), {'baz': 'quux'}) self.assertEqual(fixtures.match(corge='grault'), {'garply': 'waldo'}) self.assertEqual(fixtures.match(fred='xzyy'), {}) class TestDummyMetrics(TestCase): def test_get(self): backend = DummyBackend() metrics = DummyMetrics(backend, 'owner-1') backend.fixtures.add(foo='bar', result={'baz': 'quux'}) self.assertEqual(metrics.get(foo='bar'), {'baz': 'quux'}) class TestDummyBackend(TestCase): pass
from twisted.trial.unittest import TestCase from go_metrics.metrics.dummy import Fixtures, DummyMetrics, DummyBackend class TestFixtures(TestCase): def test_add(self): fixtures = Fixtures() fixtures.add(foo='bar', result={'baz': 'quux'}) self.assertEqual(fixtures.items, [{ 'foo': 'bar', 'result': {'baz': 'quux'} }]) def test_add_no_result(self): fixtures = Fixtures() fixtures.add(foo='bar') self.assertEqual(fixtures.items, [{ 'foo': 'bar', 'result': {} }]) def test_match(self): fixtures = Fixtures() fixtures.add(foo='bar', result={'baz': 'quux'}) fixtures.add(corge='grault', result={'garply': 'waldo'}) self.assertEqual(fixtures.match(foo='bar'), {'baz': 'quux'}) self.assertEqual(fixtures.match(corge='grault'), {'garply': 'waldo'}) self.assertEqual(fixtures.match(fred='xzyy'), {}) class TestDummyMetrics(TestCase): def test_get(self): backend = DummyBackend() metrics = DummyMetrics(backend, 'owner-1') backend.fixtures.add(foo='bar', result={'baz': 'quux'}) self.assertEqual(metrics.get(foo='bar'), {'baz': 'quux'}) class TestDummyBackend(TestCase): pass
Remove no longer needed references for keeping pep8 happy
Remove no longer needed references for keeping pep8 happy
Python
bsd-3-clause
praekelt/go-metrics-api,praekelt/go-metrics-api
823e767f52bc6e3bf78a91950e9407a1acf811d2
tests/test_server.py
tests/test_server.py
import os import unittest import tempfile # Local modules import library.server as server class ServerTestCase(unittest.TestCase): @classmethod def setUp(self): self.db_fd, server.app.config['DATABASE'] = tempfile.mkstemp() server.app.config['TESTING'] = True self.app = server.app.test_client() with server.app.app_context(): server.init_db() @classmethod def tearDown(self): os.close(self.db_fd) os.unlink(server.app.config['DATABASE']) def test_root(self): rv = self.app.get('/') self.assertEqual(rv.status_code, 200) def test_book_post(self): rv = self.app.put('/books', data={'isbn': 1234}) self.assertEqual(rv.status_code, 200) rv = self.app.get('/books') self.assertEqual(rv.data, '1234') rv = self.app.put('/books', data={'isbn': 5678}) self.assertEqual(rv.status_code, 200) rv = self.app.get('/books') self.assertEqual(rv.data, '5678 1234') def test_book_get(self): rv = self.app.get('/books') self.assertEqual(rv.status_code, 200) if __name__ == '__main__': unittest.main()
import os import unittest import tempfile # Local modules import library.server as server class ServerTestCase(unittest.TestCase): @classmethod def setUp(self): self.db_fd, server.app.config['DATABASE'] = tempfile.mkstemp() server.app.config['TESTING'] = True self.app = server.app.test_client() with server.app.app_context(): server.init_db() @classmethod def tearDown(self): os.close(self.db_fd) os.unlink(server.app.config['DATABASE']) class RootTestCase(ServerTestCase): def test_root(self): rv = self.app.get('/') self.assertEqual(rv.status_code, 200) class BookTestCase(ServerTestCase): def test_book_post(self): rv = self.app.put('/books', data={'isbn': 1234}) self.assertEqual(rv.status_code, 200) rv = self.app.get('/books') self.assertEqual(rv.data, '1234') rv = self.app.put('/books', data={'isbn': 5678}) self.assertEqual(rv.status_code, 200) rv = self.app.get('/books') self.assertEqual(rv.data, '5678 1234') def test_book_get(self): rv = self.app.get('/books') self.assertEqual(rv.status_code, 200) if __name__ == '__main__': unittest.main()
Refactor test case into two classes
Refactor test case into two classes
Python
mit
HoldYourBreath/Library,HoldYourBreath/Library,HoldYourBreath/Library,HoldYourBreath/Library
a92397bb2218f174a2df0b5090dd31bde2164561
tg/error.py
tg/error.py
import logging from paste.deploy.converters import asbool log = logging.getLogger(__name__) def _turbogears_backlash_context(environ): tgl = environ.get('tg.locals') return {'request':getattr(tgl, 'request', None)} def ErrorHandler(app, global_conf, **errorware): """ErrorHandler Toggle If debug is enabled, this function will return the app wrapped in the WebError ``EvalException`` middleware which displays interactive debugging sessions when a traceback occurs. Otherwise, the app will be wrapped in the WebError ``ErrorMiddleware``, and the ``errorware`` dict will be passed into it. The ``ErrorMiddleware`` handles sending an email to the address listed in the .ini file, under ``email_to``. """ try: import backlash except ImportError: #pragma: no cover log.warn('backlash not installed, debug mode won\'t be available') return app if asbool(global_conf.get('debug')): app = backlash.DebuggedApplication(app, context_injectors=[_turbogears_backlash_context]) return app def ErrorReporter(app, global_conf, **errorware): try: import backlash except ImportError: #pragma: no cover log.warn('backlash not installed, email tracebacks won\'t be available') return app from backlash.trace_errors import EmailReporter if not asbool(global_conf.get('debug')): app = backlash.TraceErrorsMiddleware(app, [EmailReporter(**errorware)]) return app
import logging from paste.deploy.converters import asbool log = logging.getLogger(__name__) def _turbogears_backlash_context(environ): tgl = environ.get('tg.locals') return {'request':getattr(tgl, 'request', None)} def ErrorHandler(app, global_conf, **errorware): """ErrorHandler Toggle If debug is enabled, this function will return the app wrapped in the WebError ``EvalException`` middleware which displays interactive debugging sessions when a traceback occurs. Otherwise, the app will be wrapped in the WebError ``ErrorMiddleware``, and the ``errorware`` dict will be passed into it. The ``ErrorMiddleware`` handles sending an email to the address listed in the .ini file, under ``email_to``. """ try: import backlash except ImportError: #pragma: no cover log.warn('backlash not installed, debug mode won\'t be available') return app if asbool(global_conf.get('debug')): app = backlash.DebuggedApplication(app, context_injectors=[_turbogears_backlash_context]) return app def ErrorReporter(app, global_conf, **errorware): try: import backlash except ImportError: #pragma: no cover log.warn('backlash not installed, email tracebacks won\'t be available') return app from backlash.trace_errors import EmailReporter if not asbool(global_conf.get('debug')): app = backlash.TraceErrorsMiddleware(app, [EmailReporter(**errorware)], context_injectors=[_turbogears_backlash_context]) return app
Enable context provider for TraceErrorsMiddleware
Enable context provider for TraceErrorsMiddleware
Python
mit
lucius-feng/tg2,lucius-feng/tg2
1ad0ca50d1f4c61513bea33a4ffd999406c69600
accelerator/migrations/0019_add_deferred_user_role.py
accelerator/migrations/0019_add_deferred_user_role.py
# Generated by Django 2.2.10 on 2020-04-09 21:24 from django.db import migrations def add_deferred_user_role(apps, schema_editor): DEFERRED_MENTOR = 'Deferred Mentor' UserRole = apps.get_model('accelerator', 'UserRole') Program = apps.get_model('accelerator', 'Program') ProgramRole = apps.get_model('accelerator', 'ProgramRole') if UserRole.objects.filter(name=DEFERRED_MENTOR).exists(): user_role = UserRole.objects.filter(user=DEFERRED_MENTOR)[0] else: user_role = UserRole.objects.create(name=DEFERRED_MENTOR, sort_order=17) for program in Program.objects.all(): if not ProgramRole.objects.filter(user_role=user_role, program=program).exists(): name = "{} {} ({}-{})".format( (program.end_date.year if program.end_date else ""), DEFERRED_MENTOR, program.program_family.url_slug.upper(), program.pk) ProgramRole.objects.get_or_create( program=program, user_role=user_role, name=name) class Migration(migrations.Migration): dependencies = [ ('accelerator', '0018_make_location_nonrequired'), ] operations = [ migrations.RunPython(add_deferred_user_role, migrations.RunPython.noop) ]
# Generated by Django 2.2.10 on 2020-04-09 21:24 from django.db import migrations def add_deferred_user_role(apps, schema_editor): DEFERRED_MENTOR = 'Deferred Mentor' UserRole = apps.get_model('accelerator', 'UserRole') Program = apps.get_model('accelerator', 'Program') ProgramRole = apps.get_model('accelerator', 'ProgramRole') if UserRole.objects.filter(name=DEFERRED_MENTOR).exists(): user_role = UserRole.objects.filter(name=DEFERRED_MENTOR)[0] else: user_role = UserRole.objects.create(name=DEFERRED_MENTOR, sort_order=17) for program in Program.objects.all(): if not ProgramRole.objects.filter(user_role=user_role, program=program).exists(): name = "{} {} ({}-{})".format( (program.end_date.year if program.end_date else ""), DEFERRED_MENTOR, program.program_family.url_slug.upper(), program.pk) ProgramRole.objects.get_or_create( program=program, user_role=user_role, name=name) class Migration(migrations.Migration): dependencies = [ ('accelerator', '0018_make_location_nonrequired'), ] operations = [ migrations.RunPython(add_deferred_user_role, migrations.RunPython.noop) ]
Merge remote-tracking branch 'origin/development' into AC-7469
[AC-7469] Merge remote-tracking branch 'origin/development' into AC-7469
Python
mit
masschallenge/django-accelerator,masschallenge/django-accelerator
e5d88beba41de18ebab33e0770ddd8bb5174491e
pyfr/quadrules/__init__.py
pyfr/quadrules/__init__.py
# -*- coding: utf-8 -*- import re from pyfr.quadrules.base import BaseQuadRule, BaseTabulatedQuadRule from pyfr.quadrules.line import BaseLineQuadRule from pyfr.quadrules.tri import BaseTriQuadRule from pyfr.util import subclass_map def get_quadrule(basecls, rule, npts): # See if rule looks like the name of a scheme if re.match(r'[a-zA-Z0-9\-+_]+$', rule): rule_map = subclass_map(basecls, 'name') return rule_map[rule](npts) # Otherwise see if it looks like a tabulation elif 'PTS' in rule.upper(): # Create a suitable subclass rulecls = type(basecls.eletype, (BaseTabulatedQuadRule, basecls), {}) # Instantiate and validate r = rulecls(rule) if len(r.points) != npts: raise ValueError('Invalid number of points for quad rule') return r # Invalid else: raise ValueError('Invalid quadrature rule')
# -*- coding: utf-8 -*- import re from pyfr.quadrules.base import BaseQuadRule, BaseTabulatedQuadRule from pyfr.quadrules.line import BaseLineQuadRule from pyfr.util import subclass_map def get_quadrule(basecls, rule, npts): # See if rule looks like the name of a scheme if re.match(r'[a-zA-Z0-9\-+_]+$', rule): rule_map = subclass_map(basecls, 'name') return rule_map[rule](npts) # Otherwise see if it looks like a tabulation elif 'PTS' in rule.upper(): # Create a suitable subclass rulecls = type(basecls.eletype, (BaseTabulatedQuadRule, basecls), {}) # Instantiate and validate r = rulecls(rule) if len(r.points) != npts: raise ValueError('Invalid number of points for quad rule') return r # Invalid else: raise ValueError('Invalid quadrature rule')
Fix a bug in the quadrules.
Fix a bug in the quadrules.
Python
bsd-3-clause
tjcorona/PyFR,tjcorona/PyFR,iyer-arvind/PyFR,BrianVermeire/PyFR,tjcorona/PyFR,Aerojspark/PyFR
010de29acb284250667b393f9e1ba7b34b53aaf5
pygametemplate/__init__.py
pygametemplate/__init__.py
"""pygametemplate module for making creating games with Pygame easier.""" from __future__ import absolute_import __version__ = "0.2.0" __author__ = "Andrew Dean" from pygametemplate.game import Game
"""pygametemplate module for making creating games with Pygame easier.""" from __future__ import absolute_import __version__ = "0.2.0" __author__ = "Andrew Dean" from pygametemplate.game import Game from pygametemplate.view import View
Add View as a first class member of pygametemplate
Add View as a first class member of pygametemplate
Python
mit
AndyDeany/pygame-template
c39c60de325f5ce827de423abc646bd8662c80fb
pyp2rpmlib/package_data.py
pyp2rpmlib/package_data.py
class PackageData(object): def __init__(self, local_file, name, version): self.local_file = local_file self.name = name self.version = version class PypiData(PackageData): def __init__(self, local_file, name, version, md5, url): super(PackageData, self).__init__(local_file, name, version) self.md5 = md5 self.url = url class LocalData(PackageData): def __init__(self, local_file, name, version): super(PackageData, self).__init__(local_file, name, version)
class PackageData(object): def __init__(self, local_file, name, version): self.local_file = local_file self.name = name self.version = version def __getattr__(self, name): if name in self.__dict__: return self.__dict__[name] return None class PypiData(PackageData): def __init__(self, local_file, name, version, md5, url): super(PackageData, self).__init__(local_file, name, version) self.md5 = md5 self.url = url class LocalData(PackageData): def __init__(self, local_file, name, version): super(PackageData, self).__init__(local_file, name, version)
Package data objects should return None for missing attributes.
Package data objects should return None for missing attributes.
Python
mit
mcyprian/pyp2rpm,henrysher/spec4pypi,MichaelMraka/pyp2rpm,pombredanne/pyp2rpm,yuokada/pyp2rpm,fedora-python/pyp2rpm,joequant/pyp2rpm
7f38276fddc3d94f791d29d3bcbff4bfc9d4ee98
tests/chainer_tests/datasets_tests/test_tuple_dataset.py
tests/chainer_tests/datasets_tests/test_tuple_dataset.py
import unittest import numpy from chainer import cuda from chainer import datasets from chainer import testing from chainer.testing import attr class TestTupleDataset(unittest.TestCase): def setUp(self): self.x0 = numpy.random.rand(3, 4) self.x1 = numpy.random.rand(3, 5) def check_tuple_dataset(self, x0, x1): td = datasets.TupleDataset(x0, x1) self.assertEqual(len(td), len(x0)) for i in range(len(x0)): example = td[i] self.assertEqual(len(example), 2) numpy.testing.assert_array_equal( cuda.to_cpu(example[0]), cuda.to_cpu(x0[i])) numpy.testing.assert_array_equal( cuda.to_cpu(example[1]), cuda.to_cpu(x1[i])) def test_tuple_dataset_cpu(self): self.check_tuple_dataset(self.x0, self.x1) @attr.gpu def test_tuple_dataset_gpu(self): self.check_tuple_dataset(cuda.to_gpu(self.x0), cuda.to_gpu(self.x1)) testing.run_module(__name__, __file__)
import unittest import numpy from chainer import cuda from chainer import datasets from chainer import testing from chainer.testing import attr class TestTupleDataset(unittest.TestCase): def setUp(self): self.x0 = numpy.random.rand(3, 4) self.x1 = numpy.random.rand(3, 5) self.z0 = numpy.random.rand(4, 4) def check_tuple_dataset(self, x0, x1): td = datasets.TupleDataset(x0, x1) self.assertEqual(len(td), len(x0)) for i in range(len(x0)): example = td[i] self.assertEqual(len(example), 2) numpy.testing.assert_array_equal( cuda.to_cpu(example[0]), cuda.to_cpu(x0[i])) numpy.testing.assert_array_equal( cuda.to_cpu(example[1]), cuda.to_cpu(x1[i])) def test_tuple_dataset_cpu(self): self.check_tuple_dataset(self.x0, self.x1) @attr.gpu def test_tuple_dataset_gpu(self): self.check_tuple_dataset(cuda.to_gpu(self.x0), cuda.to_gpu(self.x1)) def test_tuple_dataset_len_mismatch(self): with self.assertRaises(ValueError): datasets.TupleDataset(self.x0, self.z0) def test_tuple_dataset_overrun(self): td = datasets.TupleDataset(self.x0, self.x1) with self.assertRaises(IndexError): td[3] testing.run_module(__name__, __file__)
Add exception test cases for TupleDataset
Add exception test cases for TupleDataset
Python
mit
okuta/chainer,cupy/cupy,hvy/chainer,keisuke-umezawa/chainer,niboshi/chainer,anaruse/chainer,ronekko/chainer,keisuke-umezawa/chainer,jnishi/chainer,chainer/chainer,hvy/chainer,keisuke-umezawa/chainer,ktnyt/chainer,kikusu/chainer,okuta/chainer,delta2323/chainer,niboshi/chainer,niboshi/chainer,rezoo/chainer,wkentaro/chainer,ktnyt/chainer,kiyukuta/chainer,wkentaro/chainer,ktnyt/chainer,okuta/chainer,chainer/chainer,keisuke-umezawa/chainer,cupy/cupy,jnishi/chainer,chainer/chainer,jnishi/chainer,jnishi/chainer,wkentaro/chainer,hvy/chainer,niboshi/chainer,pfnet/chainer,kikusu/chainer,cupy/cupy,cupy/cupy,chainer/chainer,hvy/chainer,aonotas/chainer,ktnyt/chainer,kashif/chainer,ysekky/chainer,wkentaro/chainer,tkerola/chainer,okuta/chainer
16091eebd0242782715600df9f6db9596f5797fe
tagging_autocomplete/urls.py
tagging_autocomplete/urls.py
from django.conf.urls import patterns, url urlpatterns = patterns( 'tagging_autocomplete.views', url(r'^list$', 'list_tags', name='tagging_autocomplete-list'), )
from django.conf.urls import url urlpatterns = [ 'tagging_autocomplete.views', url(r'^list$', 'list_tags', name='tagging_autocomplete-list'), ]
Drop the deprecated way of specifying url patterns
Drop the deprecated way of specifying url patterns
Python
mit
ludwiktrammer/django-tagging-autocomplete
397099cc8e2628a548c66957168dfab3de7f7f59
estudios_socioeconomicos/tests.py
estudios_socioeconomicos/tests.py
# from django.test import TestCase # Create your tests here.
from django.test import TestCase from .models import Pregunta, Seccion, Subseccion from .load import load_data class TestLoadPreguntas(TestCase): """ Suite to test the script to load questions. """ def test_load_preguntas(self): """ Test that the script to load questions works properly. We assert that the number of objects inserted is the same as we expect. """ load_data() self.assertEqual(142, len(Pregunta.objects.all())) self.assertEqual(7, len(Seccion.objects.all())) self.assertEqual(18, len(Subseccion.objects.all()))
Add test for loading script.
Add test for loading script.
Python
mit
erikiado/jp2_online,erikiado/jp2_online,erikiado/jp2_online
5a764e0b91db628efd20d63d70c5ed688695f8b1
app/routes.py
app/routes.py
from app import app from flask import redirect, render_template @app.route('/') def index(): return render_template('index.html') # default 'catch all' route @app.route('/', defaults={'path': ''}) @app.route('/<path:path>') def catch_all(path): return redirect('/')
from app import app from app.models import Digit from flask import redirect, render_template, request, jsonify @app.route('/') def index(): return render_template('index.html') # api route # parameters # # id: id to query, will return all otherwise # select: one value per item in the query # limit: limit, obviously. @app.route('/api') def api(): query_id = request.args.get('id') # get first id in query string query_limit = request.args.get('limit') # get first limit in query string query_select = request.args.getlist('select') # get all select params if query_id is not None: result = Digit.query.\ filter(Digit.id == query_id).\ all() else: result = Digit.query.limit(query_limit).all() return jsonify(result=[r.as_dict(query_select) for r in result]) # default 'catch all' route @app.route('/', defaults={'path': ''}) @app.route('/<path:path>') def catch_all(path): return redirect('/')
Add basic functional DB /api route
Add basic functional DB /api route
Python
mit
starcalibre/MNIST3D,starcalibre/MNIST3D,starcalibre/MNIST3D
e6d9524d6e29077cfb805cbafd99caf2b080a1c6
src/hyperloop/aero.py
src/hyperloop/aero.py
from openmdao.main.api import Component from openmdao.lib.datatypes.api import Float #put inside pod class Aero(Component): """Place holder for real aerodynamic calculations of the capsule""" #Inputs coef_drag = Float(1, iotype="in", desc="capsule drag coefficient") area_capsule = Float(18000, iotype="in", units="cm**2", desc="capsule frontal area") velocity_capsule = Float(600, iotype="in", units="m/s", desc="capsule frontal area") rho = Float(iotype="in", units="kg/m**3", desc="tube air density") gross_thrust = Float(iotype="in", units="N", desc="nozzle gross thrust") #Outputs net_force = Float(iotype="out", desc="Net force with drag considerations", units="N") drag = Float(iotype="out", units="N", desc="Drag Force") def execute(self): #Drag = 0.5*Cd*rho*Veloc*Area self.drag = 0.5*self.coef_drag*self.rho*self.velocity_capsule*self.area_capsule self.net_force = self.gross_thrust - self.drag
from openmdao.main.api import Component from openmdao.lib.datatypes.api import Float #put inside pod class Aero(Component): """Place holder for real aerodynamic calculations of the capsule""" #Inputs coef_drag = Float(1, iotype="in", desc="capsule drag coefficient") area_capsule = Float(18000, iotype="in", units="cm**2", desc="capsule frontal area") velocity_capsule = Float(600, iotype="in", units="m/s", desc="capsule velocity") rho = Float(iotype="in", units="kg/m**3", desc="tube air density") gross_thrust = Float(iotype="in", units="N", desc="nozzle gross thrust") #Outputs net_force = Float(iotype="out", desc="Net force with drag considerations", units="N") drag = Float(iotype="out", units="N", desc="Drag Force") def execute(self): #Drag = 0.5*Cd*rho*Veloc**2*Area self.drag = 0.5*self.coef_drag*self.rho*self.velocity_capsule**2*self.area_capsule self.net_force = self.gross_thrust - self.drag
Fix velocity_capsule description and drag formula
Fix velocity_capsule description and drag formula Drag force should be quadratically dependent on speed instead of linearly dependent.
Python
apache-2.0
HyperloopTeam/Hyperloop,paulopperman/Hyperloop,whiplash01/Hyperloop,whiplash01/Hyperloop,UwHyperloop/Hyperloop,UwHyperloop/Hyperloop,HyperloopTeam/Hyperloop,paulopperman/Hyperloop,kishenr12/Hyperloop,kishenr12/Hyperloop
e6cf8c244cdffa08d67a45c3a44236c3b91aab78
examples/rmg/liquid_phase/input.py
examples/rmg/liquid_phase/input.py
# Data sources database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [], seedMechanisms = [], kineticsDepositories = ['training'], kineticsFamilies = 'default', kineticsEstimator = 'rate rules', ) # List of species species( label='octane', reactive=True, structure=SMILES("C(CCCCC)CC"), ) species( label='oxygen', reactive=True, structure=SMILES("[O][O]"), ) # Reaction systems liquidReactor( temperature=(500,'K'), initialConcentrations={ "octane": (6.154e-3,'mol/cm^3'), "oxygen": (4.953e-6,'mol/cm^3') }, terminationTime=(5,'s'), ) solvation( solvent='octane' ) simulator( atol=1e-16, rtol=1e-8, ) model( toleranceKeepInEdge=1E-9, toleranceMoveToCore=0.001, toleranceInterruptSimulation=0.1, maximumEdgeSpecies=100000 ) options( units='si', saveRestartPeriod=None, drawMolecules=False, generatePlots=False, saveConcentrationProfiles=True, )
# Data sources database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [], seedMechanisms = [], kineticsDepositories = ['training'], kineticsFamilies = 'default', kineticsEstimator = 'rate rules', ) # Constraints on generated species generatedSpeciesConstraints( maximumRadicalElectrons = 3, ) # List of species species( label='octane', multiplicity = 1, reactive=True, structure=SMILES("C(CCCCC)CC"), ) species( label='oxygen', multiplicity = 3, reactive=True, structure=SMILES("[O][O]"), ) # Reaction systems liquidReactor( temperature=(500,'K'), initialConcentrations={ "octane": (6.154e-3,'mol/cm^3'), "oxygen": (4.953e-6,'mol/cm^3') }, terminationTime=(5,'s'), ) solvation( solvent='octane' ) simulator( atol=1e-16, rtol=1e-8, ) model( toleranceKeepInEdge=1E-9, toleranceMoveToCore=0.001, toleranceInterruptSimulation=0.1, maximumEdgeSpecies=100000 ) options( units='si', saveRestartPeriod=None, drawMolecules=False, generatePlots=False, saveConcentrationProfiles=True, )
Update RMG example liquid_phase with multiplicity label
Update RMG example liquid_phase with multiplicity label
Python
mit
chatelak/RMG-Py,pierrelb/RMG-Py,enochd/RMG-Py,comocheng/RMG-Py,chatelak/RMG-Py,nyee/RMG-Py,enochd/RMG-Py,nickvandewiele/RMG-Py,nyee/RMG-Py,pierrelb/RMG-Py,nickvandewiele/RMG-Py,comocheng/RMG-Py
9541fd723308d51f7c380649a81b4992074a1193
workout_manager/urls.py
workout_manager/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^', include('manager.urls')), url(r'exercise/', include('exercises.urls')), url(r'weight/', include('weight.urls')), url(r'nutrition/', include('nutrition.urls')), url(r'^browserid/', include('django_browserid.urls')), )
from django.conf.urls import patterns, include, url from django.conf.urls.i18n import i18n_patterns from django.contrib import admin admin.autodiscover() urlpatterns = i18n_patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^', include('manager.urls')), url(r'exercise/', include('exercises.urls')), url(r'weight/', include('weight.urls')), url(r'nutrition/', include('nutrition.urls')), url(r'^browserid/', include('django_browserid.urls')), )
Append the name of the current language to the URLs
Append the name of the current language to the URLs --HG-- branch : 1.1-dev
Python
agpl-3.0
DeveloperMal/wger,petervanderdoes/wger,DeveloperMal/wger,kjagoo/wger_stark,petervanderdoes/wger,wger-project/wger,kjagoo/wger_stark,rolandgeider/wger,wger-project/wger,DeveloperMal/wger,kjagoo/wger_stark,DeveloperMal/wger,petervanderdoes/wger,wger-project/wger,rolandgeider/wger,rolandgeider/wger,kjagoo/wger_stark,petervanderdoes/wger,rolandgeider/wger,wger-project/wger
038e60b342367e3ea6499d16d4f8a9666d99d0bf
django_custom_500/example_project/tests/test_basic.py
django_custom_500/example_project/tests/test_basic.py
# -*- encoding: utf-8 -*- # ! python2 from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals """Tests for django-custom-500's decorators""" import unittest import requests from django.test import TestCase, LiveServerTestCase class NormalViewTestCase(TestCase): def test_normal_view(self): ok_response = self.client.get('/normal-view-that-returns-data') self.assertTrue('42' in ok_response.content) class InternalErrorTestCase(LiveServerTestCase): def test_error_view(self): error_response = requests.get('%s%s' % (self.live_server_url, '/view-that-raises-value-error')) self.assertEqual(error_response.status_code, 500) self.assertIn("500 Internal Server Error", error_response.content) if __name__ == "__main__": unittest.main()
# -*- encoding: utf-8 -*- # ! python2 from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals """Tests for django-custom-500's decorators""" import unittest import requests from django.test import TestCase, LiveServerTestCase class NormalViewTestCase(TestCase): def test_normal_view(self): ok_response = self.client.get('/normal-view-that-returns-data') self.assertIn('42', ok_response.content) class InternalErrorTestCase(LiveServerTestCase): def test_error_view(self): error_response = requests.get('%s%s' % (self.live_server_url, '/view-that-raises-value-error')) self.assertEqual(error_response.status_code, 500) self.assertIn("500 Internal Server Error", error_response.content) if __name__ == "__main__": unittest.main()
Fix for 3.3 and 3.4
Fix for 3.3 and 3.4
Python
mit
illagrenan/django-custom-500,illagrenan/django-custom-500
cca7dee87863219b382321ba563cb48b1e58a4fb
tests/chainer_tests/functions_tests/pooling_tests/test_pooling_nd_kernel.py
tests/chainer_tests/functions_tests/pooling_tests/test_pooling_nd_kernel.py
import unittest import mock import chainer from chainer.functions.pooling import pooling_nd_kernel from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'ndim': [2, 3, 4], })) @attr.gpu class TestPoolingNDKernelMemo(unittest.TestCase): def setUp(self): chainer.cuda.clear_memo() def test_pooling_nd_kernel_forward_memo(self): ndim = self.ndim with mock.patch('chainer.functions.pooling.pooling_nd_kernel.' 'PoolingNDKernelForward._generate') as m: pooling_nd_kernel.PoolingNDKernelForward.generate(ndim) m.assert_called_once_with(ndim) pooling_nd_kernel.PoolingNDKernelForward.generate(ndim) m.assert_called_once_with(ndim) def test_pooling_nd_kernel_backward_memo(self): ndim = self.ndim with mock.patch('chainer.functions.pooling.pooling_nd_kernel.' 'PoolingNDKernelBackward._generate') as m: pooling_nd_kernel.PoolingNDKernelBackward.generate(ndim) m.assert_called_once_with(ndim) pooling_nd_kernel.PoolingNDKernelBackward.generate(ndim) m.assert_called_once_with(ndim) testing.run_module(__name__, __file__)
import unittest import mock import chainer from chainer.functions.pooling import pooling_nd_kernel from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'ndim': [2, 3, 4], })) @attr.gpu class TestPoolingNDKernelMemo(unittest.TestCase): def setUp(self): chainer.cuda.clear_memo() def test_pooling_nd_kernel_forward_memo(self): ndim = self.ndim with mock.patch('chainer.functions.pooling.pooling_nd_kernel.' 'PoolingNDKernelForward._generate') as m: pooling_nd_kernel.PoolingNDKernelForward.generate(ndim) m.assert_called_once_with(ndim) pooling_nd_kernel.PoolingNDKernelForward.generate(ndim) # Check that the mocked _generate() function is called just once # because the result of generate() function is cached. m.assert_called_once_with(ndim) def test_pooling_nd_kernel_backward_memo(self): ndim = self.ndim with mock.patch('chainer.functions.pooling.pooling_nd_kernel.' 'PoolingNDKernelBackward._generate') as m: pooling_nd_kernel.PoolingNDKernelBackward.generate(ndim) m.assert_called_once_with(ndim) pooling_nd_kernel.PoolingNDKernelBackward.generate(ndim) # Check that the mocked _generate() function is called just once # because the result of generate() function is cached. m.assert_called_once_with(ndim) testing.run_module(__name__, __file__)
Add comments for tests of caching.
Add comments for tests of caching.
Python
mit
cupy/cupy,hvy/chainer,jnishi/chainer,ysekky/chainer,kashif/chainer,jnishi/chainer,delta2323/chainer,keisuke-umezawa/chainer,jnishi/chainer,niboshi/chainer,niboshi/chainer,hvy/chainer,keisuke-umezawa/chainer,okuta/chainer,wkentaro/chainer,wkentaro/chainer,tkerola/chainer,ronekko/chainer,ktnyt/chainer,chainer/chainer,keisuke-umezawa/chainer,wkentaro/chainer,niboshi/chainer,chainer/chainer,hvy/chainer,keisuke-umezawa/chainer,chainer/chainer,jnishi/chainer,hvy/chainer,niboshi/chainer,ktnyt/chainer,ktnyt/chainer,okuta/chainer,kiyukuta/chainer,okuta/chainer,cupy/cupy,wkentaro/chainer,cupy/cupy,okuta/chainer,chainer/chainer,anaruse/chainer,aonotas/chainer,ktnyt/chainer,rezoo/chainer,cupy/cupy,pfnet/chainer
5e4c12067ee2b1d9affceaea789405422f7233a1
ce/common.py
ce/common.py
#!/usr/bin/env python # vim: set fileencoding=UTF-8 : import inspect class DynamicMethods(object): def list_methods(self, predicate): """Find all transform methods within the class that satisfies the predicate. Returns: A list of tuples containing method names and corresponding methods that can be called with a tree as the argument for each method. """ methods = [member[0] for member in inspect.getmembers( self.__class__, predicate=inspect.ismethod)] return [getattr(self, method) for method in methods if not method.startswith('_') and method != 'list_methods' and predicate(method)] class Comparable(object): def __ne__(self, other): return not self.__eq__(other) def __ge__(self, other): return not self.__lt__(other) def __gt__(self, other): return not self.__eq__(other) and not self.__lt__(other) def __le__(self, other): return not self.__gt__(other)
#!/usr/bin/env python # vim: set fileencoding=UTF-8 : import inspect class DynamicMethods(object): def list_methods(self, predicate): """Find all transform methods within the class that satisfies the predicate. Returns: A list of tuples containing method names and corresponding methods that can be called with a tree as the argument for each method. """ methods = [member[0] for member in inspect.getmembers(self, predicate=inspect.ismethod)] return [getattr(self, method) for method in methods if not method.startswith('_') and method != 'list_methods' and predicate(method)] class Comparable(object): def __ne__(self, other): return not self.__eq__(other) def __ge__(self, other): return not self.__lt__(other) def __gt__(self, other): return not self.__eq__(other) and not self.__lt__(other) def __le__(self, other): return not self.__gt__(other)
Fix broken list_methods due to inspect behaviour
Fix broken list_methods due to inspect behaviour
Python
mit
admk/soap
012ab9bf79ae2f70079534ce6ab527f8e08a50f3
doc/tutorials/python/secure-msg-template.py
doc/tutorials/python/secure-msg-template.py
async def init(): me = input('Who are you? ').strip() wallet_name = '%s-wallet' % me # 1. Create Wallet and Get Wallet Handle try: await wallet.create_wallet(pool_name, wallet_name, None, None, None) except: pass wallet_handle = await wallet.open_wallet(wallet_name, None, None) print('wallet = %s' % wallet_handle) (my_did, my_vk) = await did.create_and_store_my_did(wallet_handle, "{}") print('my_did and verkey = %s %s' % (my_did, my_vk)) their = input("Other party's DID and verkey? ").strip().split(' ') return wallet_handle, my_did, my_vk, their[0], their[1]
import asyncio import time import re async def prep(wallet_handle, my_vk, their_vk, msg): print('prepping %s' % msg) async def init(): return None, None, None, None, None async def read(wallet_handle, my_vk): print('reading') async def demo(): wallet_handle, my_did, my_vk, their_did, their_vk = await init() while True: argv = input('> ').strip().split(' ') cmd = argv[0].lower() rest = ' '.join(argv[1:]) if re.match(cmd, 'prep'): await prep(wallet_handle, my_vk, their_vk, rest) elif re.match(cmd, 'read'): await read(wallet_handle, my_vk) elif re.match(cmd, 'quit'): break else: print('Huh?') if __name__ == '__main__': try: loop = asyncio.get_event_loop() loop.run_until_complete(demo()) time.sleep(1) # waiting for libindy thread complete except KeyboardInterrupt: print('')
Fix template that was accidentally overwritten
Fix template that was accidentally overwritten
Python
apache-2.0
anastasia-tarasova/indy-sdk,anastasia-tarasova/indy-sdk,Artemkaaas/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,srottem/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,Artemkaaas/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,anastasia-tarasova/indy-sdk,Artemkaaas/indy-sdk,anastasia-tarasova/indy-sdk,peacekeeper/indy-sdk,anastasia-tarasova/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,anastasia-tarasova/indy-sdk,Artemkaaas/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,Artemkaaas/indy-sdk,anastasia-tarasova/indy-sdk,anastasia-tarasova/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk
a118e2b7133cf4391c1df41d95f9e4329a0bf5e9
tests/__init__.py
tests/__init__.py
import logging import unittest import os import shutil from sqlalchemy import create_engine from rtrss import config, database logging.disable(logging.ERROR) engine = create_engine(config.SQLALCHEMY_DATABASE_URI, echo=False, client_encoding='utf8') # Reconfigure session factory to use our test schema database.Session.configure(bind=engine) class AttrDict(dict): """Class to make mock objects""" def __init__(self, *args, **kwargs): super(AttrDict, self).__init__(*args, **kwargs) self.__dict__ = self class RTRSSTestCase(unittest.TestCase): @classmethod def setUpClass(cls): if os.path.isdir(config.DATA_DIR): os.rmdir(config.DATA_DIR) os.makedirs(config.DATA_DIR) @classmethod def tearDownClass(cls): shutil.rmtree(config.DATA_DIR) class RTRSSDataBaseTestCase(RTRSSTestCase): def setUp(self): database.clear(engine) database.init(engine) self.db = database.Session() def tearDown(self): database.clear(engine) self.db.close()
import logging import unittest import os import shutil from sqlalchemy import create_engine from rtrss import config, database logging.disable(logging.ERROR) engine = create_engine(config.SQLALCHEMY_DATABASE_URI, echo=False, client_encoding='utf8') # Reconfigure session factory to use our test schema database.Session.configure(bind=engine) class AttrDict(dict): """Class to make mock objects""" def __init__(self, *args, **kwargs): super(AttrDict, self).__init__(*args, **kwargs) self.__dict__ = self class RTRSSTestCase(unittest.TestCase): @classmethod def setUpClass(cls): if os.path.isdir(config.DATA_DIR): shutil.rmtree(config.DATA_DIR) os.makedirs(config.DATA_DIR) @classmethod def tearDownClass(cls): shutil.rmtree(config.DATA_DIR) class RTRSSDataBaseTestCase(RTRSSTestCase): def setUp(self): database.clear(engine) database.init(engine) self.db = database.Session() def tearDown(self): database.clear(engine) self.db.close()
Remove test data folder with all contents during setUp
Remove test data folder with all contents during setUp
Python
apache-2.0
notapresent/rtrss,notapresent/rtrss,notapresent/rtrss,notapresent/rtrss
1de254b56eba45ecdc88d26272ab1f123e734e25
tests/test_dem.py
tests/test_dem.py
import unittest import numpy as np class CalculationMethodsTestCase(unittest.TestCase): def setUp(self): self.dem = DEMGrid() def test_calculate_slope(self): sx, sy = self.dem._calculate_slope() def test_calculate_laplacian(self): del2z = self.dem._calculate_lapalacian() def test_calculate_directional_laplacian(self): alpha = np.pi/4 del2z = self.dem._calculate_lapalacian(alpha) def test_pad_boundary(self): dx = 5 dy = 5 grid = self.dem._griddata pad_x = np.zeros((self.ny, np.round(dx/2)) pad_y = np.zeros((self.nx + 2*np.round(dx/2), np.round(dy/2))) padgrid = np.vstack([pad_y, np.hstack([pad_x, self.dem._griddata, pad_x]), pad_y]]) self.dem._pad_boundary(dx, dy) assertEqual(self.dem.grid, padgrid, 'Grid padded incorrectly')
import unittest import numpy as np import filecmp TESTDATA_FILENAME = os.path.join(os.path.dirname(__file__), 'data/big_basin.tif') class CalculationMethodsTestCase(unittest.TestCase): def setUp(self): self.dem = DEMGrid(TESTDATA_FILENAME) def test_calculate_slope(self): sx, sy = self.dem._calculate_slope() def test_calculate_laplacian(self): del2z = self.dem._calculate_lapalacian() def test_calculate_directional_laplacian(self): alpha = np.pi/4 del2z = self.dem._calculate_lapalacian(alpha) def test_pad_boundary(self): dx = 5 dy = 5 grid = self.dem._griddata pad_x = np.zeros((self.ny, np.round(dx/2)) pad_y = np.zeros((self.nx + 2*np.round(dx/2), np.round(dy/2))) padgrid = np.vstack([pad_y, np.hstack([pad_x, self.dem._griddata, pad_x]), pad_y]]) self.dem._pad_boundary(dx, dy) assertEqual(self.dem.grid, padgrid, 'Grid padded incorrectly') class BaseSpatialGridTestCase(unittest.TestCase): def setUp(self): self.dem = BaseSpatialGrid(TESTDATA_FILENAME) def test_save(self): os.remove('test.tif') self.save('test.tif') this_file = os.path.join(os.path.dirname(__file__), 'test.tif') test_file = TESTDATA_FILENAME self.assertTrue(filecmp.cmp(this_file, test_file, shallow=False), 'GeoTIFF saved incorrectly')
Add test for writing spatial grid to file
Add test for writing spatial grid to file
Python
mit
stgl/scarplet,rmsare/scarplet
28f25bb7ca5a415bbc3ca2aabd7e290339140a9f
tests/test_dns.py
tests/test_dns.py
from .utils import TestCase, skipUnless from dynsupdate import client import os class DnsTests(TestCase): @skipUnless(os.getenv("SLOW"), "To slow") def test_build_resolver(self): domain = 'google-public-dns-a.google.com' res = client.NameUpdate.build_resolver(domain) self.assertListEqual(res.nameservers, ['8.8.8.8'])
from .utils import TestCase, skipUnless, mock from dynsupdate import client import os class DnsTests(TestCase): @skipUnless(os.getenv("SLOW"), "To slow") def test_build_resolver(self): domain = 'google-public-dns-a.google.com' res = client.NameUpdate.build_resolver(domain) self.assertListEqual(res.nameservers, ['8.8.8.8']) @mock.patch('dns.resolver.query') @mock.patch('dns.resolver.Resolver') def test_build_resolver_fake(self, mock_resolver, mock_query): mock_rdata = mock.Mock() mock_rdata.address = "127.0.0.1" mock_query.return_value = iter([mock_rdata]) res = client.NameUpdate.build_resolver("ns1.fake.com", port=999) mock_query.assert_called_with("ns1.fake.com", "A") print(mock_resolver.mock_calls) mock_resolver.return_value.nameservers.append \ .assert_called_with("127.0.0.1") self.assertEqual(res.port, 999)
Add mocked test of build_resolver
Add mocked test of build_resolver
Python
bsd-3-clause
bacher09/dynsupdate
36dd1493f329e82edd4ed514bfaaa0b58c882141
virtool/processes.py
virtool/processes.py
STEP_COUNTS = { "delete_reference": 2, "import_reference": 0, "setup_remote_reference": 0, "update_remote_reference": 0, "update_software": 0, "install_hmms": 0 } FIRST_STEPS = { "delete_reference": "delete_indexes", "import_reference": "load_file", "setup_remote_reference": "", "update_remote_reference": "", "update_software": "", "install_hmms": "" } UNIQUES = [ "update_software", "install_hmms" ] class ProgressTracker: def __init__(self, total, db=None, increment=0.05, factor=1): self.total = total self.db = db self.increment = increment self.factor = factor self.count = 0 self.last_reported = 0 def add(self, value): count = self.count + value if count > self.total: raise ValueError("Count cannot exceed total") self.count = count return self.progress async def reported(self): self.last_reported = self.progress @property def progress(self): return round(self.count / self.total * self.factor, 2)
STEP_COUNTS = { "delete_reference": 2, "import_reference": 0, "setup_remote_reference": 0, "update_remote_reference": 0, "update_software": 0, "install_hmms": 0 } FIRST_STEPS = { "delete_reference": "delete_indexes", "import_reference": "load_file", "setup_remote_reference": "", "update_remote_reference": "", "update_software": "", "install_hmms": "" } UNIQUES = [ "update_software", "install_hmms" ] class ProgressTracker: def __init__(self, total, db=None, increment=0.05, factor=1): self.total = total self.db = db self.increment = increment self.factor = factor self.count = 0 self.last_reported = 0 def add(self, value): count = self.count + value if count > self.total: raise ValueError("Count cannot exceed total") self.count = count return self.progress def reported(self): self.last_reported = self.progress @property def progress(self): return round(self.count / self.total * self.factor, 2)
Fix not awaited ProgressTracker bug
Fix not awaited ProgressTracker bug
Python
mit
virtool/virtool,virtool/virtool,igboyes/virtool,igboyes/virtool
7653f2c6e4f72e40eefee5d70d83ceafb8bc4282
lib/extend.py
lib/extend.py
from collections import OrderedDict import ruamel.yaml yaml = ruamel.yaml.YAML() class Operation(): def __init__(self, extension): self.extension = extension class Merge(Operation): def apply(self, base): ret = base.copy() for key, value in self.extension.items(): if key in base and isinstance(value, Operation): ret[key] = value.apply(base[key]) else: ret[key] = value return ret class Prepend(Operation): def apply(self, base): return self.extension + base def merge(*items): return Merge(OrderedDict(items)) def prepend(*items): return Prepend(list(items)) def extend(*items): extension = OrderedDict(items) base = extension['_base'] del extension['_base'] syntax = yaml.load( open(base, 'r') ) return Merge(extension).apply(syntax)
from collections import OrderedDict import ruamel.yaml yaml = ruamel.yaml.YAML() class Operation(): def __init__(self, extension): self.extension = extension class Merge(Operation): def apply(self, base): ret = base.copy() for key, value in self.extension.items(): if key in base and isinstance(value, Operation): ret[key] = value.apply(base[key]) else: ret[key] = value return ret class Prepend(Operation): def apply(self, base): return self.extension + base def merge(*items): return Merge(OrderedDict(items)) def prepend(*items): return Prepend(list(items)) def extend(*items): extension = OrderedDict(items) base = extension['_base'] del extension['_base'] with open(base, 'r') as base_file: syntax = yaml.load(base_file) return Merge(extension).apply(syntax)
Use context manager to read syntax file
Use context manager to read syntax file
Python
mit
Thom1729/YAML-Macros
616e542ee32b1ac83dd4d1977119ef670520c476
saleor/warehouse/models.py
saleor/warehouse/models.py
import uuid from django.db import models from django.utils.translation import pgettext_lazy from ..account.models import Address from ..shipping.models import ShippingZone class WarehouseQueryset(models.QuerySet): def prefetch_data(self): return self.select_related("address").prefetch_related("shipping_zones") class Warehouse(models.Model): id = models.UUIDField(default=uuid.uuid4, primary_key=True) name = models.CharField( pgettext_lazy("Warehouse field description", "Warehouse name"), max_length=255 ) company_name = models.CharField( pgettext_lazy("Warehouse field description", "Legal company name"), blank=True, max_length=255, ) shipping_zones = models.ManyToManyField(ShippingZone, blank=True) address = models.ForeignKey(Address, on_delete=models.CASCADE) email = models.EmailField( pgettext_lazy("Warehouse field description", "Email address"), blank=True, default="", ) objects = WarehouseQueryset.as_manager() class Meta: ordering = ("-name",) permissions = ( ( "manage_warehouses", pgettext_lazy("Permission description", "Manage warehouses."), ), ) def __str__(self): return self.name def delete(self, *args, **kwargs): self.address.delete() super().delete(*args, **kwargs)
import uuid from typing import Set from django.db import models from django.utils.translation import pgettext_lazy from ..account.models import Address from ..shipping.models import ShippingZone class WarehouseQueryset(models.QuerySet): def prefetch_data(self): return self.select_related("address").prefetch_related("shipping_zones") class Warehouse(models.Model): id = models.UUIDField(default=uuid.uuid4, primary_key=True) name = models.CharField( pgettext_lazy("Warehouse field description", "Warehouse name"), max_length=255 ) company_name = models.CharField( pgettext_lazy("Warehouse field description", "Legal company name"), blank=True, max_length=255, ) shipping_zones = models.ManyToManyField(ShippingZone, blank=True) address = models.ForeignKey(Address, on_delete=models.CASCADE) email = models.EmailField( pgettext_lazy("Warehouse field description", "Email address"), blank=True, default="", ) objects = WarehouseQueryset.as_manager() class Meta: ordering = ("-name",) permissions = ( ( "manage_warehouses", pgettext_lazy("Permission description", "Manage warehouses."), ), ) def __str__(self): return self.name @property def countries(self) -> Set[str]: countries_zone = ",".join( ShippingZone.objects.prefetch_related("warehouse_set") .filter(warehouse=self) .values_list("countries", flat=True) ) return set(countries_zone.split(",")) def delete(self, *args, **kwargs): self.address.delete() super().delete(*args, **kwargs)
Simplify getting countries associated with warehouse
Simplify getting countries associated with warehouse
Python
bsd-3-clause
mociepka/saleor,mociepka/saleor,mociepka/saleor
b6d9e7c24b0185d6a715adee4fc457afda6078f4
src/waldur_core/core/migrations/0008_changeemailrequest_uuid.py
src/waldur_core/core/migrations/0008_changeemailrequest_uuid.py
from django.db import migrations import waldur_core.core.fields class Migration(migrations.Migration): dependencies = [ ('core', '0007_changeemailrequest'), ] operations = [ migrations.AddField( model_name='changeemailrequest', name='uuid', field=waldur_core.core.fields.UUIDField(null=True), ), ]
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0007_changeemailrequest'), ] operations = [ migrations.AddField( model_name='changeemailrequest', name='uuid', field=models.UUIDField(), ), ]
Fix UUID field migration for change email request model.
Fix UUID field migration for change email request model. We should have been used builtin UUID field because our own field has uniqueness constraint.
Python
mit
opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind
a06ca6899062bab407cb4c6884d0bf148a380b1f
netsecus/task.py
netsecus/task.py
from __future__ import unicode_literals class Task(object): def __init__(self, number, description, maxPoints): self.number = number self.description = description self.maxPoints = maxPoints
from __future__ import unicode_literals class Task(object): def __init__(self, number, description, maxPoints, reachedPoints): self.number = number self.description = description self.maxPoints = maxPoints self.reachedPoints = reachedPoints
Add a variable to hold reached points
Add a variable to hold reached points
Python
mit
hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem