commit stringlengths 40 40 | old_file stringlengths 4 150 | new_file stringlengths 4 150 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 501 | message stringlengths 15 4.06k | lang stringclasses 4 values | license stringclasses 13 values | repos stringlengths 5 91.5k | diff stringlengths 0 4.35k |
|---|---|---|---|---|---|---|---|---|---|---|
f6cad1777023ceb53db8599bc2e74bf0ab2aa0a7 | orchestrator/__init__.py | orchestrator/__init__.py | from __future__ import absolute_import
from celery.signals import setup_logging
import orchestrator.logger
__version__ = '0.5.1'
__author__ = 'sukrit'
orchestrator.logger.init_logging()
setup_logging.connect(orchestrator.logger.init_celery_logging)
| from __future__ import absolute_import
from celery.signals import setup_logging
import orchestrator.logger
__version__ = '0.5.2'
__author__ = 'sukrit'
orchestrator.logger.init_logging()
setup_logging.connect(orchestrator.logger.init_celery_logging)
| Prepare for next dev release | Prepare for next dev release | Python | mit | totem/cluster-orchestrator,totem/cluster-orchestrator,totem/cluster-orchestrator | ---
+++
@@ -2,7 +2,7 @@
from celery.signals import setup_logging
import orchestrator.logger
-__version__ = '0.5.1'
+__version__ = '0.5.2'
__author__ = 'sukrit'
orchestrator.logger.init_logging() |
569c056e016131ec4325185ee9fe814018d5e1fe | server/bands/__init__.py | server/bands/__init__.py | from flask import session, redirect, url_for, g, jsonify, Response
from flask.views import MethodView
from server.models import Band
class RestrictedBandPage(MethodView):
def dispatch_request(self, *args, **kwargs):
if not 'bandId' in session:
return redirect(url_for('bands.session.index'))
else:
self.band = Band.query.get(session['bandId'])
if not self.band:
return redirect(url_for('bands.session.index'))
else:
g.band = self.band
return super(RestrictedBandPage, self).dispatch_request(*args, **kwargs)
class AjaxException(Exception):
errors = []
def __init__(self, *args):
super(Exception, self).__init__()
self.errors = args
AJAX_SUCCESS = Response(200)
class AjaxForm(MethodView):
def post(self):
if self.form.validate_on_submit():
try:
result = self.on_submit()
if type(result) is Response:
return result
else:
return jsonify(result)
except AjaxException as e:
errors = self.form.errors
if len(e.errors) > 0:
errors['general'] = e.errors
return jsonify(errors=errors), 400
else:
return jsonify(errors=self.form.errors), 400
| from flask import session, redirect, url_for, g, jsonify, Response
from flask.views import MethodView
from server.models import Band
class RestrictedBandPage(MethodView):
def dispatch_request(self, *args, **kwargs):
if not 'bandId' in session:
return redirect(url_for('bands.session.index'))
else:
self.band = Band.query.get(session['bandId'])
if not self.band:
del session['bandId']
return redirect(url_for('bands.session.index'))
else:
g.band = self.band
return super(RestrictedBandPage, self).dispatch_request(*args, **kwargs)
class AjaxException(Exception):
errors = []
def __init__(self, *args):
super(Exception, self).__init__()
self.errors = args
AJAX_SUCCESS = Response(200)
class AjaxForm(MethodView):
def post(self):
if self.form.validate_on_submit():
try:
result = self.on_submit()
if type(result) is Response:
return result
else:
return jsonify(result)
except AjaxException as e:
errors = self.form.errors
if len(e.errors) > 0:
errors['general'] = e.errors
return jsonify(errors=errors), 400
else:
return jsonify(errors=self.form.errors), 400
| Fix problem on no-longer existing bands that are still as logged in session available | Fix problem on no-longer existing bands that are still as logged in session available
| Python | apache-2.0 | dennisausbremen/tunefish,dennisausbremen/tunefish,dennisausbremen/tunefish | ---
+++
@@ -10,6 +10,7 @@
else:
self.band = Band.query.get(session['bandId'])
if not self.band:
+ del session['bandId']
return redirect(url_for('bands.session.index'))
else:
g.band = self.band |
ec2456eac36a96c9819920bf8b4176e6a37ad9a5 | saleor/product/migrations/0020_attribute_data_to_class.py | saleor/product/migrations/0020_attribute_data_to_class.py | from __future__ import unicode_literals
from django.db import migrations, models
def move_data(apps, schema_editor):
Product = apps.get_model('product', 'Product')
ProductClass = apps.get_model('product', 'ProductClass')
for product in Product.objects.all():
attributes = product.attributes.all()
product_class = ProductClass.objects.all()
for attribute in attributes:
product_class = product_class.filter(
variant_attributes__in=[attribute])
product_class = product_class.first()
if product_class is None:
product_class = ProductClass.objects.create(
name='Migrated Product Class',
has_variants=True)
product_class.variant_attributes = attributes
product_class.save()
product.product_class = product_class
product.save()
class Migration(migrations.Migration):
dependencies = [
('product', '0019_auto_20161212_0230'),
]
operations = [
migrations.RunPython(move_data),
]
| from __future__ import unicode_literals
from django.db import migrations, models
def move_data(apps, schema_editor):
Product = apps.get_model('product', 'Product')
ProductClass = apps.get_model('product', 'ProductClass')
for product in Product.objects.all():
attributes = product.attributes.all()
product_class = ProductClass.objects.all()
for attribute in attributes:
product_class = product_class.filter(
variant_attributes__in=[attribute])
product_class = product_class.first()
if product_class is None:
product_class = ProductClass.objects.create(
name='Unnamed product type',
has_variants=True)
product_class.variant_attributes = attributes
product_class.save()
product.product_class = product_class
product.save()
class Migration(migrations.Migration):
dependencies = [
('product', '0019_auto_20161212_0230'),
]
operations = [
migrations.RunPython(move_data),
]
| Rename productclass made during migration | Rename productclass made during migration
| Python | bsd-3-clause | KenMutemi/saleor,HyperManTT/ECommerceSaleor,mociepka/saleor,maferelo/saleor,maferelo/saleor,tfroehlich82/saleor,tfroehlich82/saleor,car3oon/saleor,itbabu/saleor,KenMutemi/saleor,KenMutemi/saleor,UITools/saleor,UITools/saleor,jreigel/saleor,mociepka/saleor,tfroehlich82/saleor,itbabu/saleor,car3oon/saleor,UITools/saleor,HyperManTT/ECommerceSaleor,mociepka/saleor,maferelo/saleor,UITools/saleor,itbabu/saleor,HyperManTT/ECommerceSaleor,jreigel/saleor,jreigel/saleor,UITools/saleor,car3oon/saleor | ---
+++
@@ -16,7 +16,7 @@
product_class = product_class.first()
if product_class is None:
product_class = ProductClass.objects.create(
- name='Migrated Product Class',
+ name='Unnamed product type',
has_variants=True)
product_class.variant_attributes = attributes
product_class.save() |
f31e8215838e40960abff6c86be8c66cbf113c95 | server/rest/twofishes.py | server/rest/twofishes.py | import requests
from girder.api import access
from girder.api.describe import Description
from girder.api.rest import Resource
class TwoFishes(Resource):
def __init__(self):
self.resourceName = 'minerva_geocoder'
self.route('GET', (), self.geocode)
self.route('GET', ('autocomplete',), self.autocomplete)
@access.public
def geocode(self, params):
r = requests.get(params['twofishes'],
params={'query': params['location'],
'responseIncludes': 'WKT_GEOMETRY'})
return r.json()
geocode.description = (
Description('Get geojson for a given location name')
.param('twofishes', 'Twofishes url')
.param('location', 'Location name to get a geojson')
)
@access.public
def autocomplete(self, params):
r = requests.get(params['twofishes'],
params={'autocomplete': True,
'query': params['location'],
'maxInterpretations': 10,
'autocompleteBias': None})
return [i['feature']['matchedName'] for i in r.json()['interpretations']]
autocomplete.description = (
Description('Autocomplete result for a given location name')
.param('twofishes', 'Twofishes url')
.param('location', 'Location name to autocomplete')
)
| import requests
from shapely.wkt import loads
from shapely.geometry import mapping
from girder.api import access
from girder.api.describe import Description
from girder.api.rest import Resource
class TwoFishes(Resource):
def __init__(self):
self.resourceName = 'minerva_geocoder'
self.route('GET', (), self.geocode)
self.route('GET', ('autocomplete',), self.autocomplete)
@access.public
def geocode(self, params):
r = requests.get(params['twofishes'],
params={'query': params['location'],
'responseIncludes': 'WKT_GEOMETRY'})
wkt = r.json()['interpretations'][0]['feature']['geometry']['wktGeometry']
return mapping(loads(wkt))
geocode.description = (
Description('Get geojson for a given location name')
.param('twofishes', 'Twofishes url')
.param('location', 'Location name to get a geojson')
)
@access.public
def autocomplete(self, params):
r = requests.get(params['twofishes'],
params={'autocomplete': True,
'query': params['location'],
'maxInterpretations': 10,
'autocompleteBias': None})
return [i['feature']['matchedName'] for i in r.json()['interpretations']]
autocomplete.description = (
Description('Autocomplete result for a given location name')
.param('twofishes', 'Twofishes url')
.param('location', 'Location name to autocomplete')
)
| Make the endpoint return geojson as opposed to wkt geometry | Make the endpoint return geojson as opposed to wkt geometry
| Python | apache-2.0 | Kitware/minerva,Kitware/minerva,Kitware/minerva | ---
+++
@@ -1,4 +1,6 @@
import requests
+from shapely.wkt import loads
+from shapely.geometry import mapping
from girder.api import access
from girder.api.describe import Description
@@ -16,7 +18,8 @@
r = requests.get(params['twofishes'],
params={'query': params['location'],
'responseIncludes': 'WKT_GEOMETRY'})
- return r.json()
+ wkt = r.json()['interpretations'][0]['feature']['geometry']['wktGeometry']
+ return mapping(loads(wkt))
geocode.description = (
Description('Get geojson for a given location name') |
3665b8859f72ec416682857ab22f7e29fc30f0df | alignment/models.py | alignment/models.py | from django.db import models
# Create your models here.
class AlignmentConsensus(models.Model):
slug = models.SlugField(max_length=100, unique=True)
alignment = models.BinaryField() | from django.db import models
# Create your models here.
class AlignmentConsensus(models.Model):
slug = models.SlugField(max_length=100, unique=True)
alignment = models.BinaryField()
gn_consensus = models.BinaryField(blank=True) # Store conservation calculation for each GN | Add field on cached alignments to store more information | Add field on cached alignments to store more information
| Python | apache-2.0 | cmunk/protwis,protwis/protwis,fosfataza/protwis,cmunk/protwis,fosfataza/protwis,protwis/protwis,protwis/protwis,fosfataza/protwis,cmunk/protwis,cmunk/protwis,fosfataza/protwis | ---
+++
@@ -5,3 +5,4 @@
class AlignmentConsensus(models.Model):
slug = models.SlugField(max_length=100, unique=True)
alignment = models.BinaryField()
+ gn_consensus = models.BinaryField(blank=True) # Store conservation calculation for each GN |
5d8e6e47964d80f380db27acd120136a43e80550 | aimpoint_mon/make_web_page.py | aimpoint_mon/make_web_page.py | #!/usr/bin/env python
import os
import argparse
import json
from pathlib import Path
from jinja2 import Template
import pyyaks.logger
def get_opt():
parser = argparse.ArgumentParser(description='Get aimpoint drift data '
'from aspect solution files')
parser.add_argument("--data-root",
default=".",
help="Root directory for asol and index files")
return parser.parse_args()
# Options
opt = get_opt()
# Set up logging
loglevel = pyyaks.logger.INFO
logger = pyyaks.logger.get_logger(name='make_web_page', level=loglevel,
format="%(asctime)s %(message)s")
def main():
# Files
index_template_file = Path(__file__).parent / 'data' / 'index_template.html'
index_file = os.path.join(opt.data_root, 'index.html')
info_file = os.path.join(opt.data_root, 'info.json')
# Jinja template context
logger.info('Loading info file {}'.format(info_file))
context = json.load(open(info_file, 'r'))
template = Template(open(index_template_file).read())
context['static'] = True
html = template.render(**context)
logger.info('Writing index file {}'.format(index_file))
with open(index_file, 'w') as fh:
fh.write(html)
if __name__ == '__main__':
main()
| #!/usr/bin/env python
import os
import argparse
import json
from pathlib import Path
from jinja2 import Template
import pyyaks.logger
def get_opt():
parser = argparse.ArgumentParser(description='Make aimpoint monitor web page')
parser.add_argument("--data-root",
default=".",
help="Root directory for asol and index files")
return parser.parse_args()
# Options
opt = get_opt()
# Set up logging
loglevel = pyyaks.logger.INFO
logger = pyyaks.logger.get_logger(name='make_web_page', level=loglevel,
format="%(asctime)s %(message)s")
def main():
# Files
index_template_file = Path(__file__).parent / 'data' / 'index_template.html'
index_file = os.path.join(opt.data_root, 'index.html')
info_file = os.path.join(opt.data_root, 'info.json')
# Jinja template context
logger.info('Loading info file {}'.format(info_file))
context = json.load(open(info_file, 'r'))
template = Template(open(index_template_file).read())
context['static'] = True
html = template.render(**context)
logger.info('Writing index file {}'.format(index_file))
with open(index_file, 'w') as fh:
fh.write(html)
if __name__ == '__main__':
main()
| Fix tool description in argparse help | Fix tool description in argparse help | Python | bsd-2-clause | sot/aimpoint_mon,sot/aimpoint_mon | ---
+++
@@ -10,8 +10,7 @@
def get_opt():
- parser = argparse.ArgumentParser(description='Get aimpoint drift data '
- 'from aspect solution files')
+ parser = argparse.ArgumentParser(description='Make aimpoint monitor web page')
parser.add_argument("--data-root",
default=".",
help="Root directory for asol and index files") |
2c03171b75b6bb4f3a77d3b46ee8fd1e5b022077 | template_engine/jinja2_filters.py | template_engine/jinja2_filters.py | from email import utils
import re
import time
import urllib
def digits(s):
if not s:
return ''
return re.sub('[^0-9]', '', s)
def floatformat(num, num_decimals):
return "%.{}f".format(num_decimals) % num
def strftime(datetime, formatstr):
"""
Uses Python's strftime with some tweaks
"""
return datetime.strftime(formatstr).lstrip("0").replace(" 0", " ")
def strip_frc(s):
if not s:
return ''
return s[3:]
def urlencode(s):
return urllib.quote(s.encode('utf8'))
def rfc2822(datetime):
tt = datetime.timetuple()
timestamp = time.mktime(tt)
return utils.formatdate(timestamp)
# def slugify(s):
# """
# Use Django's slugify method
# """
# return defaultfilters.slugify(s)
| from email import utils
import re
import time
import urllib
def digits(s):
if not s:
return ''
if type(s) is int:
return s
return re.sub('[^0-9]', '', s)
def floatformat(num, num_decimals):
return "%.{}f".format(num_decimals) % num
def strftime(datetime, formatstr):
"""
Uses Python's strftime with some tweaks
"""
return datetime.strftime(formatstr).lstrip("0").replace(" 0", " ")
def strip_frc(s):
if not s:
return ''
return s[3:]
def urlencode(s):
return urllib.quote(s.encode('utf8'))
def rfc2822(datetime):
tt = datetime.timetuple()
timestamp = time.mktime(tt)
return utils.formatdate(timestamp)
# def slugify(s):
# """
# Use Django's slugify method
# """
# return defaultfilters.slugify(s)
| Fix type error if input is int | Fix type error if input is int
| Python | mit | bdaroz/the-blue-alliance,the-blue-alliance/the-blue-alliance,jaredhasenklein/the-blue-alliance,synth3tk/the-blue-alliance,verycumbersome/the-blue-alliance,synth3tk/the-blue-alliance,the-blue-alliance/the-blue-alliance,bdaroz/the-blue-alliance,jaredhasenklein/the-blue-alliance,tsteward/the-blue-alliance,phil-lopreiato/the-blue-alliance,tsteward/the-blue-alliance,nwalters512/the-blue-alliance,phil-lopreiato/the-blue-alliance,nwalters512/the-blue-alliance,jaredhasenklein/the-blue-alliance,bdaroz/the-blue-alliance,phil-lopreiato/the-blue-alliance,synth3tk/the-blue-alliance,bdaroz/the-blue-alliance,verycumbersome/the-blue-alliance,verycumbersome/the-blue-alliance,tsteward/the-blue-alliance,synth3tk/the-blue-alliance,the-blue-alliance/the-blue-alliance,tsteward/the-blue-alliance,fangeugene/the-blue-alliance,tsteward/the-blue-alliance,verycumbersome/the-blue-alliance,jaredhasenklein/the-blue-alliance,verycumbersome/the-blue-alliance,bdaroz/the-blue-alliance,the-blue-alliance/the-blue-alliance,jaredhasenklein/the-blue-alliance,fangeugene/the-blue-alliance,fangeugene/the-blue-alliance,fangeugene/the-blue-alliance,phil-lopreiato/the-blue-alliance,tsteward/the-blue-alliance,nwalters512/the-blue-alliance,phil-lopreiato/the-blue-alliance,nwalters512/the-blue-alliance,synth3tk/the-blue-alliance,the-blue-alliance/the-blue-alliance,nwalters512/the-blue-alliance,fangeugene/the-blue-alliance,verycumbersome/the-blue-alliance,phil-lopreiato/the-blue-alliance,fangeugene/the-blue-alliance,nwalters512/the-blue-alliance,bdaroz/the-blue-alliance,the-blue-alliance/the-blue-alliance,synth3tk/the-blue-alliance,jaredhasenklein/the-blue-alliance | ---
+++
@@ -7,6 +7,8 @@
def digits(s):
if not s:
return ''
+ if type(s) is int:
+ return s
return re.sub('[^0-9]', '', s)
|
6c7c02f9f0c8d39d5c6b12ad7285b6da54ebbea5 | shoop/core/migrations/0028_roundingbehaviorcomponent.py | shoop/core/migrations/0028_roundingbehaviorcomponent.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from decimal import Decimal
import shoop.core.models
import enumfields.fields
class Migration(migrations.Migration):
dependencies = [
('shoop', '0027_contact_group_behavior'),
]
operations = [
migrations.CreateModel(
name='RoundingBehaviorComponent',
fields=[
('servicebehaviorcomponent_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoop.ServiceBehaviorComponent')),
('quant', models.DecimalField(default=Decimal('0.05'), verbose_name='rounding quant', max_digits=36, decimal_places=9)),
('mode', enumfields.fields.EnumField(default=b'ROUND_HALF_UP', max_length=10, verbose_name='rounding mode', enum=shoop.core.models.RoundingMode)),
],
options={
'abstract': False,
},
bases=('shoop.servicebehaviorcomponent',),
),
]
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from decimal import Decimal
import shoop.core.models
import enumfields.fields
class Migration(migrations.Migration):
dependencies = [
('shoop', '0027_contact_group_behavior'),
]
operations = [
migrations.CreateModel(
name='RoundingBehaviorComponent',
fields=[
('servicebehaviorcomponent_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoop.ServiceBehaviorComponent')),
('quant', models.DecimalField(default=Decimal('0.05'), verbose_name='rounding quant', max_digits=36, decimal_places=9)),
('mode', enumfields.fields.EnumField(default='ROUND_HALF_UP', max_length=10, verbose_name='rounding mode', enum=shoop.core.models.RoundingMode)),
],
options={
'abstract': False,
},
bases=('shoop.servicebehaviorcomponent',),
),
]
| Remove bytes from migration 0028 | Core: Remove bytes from migration 0028
| Python | agpl-3.0 | shoopio/shoop,shawnadelic/shuup,suutari/shoop,shawnadelic/shuup,suutari/shoop,hrayr-artunyan/shuup,suutari-ai/shoop,hrayr-artunyan/shuup,shoopio/shoop,shoopio/shoop,hrayr-artunyan/shuup,suutari-ai/shoop,suutari/shoop,suutari-ai/shoop,shawnadelic/shuup | ---
+++
@@ -19,7 +19,7 @@
fields=[
('servicebehaviorcomponent_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoop.ServiceBehaviorComponent')),
('quant', models.DecimalField(default=Decimal('0.05'), verbose_name='rounding quant', max_digits=36, decimal_places=9)),
- ('mode', enumfields.fields.EnumField(default=b'ROUND_HALF_UP', max_length=10, verbose_name='rounding mode', enum=shoop.core.models.RoundingMode)),
+ ('mode', enumfields.fields.EnumField(default='ROUND_HALF_UP', max_length=10, verbose_name='rounding mode', enum=shoop.core.models.RoundingMode)),
],
options={
'abstract': False, |
350bd08bdea2df07928d8203680a8bc33d1a7eb1 | keops/settings.py | keops/settings.py | from katrid.conf.app_settings import *
DATABASES = {
'default': {
'ENGINE': 'katrid.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
AUTH_USER_MODEL = 'base.user'
INSTALLED_APPS.append('keops')
SERIALIZATION_MODULES = {
'python': 'keops.core.serializers.python',
'json': 'keops.core.serializers.json',
'xml': 'keops.core.serializers.xml_serializer',
'yaml': 'keops.core.serializers.pyyaml',
'csv': 'keops.core.serializers.csv_serializer',
'txt': 'keops.core.serializers.txt_serializer',
'mako': 'keops.core.serializers.mako_serializer',
}
| from katrid.conf.app_settings import *
DATABASES = {
'default': {
'ENGINE': 'katrid.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
AUTH_USER_MODEL = 'base.user'
INSTALLED_APPS.append('keops')
SERIALIZATION_MODULES = {
'python': 'keops.core.serializers.python',
'json': 'keops.core.serializers.json',
'xml': 'keops.core.serializers.xml_serializer',
'yaml': 'keops.core.serializers.pyyaml',
'csv': 'keops.core.serializers.csv_serializer',
'txt': 'keops.core.serializers.txt_serializer',
}
| Add exclude fields to model options | Add exclude fields to model options
| Python | bsd-3-clause | katrid/keops,katrid/keops,katrid/keops | ---
+++
@@ -18,5 +18,4 @@
'yaml': 'keops.core.serializers.pyyaml',
'csv': 'keops.core.serializers.csv_serializer',
'txt': 'keops.core.serializers.txt_serializer',
- 'mako': 'keops.core.serializers.mako_serializer',
} |
78f3e210a105d4b096b48c33889ec1ed1f7fa1e9 | app/models/completed_application.py | app/models/completed_application.py | import random
from faker import Faker
from .. import db
from sqlalchemy.orm import validates
class CompletedApplication(db.Model):
id = db.Column(db.Integer, primary_key=True)
student_profile_id = db.Column(
db.Integer, db.ForeignKey('student_profile.id'), nullable=False)
# college name
college = db.Column(db.String, index=True)
# statuses include 'Pending Results', 'Accepted', 'Denied', 'Waitlisted',
# 'Deferred'
status = db.Column(db.String, index=True)
@validates('status')
def validate_status(self, key, status):
assert status in ['Pending Results', 'Accepted', 'Denied', 'Waitlisted', 'Deferred']
return status
@staticmethod
def generate_fake(count=2):
fake = Faker()
names = random.sample([
'Cornell',
'Princeton',
'University of Florida',
'University of Richmond',
], count)
statuses = ['Pending Results', 'Accepted', 'Denied', 'Waitlisted', 'Deferred']
comp_apps = []
for i in range(count):
comp_apps.append(
CompletedApplication(
college=names[i],
status=random.choice(statuses)))
return comp_apps
def __repr__(self):
return '<CompletedApplication {}, {}>'.format(
self.name, self.status) | import random
from faker import Faker
from .. import db
from sqlalchemy.orm import validates
class CompletedApplication(db.Model):
id = db.Column(db.Integer, primary_key=True)
student_profile_id = db.Column(
db.Integer, db.ForeignKey('student_profile.id'), nullable=False)
# college name
college = db.Column(db.String, index=True)
# statuses include 'Pending Results', 'Accepted', 'Denied', 'Waitlisted',
# 'Deferred'
status = db.Column(db.String, index=True)
@validates('status')
def validate_status(self, key, status):
assert status in ['Pending Results', 'Accepted', 'Denied', 'Waitlisted', 'Deferred']
return status
@staticmethod
def generate_fake(count=2):
fake = Faker()
names = random.sample([
'Cornell',
'Princeton',
'University of Florida',
'University of Richmond',
], count)
statuses = ['Pending Results', 'Accepted', 'Denied', 'Waitlisted', 'Deferred']
comp_apps = []
for i in range(count):
comp_apps.append(
CompletedApplication(
college=names[i],
status=random.choice(statuses)))
return comp_apps
def __repr__(self):
return '<CompletedApplication {}, {}>'.format(
self.college, self.status)
| Fix __repr__ bug for CompletedApplication | Fix __repr__ bug for CompletedApplication
| Python | mit | hack4impact/next-gen-scholars,hack4impact/next-gen-scholars,hack4impact/next-gen-scholars | ---
+++
@@ -38,4 +38,4 @@
def __repr__(self):
return '<CompletedApplication {}, {}>'.format(
- self.name, self.status)
+ self.college, self.status) |
0a4ee589b81c8d16bf3e0628081b45a7f67f670f | backend/servers/etlserver/setup.py | backend/servers/etlserver/setup.py | from setuptools import setup, find_packages
setup(
name='etlserver',
version='0.1.0',
packages=find_packages(),
install_requires=[
'materials_commons==0.7.7b2',
'configparser',
'flask-api',
'faktory',
'rethinkdb',
'argparse',
'six',
'xlsxwriter',
'openpyxl',
'globus_sdk'],
)
| from setuptools import setup, find_packages
setup(
name='etlserver',
version='0.1.0',
packages=find_packages(),
install_requires=[
'materials_commons==0.7.7b3',
'configparser',
'flask-api',
'faktory',
'rethinkdb',
'argparse',
'six',
'xlsxwriter',
'openpyxl',
'globus_sdk'],
)
| Correct materials-commons version for requirements | Correct materials-commons version for requirements
| Python | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | ---
+++
@@ -5,7 +5,7 @@
version='0.1.0',
packages=find_packages(),
install_requires=[
- 'materials_commons==0.7.7b2',
+ 'materials_commons==0.7.7b3',
'configparser',
'flask-api',
'faktory', |
80918b006ddf490096dbe4817162b3c1b8afd0d4 | components/includes/utilities.py | components/includes/utilities.py | import random
import json
import SocketExtend as SockExt
import config as conf
import parser as p
def ping(sock):
try:
rand = random.randint(1, 99999)
data = {'request':'ping', 'contents': {'value':rand}}
SockExt.send_msg(sock, json.dumps(data))
result = json.loads(SockExt.recv_msg(sock))
if result['return'] == rand:
return True
else:
return False
except Exception as e:
print "Exception while pinging: ", e
return False
def multiping(port, auths=[]):
result = True
for a_ip in auths:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#s.settimeout(120.0)
sock.connect((a_ip, int(port)))
if not ping(sock):
result = False
sock.shutdown(socket.SHUT_RDWR)
sock.close()
return result
def alive(port, machines=[]):
attempted = 0
success = False
while (attempted < conf.tries):
try:
if utilities.multiping(port, machines):
success = True
break
except Exception as e:
attempted += 1
return success
| import random
import json
import SocketExtend as SockExt
import config as conf
import parser as p
def ping(sock):
try:
rand = random.randint(1, 99999)
data = {'request':'ping', 'contents': {'value':rand}}
SockExt.send_msg(sock, json.dumps(data))
result = json.loads(SockExt.recv_msg(sock))
if result['return'] == rand:
return True
else:
return False
except Exception as e:
print "Exception while pinging: ", e
return False
def multiping(port, auths=[]):
result = True
for a_ip in auths:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#s.settimeout(120.0)
sock.connect((a_ip, int(port)))
if not ping(sock):
result = False
sock.shutdown(socket.SHUT_RDWR)
sock.close()
return result
def alive(port, machines=[]):
attempted = 0
success = False
while (attempted < conf.tries):
try:
if utilities.multiping(port, machines):
success = True
print "hey"
break
except Exception as e:
print "ouups"
attempted += 1
return success
| Clean up, comments, liveness checking, robust data transfer | Clean up, comments, liveness checking, robust data transfer
| Python | bsd-2-clause | mavroudisv/Crux | ---
+++
@@ -42,8 +42,10 @@
try:
if utilities.multiping(port, machines):
success = True
+ print "hey"
break
except Exception as e:
+ print "ouups"
attempted += 1
return success |
e90c7d034f070361893f77d7a257640d647be0c7 | mbuild/tests/test_xyz.py | mbuild/tests/test_xyz.py | import numpy as np
import pytest
import mbuild as mb
from mbuild.utils.io import get_fn
from mbuild.tests.base_test import BaseTest
from mbuild.exceptions import MBuildError
class TestXYZ(BaseTest):
def test_load_no_top(self, ethane):
ethane.save(filename='ethane.xyz')
ethane_in = mb.load('ethane.xyz')
assert len(ethane_in.children) == 8
assert ethane_in.n_bonds == 0
assert set([child.name for child in ethane_in.children]) == {'C', 'H'}
def test_wrong_n_atoms(self):
with pytest.raises(MBuildError):
mb.load(get_fn('too_few_atoms.xyz'))
with pytest.raises(MBuildError):
mb.load(get_fn('too_many_atoms.xyz'))
def test_save(self, ethane):
ethane.save(filename='ethane.xyz')
ethane_in = mb.load('ethane.xyz')
assert len(ethane_in.children) == 8
assert set([child.name for child in ethane_in.children]) == {'C', 'H'}
def test_coordinates(self, ethane):
ethane.save(filename='ethane.xyz')
ethane_in = mb.load('ethane.xyz')
assert np.allclose(ethane.xyz, ethane_in.xyz)
| import numpy as np
import pytest
import mbuild as mb
from mbuild.formats.xyz import write_xyz
from mbuild.utils.io import get_fn
from mbuild.tests.base_test import BaseTest
from mbuild.exceptions import MBuildError
class TestXYZ(BaseTest):
def test_load_no_top(self, ethane):
ethane.save(filename='ethane.xyz')
ethane_in = mb.load('ethane.xyz')
assert len(ethane_in.children) == 8
assert ethane_in.n_bonds == 0
assert set([child.name for child in ethane_in.children]) == {'C', 'H'}
def test_wrong_n_atoms(self):
with pytest.raises(MBuildError):
mb.load(get_fn('too_few_atoms.xyz'))
with pytest.raises(MBuildError):
mb.load(get_fn('too_many_atoms.xyz'))
def test_bad_input(self, ethane):
with pytest.raises(ValueError):
assert isinstance(ethane, mb.Compound)
write_xyz(ethane, 'compound.xyz')
def test_save(self, ethane):
ethane.save(filename='ethane.xyz')
ethane_in = mb.load('ethane.xyz')
assert len(ethane_in.children) == 8
assert set([child.name for child in ethane_in.children]) == {'C', 'H'}
def test_coordinates(self, ethane):
ethane.save(filename='ethane.xyz')
ethane_in = mb.load('ethane.xyz')
assert np.allclose(ethane.xyz, ethane_in.xyz)
| Add test to ensure write_xyz does not directly take in compound | Add test to ensure write_xyz does not directly take in compound
| Python | mit | iModels/mbuild,iModels/mbuild | ---
+++
@@ -2,6 +2,7 @@
import pytest
import mbuild as mb
+from mbuild.formats.xyz import write_xyz
from mbuild.utils.io import get_fn
from mbuild.tests.base_test import BaseTest
from mbuild.exceptions import MBuildError
@@ -21,6 +22,11 @@
with pytest.raises(MBuildError):
mb.load(get_fn('too_many_atoms.xyz'))
+ def test_bad_input(self, ethane):
+ with pytest.raises(ValueError):
+ assert isinstance(ethane, mb.Compound)
+ write_xyz(ethane, 'compound.xyz')
+
def test_save(self, ethane):
ethane.save(filename='ethane.xyz')
ethane_in = mb.load('ethane.xyz') |
5682c2a311dbaf94f0b7876b10cabbc90eb88628 | hooks/post_gen_project.py | hooks/post_gen_project.py | """
Does the following:
1. Removes _version file and run versionner install if use_versionner == y
"""
from __future__ import print_function
import os
from subprocess import call
# Get the root project directory
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
def remove_file(file_name):
if os.path.exists(file_name):
os.remove(file_name)
def remove_version_file():
"""Removes the _version file if versionner is going to be used."""
file_name = os.path.join(PROJECT_DIRECTORY,
'{{ cookiecutter.project_name }}/_version.py')
remove_file(file_name)
def install_versioneer():
"""Start versioneer in the repository, this will create
versioneer.py and _version.py."""
call(['versioneer', 'install'])
# 1. Removes _version file and run versionner install if use_versionner == y
if '{{ cookiecutter.use_versioneer }}'.lower() == 'y':
remove_version_file()
try:
install_versioneer()
except Exception:
print(
"versioneer isn't avalaible, please install versioneer and run:\n $ versioneer install")
| """
Does the following:
1. Removes _version file and run versionner install if use_versionner == y
"""
from __future__ import print_function
import os
from subprocess import call
# Get the root project directory
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
def remove_file(file_name):
if os.path.exists(file_name):
os.remove(file_name)
def remove_version_file():
"""Removes the _version file if versionner is going to be used."""
file_name = os.path.join(PROJECT_DIRECTORY,
'{{ cookiecutter.project_name }}/_version.py')
remove_file(file_name)
def install_versioneer():
"""Start versioneer in the repository, this will create
versioneer.py and _version.py."""
try:
call(['versioneer', 'install'])
except Exception:
print(
"versioneer isn't avalaible, please install versioneer and run:\n $ versioneer install")
def init_git():
"""Start git repository"""
try:
call(['git', 'init'])
except Exception:
print("git isn't avalaible, please install git and run:\n $ git init")
# 1. Removes _version file and run versionner install if use_versionner == y
if '{{ cookiecutter.use_versioneer }}'.lower() == 'y':
remove_version_file()
init_git()
install_versioneer()
| Add git init to post hooks, and move error handling to functions | Add git init to post hooks, and move error handling to functions
| Python | mit | rlaverde/spyder-plugin-cookiecutter | ---
+++
@@ -27,14 +27,24 @@
def install_versioneer():
"""Start versioneer in the repository, this will create
versioneer.py and _version.py."""
- call(['versioneer', 'install'])
+ try:
+ call(['versioneer', 'install'])
+ except Exception:
+ print(
+ "versioneer isn't avalaible, please install versioneer and run:\n $ versioneer install")
+
+def init_git():
+ """Start git repository"""
+ try:
+ call(['git', 'init'])
+ except Exception:
+ print("git isn't avalaible, please install git and run:\n $ git init")
+
# 1. Removes _version file and run versionner install if use_versionner == y
if '{{ cookiecutter.use_versioneer }}'.lower() == 'y':
remove_version_file()
- try:
- install_versioneer()
- except Exception:
- print(
- "versioneer isn't avalaible, please install versioneer and run:\n $ versioneer install")
+
+ init_git()
+ install_versioneer() |
75d3ad43874e0db206958cdbd26fe4ab039d8d20 | reaper.py | reaper.py | #!/usr/bin/python
from redis import Redis
import time
from messages import addSystemMessage
STARTTIME = 1302231346
PING_PERIOD = 10
SEARCH_PERIOD = 1
def getTime():
return time.time() - STARTTIME
def getD(db, session, key, defaultValue=''):
v = db.hget("session-"+session, key)
if v is not None:
return v
return defaultValue
if __name__=='__main__':
db = Redis(host='localhost')
while True:
for dead in db.zrangebyscore('chats-alive', 0, getTime()-PING_PERIOD*2):
chat, session = dead.split('/') # FIXME: what if a user fucks this up by sticking a / in their uid?
db.zrem('chats-alive', dead)
db.srem(('chat-%s-sessions' % chat), session)
db.srem('sessions-chatting', session)
name = getD(db, session, 'name', 'UNKNOWN USER')
print 'dead', dead, name
addSystemMessage(db, chat, '%s\'s connection timed out. Please don\'t quit straight away; they could be back.' % (name))
for dead in db.zrangebyscore('searchers', 0, getTime()-SEARCH_PERIOD*2):
print 'reaping searcher', dead
db.zrem('searchers', dead)
time.sleep(1)
| #!/usr/bin/python
from redis import Redis
import time
from messages import addSystemMessage
STARTTIME = 1302231346
PING_PERIOD = 10
SEARCH_PERIOD = 1
def getTime():
return time.time() - STARTTIME
def getD(db, session, key, defaultValue=''):
v = db.hget("session-"+session, key)
if v is not None:
return v
return defaultValue
if __name__=='__main__':
db = Redis(host='localhost')
while True:
for dead in db.zrangebyscore('chats-alive', 0, getTime()-PING_PERIOD*2):
chat, session = dead.split('/') # FIXME: what if a user fucks this up by sticking a / in their uid?
db.zrem('chats-alive', dead)
db.srem(('chat-%s-sessions' % chat), session)
db.srem('sessions-chatting', session)
name = getD(db, session, 'name', 'UNKNOWN USER')
print 'dead', dead, name
addSystemMessage(db, chat, '%s\'s connection timed out. Please don\'t quit straight away; they could be back.' % (name), True)
for dead in db.zrangebyscore('searchers', 0, getTime()-SEARCH_PERIOD*2):
print 'reaping searcher', dead
db.zrem('searchers', dead)
time.sleep(1)
| Update user list when reaping. | Update user list when reaping.
| Python | mit | MSPARP/MSPARP,MSPARP/MSPARP,MSPARP/MSPARP | ---
+++
@@ -30,7 +30,7 @@
db.srem('sessions-chatting', session)
name = getD(db, session, 'name', 'UNKNOWN USER')
print 'dead', dead, name
- addSystemMessage(db, chat, '%s\'s connection timed out. Please don\'t quit straight away; they could be back.' % (name))
+ addSystemMessage(db, chat, '%s\'s connection timed out. Please don\'t quit straight away; they could be back.' % (name), True)
for dead in db.zrangebyscore('searchers', 0, getTime()-SEARCH_PERIOD*2):
print 'reaping searcher', dead |
309e4a922729e38a855bd89982cef9b40ba55831 | cabot/metricsapp/models/elastic.py | cabot/metricsapp/models/elastic.py | from django.db import models
from cabot.metricsapp.api import create_es_client
from .base import MetricsSourceBase
class ElasticsearchSource(MetricsSourceBase):
class Meta:
app_label = 'metricsapp'
def __str__(self):
return self.name
urls = models.TextField(
max_length=250,
null=False,
help_text='Comma-separated list of Elasticsearch hosts. '
'Format: "localhost" or "https://user:secret@localhost:443."'
)
index = models.TextField(
max_length=50,
default='*',
help_text='Elasticsearch index name. Can include wildcards (*)',
)
timeout = models.IntegerField(
default=60,
help_text='Timeout for queries to this index.'
)
_client = None
@property
def client(self):
"""
Return a global elasticsearch-py client for this ESSource (recommended practice
for elasticsearch-py).
"""
if not self._client:
self._client = create_es_client(self.urls, self.timeout)
return self._client
def save(self, *args, **kwargs):
"""
If the timeout or urls changes, we need to create a new global client.
"""
self._client = create_es_client(self.urls, self.timeout)
super(ElasticsearchSource, self).save(*args, **kwargs)
| from django.db import models
from cabot.metricsapp.api import create_es_client
from .base import MetricsSourceBase
class ElasticsearchSource(MetricsSourceBase):
class Meta:
app_label = 'metricsapp'
def __str__(self):
return self.name
urls = models.TextField(
max_length=250,
null=False,
help_text='Comma-separated list of Elasticsearch hosts. '
'Format: "localhost" or "https://user:secret@localhost:443."'
)
index = models.TextField(
max_length=50,
default='*',
help_text='Elasticsearch index name. Can include wildcards (*)',
)
timeout = models.IntegerField(
default=60,
help_text='Timeout for queries to this index.'
)
_clients = {}
@property
def client(self):
"""
Return a global elasticsearch-py client for this ESSource (recommended practice
for elasticsearch-py).
"""
client_key = '{}_{}'.format(self.urls, self.timeout)
client = self._clients.get(client_key)
if not client:
client = create_es_client(self.urls, self.timeout)
self._clients[client_key] = client
return client
| Create new clients if timeout/urls change and store in a dict keyed by urls_timeout | Create new clients if timeout/urls change and store in a dict keyed by urls_timeout
| Python | mit | Affirm/cabot,Affirm/cabot,Affirm/cabot,Affirm/cabot | ---
+++
@@ -26,7 +26,7 @@
help_text='Timeout for queries to this index.'
)
- _client = None
+ _clients = {}
@property
def client(self):
@@ -34,13 +34,11 @@
Return a global elasticsearch-py client for this ESSource (recommended practice
for elasticsearch-py).
"""
- if not self._client:
- self._client = create_es_client(self.urls, self.timeout)
- return self._client
+ client_key = '{}_{}'.format(self.urls, self.timeout)
+ client = self._clients.get(client_key)
- def save(self, *args, **kwargs):
- """
- If the timeout or urls changes, we need to create a new global client.
- """
- self._client = create_es_client(self.urls, self.timeout)
- super(ElasticsearchSource, self).save(*args, **kwargs)
+ if not client:
+ client = create_es_client(self.urls, self.timeout)
+ self._clients[client_key] = client
+
+ return client |
5ac675b36c7c7ba9110b6b16e11a56f554ff8c8e | signbank/video/urls.py | signbank/video/urls.py | from django.conf.urls import *
urlpatterns = patterns('',
(r'^video/(?P<videoid>.*)$', 'signbank.video.views.video'),
(r'^upload/', 'signbank.video.views.addvideo'),
(r'^delete/(?P<videoid>.*)$', 'signbank.video.views.deletevideo'),
(r'^poster/(?P<videoid>.*)$', 'signbank.video.views.poster'),
(r'^iframe/(?P<videoid>.*)$', 'signbank.video.views.iframe'),
)
| from django.conf.urls import *
urlpatterns = patterns('',
(r'^video/(?P<videoid>\d+)$', 'signbank.video.views.video'),
(r'^upload/', 'signbank.video.views.addvideo'),
(r'^delete/(?P<videoid>\d+)$', 'signbank.video.views.deletevideo'),
(r'^poster/(?P<videoid>\d+)$', 'signbank.video.views.poster'),
(r'^iframe/(?P<videoid>\d+)$', 'signbank.video.views.iframe'),
)
| Use more explicit pattern for video id in URL to prevent matching trailing slash. | Use more explicit pattern for video id in URL to prevent matching trailing slash.
| Python | bsd-3-clause | Signbank/Auslan-signbank,Signbank/Auslan-signbank,Signbank/BSL-signbank,Signbank/BSL-signbank,Signbank/BSL-signbank,Signbank/Auslan-signbank,Signbank/BSL-signbank,Signbank/Auslan-signbank | ---
+++
@@ -2,11 +2,11 @@
urlpatterns = patterns('',
- (r'^video/(?P<videoid>.*)$', 'signbank.video.views.video'),
+ (r'^video/(?P<videoid>\d+)$', 'signbank.video.views.video'),
(r'^upload/', 'signbank.video.views.addvideo'),
- (r'^delete/(?P<videoid>.*)$', 'signbank.video.views.deletevideo'),
- (r'^poster/(?P<videoid>.*)$', 'signbank.video.views.poster'),
- (r'^iframe/(?P<videoid>.*)$', 'signbank.video.views.iframe'),
+ (r'^delete/(?P<videoid>\d+)$', 'signbank.video.views.deletevideo'),
+ (r'^poster/(?P<videoid>\d+)$', 'signbank.video.views.poster'),
+ (r'^iframe/(?P<videoid>\d+)$', 'signbank.video.views.iframe'),
)
|
5dc5de9dab24cf698dc26db24d1e1697472c2e05 | tests/integration/pillar/test_pillar_include.py | tests/integration/pillar/test_pillar_include.py | from __future__ import unicode_literals
from tests.support.case import ModuleCase
class PillarIncludeTest(ModuleCase):
def test_pillar_include(self):
'''
Test pillar include
'''
ret = self.minion_run('pillar.items')
assert 'a' in ret['element']
assert ret['element']['a'] == {'a': ['Entry A']}
assert 'b' in ret['element']
assert ret['element']['b'] == {'b': ['Entry B']}
def test_pillar_glob_include(self):
'''
Test pillar include via glob pattern
'''
ret = self.minion_run('pillar.items')
assert 'glob-a' in ret
assert ret['glob-a'] == 'Entry A'
assert 'glob-b' in ret
assert ret['glob-b'] == 'Entry B'
| # -*- coding: utf-8 -*-
'''
Pillar include tests
'''
from __future__ import unicode_literals
from tests.support.case import ModuleCase
class PillarIncludeTest(ModuleCase):
def test_pillar_include(self):
'''
Test pillar include
'''
ret = self.minion_run('pillar.items')
assert 'a' in ret['element']
assert ret['element']['a'] == {'a': ['Entry A']}
assert 'b' in ret['element']
assert ret['element']['b'] == {'b': ['Entry B']}
def test_pillar_glob_include(self):
'''
Test pillar include via glob pattern
'''
ret = self.minion_run('pillar.items')
assert 'glob-a' in ret
assert ret['glob-a'] == 'Entry A'
assert 'glob-b' in ret
assert ret['glob-b'] == 'Entry B'
| Use file encoding and add docstring | Use file encoding and add docstring
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | ---
+++
@@ -1,4 +1,9 @@
+# -*- coding: utf-8 -*-
+'''
+Pillar include tests
+'''
from __future__ import unicode_literals
+
from tests.support.case import ModuleCase
|
443c7f0758b8131069aa0ef9e89eeed6f2d086c1 | pyheufybot/bothandler.py | pyheufybot/bothandler.py | import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.yml")
self.globalConfig.loadConfig(None)
configList = self.getConfigList()
if len(configList) == 0:
print "*** WARNING: No server configs found. Using the global config instead."
else:
for filename in self.getConfigList():
config = Config(filename, globalConfig.settings)
def getConfigList(self):
root = os.path.join("config")
configs = []
for item in os.listdir(root):
if not os.path.isfile(os.path.join(root, item)):
continue
if not item.endswith(".yml"):
continue
if item == "globalconfig.yml":
continue
configs.append(item)
return configs
if __name__ == "__main__":
# Create folders
if not os.path.exists(os.path.join("config")):
os.makedirs("config")
handler = BotHandler() | import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.yml")
self.globalConfig.loadConfig(None)
configList = self.getConfigList()
if len(configList) == 0:
print "WARNING: No server configs found. Using the global config instead."
else:
for filename in self.getConfigList():
config = Config(filename, globalConfig.settings)
def getConfigList(self):
root = os.path.join("config")
configs = []
for item in os.listdir(root):
if not os.path.isfile(os.path.join(root, item)):
continue
if not item.endswith(".yml"):
continue
if item == "globalconfig.yml":
continue
configs.append(item)
return configs
if __name__ == "__main__":
# Create folders
if not os.path.exists(os.path.join("config")):
os.makedirs("config")
handler = BotHandler()
| Make debug logging a bit more consistent | Make debug logging a bit more consistent | Python | mit | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot | ---
+++
@@ -14,7 +14,7 @@
configList = self.getConfigList()
if len(configList) == 0:
- print "*** WARNING: No server configs found. Using the global config instead."
+ print "WARNING: No server configs found. Using the global config instead."
else:
for filename in self.getConfigList():
config = Config(filename, globalConfig.settings) |
a01d87c77db46eeb61ff175e6f7cb6973fe80fa2 | python/misc/functions.py | python/misc/functions.py | #!/usr/bin/env python
import socket
def convert_filetime_to_epoch(filetime):
return (filetime / 10000000) - 11644473600
# Can be used to test connectivity if telnet isn't installed (https://stackoverflow.com/a/33117579/399105)
def test_connectivity(host, port, timeout=3):
try:
socket.setdefaulttimeout(timeout)
socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((host, port))
return True
except Exception as ex:
print(ex.message)
return False
| #!/usr/bin/env python
import socket
def convert_filetime_to_epoch(filetime):
return (filetime / 10000000) - 11644473600
# Can be used to test connectivity if telnet isn't installed (https://stackoverflow.com/a/33117579/399105)
def test_connectivity(host, port, timeout=3):
try:
socket.setdefaulttimeout(timeout)
socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((host, port))
return True
except Exception as ex:
print(ex)
return False
| Fix DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 | Fix DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
| Python | mit | bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile | ---
+++
@@ -12,5 +12,5 @@
socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((host, port))
return True
except Exception as ex:
- print(ex.message)
+ print(ex)
return False |
55476a86ed482d2e1f473dc629848d2068225c73 | keras/dtensor/__init__.py | keras/dtensor/__init__.py | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# 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.
# ==============================================================================
"""Keras' DTensor library."""
_DTENSOR_API_ENABLED = False
# Conditional import the dtensor API, since it is currently broken in OSS.
if _DTENSOR_API_ENABLED:
# pylint: disable=g-direct-tensorflow-import, g-import-not-at-top
from tensorflow.dtensor import python as dtensor_api
else:
# Leave it with a placeholder, so that the import line from other python file
# will not break.
dtensor_api = None
| # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# 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.
# ==============================================================================
"""Keras' DTensor library."""
_DTENSOR_API_ENABLED = False
# Conditional import the dtensor API, since it is currently broken in OSS.
if _DTENSOR_API_ENABLED:
from tensorflow.compat.v2.experimental import dtensor as dtensor_api # pylint: disable=g-import-not-at-top
else:
# Leave it with a placeholder, so that the import line from other python file
# will not break.
dtensor_api = None
| Change keras to use dtensor public API. | Change keras to use dtensor public API.
PiperOrigin-RevId: 438605222
| Python | apache-2.0 | keras-team/keras,keras-team/keras | ---
+++
@@ -19,11 +19,8 @@
# Conditional import the dtensor API, since it is currently broken in OSS.
if _DTENSOR_API_ENABLED:
- # pylint: disable=g-direct-tensorflow-import, g-import-not-at-top
- from tensorflow.dtensor import python as dtensor_api
+ from tensorflow.compat.v2.experimental import dtensor as dtensor_api # pylint: disable=g-import-not-at-top
else:
# Leave it with a placeholder, so that the import line from other python file
# will not break.
dtensor_api = None
-
- |
0b88b8e2cf1f841535a679bea249fba19cd2ba1d | maas/client/viscera/tests/test_sshkeys.py | maas/client/viscera/tests/test_sshkeys.py | """Test for `maas.client.viscera.sshkeys`."""
from .. import sshkeys
from ...testing import (
make_string_without_spaces,
TestCase,
)
from ..testing import bind
def make_origin():
return bind(sshkeys.SSHKeys, sshkeys.SSHKey)
class TestSSHKeys(TestCase):
def test__sshkeys_create(self):
""" SSHKeys.create() returns a new SSHKey. """
SSHKeys = make_origin().SSHKeys
key = make_string_without_spaces()
SSHKeys._handler.create.return_value = {
"id": 1,
"key": key,
"keysource": "",
}
SSHKeys.create(key=key)
SSHKeys._handler.create.assert_called_once_with(
key=key
)
| """Test for `maas.client.viscera.sshkeys`."""
import random
from .. import sshkeys
from ...testing import (
make_string_without_spaces,
TestCase,
)
from ..testing import bind
from testtools.matchers import Equals
def make_origin():
return bind(sshkeys.SSHKeys, sshkeys.SSHKey)
class TestSSHKeys(TestCase):
def test__sshkeys_create(self):
""" SSHKeys.create() returns a new SSHKey. """
SSHKeys = make_origin().SSHKeys
key = make_string_without_spaces()
SSHKeys._handler.create.return_value = {
"id": 1,
"key": key,
"keysource": "",
}
SSHKeys.create(key=key)
SSHKeys._handler.create.assert_called_once_with(
key=key
)
def test__sshkeys_read(self):
""" SSHKeys.read() returns a list of SSH keys. """
SSHKeys = make_origin().SSHKeys
keys = [
{
"id": random.randint(0, 100),
"key": make_string_without_spaces(),
"keysource": "",
}
for _ in range(3)
]
SSHKeys._handler.read.return_value = keys
ssh_keys = SSHKeys.read()
self.assertThat(len(ssh_keys), Equals(3))
class TestSSHKey(TestCase):
def test__sshkey_read(self):
""" SSHKeys.read() returns a single SSH key. """
SSHKey = make_origin().SSHKey
key_id = random.randint(0, 100)
key_dict = {
"id": key_id,
"key": make_string_without_spaces(),
"keysource": "",
}
SSHKey._handler.read.return_value = key_dict
self.assertThat(SSHKey.read(id=key_id), Equals(SSHKey(key_dict)))
| Add tests for .read methods | Add tests for .read methods
| Python | agpl-3.0 | alburnum/alburnum-maas-client,blakerouse/python-libmaas | ---
+++
@@ -1,4 +1,6 @@
"""Test for `maas.client.viscera.sshkeys`."""
+
+import random
from .. import sshkeys
@@ -8,6 +10,8 @@
)
from ..testing import bind
+
+from testtools.matchers import Equals
def make_origin():
@@ -29,3 +33,33 @@
SSHKeys._handler.create.assert_called_once_with(
key=key
)
+
+ def test__sshkeys_read(self):
+ """ SSHKeys.read() returns a list of SSH keys. """
+ SSHKeys = make_origin().SSHKeys
+ keys = [
+ {
+ "id": random.randint(0, 100),
+ "key": make_string_without_spaces(),
+ "keysource": "",
+ }
+ for _ in range(3)
+ ]
+ SSHKeys._handler.read.return_value = keys
+ ssh_keys = SSHKeys.read()
+ self.assertThat(len(ssh_keys), Equals(3))
+
+
+class TestSSHKey(TestCase):
+
+ def test__sshkey_read(self):
+ """ SSHKeys.read() returns a single SSH key. """
+ SSHKey = make_origin().SSHKey
+ key_id = random.randint(0, 100)
+ key_dict = {
+ "id": key_id,
+ "key": make_string_without_spaces(),
+ "keysource": "",
+ }
+ SSHKey._handler.read.return_value = key_dict
+ self.assertThat(SSHKey.read(id=key_id), Equals(SSHKey(key_dict))) |
0633a9dbc2dd5972c41a1d3a21243af7f1a11055 | core/migrations/0065_alter_machinerequest_required_fields.py | core/migrations/0065_alter_machinerequest_required_fields.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-09-29 19:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0064_remove_ssh_keys_toggle'),
]
operations = [
migrations.AlterModelOptions(
name='atmosphereuser',
options={'verbose_name': 'user', 'verbose_name_plural': 'users'},
),
migrations.AlterField(
model_name='machinerequest',
name='new_application_description',
field=models.TextField(default=b'Description Missing'),
),
migrations.AlterField(
model_name='machinerequest',
name='new_application_name',
field=models.CharField(default='No Name Provided', max_length=256),
preserve_default=False,
),
migrations.AlterField(
model_name='machinerequest',
name='new_application_visibility',
field=models.CharField(default=b'private', max_length=256),
),
migrations.AlterField(
model_name='machinerequest',
name='new_version_change_log',
field=models.TextField(default=b'Changelog Missing'),
),
migrations.AlterField(
model_name='machinerequest',
name='new_version_name',
field=models.CharField(default=b'1.0', max_length=256),
),
]
| # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-09-29 19:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0064_remove_ssh_keys_toggle'),
]
operations = [
migrations.AlterField(
model_name='machinerequest',
name='new_application_description',
field=models.TextField(default=b'Description Missing'),
),
migrations.AlterField(
model_name='machinerequest',
name='new_application_name',
field=models.CharField(default='No Name Provided', max_length=256),
preserve_default=False,
),
migrations.AlterField(
model_name='machinerequest',
name='new_application_visibility',
field=models.CharField(default=b'private', max_length=256),
),
migrations.AlterField(
model_name='machinerequest',
name='new_version_change_log',
field=models.TextField(default=b'Changelog Missing'),
),
migrations.AlterField(
model_name='machinerequest',
name='new_version_name',
field=models.CharField(default=b'1.0', max_length=256),
),
]
| Remove Meta-class change for AtmosphereUser | Remove Meta-class change for AtmosphereUser
Fixed in solitary-snipe, so not needed anymore. | Python | apache-2.0 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | ---
+++
@@ -12,10 +12,6 @@
]
operations = [
- migrations.AlterModelOptions(
- name='atmosphereuser',
- options={'verbose_name': 'user', 'verbose_name_plural': 'users'},
- ),
migrations.AlterField(
model_name='machinerequest',
name='new_application_description', |
52f85821e35389741f5c595c1808b7b7efab2850 | config.py | config.py | FFMPEG_PATH = '/usr/local/bin/ffmpeg'
VIDEO_CODEC = 'h264' # used with ffprobe to detect whether or not we need to encode
VIDEO_ENCODER = 'h264_omx'
AUDIO_CODEC = 'aac' # used with ffprobe to detect whether or not we need to encode
AUDIO_ENCODER = 'aac'
BITRATE = '2500k'
INPUT_EXTS = ['.mkv', '.mp4']
OUTPUT_EXT = '.mp4'
| FFMPEG_PATH = '/usr/local/bin/ffmpeg'
VIDEO_CODEC = 'h264' # used with ffprobe to detect whether or not we need to encode
VIDEO_ENCODER = 'h264_omx'
AUDIO_CODEC = 'aac' # used with ffprobe to detect whether or not we need to encode
AUDIO_ENCODER = 'aac'
BITRATE = '2500k'
INPUT_EXTS = ['.mkv', '.mp4', '.avi']
OUTPUT_EXT = '.mp4'
| Add avi as input ext | Add avi as input ext
| Python | mit | danielbreves/auto_encoder | ---
+++
@@ -8,5 +8,5 @@
BITRATE = '2500k'
-INPUT_EXTS = ['.mkv', '.mp4']
+INPUT_EXTS = ['.mkv', '.mp4', '.avi']
OUTPUT_EXT = '.mp4' |
3e66c6546eda367bfef4038a4bb512862a9dd01f | config.py | config.py | # -*- coding: utf-8 -*-
DOMAIN = 'studyindenmark-newscontrol.appspot.com'
MAIL_SENDER = "Per Thulin <per@youtify.com>" | # -*- coding: utf-8 -*-
DOMAIN = 'studyindenmark-newscontrol.appspot.com'
MAIL_SENDER = "Study in Denmark <studyindenmark@gmail.com>" | Change email sender to studyindenmark@gmail.com | Change email sender to studyindenmark@gmail.com
| Python | mit | studyindenmark/newscontrol,youtify/newscontrol,studyindenmark/newscontrol,youtify/newscontrol | ---
+++
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
DOMAIN = 'studyindenmark-newscontrol.appspot.com'
-MAIL_SENDER = "Per Thulin <per@youtify.com>"
+MAIL_SENDER = "Study in Denmark <studyindenmark@gmail.com>" |
aee3fa76d0d61778f17d200f630bbed145fd69c8 | nova/policies/instance_usage_audit_log.py | nova/policies/instance_usage_audit_log.py | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# 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.
from oslo_policy import policy
from nova.policies import base
BASE_POLICY_NAME = 'os_compute_api:os-instance-usage-audit-log'
instance_usage_audit_log_policies = [
policy.RuleDefault(
name=BASE_POLICY_NAME,
check_str=base.RULE_ADMIN_API),
]
def list_rules():
return instance_usage_audit_log_policies
| # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# 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.
from nova.policies import base
BASE_POLICY_NAME = 'os_compute_api:os-instance-usage-audit-log'
instance_usage_audit_log_policies = [
base.create_rule_default(
BASE_POLICY_NAME,
base.RULE_ADMIN_API,
"""Lists all usage audits and that occurred before a specified time
for all servers on all compute hosts where usage auditing is configured.""",
[
{
'method': 'GET',
'path': '/os-instance_usage_audit_log'
},
{
'method': 'GET',
'path': '/os-instance_usage_audit_log/{before_timestamp}'
}
]),
]
def list_rules():
return instance_usage_audit_log_policies
| Add policy description for instance-usage-audit-log | Add policy description for instance-usage-audit-log
This commit adds policy doc for instance-usage-audit-log policies.
Partial implement blueprint policy-docs
Change-Id: I8baedb9cb69ccb04361cc0003311487599bc9440
| Python | apache-2.0 | rahulunair/nova,jianghuaw/nova,mahak/nova,klmitch/nova,Juniper/nova,rahulunair/nova,klmitch/nova,mahak/nova,phenoxim/nova,rajalokan/nova,openstack/nova,mikalstill/nova,mikalstill/nova,klmitch/nova,gooddata/openstack-nova,Juniper/nova,Juniper/nova,mahak/nova,gooddata/openstack-nova,phenoxim/nova,jianghuaw/nova,rahulunair/nova,vmturbo/nova,gooddata/openstack-nova,vmturbo/nova,mikalstill/nova,jianghuaw/nova,vmturbo/nova,gooddata/openstack-nova,openstack/nova,vmturbo/nova,klmitch/nova,rajalokan/nova,rajalokan/nova,jianghuaw/nova,openstack/nova,rajalokan/nova,Juniper/nova | ---
+++
@@ -13,8 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-from oslo_policy import policy
-
from nova.policies import base
@@ -22,9 +20,21 @@
instance_usage_audit_log_policies = [
- policy.RuleDefault(
- name=BASE_POLICY_NAME,
- check_str=base.RULE_ADMIN_API),
+ base.create_rule_default(
+ BASE_POLICY_NAME,
+ base.RULE_ADMIN_API,
+ """Lists all usage audits and that occurred before a specified time
+for all servers on all compute hosts where usage auditing is configured.""",
+ [
+ {
+ 'method': 'GET',
+ 'path': '/os-instance_usage_audit_log'
+ },
+ {
+ 'method': 'GET',
+ 'path': '/os-instance_usage_audit_log/{before_timestamp}'
+ }
+ ]),
]
|
d8b5aa8d51fa61c400dd1929d3586e202b860b9d | registration/__init__.py | registration/__init__.py | from django.utils.version import get_version as django_get_version
VERSION = (0, 9, 0, 'beta', 1)
def get_version():
return django_get_version(VERSION) # pragma: no cover
| VERSION = (0, 9, 0, 'beta', 1)
def get_version():
from django.utils.version import get_version as django_get_version
return django_get_version(VERSION) # pragma: no cover
| Move import of Django's get_version into django-registration's get_version, to avoid dependency-order problems. | Move import of Django's get_version into django-registration's get_version, to avoid dependency-order problems.
| Python | bsd-3-clause | remarkablerocket/django-mailinglist-registration,remarkablerocket/django-mailinglist-registration | ---
+++
@@ -1,8 +1,6 @@
-from django.utils.version import get_version as django_get_version
-
-
VERSION = (0, 9, 0, 'beta', 1)
def get_version():
+ from django.utils.version import get_version as django_get_version
return django_get_version(VERSION) # pragma: no cover |
fedf78926b7c135f0f86934975a2b70aa1256884 | app/models.py | app/models.py | from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from . import db
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
email = db.Column(db.String(64),
nullable=False,
unique=True,
index=True)
username = db.Column(db.String(64),
nullable=False,
unique=True,
index=True)
is_admin = db.Column(db.Boolean)
password_hash = db.Column(db.String(128))
name = db.Column(db.String(64))
member_since = db.Column(db.DateTime(), default = datetime.utcnow)
@property
def password(self):
raise AttributeError('Password is not a readable attribute')
@password.setter
def password(self, password):
self.password_hash = generate_password_hash(password)
def verify_password(self, password):
return check_password_hash(self.password_hash, password)
| from datetime import datetime
from flask.ext.login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from . import db, login_manager
class User(UserMixin, db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
email = db.Column(db.String(64),
nullable=False,
unique=True,
index=True)
username = db.Column(db.String(64),
nullable=False,
unique=True,
index=True)
is_admin = db.Column(db.Boolean)
password_hash = db.Column(db.String(128))
name = db.Column(db.String(64))
member_since = db.Column(db.DateTime(), default = datetime.utcnow)
@property
def password(self):
raise AttributeError('Password is not a readable attribute')
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
@password.setter
def password(self, password):
self.password_hash = generate_password_hash(password)
def verify_password(self, password):
return check_password_hash(self.password_hash, password)
| Add user_loader function for loading a user | Add user_loader function for loading a user
| Python | mit | finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is | ---
+++
@@ -1,10 +1,12 @@
from datetime import datetime
+
+from flask.ext.login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
-from . import db
+from . import db, login_manager
-class User(db.Model):
+class User(UserMixin, db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
email = db.Column(db.String(64),
@@ -23,6 +25,10 @@
@property
def password(self):
raise AttributeError('Password is not a readable attribute')
+
+ @login_manager.user_loader
+ def load_user(user_id):
+ return User.query.get(int(user_id))
@password.setter
def password(self, password): |
5fba86c9f9b0d647dc8f821a97a7cc2dbb76deeb | basis_set_exchange/tests/test_aux_sanity.py | basis_set_exchange/tests/test_aux_sanity.py | """
Tests for sanity of auxiliary basis sets
"""
import pytest
from .common_testvars import bs_names, bs_metadata
@pytest.mark.parametrize('basis_name', bs_names)
def test_aux_sanity(basis_name):
"""For all basis sets, check that
1. All aux basis sets exist
2. That the role of the aux basis set matches the role in
the orbital basis
"""
this_metadata = bs_metadata[basis_name]
for role, aux in this_metadata['auxiliaries'].items():
assert aux in bs_metadata
aux_metadata = bs_metadata[aux]
assert role == aux_metadata['role']
@pytest.mark.parametrize('basis_name', bs_names)
def test_aux_reverse(basis_name):
"""Make sure all aux basis sets are paired with at least one orbital basis set
"""
this_metadata = bs_metadata[basis_name]
r = this_metadata['role']
if r == 'orbital' or r == 'guess':
return
# Find where this basis set is listed as an auxiliary
found = False
for k, v in bs_metadata.items():
aux = v['auxiliaries']
for ak, av in aux.items():
if av == basis_name:
assert ak == r
found = True
assert found
| """
Tests for sanity of auxiliary basis sets
"""
import pytest
from .common_testvars import bs_names, bs_metadata
from ..misc import transform_basis_name
@pytest.mark.parametrize('basis_name', bs_names)
def test_aux_sanity(basis_name):
"""For all basis sets, check that
1. All aux basis sets exist
2. That the role of the aux basis set matches the role in
the orbital basis
"""
this_metadata = bs_metadata[basis_name]
for role, aux in this_metadata['auxiliaries'].items():
assert aux in bs_metadata
aux_metadata = bs_metadata[aux]
assert role == aux_metadata['role']
@pytest.mark.parametrize('basis_name', bs_names)
def test_aux_reverse(basis_name):
"""Make sure all aux basis sets are paired with at least one orbital basis set
"""
this_metadata = bs_metadata[basis_name]
role = this_metadata['role']
if role == 'orbital' or role == 'guess':
return
# All possible names for this auxiliary set
# We only have to match one
all_aux_names = this_metadata["other_names"] + [basis_name]
all_aux_names = [transform_basis_name(x) for x in all_aux_names]
# Find where this basis set is listed as an auxiliary
found = False
for k, v in bs_metadata.items():
aux = v['auxiliaries']
for aux_role, aux_name in aux.items():
if aux_name in all_aux_names:
assert aux_role == role
found = True
assert found
| Fix test: Auxiliaries can have multiple names | Fix test: Auxiliaries can have multiple names
| Python | bsd-3-clause | MOLSSI-BSE/basis_set_exchange | ---
+++
@@ -5,6 +5,7 @@
import pytest
from .common_testvars import bs_names, bs_metadata
+from ..misc import transform_basis_name
@pytest.mark.parametrize('basis_name', bs_names)
@@ -31,17 +32,22 @@
"""
this_metadata = bs_metadata[basis_name]
- r = this_metadata['role']
- if r == 'orbital' or r == 'guess':
+ role = this_metadata['role']
+ if role == 'orbital' or role == 'guess':
return
+
+ # All possible names for this auxiliary set
+ # We only have to match one
+ all_aux_names = this_metadata["other_names"] + [basis_name]
+ all_aux_names = [transform_basis_name(x) for x in all_aux_names]
# Find where this basis set is listed as an auxiliary
found = False
for k, v in bs_metadata.items():
aux = v['auxiliaries']
- for ak, av in aux.items():
- if av == basis_name:
- assert ak == r
+ for aux_role, aux_name in aux.items():
+ if aux_name in all_aux_names:
+ assert aux_role == role
found = True
assert found |
eb28f042e1fdc6b18fbbc75b2dc31825b9ee70ee | dev/scripts/milestone2rst.py | dev/scripts/milestone2rst.py | from __future__ import print_function
import urllib, json, sys
def generate(milestone):
# Find the milestone number for the given name
milestones_json = json.loads(urllib.urlopen('https://api.github.com/repos/CoolProp/CoolProp/milestones').read())
# Map between name and number
title_to_number_map = {stone['title']: stone['number'] for stone in milestones_json}
# Find the desired number
number = title_to_number_map[milestone]
# Get the issues associated with the milestone
issues = json.loads(urllib.urlopen('https://api.github.com/repos/CoolProp/CoolProp/issues?state=all&milestone='+str(number)).read())
# Make sure all issues are closed in this milestone
for issue in issues:
if issue['state'] != 'closed': raise ValueError('This issue is still open: ' + issue['title'])
rst = 'Issues Closed:\n\n'+'\n'.join(['* `#{n:d} <http://github.com/CoolProp/CoolProp/issues/{n:d}>`_ : {t:s}'.format(n = issue['number'], t = issue['title']) for issue in issues])
return rst
if __name__=='__main__':
if len(sys.argv) != 2:
raise ValueError('This script should be called like this: python milestone2rst.py v5')
print(generate(sys.argv[1])) | from __future__ import print_function
import urllib, json, sys
def generate(milestone):
# Find the milestone number for the given name
milestones_json = json.loads(urllib.urlopen('https://api.github.com/repos/CoolProp/CoolProp/milestones').read())
# Map between name and number
title_to_number_map = {stone['title']: stone['number'] for stone in milestones_json}
# Find the desired number
number = title_to_number_map[milestone]
# Get the issues associated with the milestone
issues = json.loads(urllib.urlopen('https://api.github.com/repos/CoolProp/CoolProp/issues?state=all&per_page=100&milestone='+str(number)).read())
# Make sure all issues are closed in this milestone
for issue in issues:
if issue['state'] != 'closed': raise ValueError('This issue is still open: ' + issue['title'])
rst = 'Issues Closed:\n\n'+'\n'.join(['* `#{n:d} <http://github.com/CoolProp/CoolProp/issues/{n:d}>`_ : {t:s}'.format(n = issue['number'], t = issue['title']) for issue in issues])
return rst
if __name__=='__main__':
if len(sys.argv) != 2:
raise ValueError('This script should be called like this: python milestone2rst.py v5')
print(generate(sys.argv[1])) | Allow to get up to 100 issues at once | Allow to get up to 100 issues at once
| Python | mit | dcprojects/CoolProp,DANA-Laboratory/CoolProp,JonWel/CoolProp,henningjp/CoolProp,JonWel/CoolProp,DANA-Laboratory/CoolProp,dcprojects/CoolProp,JonWel/CoolProp,CoolProp/CoolProp,CoolProp/CoolProp,CoolProp/CoolProp,dcprojects/CoolProp,CoolProp/CoolProp,henningjp/CoolProp,dcprojects/CoolProp,henningjp/CoolProp,JonWel/CoolProp,CoolProp/CoolProp,henningjp/CoolProp,dcprojects/CoolProp,henningjp/CoolProp,CoolProp/CoolProp,henningjp/CoolProp,DANA-Laboratory/CoolProp,JonWel/CoolProp,henningjp/CoolProp,dcprojects/CoolProp,CoolProp/CoolProp,DANA-Laboratory/CoolProp,JonWel/CoolProp,DANA-Laboratory/CoolProp,DANA-Laboratory/CoolProp,DANA-Laboratory/CoolProp,dcprojects/CoolProp,CoolProp/CoolProp,henningjp/CoolProp,JonWel/CoolProp | ---
+++
@@ -13,7 +13,7 @@
number = title_to_number_map[milestone]
# Get the issues associated with the milestone
- issues = json.loads(urllib.urlopen('https://api.github.com/repos/CoolProp/CoolProp/issues?state=all&milestone='+str(number)).read())
+ issues = json.loads(urllib.urlopen('https://api.github.com/repos/CoolProp/CoolProp/issues?state=all&per_page=100&milestone='+str(number)).read())
# Make sure all issues are closed in this milestone
for issue in issues: |
f69125a2e9dcd614057c87a36b415f8966075334 | distarray/tests/test_odin.py | distarray/tests/test_odin.py | import numpy as np
from IPython.parallel import Client
from distarray.client import DistArrayContext
from distarray import odin
import unittest
c = Client()
dv = c[:]
dac = DistArrayContext(dv)
@odin.local(dac)
def localsin(da):
return np.sin(da)
@odin.local(dac)
def localadd50(da):
return da + 50
@odin.local(dac)
def localsum(da):
return np.sum(da)
class TestLocal(unittest.TestCase):
def setUp(self):
dv.execute('import numpy as np')
self.da = dac.empty((1024, 1024))
self.da.fill(2 * np.pi)
def test_localsin(self):
db = localsin(self.da)
def test_localadd(self):
dc = localadd50(self.da)
def test_localsum(self):
dd = localsum(self.da)
#assert_allclose(db, 0)
if __name__ == '__main__':
unittest.main()
| import numpy as np
from IPython.parallel import Client
from distarray.client import DistArrayContext
from distarray import odin
import unittest
c = Client()
dv = c[:]
dac = DistArrayContext(dv)
@odin.local(dac)
def local_sin(da):
return np.sin(da)
@odin.local(dac)
def local_add50(da):
return da + 50
@odin.local(dac)
def local_sum(da):
return np.sum(da)
class TestLocal(unittest.TestCase):
def setUp(self):
dv.execute('import numpy as np')
self.da = dac.empty((1024, 1024))
self.da.fill(2 * np.pi)
def test_local_sin(self):
db = local_sin(self.da)
def test_local_add(self):
dc = local_add50(self.da)
def test_local_sum(self):
dd = local_sum(self.da)
if __name__ == '__main__':
unittest.main()
| Refactor names a bit for PEP8. | Refactor names a bit for PEP8. | Python | bsd-3-clause | enthought/distarray,RaoUmer/distarray,RaoUmer/distarray,enthought/distarray | ---
+++
@@ -12,17 +12,17 @@
@odin.local(dac)
-def localsin(da):
+def local_sin(da):
return np.sin(da)
@odin.local(dac)
-def localadd50(da):
+def local_add50(da):
return da + 50
@odin.local(dac)
-def localsum(da):
+def local_sum(da):
return np.sum(da)
@@ -33,15 +33,14 @@
self.da = dac.empty((1024, 1024))
self.da.fill(2 * np.pi)
- def test_localsin(self):
- db = localsin(self.da)
+ def test_local_sin(self):
+ db = local_sin(self.da)
- def test_localadd(self):
- dc = localadd50(self.da)
+ def test_local_add(self):
+ dc = local_add50(self.da)
- def test_localsum(self):
- dd = localsum(self.da)
- #assert_allclose(db, 0)
+ def test_local_sum(self):
+ dd = local_sum(self.da)
if __name__ == '__main__': |
e4332261b557c9567568517d33b55eaaa5d1468c | run_test_BMI_ku_model.py | run_test_BMI_ku_model.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 10 10:56:16 2017
@author: kangwang
"""
import sys
from permamodel.components import bmi_Ku_component
x=bmi_Ku_component.BmiKuMethod()
x.initialize()
x.update()
x.finalize()
print x._values["ALT"][:]
| #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 10 10:56:16 2017
@author: kangwang
"""
import os
import sys
from permamodel.components import bmi_Ku_component
from permamodel.tests import examples_directory
cfg_file = os.path.join(examples_directory, 'Ku_method.cfg')
x = bmi_Ku_component.BmiKuMethod()
x.initialize(cfg_file)
x.update()
x.finalize()
print x._values["ALT"][:]
| Initialize takes exactly one parameter | Initialize takes exactly one parameter
See http://bmi-python.readthedocs.io/en/latest/basic_modeling_interface.base.html#basic_modeling_interface.base.BmiBase.initialize
| Python | mit | permamodel/permamodel,permamodel/permamodel | ---
+++
@@ -6,13 +6,16 @@
@author: kangwang
"""
+import os
import sys
+from permamodel.components import bmi_Ku_component
+from permamodel.tests import examples_directory
-from permamodel.components import bmi_Ku_component
-x=bmi_Ku_component.BmiKuMethod()
+cfg_file = os.path.join(examples_directory, 'Ku_method.cfg')
+x = bmi_Ku_component.BmiKuMethod()
-x.initialize()
+x.initialize(cfg_file)
x.update()
x.finalize()
|
dcbb22300663f0484e81c13770f196e078e83ca5 | api/base/parsers.py | api/base/parsers.py |
from rest_framework.parsers import JSONParser
from api.base.renderers import JSONAPIRenderer
class JSONAPIParser(JSONParser):
"""
Parses JSON-serialized data. Overrides media_type.
"""
media_type = 'application/vnd.api+json'
renderer_class = JSONAPIRenderer
| from rest_framework.parsers import JSONParser
from api.base.renderers import JSONAPIRenderer
from api.base.exceptions import JSONAPIException
class JSONAPIParser(JSONParser):
"""
Parses JSON-serialized data. Overrides media_type.
"""
media_type = 'application/vnd.api+json'
renderer_class = JSONAPIRenderer
def parse(self, stream, media_type=None, parser_context=None):
"""
Parses the incoming bytestream as JSON and returns the resulting data
"""
result = super(JSONAPIParser, self).parse(stream, media_type=media_type, parser_context=parser_context)
data = result.get('data', {})
if data:
if 'attributes' not in data:
raise JSONAPIException(source={'pointer': '/data/attributes'}, detail='This field is required.')
id = data.get('id')
type = data.get('type')
attributes = data.get('attributes')
parsed = {'id': id, 'type': type}
parsed.update(attributes)
return parsed
else:
raise JSONAPIException(source={'pointer': '/data'}, detail='This field is required.')
| Add parse method which flattens data dictionary. | Add parse method which flattens data dictionary.
| Python | apache-2.0 | icereval/osf.io,RomanZWang/osf.io,cwisecarver/osf.io,abought/osf.io,sloria/osf.io,aaxelb/osf.io,zamattiac/osf.io,KAsante95/osf.io,GageGaskins/osf.io,TomHeatwole/osf.io,pattisdr/osf.io,laurenrevere/osf.io,zamattiac/osf.io,emetsger/osf.io,rdhyee/osf.io,cslzchen/osf.io,mluke93/osf.io,samchrisinger/osf.io,mattclark/osf.io,samchrisinger/osf.io,Johnetordoff/osf.io,icereval/osf.io,mluo613/osf.io,haoyuchen1992/osf.io,doublebits/osf.io,icereval/osf.io,jnayak1/osf.io,hmoco/osf.io,mattclark/osf.io,DanielSBrown/osf.io,alexschiller/osf.io,TomHeatwole/osf.io,mfraezz/osf.io,asanfilippo7/osf.io,Ghalko/osf.io,doublebits/osf.io,ticklemepierce/osf.io,pattisdr/osf.io,alexschiller/osf.io,kch8qx/osf.io,acshi/osf.io,billyhunt/osf.io,billyhunt/osf.io,petermalcolm/osf.io,wearpants/osf.io,samchrisinger/osf.io,cwisecarver/osf.io,ZobairAlijan/osf.io,wearpants/osf.io,ZobairAlijan/osf.io,kch8qx/osf.io,brandonPurvis/osf.io,felliott/osf.io,Nesiehr/osf.io,samchrisinger/osf.io,crcresearch/osf.io,cslzchen/osf.io,zachjanicki/osf.io,haoyuchen1992/osf.io,caseyrygt/osf.io,CenterForOpenScience/osf.io,leb2dg/osf.io,cslzchen/osf.io,CenterForOpenScience/osf.io,petermalcolm/osf.io,SSJohns/osf.io,felliott/osf.io,caseyrollins/osf.io,emetsger/osf.io,billyhunt/osf.io,abought/osf.io,zachjanicki/osf.io,laurenrevere/osf.io,samanehsan/osf.io,Johnetordoff/osf.io,kwierman/osf.io,ZobairAlijan/osf.io,hmoco/osf.io,cwisecarver/osf.io,chennan47/osf.io,caseyrollins/osf.io,zamattiac/osf.io,ticklemepierce/osf.io,mfraezz/osf.io,mluo613/osf.io,DanielSBrown/osf.io,chrisseto/osf.io,caseyrygt/osf.io,danielneis/osf.io,danielneis/osf.io,brianjgeiger/osf.io,HalcyonChimera/osf.io,erinspace/osf.io,emetsger/osf.io,brandonPurvis/osf.io,crcresearch/osf.io,amyshi188/osf.io,adlius/osf.io,mfraezz/osf.io,monikagrabowska/osf.io,leb2dg/osf.io,chennan47/osf.io,cosenal/osf.io,GageGaskins/osf.io,caseyrollins/osf.io,njantrania/osf.io,kch8qx/osf.io,cosenal/osf.io,adlius/osf.io,binoculars/osf.io,chrisseto/osf.io,SSJohns/osf.io,RomanZWang/osf.io,zamattiac/osf.io,KAsante95/osf.io,chrisseto/osf.io,zachjanicki/osf.io,binoculars/osf.io,emetsger/osf.io,jnayak1/osf.io,felliott/osf.io,laurenrevere/osf.io,DanielSBrown/osf.io,samanehsan/osf.io,amyshi188/osf.io,samanehsan/osf.io,abought/osf.io,TomHeatwole/osf.io,wearpants/osf.io,billyhunt/osf.io,sloria/osf.io,RomanZWang/osf.io,acshi/osf.io,rdhyee/osf.io,kwierman/osf.io,ticklemepierce/osf.io,jnayak1/osf.io,wearpants/osf.io,HalcyonChimera/osf.io,HalcyonChimera/osf.io,leb2dg/osf.io,binoculars/osf.io,amyshi188/osf.io,saradbowman/osf.io,felliott/osf.io,RomanZWang/osf.io,Johnetordoff/osf.io,Johnetordoff/osf.io,haoyuchen1992/osf.io,aaxelb/osf.io,kwierman/osf.io,pattisdr/osf.io,caneruguz/osf.io,danielneis/osf.io,brianjgeiger/osf.io,baylee-d/osf.io,chennan47/osf.io,sloria/osf.io,adlius/osf.io,cwisecarver/osf.io,aaxelb/osf.io,petermalcolm/osf.io,haoyuchen1992/osf.io,cosenal/osf.io,monikagrabowska/osf.io,monikagrabowska/osf.io,danielneis/osf.io,mluo613/osf.io,doublebits/osf.io,brianjgeiger/osf.io,doublebits/osf.io,acshi/osf.io,mfraezz/osf.io,amyshi188/osf.io,baylee-d/osf.io,cslzchen/osf.io,baylee-d/osf.io,TomBaxter/osf.io,GageGaskins/osf.io,samanehsan/osf.io,KAsante95/osf.io,mluke93/osf.io,mluke93/osf.io,chrisseto/osf.io,zachjanicki/osf.io,TomBaxter/osf.io,CenterForOpenScience/osf.io,brandonPurvis/osf.io,Nesiehr/osf.io,GageGaskins/osf.io,aaxelb/osf.io,adlius/osf.io,abought/osf.io,alexschiller/osf.io,erinspace/osf.io,mattclark/osf.io,njantrania/osf.io,CenterForOpenScience/osf.io,brandonPurvis/osf.io,SSJohns/osf.io,acshi/osf.io,monikagrabowska/osf.io,caseyrygt/osf.io,TomHeatwole/osf.io,brandonPurvis/osf.io,asanfilippo7/osf.io,alexschiller/osf.io,kch8qx/osf.io,rdhyee/osf.io,monikagrabowska/osf.io,asanfilippo7/osf.io,RomanZWang/osf.io,hmoco/osf.io,mluke93/osf.io,kch8qx/osf.io,jnayak1/osf.io,Nesiehr/osf.io,Nesiehr/osf.io,Ghalko/osf.io,erinspace/osf.io,doublebits/osf.io,petermalcolm/osf.io,mluo613/osf.io,acshi/osf.io,leb2dg/osf.io,rdhyee/osf.io,DanielSBrown/osf.io,caneruguz/osf.io,asanfilippo7/osf.io,njantrania/osf.io,billyhunt/osf.io,caseyrygt/osf.io,SSJohns/osf.io,Ghalko/osf.io,crcresearch/osf.io,caneruguz/osf.io,caneruguz/osf.io,hmoco/osf.io,KAsante95/osf.io,ticklemepierce/osf.io,ZobairAlijan/osf.io,TomBaxter/osf.io,brianjgeiger/osf.io,HalcyonChimera/osf.io,KAsante95/osf.io,kwierman/osf.io,saradbowman/osf.io,GageGaskins/osf.io,mluo613/osf.io,Ghalko/osf.io,njantrania/osf.io,cosenal/osf.io,alexschiller/osf.io | ---
+++
@@ -1,6 +1,7 @@
+from rest_framework.parsers import JSONParser
-from rest_framework.parsers import JSONParser
from api.base.renderers import JSONAPIRenderer
+from api.base.exceptions import JSONAPIException
class JSONAPIParser(JSONParser):
"""
@@ -8,3 +9,25 @@
"""
media_type = 'application/vnd.api+json'
renderer_class = JSONAPIRenderer
+
+ def parse(self, stream, media_type=None, parser_context=None):
+ """
+ Parses the incoming bytestream as JSON and returns the resulting data
+ """
+ result = super(JSONAPIParser, self).parse(stream, media_type=media_type, parser_context=parser_context)
+ data = result.get('data', {})
+
+ if data:
+ if 'attributes' not in data:
+ raise JSONAPIException(source={'pointer': '/data/attributes'}, detail='This field is required.')
+ id = data.get('id')
+ type = data.get('type')
+ attributes = data.get('attributes')
+
+ parsed = {'id': id, 'type': type}
+ parsed.update(attributes)
+
+ return parsed
+
+ else:
+ raise JSONAPIException(source={'pointer': '/data'}, detail='This field is required.') |
6c59040e8c4aab37ff0c053e295b5b9705365d94 | diylang/interpreter.py | diylang/interpreter.py | # -*- coding: utf-8 -*-
from os.path import dirname, join
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple
from .types import Environment
def interpret(source, env=None):
"""
Interpret a DIY Lang program statement
Accepts a program statement as a string, interprets it, and then
returns the resulting DIY Lang expression as string.
"""
if env is None:
env = Environment()
return unparse(evaluate(parse(source), env))
def interpret_file(filename, env=None):
"""
Interpret a DIY Lang file
Accepts the name of a DIY Lang file containing a series of statements.
Returns the value of the last expression of the file.
"""
if env is None:
env = Environment()
with open(filename, 'r') as sourcefile:
source = "".join(sourcefile.readlines())
asts = parse_multiple(source)
results = [evaluate(ast, env) for ast in asts]
return unparse(results[-1])
| # -*- coding: utf-8 -*-
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple
from .types import Environment
def interpret(source, env=None):
"""
Interpret a DIY Lang program statement
Accepts a program statement as a string, interprets it, and then
returns the resulting DIY Lang expression as string.
"""
if env is None:
env = Environment()
return unparse(evaluate(parse(source), env))
def interpret_file(filename, env=None):
"""
Interpret a DIY Lang file
Accepts the name of a DIY Lang file containing a series of statements.
Returns the value of the last expression of the file.
"""
if env is None:
env = Environment()
with open(filename, 'r') as sourcefile:
source = "".join(sourcefile.readlines())
asts = parse_multiple(source)
results = [evaluate(ast, env) for ast in asts]
return unparse(results[-1])
| Remove unused imports in interpeter. | Remove unused imports in interpeter. | Python | bsd-3-clause | kvalle/diy-lang,kvalle/diy-lang,kvalle/diy-lisp,kvalle/diy-lisp | ---
+++
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
-
-from os.path import dirname, join
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple |
ad00d75cac0afe585853092d458a0d99c1373fc8 | dlstats/fetchers/__init__.py | dlstats/fetchers/__init__.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
from . import eurostat, insee, world_bank, IMF, BEA
| #! /usr/bin/env python3
# -*- coding: utf-8 -*-
from .eurostat import Eurostat
from .insee import Insee
from .world_bank import WorldBank
from .IMF import IMF
from .BEA import BEA
__all__ = ['Eurostat', 'Insee', 'WorldBank', 'IMF', 'BEA']
| Clean up the fetchers namespace | Clean up the fetchers namespace
| Python | agpl-3.0 | MichelJuillard/dlstats,mmalter/dlstats,MichelJuillard/dlstats,Widukind/dlstats,mmalter/dlstats,MichelJuillard/dlstats,Widukind/dlstats,mmalter/dlstats | ---
+++
@@ -1,3 +1,9 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
-from . import eurostat, insee, world_bank, IMF, BEA
+from .eurostat import Eurostat
+from .insee import Insee
+from .world_bank import WorldBank
+from .IMF import IMF
+from .BEA import BEA
+
+__all__ = ['Eurostat', 'Insee', 'WorldBank', 'IMF', 'BEA'] |
e1a7b583f7651322861b07606daac2d9e6d8c2d2 | setup.py | setup.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='kittengroomer',
version='1.0',
author='Raphaël Vinot',
author_email='raphael.vinot@circl.lu',
maintainer='Raphaël Vinot',
url='https://github.com/CIRCL/CIRCLean',
description='Standalone CIRCLean/KittenGroomer code.',
packages=['kittengroomer'],
scripts=['bin/generic.py', 'bin/pier9.py', 'bin/specific.py'],
include_package_data = True,
package_data = {'data': ['PDFA_def.ps','srgb.icc']},
test_suite="tests",
classifiers=[
'License :: OSI Approved :: BSD License',
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Communications :: File Sharing',
'Topic :: Security',
],
install_requires=['twiggy'],
)
| #!/usr/bin/python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='kittengroomer',
version='1.0',
author='Raphaël Vinot',
author_email='raphael.vinot@circl.lu',
maintainer='Raphaël Vinot',
url='https://github.com/CIRCL/CIRCLean',
description='Standalone CIRCLean/KittenGroomer code.',
packages=['kittengroomer'],
scripts=['bin/generic.py', 'bin/pier9.py', 'bin/specific.py', 'bin/filecheck.py'],
include_package_data = True,
package_data = {'data': ['PDFA_def.ps','srgb.icc']},
test_suite="tests",
classifiers=[
'License :: OSI Approved :: BSD License',
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Communications :: File Sharing',
'Topic :: Security',
],
install_requires=['twiggy'],
)
| Add filecheck in the scripts | Add filecheck in the scripts
| Python | bsd-3-clause | Rafiot/PyCIRCLean,CIRCL/PyCIRCLean,Rafiot/PyCIRCLean,CIRCL/PyCIRCLean,Dymaxion00/PyCIRCLean | ---
+++
@@ -11,7 +11,7 @@
url='https://github.com/CIRCL/CIRCLean',
description='Standalone CIRCLean/KittenGroomer code.',
packages=['kittengroomer'],
- scripts=['bin/generic.py', 'bin/pier9.py', 'bin/specific.py'],
+ scripts=['bin/generic.py', 'bin/pier9.py', 'bin/specific.py', 'bin/filecheck.py'],
include_package_data = True,
package_data = {'data': ['PDFA_def.ps','srgb.icc']},
test_suite="tests", |
ffb1634e89a4ca82d62f35b8befb05b29fe5b401 | setup.py | setup.py | from setuptools import setup
setup(
name='pyretry',
version="0.9",
description='Separate your retry logic from your business logic',
author='Bob Renwick',
author_email='bob.renwick@gmail.com',
url='https://github.com/bobbyrenwick/pyretry',
packages=['pyretry'],
tests_require=[
'mock>=1.0,<1.1',
],
classifiers=(
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
),
)
| from setuptools import setup
setup(
name='pyretry',
version="0.9",
description='Separate your retry logic from your business logic',
author='Bob Renwick',
author_email='bob.renwick@gmail.com',
url='https://github.com/bobbyrenwick/pyretry',
packages=['pyretry'],
classifiers=(
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
),
)
| Revert "Add missing `tests_require` for `mock`" | Revert "Add missing `tests_require` for `mock`"
This reverts commit 08347214e93d9cfe9ad53a528aea3428afeb49a0.
I hadn't noticed the requirements.pip file!
| Python | mit | bobbyrenwick/pyretry | ---
+++
@@ -9,9 +9,6 @@
author_email='bob.renwick@gmail.com',
url='https://github.com/bobbyrenwick/pyretry',
packages=['pyretry'],
- tests_require=[
- 'mock>=1.0,<1.1',
- ],
classifiers=(
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers', |
798c4489912ab0f6706adc626d930268f2244986 | setup.py | setup.py | #! /usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from pylamb import __version__
setup(name='ILAMB',
version=__version__,
author='Mark Piper',
author_email='mark.piper@colorado.edu',
description='Python BMI for ILAMB',
long_description=open('README.md').read(),
packages=find_packages(),
scripts=[
'scripts/run_ilamb.sh'
],
)
| #! /usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from pylamb import __version__
setup(name='pylamb',
version=__version__,
author='Mark Piper',
author_email='mark.piper@colorado.edu',
description='Python BMI for ILAMB',
long_description=open('README.md').read(),
packages=find_packages(),
scripts=[
'scripts/run_ilamb.sh'
],
)
| Change package name to 'pylamb' | Change package name to 'pylamb'
| Python | mit | permamodel/ILAMB,permamodel/ILAMB,permamodel/ILAMB | ---
+++
@@ -5,7 +5,7 @@
from pylamb import __version__
-setup(name='ILAMB',
+setup(name='pylamb',
version=__version__,
author='Mark Piper',
author_email='mark.piper@colorado.edu', |
c2a1e32ac0ebfb2b575d8d2b852f6fdd3a4080f9 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
version='4.0.0',
name='vcdriver',
description='A vcenter driver based on pyvmomi, fabric and pywinrm',
url='https://github.com/Osirium/vcdriver',
license='MIT',
install_requires=['colorama', 'Fabric3', 'pyvmomi', 'pywinrm', 'six'],
packages=find_packages(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'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',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development',
],
)
| from setuptools import setup, find_packages
setup(
version='4.0.0',
name='osirium-vcdriver',
description='A vcenter driver based on pyvmomi, fabric and pywinrm',
url='https://github.com/Osirium/vcdriver',
license='MIT',
install_requires=['colorama', 'Fabric3', 'pyvmomi', 'pywinrm', 'six'],
packages=find_packages(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'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',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development',
],
)
| Use osirium prefix to avoid possible conflicts with PyPI | Use osirium prefix to avoid possible conflicts with PyPI
| Python | mit | Osirium/vcdriver | ---
+++
@@ -3,7 +3,7 @@
setup(
version='4.0.0',
- name='vcdriver',
+ name='osirium-vcdriver',
description='A vcenter driver based on pyvmomi, fabric and pywinrm',
url='https://github.com/Osirium/vcdriver',
license='MIT', |
706661c45a35fd03784a335ee58030c2a0a2e34e | setup.py | setup.py | import os
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
with open("README.rst") as f:
long_desc = f.read()
setup(
name="custodian",
packages=find_packages(),
version="0.1.0a",
install_requires=[],
extras_require={"vasp": ["pymatgen>=2.4.3"]},
package_data={},
author="Shyue Ping Ong",
author_email="shyuep@gmail.com",
maintainer="Shyue Ping Ong",
url="https://github.com/materialsproject/custodian",
license="MIT",
description="A simple JIT job management framework in Python.",
long_description=long_desc,
keywords=["jit", "just-in-time", "job", "management", "vasp"],
classifiers=[
"Programming Language :: Python :: 2.7",
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Software Development :: Libraries :: Python Modules"
],
download_url="https://github.com/materialsproject/custodian/archive/master.zip",
scripts=[os.path.join("scripts", f) for f in os.listdir("scripts")]
)
| import os
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
with open("README.rst") as f:
long_desc = f.read()
setup(
name="custodian",
packages=find_packages(),
version="0.1.0a",
install_requires=[],
extras_require={"vasp": ["pymatgen>=2.5.0"]},
package_data={},
author="Shyue Ping Ong",
author_email="shyuep@gmail.com",
maintainer="Shyue Ping Ong",
url="https://github.com/materialsproject/custodian",
license="MIT",
description="A simple JIT job management framework in Python.",
long_description=long_desc,
keywords=["jit", "just-in-time", "job", "management", "vasp"],
classifiers=[
"Programming Language :: Python :: 2.7",
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Software Development :: Libraries :: Python Modules"
],
download_url="https://github.com/materialsproject/custodian/archive/master.zip",
scripts=[os.path.join("scripts", f) for f in os.listdir("scripts")]
)
| Add 2.5.0 to extra requirements. | Add 2.5.0 to extra requirements.
| Python | mit | materialsproject/custodian,materialsproject/custodian,materialsproject/custodian,specter119/custodian,alberthxf/custodian,specter119/custodian,davidwaroquiers/custodian,xhqu1981/custodian,specter119/custodian | ---
+++
@@ -12,7 +12,7 @@
packages=find_packages(),
version="0.1.0a",
install_requires=[],
- extras_require={"vasp": ["pymatgen>=2.4.3"]},
+ extras_require={"vasp": ["pymatgen>=2.5.0"]},
package_data={},
author="Shyue Ping Ong",
author_email="shyuep@gmail.com", |
f8428dbfa7ed6628c3f46227e768d3b3afcfe93b | setup.py | setup.py | """setup.py file."""
import uuid
from setuptools import setup
from pip.req import parse_requirements
install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1())
reqs = [str(ir.req) for ir in install_reqs]
setup(
name="napalm-ansible",
version='0.7.1',
packages=["napalm_ansible"],
author="David Barroso, Kirk Byers, Mircea Ulinic",
author_email="dbarrosop@dravetech.com, ktbyers@twb-tech.com",
description="Network Automation and Programmability Abstraction Layer with Multivendor support",
classifiers=[
'Topic :: Utilities',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS',
],
url="https://github.com/napalm-automation/napalm-base",
include_package_data=True,
install_requires=reqs,
entry_points={
'console_scripts': [
'napalm-ansible=napalm_ansible:main',
],
}
)
| """setup.py file."""
import uuid
from setuptools import setup
from pip.req import parse_requirements
install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1())
reqs = [str(ir.req) for ir in install_reqs]
setup(
name="napalm-ansible",
version='0.7.2',
packages=["napalm_ansible"],
author="David Barroso, Kirk Byers, Mircea Ulinic",
author_email="dbarrosop@dravetech.com, ktbyers@twb-tech.com",
description="Network Automation and Programmability Abstraction Layer with Multivendor support",
classifiers=[
'Topic :: Utilities',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS',
],
url="https://github.com/napalm-automation/napalm-base",
include_package_data=True,
install_requires=reqs,
entry_points={
'console_scripts': [
'napalm-ansible=napalm_ansible:main',
],
}
)
| Tag error, rolling to 0.7.2 | Tag error, rolling to 0.7.2
| Python | apache-2.0 | napalm-automation/napalm-ansible,napalm-automation/napalm-ansible | ---
+++
@@ -11,7 +11,7 @@
setup(
name="napalm-ansible",
- version='0.7.1',
+ version='0.7.2',
packages=["napalm_ansible"],
author="David Barroso, Kirk Byers, Mircea Ulinic",
author_email="dbarrosop@dravetech.com, ktbyers@twb-tech.com", |
f8b229b3f769ddbb21cfd57a8e0ad5341f965439 | pylearn2/costs/tests/test_lp_norm_cost.py | pylearn2/costs/tests/test_lp_norm_cost.py | """
Test LpNorm cost
"""
import numpy
import theano
from theano import tensor as T
from nose.tools import raises
def test_shared_variables():
'''
LpNorm should handle shared variables.
'''
assert False
def test_symbolic_expressions_of_shared_variables():
'''
LpNorm should handle symbolic expressions of shared variables.
'''
assert False
@raises(Exception)
def test_symbolic_variables():
'''
LpNorm should not handle symbolic variables
'''
assert True
if __name__ == '__main__':
test_shared_variables()
test_symbolic_expressions_of_shared_variables()
test_symbolic_variables()
| """
Test LpNorm cost
"""
import os
from nose.tools import raises
from pylearn2.models.mlp import Linear
from pylearn2.models.mlp import Softmax
from pylearn2.models.mlp import MLP
from pylearn2.costs.cost import LpNorm
from pylearn2.datasets.cifar10 import CIFAR10
from pylearn2.training_algorithms.sgd import SGD
from pylearn2.termination_criteria import EpochCounter
from pylearn2.train import Train
def test_shared_variables():
'''
LpNorm should handle shared variables.
'''
model = MLP(
layers=[Linear(dim=100, layer_name='linear', irange=1.0),
Softmax(n_classes=10, layer_name='softmax', irange=1.0)],
batch_size=100,
nvis=3072
)
dataset = CIFAR10(which_set='train')
cost = LpNorm(variables=model.get_params(), p=2)
algorithm = SGD(
learning_rate=0.01,
cost=cost, batch_size=100,
monitoring_dataset=dataset,
termination_criterion=EpochCounter(1)
)
trainer = Train(
dataset=dataset,
model=model,
algorithm=algorithm
)
trainer.main_loop()
assert False
def test_symbolic_expressions_of_shared_variables():
'''
LpNorm should handle symbolic expressions of shared variables.
'''
assert False
@raises(Exception)
def test_symbolic_variables():
'''
LpNorm should not handle symbolic variables
'''
assert True
if __name__ == '__main__':
test_shared_variables()
test_symbolic_expressions_of_shared_variables()
test_symbolic_variables()
| Add more code to LpNorm unit tests | Add more code to LpNorm unit tests
| Python | bsd-3-clause | JesseLivezey/pylearn2,lisa-lab/pylearn2,w1kke/pylearn2,theoryno3/pylearn2,jeremyfix/pylearn2,se4u/pylearn2,mkraemer67/pylearn2,caidongyun/pylearn2,abergeron/pylearn2,aalmah/pylearn2,junbochen/pylearn2,daemonmaker/pylearn2,alexjc/pylearn2,jamessergeant/pylearn2,matrogers/pylearn2,alexjc/pylearn2,CIFASIS/pylearn2,goodfeli/pylearn2,chrish42/pylearn,kose-y/pylearn2,pombredanne/pylearn2,Refefer/pylearn2,kastnerkyle/pylearn2,jamessergeant/pylearn2,woozzu/pylearn2,lancezlin/pylearn2,w1kke/pylearn2,lancezlin/pylearn2,CIFASIS/pylearn2,JesseLivezey/plankton,matrogers/pylearn2,fulmicoton/pylearn2,ashhher3/pylearn2,ddboline/pylearn2,jamessergeant/pylearn2,ashhher3/pylearn2,Refefer/pylearn2,lunyang/pylearn2,hantek/pylearn2,Refefer/pylearn2,KennethPierce/pylearnk,pkainz/pylearn2,jeremyfix/pylearn2,cosmoharrigan/pylearn2,fulmicoton/pylearn2,woozzu/pylearn2,lamblin/pylearn2,daemonmaker/pylearn2,mclaughlin6464/pylearn2,hyqneuron/pylearn2-maxsom,alexjc/pylearn2,lancezlin/pylearn2,chrish42/pylearn,hantek/pylearn2,cosmoharrigan/pylearn2,hyqneuron/pylearn2-maxsom,fyffyt/pylearn2,daemonmaker/pylearn2,kose-y/pylearn2,sandeepkbhat/pylearn2,jeremyfix/pylearn2,pkainz/pylearn2,caidongyun/pylearn2,bartvm/pylearn2,pombredanne/pylearn2,CIFASIS/pylearn2,bartvm/pylearn2,TNick/pylearn2,hyqneuron/pylearn2-maxsom,goodfeli/pylearn2,ashhher3/pylearn2,nouiz/pylearn2,pkainz/pylearn2,aalmah/pylearn2,se4u/pylearn2,kastnerkyle/pylearn2,skearnes/pylearn2,lamblin/pylearn2,fishcorn/pylearn2,lamblin/pylearn2,shiquanwang/pylearn2,fulmicoton/pylearn2,mkraemer67/pylearn2,TNick/pylearn2,CIFASIS/pylearn2,fulmicoton/pylearn2,abergeron/pylearn2,abergeron/pylearn2,pombredanne/pylearn2,bartvm/pylearn2,kastnerkyle/pylearn2,msingh172/pylearn2,theoryno3/pylearn2,skearnes/pylearn2,matrogers/pylearn2,daemonmaker/pylearn2,woozzu/pylearn2,pombredanne/pylearn2,lamblin/pylearn2,junbochen/pylearn2,TNick/pylearn2,lisa-lab/pylearn2,alexjc/pylearn2,fishcorn/pylearn2,caidongyun/pylearn2,msingh172/pylearn2,lunyang/pylearn2,mkraemer67/pylearn2,se4u/pylearn2,goodfeli/pylearn2,skearnes/pylearn2,fishcorn/pylearn2,cosmoharrigan/pylearn2,shiquanwang/pylearn2,JesseLivezey/pylearn2,ddboline/pylearn2,jamessergeant/pylearn2,KennethPierce/pylearnk,lancezlin/pylearn2,abergeron/pylearn2,jeremyfix/pylearn2,hantek/pylearn2,JesseLivezey/pylearn2,ddboline/pylearn2,hyqneuron/pylearn2-maxsom,woozzu/pylearn2,lisa-lab/pylearn2,fishcorn/pylearn2,kastnerkyle/pylearn2,aalmah/pylearn2,shiquanwang/pylearn2,Refefer/pylearn2,pkainz/pylearn2,JesseLivezey/pylearn2,fyffyt/pylearn2,sandeepkbhat/pylearn2,junbochen/pylearn2,nouiz/pylearn2,kose-y/pylearn2,theoryno3/pylearn2,goodfeli/pylearn2,TNick/pylearn2,nouiz/pylearn2,theoryno3/pylearn2,msingh172/pylearn2,JesseLivezey/plankton,w1kke/pylearn2,sandeepkbhat/pylearn2,shiquanwang/pylearn2,JesseLivezey/plankton,ddboline/pylearn2,lunyang/pylearn2,junbochen/pylearn2,nouiz/pylearn2,hantek/pylearn2,KennethPierce/pylearnk,caidongyun/pylearn2,cosmoharrigan/pylearn2,lisa-lab/pylearn2,mclaughlin6464/pylearn2,mkraemer67/pylearn2,aalmah/pylearn2,JesseLivezey/plankton,fyffyt/pylearn2,ashhher3/pylearn2,lunyang/pylearn2,fyffyt/pylearn2,kose-y/pylearn2,se4u/pylearn2,w1kke/pylearn2,msingh172/pylearn2,bartvm/pylearn2,sandeepkbhat/pylearn2,KennethPierce/pylearnk,chrish42/pylearn,mclaughlin6464/pylearn2,chrish42/pylearn,mclaughlin6464/pylearn2,matrogers/pylearn2,skearnes/pylearn2 | ---
+++
@@ -1,16 +1,48 @@
"""
Test LpNorm cost
"""
-import numpy
-import theano
-from theano import tensor as T
+import os
from nose.tools import raises
+from pylearn2.models.mlp import Linear
+from pylearn2.models.mlp import Softmax
+from pylearn2.models.mlp import MLP
+from pylearn2.costs.cost import LpNorm
+from pylearn2.datasets.cifar10 import CIFAR10
+from pylearn2.training_algorithms.sgd import SGD
+from pylearn2.termination_criteria import EpochCounter
+from pylearn2.train import Train
def test_shared_variables():
'''
LpNorm should handle shared variables.
'''
+ model = MLP(
+ layers=[Linear(dim=100, layer_name='linear', irange=1.0),
+ Softmax(n_classes=10, layer_name='softmax', irange=1.0)],
+ batch_size=100,
+ nvis=3072
+ )
+
+ dataset = CIFAR10(which_set='train')
+
+ cost = LpNorm(variables=model.get_params(), p=2)
+
+ algorithm = SGD(
+ learning_rate=0.01,
+ cost=cost, batch_size=100,
+ monitoring_dataset=dataset,
+ termination_criterion=EpochCounter(1)
+ )
+
+ trainer = Train(
+ dataset=dataset,
+ model=model,
+ algorithm=algorithm
+ )
+
+ trainer.main_loop()
+
assert False
|
77919331207033e7d6f77d86978bed3280cf05ff | setup.py | setup.py | """
iniconfig: brain-dead simple config-ini parsing.
compatible CPython 2.3 through to CPython 3.2, Jython, PyPy
(c) 2010 Ronny Pfannschmidt, Holger Krekel
"""
from setuptools import setup
def main():
with open('README.txt') as fp:
readme = fp.read()
setup(
name='iniconfig',
packages=['iniconfig'],
package_dir={'': 'src'},
description='iniconfig: brain-dead simple config-ini parsing',
long_description=readme,
url='http://github.com/RonnyPfannschmidt/iniconfig',
license='MIT License',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
author='Ronny Pfannschmidt, Holger Krekel',
author_email=(
'opensource@ronnypfannschmidt.de, holger.krekel@gmail.com'),
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Operating System :: MacOS :: MacOS X',
'Topic :: Software Development :: Libraries',
'Topic :: Utilities',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
],
include_package_data=True,
zip_safe=False,
)
if __name__ == '__main__':
main()
| """
iniconfig: brain-dead simple config-ini parsing.
compatible CPython 2.3 through to CPython 3.2, Jython, PyPy
(c) 2010 Ronny Pfannschmidt, Holger Krekel
"""
from setuptools import setup
def main():
with open('README.txt') as fp:
readme = fp.read()
setup(
name='iniconfig',
packages=['iniconfig'],
package_dir={'': 'src'},
description='iniconfig: brain-dead simple config-ini parsing',
long_description=readme,
use_scm_version=True,
url='http://github.com/RonnyPfannschmidt/iniconfig',
license='MIT License',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
author='Ronny Pfannschmidt, Holger Krekel',
author_email=(
'opensource@ronnypfannschmidt.de, holger.krekel@gmail.com'),
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Operating System :: MacOS :: MacOS X',
'Topic :: Software Development :: Libraries',
'Topic :: Utilities',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
],
include_package_data=True,
zip_safe=False,
)
if __name__ == '__main__':
main()
| Fix version autodetection from git tags | Fix version autodetection from git tags | Python | mit | ronnypfannschmidt/iniconfig,RonnyPfannschmidt/iniconfig | ---
+++
@@ -18,6 +18,7 @@
package_dir={'': 'src'},
description='iniconfig: brain-dead simple config-ini parsing',
long_description=readme,
+ use_scm_version=True,
url='http://github.com/RonnyPfannschmidt/iniconfig',
license='MIT License',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], |
0d6c2ed446cfd56f922ea7202362de2f505c1a91 | setup.py | setup.py | """Setuptools entrypoint."""
import codecs
import os
from setuptools import setup
from s3keyring import __version__, __author__
dirname = os.path.dirname(__file__)
long_description = (
codecs.open(os.path.join(dirname, "README.rst"), encoding="utf-8").read() + "\n" + # noqa
codecs.open(os.path.join(dirname, "AUTHORS.rst"), encoding="utf-8").read() + "\n" + # noqa
codecs.open(os.path.join(dirname, "CHANGES.rst"), encoding="utf-8").read()
)
setup(
name="s3keyring",
include_package_data=True,
package_data={"s3keyring": ["s3keyring.ini"]},
packages=["s3keyring"],
version=__version__,
license="MIT",
author=__author__,
author_email="data@findhotel.net",
url="http://github.com/findhotel/s3keyring",
description="S3 backend for Python's keyring module",
long_description=long_description,
install_requires=[
"click>=5.1",
"keyring",
"boto3facade>=0.2.5",
"awscli",
],
classifiers=[
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3"
],
zip_safe=False,
entry_points={
"console_scripts": [
"s3keyring = s3keyring.cli:main",
]
}
)
| """Setuptools entrypoint."""
import codecs
import os
from setuptools import setup
from s3keyring import __version__, __author__
dirname = os.path.dirname(__file__)
long_description = (
codecs.open(os.path.join(dirname, "README.rst"), encoding="utf-8").read() + "\n" + # noqa
codecs.open(os.path.join(dirname, "AUTHORS.rst"), encoding="utf-8").read() + "\n" + # noqa
codecs.open(os.path.join(dirname, "CHANGES.rst"), encoding="utf-8").read()
)
setup(
name="s3keyring",
include_package_data=True,
package_data={"s3keyring": ["s3keyring.ini"]},
packages=["s3keyring"],
version=__version__,
license="MIT",
author=__author__,
author_email="data@findhotel.net",
url="http://github.com/findhotel/s3keyring",
description="S3 backend for Python's keyring module",
long_description=long_description,
install_requires=[
"click>=5.1",
"keyring",
"boto3facade>=0.2.8",
"awscli",
],
classifiers=[
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3"
],
zip_safe=False,
entry_points={
"console_scripts": [
"s3keyring = s3keyring.cli:main",
]
}
)
| Upgrade boto3facade: not setting signature version v4 globally | Upgrade boto3facade: not setting signature version v4 globally
| Python | mit | InnovativeTravel/s3-keyring | ---
+++
@@ -29,7 +29,7 @@
install_requires=[
"click>=5.1",
"keyring",
- "boto3facade>=0.2.5",
+ "boto3facade>=0.2.8",
"awscli",
],
classifiers=[ |
3767e12cb429c5e96139b149cd9e66a3b1a1e2c1 | setup.py | setup.py | from setuptools import setup, find_packages
import codecs
import os
import re
def get_version(package_name):
version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$")
package_components = package_name.split('.')
init_path = os.path.join(root_dir, *(package_components + ['__init__.py']))
with codecs.open(init_path, 'r', 'utf-8') as f:
for line in f:
match = version_re.match(line[:-1])
if match:
return match.groups()[0]
return '0.1.0'
PACKAGE = 'hackernews_scraper'
setup(name='hackernews_scraper',
description='Python library for retrieving comments and stories from HackerNews',
packages=find_packages(),
version=get_version(PACKAGE),
install_requires=['requests'],
url='https://github.com/NiGhTTraX/hackernews-scraper',
license='MIT',
platforms='any',
tests_require=['nose', 'factory_boy', 'httpretty'],
)
| from setuptools import setup, find_packages
import codecs
import os
import re
root_dir = os.path.abspath(os.path.dirname(__file__))
PACKAGE = 'hackernews_scraper'
def get_version(package_name):
version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$")
package_components = package_name.split('.')
init_path = os.path.join(root_dir, *(package_components + ['__init__.py']))
with codecs.open(init_path, 'r', 'utf-8') as f:
for line in f:
match = version_re.match(line[:-1])
if match:
return match.groups()[0]
return '0.1.0'
setup(name='hackernews_scraper',
description='Python library for retrieving comments and stories from HackerNews',
packages=find_packages(),
version=get_version(PACKAGE),
install_requires=['requests'],
url='https://github.com/NiGhTTraX/hackernews-scraper',
license='MIT',
platforms='any',
tests_require=['nose', 'factory_boy', 'httpretty'],
)
| Add the root dir variable | Add the root dir variable
| Python | bsd-2-clause | NiGhTTraX/hackernews-scraper | ---
+++
@@ -3,6 +3,9 @@
import codecs
import os
import re
+
+root_dir = os.path.abspath(os.path.dirname(__file__))
+PACKAGE = 'hackernews_scraper'
def get_version(package_name):
version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$")
@@ -15,8 +18,6 @@
return match.groups()[0]
return '0.1.0'
-PACKAGE = 'hackernews_scraper'
-
setup(name='hackernews_scraper',
description='Python library for retrieving comments and stories from HackerNews',
packages=find_packages(), |
165b1c9528205c96f94abf63dc327c1299c61f04 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
install_requires = [
"bleach",
"jinja2",
"celery-haystack",
"Django>=1.4",
"django-celery",
"django-haystack",
"django-jsonfield",
"django-model-utils",
"django-tastypie",
"docutils",
"isoweek",
"lxml",
"saved_searches",
]
setup(
name="crate.web",
version="0.1",
author="Donald Stufft",
author_email="donald@crate.io",
url="https://github.com/crateio/crate.web",
description="crate.web is a Django app that provides the building blocks to build a Package Index Server.",
license=open("LICENSE").read(),
namespace_packages=["crate"],
packages=find_packages(exclude=("tests",)),
package_data={'': ['LICENSE', 'NOTICE']},
include_package_data=True,
install_requires=install_requires,
zip_safe=False,
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2.7",
"Operating System :: OS Independent",
],
)
| #!/usr/bin/env python
from setuptools import setup, find_packages
install_requires = [
"bleach",
"jinja2",
"Django>=1.4",
"django-celery",
"django-jsonfield",
"django-model-utils",
"django-tastypie",
"docutils",
"isoweek",
"lxml",
]
setup(
name="crate.web",
version="0.1",
author="Donald Stufft",
author_email="donald@crate.io",
url="https://github.com/crateio/crate.web",
description="crate.web is a Django app that provides the building blocks to build a Package Index Server.",
license=open("LICENSE").read(),
namespace_packages=["crate"],
packages=find_packages(exclude=("tests",)),
package_data={'': ['LICENSE', 'NOTICE']},
include_package_data=True,
install_requires=install_requires,
zip_safe=False,
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2.7",
"Operating System :: OS Independent",
],
)
| Remove install_requires that are not on PyPI yet. | Remove install_requires that are not on PyPI yet.
| Python | bsd-2-clause | crateio/crate.web,crateio/crate.web | ---
+++
@@ -4,17 +4,14 @@
install_requires = [
"bleach",
"jinja2",
- "celery-haystack",
"Django>=1.4",
"django-celery",
- "django-haystack",
"django-jsonfield",
"django-model-utils",
"django-tastypie",
"docutils",
"isoweek",
"lxml",
- "saved_searches",
]
setup( |
58a73f87a8d2250d306e21c0d510d0d88497bf33 | setup.py | setup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'Jinja2',
'manifestparser',
'mongoengine',
'mozfile',
'mozillapulse']
setup(name='test-informant',
version=PACKAGE_VERSION,
description='A web service for monitoring and reporting the state of test manifests.',
long_description='See https://github.com/ahal/test-informant',
classifiers=['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',
author='Andrew Halberstadt',
author_email='ahalberstadt@mozilla.com',
url='https://github.com/ahal/test-informant',
license='MPL 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=deps)
| # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'Jinja2',
'manifestparser',
'mongoengine',
'mozfile',
'mozillapulse']
setup(name='test-informant',
version=PACKAGE_VERSION,
description='A web service for monitoring and reporting the state of test manifests.',
long_description='See https://github.com/ahal/test-informant',
classifiers=['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',
author='Andrew Halberstadt',
author_email='ahalberstadt@mozilla.com',
url='https://github.com/ahal/test-informant',
license='MPL 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=deps,
entry_points="""
[console_scripts]
test-informant = informant.pulse_listener:run
""")
| Add entry point for test-informant | Add entry point for test-informant
| Python | mpl-2.0 | mozilla/test-informant,ahal/test-informant,ahal/test-informant,mozilla/test-informant | ---
+++
@@ -33,4 +33,8 @@
packages=find_packages(),
include_package_data=True,
zip_safe=False,
- install_requires=deps)
+ install_requires=deps,
+ entry_points="""
+ [console_scripts]
+ test-informant = informant.pulse_listener:run
+ """) |
0982d077dceea70e536353bc7a8a23a30ed45cb1 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
try:
with open('README.rst', 'r', encoding='utf-8') as f:
readme = f.read()
except IOError:
readme = ''
setup(
name='cr8',
author='Mathias Fußenegger',
author_email='pip@zignar.net',
url='https://github.com/mfussenegger/cr8',
description='A collection of command line tools for crate devs',
long_description=readme,
entry_points={
'console_scripts': [
'cr8 = cr8.__main__:main',
]
},
packages=['cr8'],
install_requires=[
'crate>=0.16',
'argh',
'tqdm',
'Faker==0.9.1',
'aiohttp>=3.3,<4',
'toml'
],
extras_require={
'uvloop': ['uvloop'],
'asyncpg': ['asyncpg']
},
python_requires='>=3.6',
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
use_scm_version=True,
setup_requires=['setuptools_scm']
)
| #!/usr/bin/env python
from setuptools import setup
try:
with open('README.rst', 'r', encoding='utf-8') as f:
readme = f.read()
except IOError:
readme = ''
setup(
name='cr8',
author='Mathias Fußenegger',
author_email='pip@zignar.net',
url='https://github.com/mfussenegger/cr8',
description='A collection of command line tools for crate devs',
long_description=readme,
long_description_content_type='text/x-rst',
entry_points={
'console_scripts': [
'cr8 = cr8.__main__:main',
]
},
packages=['cr8'],
install_requires=[
'crate>=0.16',
'argh',
'tqdm',
'Faker==0.9.1',
'aiohttp>=3.3,<4',
'toml'
],
extras_require={
'uvloop': ['uvloop'],
'asyncpg': ['asyncpg']
},
python_requires='>=3.6',
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
use_scm_version=True,
setup_requires=['setuptools_scm']
)
| Set content type for long_description | Set content type for long_description
| Python | mit | mfussenegger/cr8 | ---
+++
@@ -16,6 +16,7 @@
url='https://github.com/mfussenegger/cr8',
description='A collection of command line tools for crate devs',
long_description=readme,
+ long_description_content_type='text/x-rst',
entry_points={
'console_scripts': [
'cr8 = cr8.__main__:main', |
c051fa4d653af34f1b7ccad88b6d06805e709278 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
install_requires = [
"bleach",
"jinja2",
"celery-haystack",
"Django>=1.4",
"django-celery",
"django-haystack",
"django-jsonfield",
"django-model-utils",
"django-tastypie",
"docutils",
"isoweek",
"lxml",
"saved_searches",
]
setup(
name="crate.web",
version="0.1",
author="Donald Stufft",
author_email="donald@crate.io",
url="https://github.com/crateio/crate.web",
description="crate.web is a Django app that provides the building blocks to build a Package Index Server.",
license=open("LICENSE").read(),
packages=find_packages(exclude=("tests",)),
package_data={'': ['LICENSE', 'NOTICE']},
include_package_data=True,
install_requires=install_requires,
zip_safe=False,
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2.7",
"Operating System :: OS Independent",
],
)
| #!/usr/bin/env python
from setuptools import setup, find_packages
install_requires = [
"bleach",
"jinja2",
"celery-haystack",
"Django>=1.4",
"django-celery",
"django-haystack",
"django-jsonfield",
"django-model-utils",
"django-tastypie",
"docutils",
"isoweek",
"lxml",
"saved_searches",
]
setup(
name="crate.web",
version="0.1",
author="Donald Stufft",
author_email="donald@crate.io",
url="https://github.com/crateio/crate.web",
description="crate.web is a Django app that provides the building blocks to build a Package Index Server.",
license=open("LICENSE").read(),
namespace_packages=["crate"],
packages=find_packages(exclude=("tests",)),
package_data={'': ['LICENSE', 'NOTICE']},
include_package_data=True,
install_requires=install_requires,
zip_safe=False,
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2.7",
"Operating System :: OS Independent",
],
)
| Mark crate as a namepsace package in the metadata | Mark crate as a namepsace package in the metadata
| Python | bsd-2-clause | crateio/crate.web,crateio/crate.web | ---
+++
@@ -25,6 +25,7 @@
url="https://github.com/crateio/crate.web",
description="crate.web is a Django app that provides the building blocks to build a Package Index Server.",
license=open("LICENSE").read(),
+ namespace_packages=["crate"],
packages=find_packages(exclude=("tests",)),
package_data={'': ['LICENSE', 'NOTICE']},
include_package_data=True, |
5e189930d66be1b9fd8c0e1edb1aff8078b56962 | setup.py | setup.py | """
PIP setup script for the SafeID package.
"""
from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
description=\
"""
SafeID is a proof-of-concept web server library that protects user passwords
using the Pythia protocol. Web servers can interact with a Pythia server
to encrypt new passwords and verify existing passwords.
"""
description = ' '.join(description.split())
setup(name='safeid',
version='1.3.1',
description=description,
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Operating System :: Unix',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Topic :: Security',
'Topic :: Security :: Cryptography',
'Topic :: System :: Systems Administration :: Authentication/Directory',
],
url='https://bitbucket.org/ace0/safeid',
author='Adam Everspaugh',
author_email='ace@cs.wisc.edu',
license='MIT',
keywords='password encryption authentication',
packages=['safeid'],
install_requires=['httplib2', 'pyrelic'],
zip_safe=False,
entry_points={ 'console_scripts': [ 'safeid = safeid.safeid:main' ] },
)
| """
PIP setup script for the SafeID package.
"""
from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
description=\
"""
SafeID is a proof-of-concept web server library that protects user passwords
using the Pythia protocol. Web servers can interact with a Pythia server
to encrypt new passwords and verify existing passwords.
"""
description = ' '.join(description.split())
setup(name='safeid',
version='1.4',
description=description,
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Operating System :: Unix',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Topic :: Security',
'Topic :: Security :: Cryptography',
'Topic :: System :: Systems Administration :: Authentication/Directory',
],
url='https://github.com/ace0/pyrelic',
author='Adam Everspaugh',
author_email='ace@cs.wisc.edu',
license='MIT',
keywords='password encryption authentication',
packages=['safeid'],
install_requires=['httplib2', 'pythia-pyrelic'],
zip_safe=False,
entry_points={ 'console_scripts': [ 'safeid = safeid.safeid:main' ] },
)
| Update to pypi package info | Update to pypi package info
| Python | mit | ace0/safeid | ---
+++
@@ -16,7 +16,7 @@
description = ' '.join(description.split())
setup(name='safeid',
- version='1.3.1',
+ version='1.4',
description=description,
classifiers=[
'Development Status :: 4 - Beta',
@@ -33,13 +33,13 @@
'Topic :: Security :: Cryptography',
'Topic :: System :: Systems Administration :: Authentication/Directory',
],
- url='https://bitbucket.org/ace0/safeid',
+ url='https://github.com/ace0/pyrelic',
author='Adam Everspaugh',
author_email='ace@cs.wisc.edu',
license='MIT',
keywords='password encryption authentication',
packages=['safeid'],
- install_requires=['httplib2', 'pyrelic'],
+ install_requires=['httplib2', 'pythia-pyrelic'],
zip_safe=False,
entry_points={ 'console_scripts': [ 'safeid = safeid.safeid:main' ] },
) |
4f7c8188a33d671c080b643cc8105976f6810391 | setup.py | setup.py | """Install Mesh TensorFlow."""
from setuptools import find_packages
from setuptools import setup
setup(
name='mesh-tensorflow',
version='0.1.2',
description='Mesh TensorFlow',
author='Google Inc.',
author_email='no-reply@google.com',
url='http://github.com/tensorflow/mesh',
license='Apache 2.0',
packages=find_packages(),
package_data={
# Include gin files.
'': ['*.gin'],
},
scripts=[],
install_requires=[
'absl-py',
'future',
'gin-config',
'ortools',
'six',
'tensorflow-datasets',
],
extras_require={
'tensorflow': ['tensorflow>=1.15.0'],
},
tests_require=[
'pytest'
],
setup_requires=['pytest-runner'],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
],
keywords='tensorflow machine learning',
)
| """Install Mesh TensorFlow."""
from setuptools import find_packages
from setuptools import setup
setup(
name='mesh-tensorflow',
version='0.1.3',
description='Mesh TensorFlow',
author='Google Inc.',
author_email='no-reply@google.com',
url='http://github.com/tensorflow/mesh',
license='Apache 2.0',
packages=find_packages(),
package_data={
# Include gin files.
'transformer': ['transformer/gin/*.gin'],
},
scripts=[],
install_requires=[
'absl-py',
'future',
'gin-config',
'six',
],
extras_require={
'auto_mtf': ['ortools'],
'tensorflow': ['tensorflow>=1.15.0'],
'transformer': ['tensorflow-datasets'],
},
tests_require=[
'pytest'
],
setup_requires=['pytest-runner'],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
],
keywords='tensorflow machine learning',
)
| Move mesh_tensorflow transformer/auto_mtf deps back into subpackages. | Move mesh_tensorflow transformer/auto_mtf deps back into subpackages.
PiperOrigin-RevId: 275558894
| Python | apache-2.0 | tensorflow/mesh,tensorflow/mesh | ---
+++
@@ -5,7 +5,7 @@
setup(
name='mesh-tensorflow',
- version='0.1.2',
+ version='0.1.3',
description='Mesh TensorFlow',
author='Google Inc.',
author_email='no-reply@google.com',
@@ -14,19 +14,19 @@
packages=find_packages(),
package_data={
# Include gin files.
- '': ['*.gin'],
+ 'transformer': ['transformer/gin/*.gin'],
},
scripts=[],
install_requires=[
'absl-py',
'future',
'gin-config',
- 'ortools',
'six',
- 'tensorflow-datasets',
],
extras_require={
+ 'auto_mtf': ['ortools'],
'tensorflow': ['tensorflow>=1.15.0'],
+ 'transformer': ['tensorflow-datasets'],
},
tests_require=[
'pytest' |
3a3b2b40191bda7acebf084aece8e6f5ed000db4 | setup.py | setup.py | #!/usr/bin/env python
from setuptools.depends import get_module_constant
from setuptools import setup
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name = 'detectlanguage',
packages = ['detectlanguage'],
version = get_module_constant('detectlanguage', '__version__'),
description = 'Language Detection API Client',
long_description=long_description,
long_description_content_type="text/markdown",
author = 'Laurynas Butkus',
author_email = 'info@detectlanguage.com',
url = 'https://github.com/detectlanguage/detectlanguage-python',
download_url = 'https://github.com/detectlanguage/detectlanguage-python',
keywords = ['language', 'identification', 'detection', 'api', 'client'],
install_requires= ['requests>=2.4.2'],
classifiers = [],
license = 'MIT',
)
| #!/usr/bin/env python
from setuptools.depends import get_module_constant
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name = 'detectlanguage',
packages = ['detectlanguage'],
version = get_module_constant('detectlanguage', '__version__'),
description = 'Language Detection API Client',
long_description=long_description,
long_description_content_type="text/markdown",
author = 'Laurynas Butkus',
author_email = 'info@detectlanguage.com',
url = 'https://github.com/detectlanguage/detectlanguage-python',
download_url = 'https://github.com/detectlanguage/detectlanguage-python',
keywords = ['language', 'identification', 'detection', 'api', 'client'],
install_requires= ['requests>=2.4.2'],
classifiers = [],
license = 'MIT',
)
| Fix long description loading on python 2.7 | Fix long description loading on python 2.7
| Python | mit | detectlanguage/detectlanguage-python | ---
+++
@@ -3,7 +3,7 @@
from setuptools.depends import get_module_constant
from setuptools import setup
-with open("README.md", "r", encoding="utf-8") as fh:
+with open("README.md", "r") as fh:
long_description = fh.read()
setup( |
d6f598abee19d45029998e663aaa5645a1771936 | server/migrations/0058_auto_20170822_1430.py | server/migrations/0058_auto_20170822_1430.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-08-22 21:30
from __future__ import unicode_literals
import os
from django.conf import settings
from django.db import migrations, models
import sal.plugin
from server.models import Plugin
from server import utils
# TODO: I don't think we need this in the DB.
def update_os_families(apps, schema_editor):
enabled_plugins = Plugin.objects.all()
manager = PluginManager()
enabled_plugins = apps.get_model("server", "MachineDetailPlugin")
for item in enabled_plugins.objects.all():
default_families = ['Darwin', 'Windows', 'Linux', 'ChromeOS']
plugin = manager.get_plugin_by_name(item.name)
if plugin:
try:
supported_os_families = plugin.plugin_object.get_supported_os_families()
except Exception:
supported_os_families = default_families
item.os_families = sorted(utils.stringify(supported_os_families))
item.save()
class Migration(migrations.Migration):
dependencies = [
('server', '0057_auto_20170822_1421'),
]
operations = [
migrations.RunPython(update_os_families),
]
| # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-08-22 21:30
from __future__ import unicode_literals
import os
from django.conf import settings
from django.db import migrations, models
import sal.plugin
from server.models import Plugin
from server import utils
# TODO: I don't think we need this in the DB.
def update_os_families(apps, schema_editor):
enabled_plugins = Plugin.objects.all()
manager = sal.plugin.PluginManager()
enabled_plugins = apps.get_model("server", "MachineDetailPlugin")
for item in enabled_plugins.objects.all():
default_families = ['Darwin', 'Windows', 'Linux', 'ChromeOS']
plugin = manager.get_plugin_by_name(item.name)
if plugin:
try:
supported_os_families = plugin.plugin_object.get_supported_os_families()
except Exception:
supported_os_families = default_families
item.os_families = sorted(utils.stringify(supported_os_families))
item.save()
class Migration(migrations.Migration):
dependencies = [
('server', '0057_auto_20170822_1421'),
]
operations = [
migrations.RunPython(update_os_families),
]
| Fix namespace issue in plugin manager. | Fix namespace issue in plugin manager.
| Python | apache-2.0 | salopensource/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal,salopensource/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal | ---
+++
@@ -15,7 +15,7 @@
# TODO: I don't think we need this in the DB.
def update_os_families(apps, schema_editor):
enabled_plugins = Plugin.objects.all()
- manager = PluginManager()
+ manager = sal.plugin.PluginManager()
enabled_plugins = apps.get_model("server", "MachineDetailPlugin")
for item in enabled_plugins.objects.all():
default_families = ['Darwin', 'Windows', 'Linux', 'ChromeOS'] |
a154611449f1f5a485ac0e12a9feb9e28e342331 | server/pypi/packages/grpcio/test/__init__.py | server/pypi/packages/grpcio/test/__init__.py | from __future__ import absolute_import, division, print_function
import unittest
# Adapted from https://github.com/grpc/grpc/blob/master/examples/python/helloworld.
class TestGrpcio(unittest.TestCase):
def setUp(self):
from concurrent import futures
import grpc
from . import helloworld_pb2, helloworld_pb2_grpc
class Greeter(helloworld_pb2_grpc.GreeterServicer):
def SayHello(self, request, context):
return helloworld_pb2.HelloReply(message='Hello, %s!' % request.name)
self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), self.server)
self.server.add_insecure_port('[::]:50051')
self.server.start()
def test_greeter(self):
import grpc
from . import helloworld_pb2, helloworld_pb2_grpc
channel = grpc.insecure_channel('localhost:50051')
stub = helloworld_pb2_grpc.GreeterStub(channel)
response = stub.SayHello(helloworld_pb2.HelloRequest(name='world'))
self.assertEqual("Hello, world!", response.message)
def tearDown(self):
self.server.stop(0)
| from __future__ import absolute_import, division, print_function
import unittest
# Adapted from https://github.com/grpc/grpc/blob/master/examples/python/helloworld.
class TestGrpcio(unittest.TestCase):
def setUp(self):
from concurrent import futures
import grpc
from . import helloworld_pb2, helloworld_pb2_grpc
class Greeter(helloworld_pb2_grpc.GreeterServicer):
def SayHello(self, request, context):
return helloworld_pb2.HelloReply(message='Hello, %s!' % request.name)
self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), self.server)
self.port = self.server.add_insecure_port('localhost:0')
self.assertTrue(self.port)
self.server.start()
def test_greeter(self):
import grpc
from . import helloworld_pb2, helloworld_pb2_grpc
channel = grpc.insecure_channel('localhost:{}'.format(self.port))
stub = helloworld_pb2_grpc.GreeterStub(channel)
response = stub.SayHello(helloworld_pb2.HelloRequest(name='world'))
self.assertEqual("Hello, world!", response.message)
def tearDown(self):
self.server.stop(0)
| Fix hardcoded port number in grpcio test | Fix hardcoded port number in grpcio test
| Python | mit | chaquo/chaquopy,chaquo/chaquopy,chaquo/chaquopy,chaquo/chaquopy,chaquo/chaquopy | ---
+++
@@ -17,14 +17,15 @@
self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), self.server)
- self.server.add_insecure_port('[::]:50051')
+ self.port = self.server.add_insecure_port('localhost:0')
+ self.assertTrue(self.port)
self.server.start()
def test_greeter(self):
import grpc
from . import helloworld_pb2, helloworld_pb2_grpc
- channel = grpc.insecure_channel('localhost:50051')
+ channel = grpc.insecure_channel('localhost:{}'.format(self.port))
stub = helloworld_pb2_grpc.GreeterStub(channel)
response = stub.SayHello(helloworld_pb2.HelloRequest(name='world'))
self.assertEqual("Hello, world!", response.message) |
556bda5688f86949b48d52a997b6de6f4edef45f | fields.py | fields.py | import logging
import remoteobjects.dataobject
import remoteobjects.fields
from remoteobjects.fields import *
import typepad.tpobject
class Link(remoteobjects.fields.Link):
"""A `TypePadObject` property representing a link from one TypePad API
object to another.
This `Link` works like `remoteobjects.fields.Link`, but builds links using
the TypePad API URL scheme. That is, a `Link` on ``/asset/1.json`` called
``events`` links to ``/asset/1/events.json``.
"""
def __get__(self, instance, owner):
"""Generates the `TypePadObject` representing the target of this
`Link` object.
This `__get__()` implementation implements the ``../x/target.json`` style
URLs used in the TypePad API.
"""
try:
if instance._location is None:
raise AttributeError('Cannot find URL of %s relative to URL-less %s' % (type(self).__name__, owner.__name__))
assert instance._location.endswith('.json')
newurl = instance._location[:-5]
newurl += '/' + self.api_name
newurl += '.json'
ret = self.cls.get(newurl)
ret.of_cls = self.of_cls
return ret
except Exception, e:
logging.error(str(e))
raise
| import logging
import remoteobjects.dataobject
import remoteobjects.fields
from remoteobjects.fields import *
import typepad.tpobject
class Link(remoteobjects.fields.Link):
"""A `TypePadObject` property representing a link from one TypePad API
object to another.
This `Link` works like `remoteobjects.fields.Link`, but builds links using
the TypePad API URL scheme. That is, a `Link` on ``/asset/1.json`` called
``events`` links to ``/asset/1/events.json``.
"""
def __get__(self, instance, owner):
"""Generates the `TypePadObject` representing the target of this
`Link` object.
This `__get__()` implementation implements the ``../x/target.json`` style
URLs used in the TypePad API.
"""
if instance is None:
return self
try:
if instance._location is None:
raise AttributeError('Cannot find URL of %s relative to URL-less %s' % (type(self).__name__, owner.__name__))
assert instance._location.endswith('.json')
newurl = instance._location[:-5]
newurl += '/' + self.api_name
newurl += '.json'
ret = self.cls.get(newurl)
ret.of_cls = self.of_cls
return ret
except Exception, e:
logging.error(str(e))
raise
| Return the Link instance itself when accessed through a class (so sphinx autodoc works) | Return the Link instance itself when accessed through a class (so sphinx autodoc works)
| Python | bsd-3-clause | typepad/python-typepad-api | ---
+++
@@ -25,6 +25,9 @@
URLs used in the TypePad API.
"""
+ if instance is None:
+ return self
+
try:
if instance._location is None:
raise AttributeError('Cannot find URL of %s relative to URL-less %s' % (type(self).__name__, owner.__name__)) |
2e3fed0aa1e3c01ed2e831a387cbfd6e5e8a1709 | names/__init__.py | names/__init__.py | from __future__ import unicode_literals
from os.path import abspath, join, dirname
import random
__title__ = 'names'
__version__ = '0.2'
__author__ = 'Trey Hunner'
__license__ = 'MIT'
full_path = lambda filename: abspath(join(dirname(__file__), filename))
FILES = {
'first:male': full_path('dist.male.first'),
'first:female': full_path('dist.female.first'),
'last': full_path('dist.all.last'),
}
def get_name(filename):
selected = random.random() * 90
with open(filename) as name_file:
for line in name_file:
name, _, cummulative, _ = line.split()
if float(cummulative) > selected:
return name
return "" # Return empty string if file is empty
def get_first_name(gender=None):
if gender not in ('male', 'female'):
gender = random.choice(('male', 'female'))
return get_name(FILES['first:%s' % gender]).capitalize()
def get_last_name():
return get_name(FILES['last']).capitalize()
def get_full_name(gender=None):
return "{0} {1}".format(get_first_name(gender), get_last_name())
| from __future__ import unicode_literals
from os.path import abspath, join, dirname
import random
__title__ = 'names'
__version__ = '0.2.0.post1'
__author__ = 'Trey Hunner'
__license__ = 'MIT'
full_path = lambda filename: abspath(join(dirname(__file__), filename))
FILES = {
'first:male': full_path('dist.male.first'),
'first:female': full_path('dist.female.first'),
'last': full_path('dist.all.last'),
}
def get_name(filename):
selected = random.random() * 90
with open(filename) as name_file:
for line in name_file:
name, _, cummulative, _ = line.split()
if float(cummulative) > selected:
return name
return "" # Return empty string if file is empty
def get_first_name(gender=None):
if gender not in ('male', 'female'):
gender = random.choice(('male', 'female'))
return get_name(FILES['first:%s' % gender]).capitalize()
def get_last_name():
return get_name(FILES['last']).capitalize()
def get_full_name(gender=None):
return "{0} {1}".format(get_first_name(gender), get_last_name())
| Bump version (a little late) | Bump version (a little late)
| Python | mit | treyhunner/names,treyhunner/names | ---
+++
@@ -4,7 +4,7 @@
__title__ = 'names'
-__version__ = '0.2'
+__version__ = '0.2.0.post1'
__author__ = 'Trey Hunner'
__license__ = 'MIT'
|
b8154abba5e1ea176566af2dcfa6eb2407dad9c6 | chrome/test/chromedriver/embed_version_in_cpp.py | chrome/test/chromedriver/embed_version_in_cpp.py | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Embeds Chrome user data files in C++ code."""
import optparse
import os
import sys
import chrome_paths
import cpp_source
sys.path.insert(0, os.path.join(chrome_paths.GetSrc(), 'build', 'util'))
import lastchange
def main():
parser = optparse.OptionParser()
parser.add_option('', '--version-file')
parser.add_option(
'', '--directory', type='string', default='.',
help='Path to directory where the cc/h file should be created')
options, args = parser.parse_args()
version = open(options.version_file, 'r').read().strip()
revision = lastchange.FetchVersionInfo(None).revision.strip()
global_string_map = {
'kChromeDriverVersion': version + '.' + revision
}
cpp_source.WriteSource('version',
'chrome/test/chromedriver',
options.directory, global_string_map)
if __name__ == '__main__':
sys.exit(main())
| #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Embeds Chrome user data files in C++ code."""
import optparse
import os
import sys
import chrome_paths
import cpp_source
sys.path.insert(0, os.path.join(chrome_paths.GetSrc(), 'build', 'util'))
import lastchange
def main():
parser = optparse.OptionParser()
parser.add_option('', '--version-file')
parser.add_option(
'', '--directory', type='string', default='.',
help='Path to directory where the cc/h file should be created')
options, args = parser.parse_args()
version = open(options.version_file, 'r').read().strip()
revision = lastchange.FetchVersionInfo(None).revision
if revision:
version += '.' + revision.strip()
global_string_map = {
'kChromeDriverVersion': version
}
cpp_source.WriteSource('version',
'chrome/test/chromedriver',
options.directory, global_string_map)
if __name__ == '__main__':
sys.exit(main())
| Add revision info only if available. | [chromedriver] Add revision info only if available.
This may not be available if building on a branch.
BUG=305371
NOTRY=true
Review URL: https://codereview.chromium.org/26754002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@227842 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | fujunwei/chromium-crosswalk,ltilve/chromium,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,jaruba/chromium.src,patrickm/chromium.src,Chilledheart/chromium,ltilve/chromium,M4sse/chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,hgl888/chromium-crosswalk,patrickm/chromium.src,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,Chilledheart/chromium,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,patrickm/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dednal/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,M4sse/chromium.src,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,dednal/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,ondra-novak/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,dednal/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,Jonekee/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,Jonekee/chromium.src,markYoungH/chromium.src,axinging/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,dushu1203/chromium.src,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,anirudhSK/chromium,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,markYoungH/chromium.src,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,markYoungH/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,Jonekee/chromium.src,axinging/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,Chilledheart/chromium,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,ChromiumWebApps/chromium,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,jaruba/chromium.src,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,anirudhSK/chromium,chuan9/chromium-crosswalk,ltilve/chromium,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,jaruba/chromium.src,markYoungH/chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,patrickm/chromium.src,fujunwei/chromium-crosswalk,Chilledheart/chromium,anirudhSK/chromium,axinging/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk,ltilve/chromium,markYoungH/chromium.src,Jonekee/chromium.src,Fireblend/chromium-crosswalk,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,Just-D/chromium-1,Jonekee/chromium.src,markYoungH/chromium.src,M4sse/chromium.src,anirudhSK/chromium,M4sse/chromium.src,anirudhSK/chromium,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,M4sse/chromium.src,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,ltilve/chromium,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,markYoungH/chromium.src,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,patrickm/chromium.src,littlstar/chromium.src,dednal/chromium.src,ondra-novak/chromium.src,littlstar/chromium.src,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,ChromiumWebApps/chromium,littlstar/chromium.src,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,anirudhSK/chromium,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,Jonekee/chromium.src,ondra-novak/chromium.src,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,patrickm/chromium.src,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,krieger-od/nwjs_chromium.src,jaruba/chromium.src,Just-D/chromium-1,Fireblend/chromium-crosswalk,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,littlstar/chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,ltilve/chromium,dednal/chromium.src,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,littlstar/chromium.src,Chilledheart/chromium,M4sse/chromium.src | ---
+++
@@ -25,9 +25,12 @@
options, args = parser.parse_args()
version = open(options.version_file, 'r').read().strip()
- revision = lastchange.FetchVersionInfo(None).revision.strip()
+ revision = lastchange.FetchVersionInfo(None).revision
+ if revision:
+ version += '.' + revision.strip()
+
global_string_map = {
- 'kChromeDriverVersion': version + '.' + revision
+ 'kChromeDriverVersion': version
}
cpp_source.WriteSource('version',
'chrome/test/chromedriver', |
cc103392eea1f620b656e0dfdb1432a1a589385c | euler_python/problem55.py | euler_python/problem55.py | """
problem55.py
If we take 47, reverse and add, 47 + 74 = 121, which is palindromic. A number
that never forms a palindrome through the reverse and add process is called a
Lychrel number. How many Lychrel numbers are there below ten-thousand? (Only
consider fifty iterations)
"""
from toolset import iterate, quantify, take
def to_digits(num):
# to_digits(1234) --> [1, 2, 3, 4]
return list(map(int, str(num)))
def to_num(digits):
# to_num([1, 2, 3, 4]) --> 1234
return int(''.join(map(str, digits)))
def is_palindromic(num):
return to_digits(num) == list(reversed(to_digits(num)))
def is_lychrel(num):
rev = lambda x: to_num(to_digits(x)[::-1])
start = num + rev(num)
iterations = iterate(lambda x: x + rev(x), start)
return not any(is_palindromic(n) for n in take(50, iterations))
def problem55():
return quantify(range(1, 10000), pred=is_lychrel)
| """
problem55.py
If we take 47, reverse and add, 47 + 74 = 121, which is palindromic. A number
that never forms a palindrome through the reverse and add process is called a
Lychrel number. How many Lychrel numbers are there below ten-thousand? (Only
consider fifty iterations)
"""
from toolset import iterate, quantify, take
def to_digits(num):
# to_digits(1234) --> [1, 2, 3, 4]
return list(map(int, str(num)))
def to_num(digits):
# to_num([1, 2, 3, 4]) --> 1234
return int(''.join(map(str, digits)))
def is_palindromic(num):
return to_digits(num) == list(reversed(to_digits(num)))
def is_lychrel(num):
rev = lambda x: to_num(reversed(to_digits(x)))
start = num + rev(num)
iterations = iterate(lambda x: x + rev(x), start)
return not any(is_palindromic(n) for n in take(50, iterations))
def problem55():
return quantify(range(1, 10000), pred=is_lychrel)
| Use clearer function name in is_lychrel | Use clearer function name in is_lychrel
| Python | mit | mjwestcott/projecteuler,mjwestcott/projecteuler,mjwestcott/projecteuler | ---
+++
@@ -20,7 +20,7 @@
return to_digits(num) == list(reversed(to_digits(num)))
def is_lychrel(num):
- rev = lambda x: to_num(to_digits(x)[::-1])
+ rev = lambda x: to_num(reversed(to_digits(x)))
start = num + rev(num)
iterations = iterate(lambda x: x + rev(x), start)
return not any(is_palindromic(n) for n in take(50, iterations)) |
7a1351c7f677380eeee8027399e69b0d34e3e858 | daybed/tests/features/model_data.py | daybed/tests/features/model_data.py | import json
from lettuce import step, world
@step(u'post "([^"]*)" records?')
def post_record(step, model_name):
world.path = '/data/%s' % str(model_name.lower())
for record in step.hashes:
data = json.dumps(record)
world.response = world.browser.post(world.path, params=data, status='*')
@step(u'obtain a record id')
def obtain_a_record_id(step):
assert 'id' in world.response.json
@step(u'retrieve the "([^"]*)" records')
def retrieve_records(step, model_name):
world.path = '/data/%s' % str(model_name.lower())
world.response = world.browser.get(world.path, status='*')
@step(u'results are :')
def results_are(step):
results = world.response.json['data']
assert len(results) >= len(step.hashes)
for i, result in enumerate(results):
assert result == step.hashes[i]
| import json
from lettuce import step, world
@step(u'post "([^"]*)" records?')
def post_record(step, model_name):
world.path = '/data/%s' % str(model_name.lower())
for record in step.hashes:
data = json.dumps(record)
world.response = world.browser.post(world.path, params=data, status='*')
@step(u'obtain a record id')
def obtain_a_record_id(step):
assert 'id' in world.response.json
@step(u'retrieve the "([^"]*)" records')
def retrieve_records(step, model_name):
world.path = '/data/%s' % str(model_name.lower())
world.response = world.browser.get(world.path, status='*')
@step(u'results are :')
def results_are(step):
results = world.response.json['data']
assert len(results) >= len(step.hashes)
for i, result in enumerate(results):
step.hashes[i]['id'] = result['id'] # We cannot guess it
assert result == step.hashes[i]
| Fix bug of adding the id to the resulting data | Fix bug of adding the id to the resulting data
| Python | bsd-3-clause | spiral-project/daybed,spiral-project/daybed | ---
+++
@@ -25,4 +25,5 @@
results = world.response.json['data']
assert len(results) >= len(step.hashes)
for i, result in enumerate(results):
+ step.hashes[i]['id'] = result['id'] # We cannot guess it
assert result == step.hashes[i] |
57bc5d89450633ffed33460ae18842f728d601ed | enthought/qt/QtCore.py | enthought/qt/QtCore.py | import os
qt_api = os.environ.get('QT_API', 'pyqt')
if qt_api == 'pyqt':
from PyQt4.QtCore import *
from PyQt4.QtCore import pyqtSignal as Signal
from PyQt4.Qt import QCoreApplication
from PyQt4.Qt import Qt
# Emulate PySide version metadata.
__version__ = QT_VERSION_STR
__version_info__ = tuple(map(int, QT_VERSION_STR.split('.')))
else:
from PySide.QtCore import *
| import os
qt_api = os.environ.get('QT_API', 'pyqt')
if qt_api == 'pyqt':
from PyQt4.QtCore import *
from PyQt4.QtCore import pyqtSignal as Signal
from PyQt4.Qt import QCoreApplication
from PyQt4.Qt import Qt
__version__ = QT_VERSION_STR
__version_info__ = tuple(map(int, QT_VERSION_STR.split('.')))
else:
import PySide
from PySide.QtCore import *
__version__ = PySide.__version__
__version_info__ = PySide.__version_info__
| Add version info for PySide as well. | Add version info for PySide as well.
| Python | bsd-3-clause | burnpanck/traits,burnpanck/traits | ---
+++
@@ -9,9 +9,12 @@
from PyQt4.Qt import QCoreApplication
from PyQt4.Qt import Qt
- # Emulate PySide version metadata.
__version__ = QT_VERSION_STR
__version_info__ = tuple(map(int, QT_VERSION_STR.split('.')))
else:
+ import PySide
from PySide.QtCore import *
+
+ __version__ = PySide.__version__
+ __version_info__ = PySide.__version_info__ |
ba2618e5ca63cad92e17ea154c9d8332064f7771 | pdvega/_axes.py | pdvega/_axes.py | from vega3 import VegaLite
class VegaLiteAxes(object):
"""Class representing a pdvega plot axes"""
def __init__(self, spec=None, data=None):
self.vlspec = VegaLite(spec, data)
@property
def spec(self):
return self.vlspec.spec
@property
def data(self):
return self.vlspec.data
def _ipython_display_(self):
return self.vlspec._ipython_display_()
def display(self):
return self.vlspec.display()
| from vega3 import VegaLite
class VegaLiteAxes(object):
"""Class representing a pdvega plot axes"""
def __init__(self, spec=None, data=None):
self.vlspec = VegaLite(spec, data)
@property
def spec(self):
return self.vlspec.spec
@property
def spec_no_data(self):
return {key: val for key, val in self.spec.items() if key != 'data'}
@property
def data(self):
return self.vlspec.data
def _ipython_display_(self):
return self.vlspec._ipython_display_()
def display(self):
return self.vlspec.display()
| Add spec_no_data attribute to axes | Add spec_no_data attribute to axes
| Python | mit | jakevdp/pdvega | ---
+++
@@ -11,6 +11,10 @@
return self.vlspec.spec
@property
+ def spec_no_data(self):
+ return {key: val for key, val in self.spec.items() if key != 'data'}
+
+ @property
def data(self):
return self.vlspec.data
|
4f47fef587b520e4110b232a2eaf175e79be375a | binstar_client/utils/notebook/__init__.py | binstar_client/utils/notebook/__init__.py | import re
from ...errors import BinstarError
from .downloader import *
from .uploader import *
from .finder import *
from .scm import *
def parse(handle):
"""
>>> parse("user/project:main.ipynb")
('user', 'project', 'main.ipynb')
>>> parse("project")
(None, 'project', None)
>>> parse("user/project")
('user', 'project', None)
:param handle: String
:return: username, project, file
"""
r = r'^(?P<user0>\w+)/(?P<project0>\w+):(?P<notebook0>\w+)$|^(?P<user1>\w+)/(?P<project1>\w+)$|^(?P<project2>\w+)$'
try:
parsed = re.compile(r).match(handle).groupdict()
except AttributeError:
raise BinstarError("{} can't be parsed".format(handle))
if parsed['project2'] is not None:
return None, parsed['project2'], None
elif parsed['project1'] is not None:
return parsed['user1'], parsed['project1'], None
else:
return parsed['user0'], parsed['project0'], parsed['notebook0']
| import re
from ...errors import BinstarError
from .downloader import *
from .uploader import *
from .finder import *
from .scm import *
def parse(handle):
"""
>>> parse("user/project:main.ipynb")
('user', 'project', 'main.ipynb')
>>> parse("project")
(None, 'project', None)
>>> parse("user/project")
('user', 'project', None)
:param handle: String
:return: username, project, file
"""
r = r'^(?P<user0>\w+)/(?P<project0>\w+):(?P<notebook0>\w+)$|^(?P<user1>\w+)/(?P<project1>\w+)$|^(?P<project2>.+)$'
try:
parsed = re.compile(r).match(handle).groupdict()
except AttributeError:
raise BinstarError("{} can't be parsed".format(handle))
if parsed['project2'] is not None:
return None, parsed['project2'], None
elif parsed['project1'] is not None:
return parsed['user1'], parsed['project1'], None
else:
return parsed['user0'], parsed['project0'], parsed['notebook0']
| Allow extensions on last parameter | Allow extensions on last parameter
| Python | bsd-3-clause | Anaconda-Platform/anaconda-client,Anaconda-Platform/anaconda-client,Anaconda-Platform/anaconda-client | ---
+++
@@ -18,7 +18,7 @@
:param handle: String
:return: username, project, file
"""
- r = r'^(?P<user0>\w+)/(?P<project0>\w+):(?P<notebook0>\w+)$|^(?P<user1>\w+)/(?P<project1>\w+)$|^(?P<project2>\w+)$'
+ r = r'^(?P<user0>\w+)/(?P<project0>\w+):(?P<notebook0>\w+)$|^(?P<user1>\w+)/(?P<project1>\w+)$|^(?P<project2>.+)$'
try:
parsed = re.compile(r).match(handle).groupdict() |
a3b31c0a3157accb76611d57caa591cd2cdf8d7a | tests/test_mgi_load.py | tests/test_mgi_load.py | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import mgi
import mgi.load
import mgi.models
def test_mgi_load():
engine = create_engine('sqlite://')
metadata = mgi.models.Base.metadata
metadata.bind = engine
metadata.create_all()
sessionmaker_ = sessionmaker(engine)
_testinput = 'tests/data/'
nr_entries = mgi.load.load(_testinput, sessionmaker_)
session = sessionmaker_ ()
loaded = session.query(mgi.models.Entry).count()
assert nr_entries == 15
assert loaded == nr_entries
# MGI:1915545 is in the file but does not have a cellular component
assert not session.query(mgi.models.Entry).filter(mgi.models.Entry.mgi_id == 'MGI:1915545').count()
| from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy import and_
import mgi
import mgi.load
import mgi.models
from translations.models import Translation
def test_mgi_load():
engine = create_engine('sqlite://')
metadata = mgi.models.Base.metadata
metadata.bind = engine
metadata.create_all()
sessionmaker_ = sessionmaker(engine)
_testinput = 'tests/data/'
nr_entries = mgi.load.load(_testinput, sessionmaker_)
session = sessionmaker_ ()
loaded = session.query(mgi.models.Entry).count()
assert nr_entries == 15
assert loaded == nr_entries
# MGI:1915545 is in the file but does not have a cellular component
assert not session.query(mgi.models.Entry).filter(mgi.models.Entry.mgi_id == 'MGI:1915545').count()
assert session.query(Translation).filter(
and_(Translation.input_namespace == 'ensembl:gene_id',
Translation.input_name == 'ENSMUSG00000026004',
Translation.output_namespace == 'mgi')).count()
| Test MGI translation loading too. | Test MGI translation loading too.
| Python | mit | luispedro/waldo,luispedro/waldo | ---
+++
@@ -1,9 +1,11 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
+from sqlalchemy import and_
import mgi
import mgi.load
import mgi.models
+from translations.models import Translation
def test_mgi_load():
engine = create_engine('sqlite://')
@@ -22,3 +24,9 @@
# MGI:1915545 is in the file but does not have a cellular component
assert not session.query(mgi.models.Entry).filter(mgi.models.Entry.mgi_id == 'MGI:1915545').count()
+ assert session.query(Translation).filter(
+ and_(Translation.input_namespace == 'ensembl:gene_id',
+ Translation.input_name == 'ENSMUSG00000026004',
+ Translation.output_namespace == 'mgi')).count()
+
+ |
f19fb3bf2eb90f77b193dc25f5b8bec0dfd253bc | fabtools/require/mysql.py | fabtools/require/mysql.py | """
Idempotent API for managing MySQL users and databases
"""
from __future__ import with_statement
from fabtools.mysql import *
from fabtools.deb import is_installed, preseed_package
from fabtools.require.deb import package
from fabtools.require.service import started
def server(version='5.1', password=None):
"""
Require a MySQL server
"""
if not is_installed("mysql-server-%s" % version):
if password is None:
password = prompt_password()
with settings(hide('running')):
preseed_package('mysql-server', {
'mysql-server/root_password': ('password', password),
'mysql-server/root_password_again': ('password', password),
})
package('mysql-server-%s' % version)
started('mysql')
def user(name, password, **kwargs):
"""
Require a MySQL user
"""
if not user_exists(name, **kwargs):
create_user(name, password, **kwargs)
def database(name, **kwargs):
"""
Require a MySQL database
"""
if not database_exists(name, **kwargs):
create_database(name, **kwargs)
| """
Idempotent API for managing MySQL users and databases
"""
from __future__ import with_statement
from fabtools.mysql import *
from fabtools.deb import is_installed, preseed_package
from fabtools.require.deb import package
from fabtools.require.service import started
def server(version=None, password=None):
"""
Require a MySQL server
"""
if version:
pkg_name = 'mysql-server-%s' % version
else:
pkg_name = 'mysql-server'
if not is_installed(pkg_name):
if password is None:
password = prompt_password()
with settings(hide('running')):
preseed_package('mysql-server', {
'mysql-server/root_password': ('password', password),
'mysql-server/root_password_again': ('password', password),
})
package(pkg_name)
started('mysql')
def user(name, password, **kwargs):
"""
Require a MySQL user
"""
if not user_exists(name, **kwargs):
create_user(name, password, **kwargs)
def database(name, **kwargs):
"""
Require a MySQL database
"""
if not database_exists(name, **kwargs):
create_database(name, **kwargs)
| Fix require MySQL server on Ubuntu 12.04 LTS | Fix require MySQL server on Ubuntu 12.04 LTS
| Python | bsd-2-clause | pombredanne/fabtools,ronnix/fabtools,fabtools/fabtools,badele/fabtools,sociateru/fabtools,davidcaste/fabtools,pahaz/fabtools,n0n0x/fabtools-python,ahnjungho/fabtools,hagai26/fabtools,prologic/fabtools,AMOSoft/fabtools,bitmonk/fabtools,wagigi/fabtools-python | ---
+++
@@ -9,11 +9,16 @@
from fabtools.require.service import started
-def server(version='5.1', password=None):
+def server(version=None, password=None):
"""
Require a MySQL server
"""
- if not is_installed("mysql-server-%s" % version):
+ if version:
+ pkg_name = 'mysql-server-%s' % version
+ else:
+ pkg_name = 'mysql-server'
+
+ if not is_installed(pkg_name):
if password is None:
password = prompt_password()
@@ -23,7 +28,7 @@
'mysql-server/root_password_again': ('password', password),
})
- package('mysql-server-%s' % version)
+ package(pkg_name)
started('mysql')
|
d540b7c14b9411acdedfe41a77fd4911ef2eb660 | src/cmdtree/tests/functional/test_command.py | src/cmdtree/tests/functional/test_command.py | from cmdtree import INT
from cmdtree import command, argument, option
@argument("host", help="server listen address")
@option("reload", is_flag=True, help="if auto-reload on")
@option("port", help="server port", type=INT, default=8888)
@command(help="run a http server on given address")
def run_server(host, reload, port):
return host, port, reload
def test_should_return_given_argument():
from cmdtree import entry
result = entry(
["run_server", "host", "--reload", "--port", "8888"]
)
assert result == ("host", 8888, True) | import pytest
from cmdtree import INT
from cmdtree import command, argument, option
@argument("host", help="server listen address")
@option("reload", is_flag=True, help="if auto-reload on")
@option("port", help="server port", type=INT, default=8888)
@command(help="run a http server on given address")
def run_server(host, reload, port):
return host, port, reload
@command(help="run a http server on given address")
@argument("host", help="server listen address")
@option("port", help="server port", type=INT, default=8888)
def order(port, host):
return host, port
def test_should_return_given_argument():
from cmdtree import entry
result = entry(
["run_server", "host", "--reload", "--port", "8888"]
)
assert result == ("host", 8888, True)
def test_should_reverse_decorator_order_has_no_side_effect():
from cmdtree import entry
result = entry(
["order", "host", "--port", "8888"]
)
assert result == ("host", 8888) | Add functional test for reverse decorator order | Update: Add functional test for reverse decorator order
| Python | mit | winkidney/cmdtree,winkidney/cmdtree | ---
+++
@@ -1,3 +1,4 @@
+import pytest
from cmdtree import INT
from cmdtree import command, argument, option
@@ -10,9 +11,24 @@
return host, port, reload
+@command(help="run a http server on given address")
+@argument("host", help="server listen address")
+@option("port", help="server port", type=INT, default=8888)
+def order(port, host):
+ return host, port
+
+
def test_should_return_given_argument():
from cmdtree import entry
result = entry(
["run_server", "host", "--reload", "--port", "8888"]
)
assert result == ("host", 8888, True)
+
+
+def test_should_reverse_decorator_order_has_no_side_effect():
+ from cmdtree import entry
+ result = entry(
+ ["order", "host", "--port", "8888"]
+ )
+ assert result == ("host", 8888) |
d91f12a36e7980111511a6eb94aea2b09a18cb42 | app/models.py | app/models.py | from app import db
class Base(db.Model):
__abstract__ = True
pk = db.Column(db.Integer, primary_key=True)
created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())
class Route(Base):
__tablename__ = 'routes'
origin_point = db.Column(db.String(128), nullable=False)
destination_point = db.Column(db.String(128), nullable=False)
distance = db.Column(db.Integer, nullable=False)
def __repr__(self):
return '<Route <{0}-{1}-{2}>'.format(self.origin_point,
self.destination_point,
self.distance)
| from app import db
from app.dijkstra import Graph, get_shortest_path
class Base(db.Model):
__abstract__ = True
pk = db.Column(db.Integer, primary_key=True)
created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())
class Route(Base):
__tablename__ = 'routes'
origin_point = db.Column(db.String(128), nullable=False)
destination_point = db.Column(db.String(128), nullable=False)
distance = db.Column(db.Integer, nullable=False)
def __repr__(self):
return '<Route <{0}-{1}-{2}>'.format(self.origin_point,
self.destination_point,
self.distance)
@classmethod
def calculate(cls, origin, destination, autonomy, fuel_price):
distance, path = cls._calculate_shortest_path(origin, destination)
cost = cls._calculate_cost(distance, autonomy, fuel_price)
return cost, ' '.join(path)
def _calculate_shortest_path(origin, destination):
graph = Graph()
routes = Route.query.all()
for route in routes:
graph.add_node(route.origin_point)
for route in routes:
graph.add_edge(route.origin_point,
route.destination_point,
route.distance)
return get_shortest_path(graph, origin, destination)
def _calculate_cost(distance, autonomy, fuel_price):
return distance * fuel_price / autonomy
| Add "calculate" method to Route model to calculate the cost | Add "calculate" method to Route model to calculate the cost
| Python | mit | mdsrosa/routes_api_python | ---
+++
@@ -1,4 +1,5 @@
from app import db
+from app.dijkstra import Graph, get_shortest_path
class Base(db.Model):
@@ -22,3 +23,26 @@
return '<Route <{0}-{1}-{2}>'.format(self.origin_point,
self.destination_point,
self.distance)
+
+ @classmethod
+ def calculate(cls, origin, destination, autonomy, fuel_price):
+ distance, path = cls._calculate_shortest_path(origin, destination)
+ cost = cls._calculate_cost(distance, autonomy, fuel_price)
+ return cost, ' '.join(path)
+
+ def _calculate_shortest_path(origin, destination):
+ graph = Graph()
+ routes = Route.query.all()
+
+ for route in routes:
+ graph.add_node(route.origin_point)
+
+ for route in routes:
+ graph.add_edge(route.origin_point,
+ route.destination_point,
+ route.distance)
+
+ return get_shortest_path(graph, origin, destination)
+
+ def _calculate_cost(distance, autonomy, fuel_price):
+ return distance * fuel_price / autonomy |
be94babb7feb7c32c0d269a8cfa8b722c70e0ab0 | map_service/lib/wso2/carbon_connect.py | map_service/lib/wso2/carbon_connect.py | __author__ = 'tmkasun'
from suds.client import Client
from suds.transport.https import HttpAuthenticated
class AdminService(object):
client = None
def __init__(self, api, service_name):
self.tenant = HttpAuthenticated(username=api['username'], password=api['password'])
self.protocol = 'http'
if api['ssl']:
self.protocol = 'https'
self.wsdl_url = '{}://{}:{}/services/{}?wsdl'.format(self.protocol, api['host'], api['port'],
service_name)
self.service_url = '{}://{}:{}/services/{}'.format(self.protocol, api['host'], api['port'],
service_name)
def connect(self):
self.client = Client(self.wsdl_url, transport=self.tenant, location=self.service_url)
def is_connected(self):
if not self.client:
return False
return True | __author__ = 'tmkasun'
from suds.client import Client
from suds.transport.https import HttpAuthenticated
class AdminService(object):
client = None
def __init__(self, api, service_name):
self.tenant = HttpAuthenticated(username=api['username'], password=api['password'])
self.protocol = 'http'
self.port = api['port']
# TODO: Is Admin service available without ssl ?
if api['ssl']:
self.protocol = 'https'
self.port = api['ssl_port']
self.wsdl_url = '{}://{}:{}/services/{}?wsdl'.format(self.protocol, api['host'], self.port,
service_name)
self.service_url = '{}://{}:{}/services/{}'.format(self.protocol, api['host'], self.port,
service_name)
def connect(self):
self.client = Client(self.wsdl_url, transport=self.tenant, location=self.service_url)
def is_connected(self):
if not self.client:
return False
return True | Add support to non-ssl webservices | Add support to non-ssl webservices
| Python | apache-2.0 | tmkasun/Knnect,tmkasun/Knnect,tmkasun/Knnect,tmkasun/Knnect | ---
+++
@@ -11,12 +11,16 @@
self.tenant = HttpAuthenticated(username=api['username'], password=api['password'])
self.protocol = 'http'
+ self.port = api['port']
+
+ # TODO: Is Admin service available without ssl ?
if api['ssl']:
self.protocol = 'https'
+ self.port = api['ssl_port']
- self.wsdl_url = '{}://{}:{}/services/{}?wsdl'.format(self.protocol, api['host'], api['port'],
+ self.wsdl_url = '{}://{}:{}/services/{}?wsdl'.format(self.protocol, api['host'], self.port,
service_name)
- self.service_url = '{}://{}:{}/services/{}'.format(self.protocol, api['host'], api['port'],
+ self.service_url = '{}://{}:{}/services/{}'.format(self.protocol, api['host'], self.port,
service_name)
def connect(self): |
8f264af74ca4f1b956af33853134ff8ec722fc40 | huecli.py | huecli.py | import click
from hue import bridge, configuration
@click.group()
def cli():
"""
Control Philips HUE lighting from the command line
"""
@cli.command()
def setup():
"""
Setup connection to Bridge
"""
ip_address = bridge.discover()
bridge.connect(ip_address)
config = configuration.create(ip_address)
message = 'Config created for IP address: {0}'.format(config['ip_address'])
click.echo(message)
@cli.command()
def list():
"""
List available lights
"""
config = configuration.get()
b = bridge.connect(config['ip_address'])
for light in b.lights:
click.echo(light.name)
| import click
from hue import bridge, configuration
@click.group()
def cli():
"""
Control Philips HUE lighting from the command line
"""
@cli.command()
def setup():
"""
Setup connection to Bridge
"""
ip_address = bridge.discover()
bridge.connect(ip_address)
config = configuration.create(ip_address)
message = 'Config created for IP address: {0}'.format(config['ip_address'])
click.echo(message)
@cli.command()
def list():
"""
List available lights
"""
config = configuration.get()
b = bridge.connect(config['ip_address'])
for light in b.lights:
message = '{0}: {1}'.format(light.name, 'ON' if light.on else 'OFF')
click.echo(message)
| Add status to list output | Add status to list output
| Python | mit | projectweekend/HUEcli | ---
+++
@@ -30,4 +30,5 @@
config = configuration.get()
b = bridge.connect(config['ip_address'])
for light in b.lights:
- click.echo(light.name)
+ message = '{0}: {1}'.format(light.name, 'ON' if light.on else 'OFF')
+ click.echo(message) |
09d10b24fabbc5982d118b4ba292732945c0e78d | vocab.py | vocab.py | import sys
from collections import defaultdict
counter = defaultdict(int)
cut = 10
with open(sys.argv[1]) as f:
for line in f:
for word in line.split():
counter[word] += 1
from operator import itemgetter
for word,count in sorted( counter.iteritems(), key=itemgetter(1), reverse=True ):
if count > cut:
print word, count
| from __future__ import print_function
import sys
from collections import Counter
from operator import itemgetter
def main():
cut = 10
counter = Counter()
with open(sys.argv[1], 'r') as f:
for line in f:
for word in line.split():
counter[word] += 1
for word, count in sorted(counter.items(), key=itemgetter(1), reverse=True):
if count > cut:
print(word, count)
if __name__ == "__main__":
main()
| Clean Python code and make it compatible with both python2 and python3 | Clean Python code and make it compatible with both python2 and python3
| Python | mit | alexalemi/textbench,alexalemi/textbench,alexalemi/textbench,alexalemi/textbench,alexalemi/textbench | ---
+++
@@ -1,20 +1,21 @@
+from __future__ import print_function
import sys
-
-from collections import defaultdict
-
-counter = defaultdict(int)
-cut = 10
-
-with open(sys.argv[1]) as f:
- for line in f:
- for word in line.split():
- counter[word] += 1
+from collections import Counter
+from operator import itemgetter
-from operator import itemgetter
+def main():
+ cut = 10
+ counter = Counter()
+ with open(sys.argv[1], 'r') as f:
+ for line in f:
+ for word in line.split():
+ counter[word] += 1
-for word,count in sorted( counter.iteritems(), key=itemgetter(1), reverse=True ):
- if count > cut:
- print word, count
+ for word, count in sorted(counter.items(), key=itemgetter(1), reverse=True):
+ if count > cut:
+ print(word, count)
+if __name__ == "__main__":
+ main() |
c5a2cdf6f0a5d94a3f059677ca95383b1dd0be29 | src/python/twitter/common/python/__init__.py | src/python/twitter/common/python/__init__.py | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the License.
# You may obtain a copy of the License in the LICENSE file, or 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.
# ==================================================================================================
| # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the License.
# You may obtain a copy of the License in the LICENSE file, or 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.
# ==================================================================================================
# TODO(John Sirois): This works around a bug in namespace package injection for the setup_py
# command's sdist generation of a library using with_binaries. In this case
# the src/python/twitter/common/python target has a with_binaries that includes the pex.pex pex and
# this __init__.py is emitted in the sdist with no namespace package by the setup_py command unless
# manually added below.
__import__('pkg_resources').declare_namespace(__name__)
| Work around the twitter.common.python egg including the pex binary in a non-namespace package defeating twitter.common.python imports. | Work around the twitter.common.python egg including the pex binary in a non-namespace package defeating twitter.common.python imports.
(sapling split of 53156b2acfc0f37e12d1cc78fbf747ec72da210a) | Python | apache-2.0 | pantsbuild/pex,sixninetynine/pex,URXtech/pex,jamesbroadhead/pex,rouge8/pex,jsirois/pex,snyaggarwal/pex,kwlzn/pex,mzdanieltest/pex,snyaggarwal/pex,jsirois/pex,jamesbroadhead/pex,URXtech/pex,pombredanne/pex,mzdanieltest/pex,rouge8/pex,pantsbuild/pex,sixninetynine/pex,kwlzn/pex,pombredanne/pex | ---
+++
@@ -13,3 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==================================================================================================
+
+# TODO(John Sirois): This works around a bug in namespace package injection for the setup_py
+# command's sdist generation of a library using with_binaries. In this case
+# the src/python/twitter/common/python target has a with_binaries that includes the pex.pex pex and
+# this __init__.py is emitted in the sdist with no namespace package by the setup_py command unless
+# manually added below.
+__import__('pkg_resources').declare_namespace(__name__) |
05c3775c589b5afdb9f3d7d3e347615d699669c7 | catwatch/blueprints/issue/views.py | catwatch/blueprints/issue/views.py | from flask import (
Blueprint,
flash,
redirect,
url_for,
render_template)
from flask_login import current_user
from flask_babel import gettext as _
from catwatch.blueprints.issue.models import Issue
from catwatch.blueprints.issue.forms import SupportForm
issue = Blueprint('issue', __name__, template_folder='templates')
@issue.route('/support', methods=['GET', 'POST'])
def support():
# Pre-populate the email field if the user is signed in.
form = SupportForm(obj=current_user)
if form.validate_on_submit():
i = Issue()
form.populate_obj(i)
i.save()
flash(_('Help is on the way, expect a response shortly.'), 'success')
return redirect(url_for('issue.support'))
return render_template('issue/support.jinja2', form=form)
| from flask import (
Blueprint,
flash,
redirect,
url_for,
render_template)
from flask_login import current_user
from flask_babel import gettext as _
from catwatch.blueprints.issue.models import Issue
from catwatch.blueprints.issue.forms import SupportForm
issue = Blueprint('issue', __name__, template_folder='templates')
@issue.route('/support', methods=['GET', 'POST'])
def support():
form = SupportForm(obj=current_user)
if form.validate_on_submit():
i = Issue()
form.populate_obj(i)
i.save()
flash(_('Help is on the way, expect a response shortly.'), 'success')
return redirect(url_for('issue.support'))
return render_template('issue/support.jinja2', form=form)
| Normalize the issue blueprint's code base | Normalize the issue blueprint's code base
| Python | mit | nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask | ---
+++
@@ -16,7 +16,6 @@
@issue.route('/support', methods=['GET', 'POST'])
def support():
- # Pre-populate the email field if the user is signed in.
form = SupportForm(obj=current_user)
if form.validate_on_submit(): |
ca48a722fbfeaf8a9e0db5f507ca064e2d90b7dd | update_station_data.py | update_station_data.py | import json
from ns_api import Station, NSAPI
from local_settings import USERNAME, APIKEY
def update_station_data():
nsapi = NSAPI(USERNAME, APIKEY)
stations = nsapi.get_stations()
data = {'stations': []}
for station in stations:
# if station.country == "NL" and "Utrecht" in station.names['long']:
if station.country == "NL":
names = station.names
data['stations'].append({'names': names, 'lon': station.lon, 'lat': station.lat, 'type': station.stationtype})
json_data = json.dumps(data, indent=4, sort_keys=True)
with open('stations.json', 'w') as fileout:
fileout.write(json_data)
if __name__ == "__main__":
update_station_data()
| import json
from ns_api import Station, NSAPI
from local_settings import USERNAME, APIKEY
def update_station_data():
nsapi = NSAPI(USERNAME, APIKEY)
stations = nsapi.get_stations()
data = {'stations': []}
for station in stations:
# if station.country == "NL" and "Utrecht" in station.names['long']:
if station.country == "NL":
names = station.names
data['stations'].append({'names': names, 'lon': station.lon, 'lat': station.lat, 'type': station.stationtype})
json_data = json.dumps(data, indent=4, sort_keys=True)
with open('./data/stations.json', 'w') as fileout:
fileout.write(json_data)
if __name__ == "__main__":
update_station_data()
| Move location of generated stations.json to data directory | Move location of generated stations.json to data directory
| Python | mit | bartromgens/nsmaps,bartromgens/nsmaps,bartromgens/nsmaps | ---
+++
@@ -16,7 +16,7 @@
data['stations'].append({'names': names, 'lon': station.lon, 'lat': station.lat, 'type': station.stationtype})
json_data = json.dumps(data, indent=4, sort_keys=True)
- with open('stations.json', 'w') as fileout:
+ with open('./data/stations.json', 'w') as fileout:
fileout.write(json_data)
|
4c0173263b59b9f2940c70a362ced8bfeb26c4f3 | databaker/framework.py | databaker/framework.py | import xlutils, xypath
import databaker
import os
import databaker.constants
from databaker.constants import * # also brings in template
import databaker.databakersolo as ds # causes the xypath.loader to be overwritten
from databaker.jupybakeutils import HDim, HDimConst, savepreviewhtml, writetechnicalCSV, ConversionSegment
def loadxlstabs(inputfile):
print("Loading %s which has size %d bytes" % (inputfile, os.path.getsize(inputfile)))
tableset = xypath.loader.table_set(inputfile, extension='xls')
tabs = list(xypath.loader.get_sheets(tableset, "*"))
print("Table names: %s" % ", ".join([tab.name for tab in tabs]))
return tabs
import pandas as pd
def topandas(conversionsegment):
return pd.DataFrame.from_dict(conversionsegment.lookupall())
| import xlutils, xypath
import databaker
import os
import databaker.constants
from databaker.constants import * # also brings in template
import databaker.databakersolo as ds # causes the xypath.loader to be overwritten
from databaker.jupybakeutils import HDim, HDimConst, savepreviewhtml, writetechnicalCSV, ConversionSegment
def loadxlstabs(inputfile, sheetids="*"):
print("Loading %s which has size %d bytes" % (inputfile, os.path.getsize(inputfile)))
tableset = xypath.loader.table_set(inputfile, extension='xls')
tabs = list(xypath.loader.get_sheets(tableset, sheetids))
print("Table names: %s" % ", ".join([tab.name for tab in tabs]))
return tabs
import pandas as pd
def topandas(conversionsegment):
return pd.DataFrame.from_dict(conversionsegment.lookupall())
| Add table sheet selection capabilit | Add table sheet selection capabilit
| Python | agpl-3.0 | scraperwiki/databaker,scraperwiki/databaker | ---
+++
@@ -6,10 +6,10 @@
import databaker.databakersolo as ds # causes the xypath.loader to be overwritten
from databaker.jupybakeutils import HDim, HDimConst, savepreviewhtml, writetechnicalCSV, ConversionSegment
-def loadxlstabs(inputfile):
+def loadxlstabs(inputfile, sheetids="*"):
print("Loading %s which has size %d bytes" % (inputfile, os.path.getsize(inputfile)))
tableset = xypath.loader.table_set(inputfile, extension='xls')
- tabs = list(xypath.loader.get_sheets(tableset, "*"))
+ tabs = list(xypath.loader.get_sheets(tableset, sheetids))
print("Table names: %s" % ", ".join([tab.name for tab in tabs]))
return tabs
|
a78b305ec1624bc76b527094e937a831f6ea37dd | h2o-py/tests/testdir_misc/pyunit_make_metrics.py | h2o-py/tests/testdir_misc/pyunit_make_metrics.py | from __future__ import division
from __future__ import print_function
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
from h2o.estimators import H2OGradientBoostingEstimator
def pyunit_make_metrics():
fr = h2o.import_file(pyunit_utils.locate("smalldata/logreg/prostate.csv"))
fr["CAPSULE"] = fr["CAPSULE"].asfactor()
fr["RACE"] = fr["RACE"].asfactor()
fr.describe()
response = "AGE"
predictors = range(1,fr.ncol)
model = H2OGradientBoostingEstimator()
model.train(x=predictors,y=response,training_frame=fr)
p = model.model_performance(train=True)
# p = make_metrics(predicted,actual,"gaussian")
if __name__ == "__main__":
pyunit_utils.standalone_test(pyunit_make_metrics)
else:
pyunit_make_metrics() | from __future__ import division
from __future__ import print_function
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
from h2o.estimators import H2OGradientBoostingEstimator
def pyunit_make_metrics():
fr = h2o.import_file(pyunit_utils.locate("smalldata/logreg/prostate.csv"))
fr["CAPSULE"] = fr["CAPSULE"].asfactor()
fr["RACE"] = fr["RACE"].asfactor()
fr.describe()
response = "AGE"
predictors = range(1,fr.ncol)
# model = H2OGradientBoostingEstimator()
# model.train(x=predictors,y=response,training_frame=fr)
# p = model.model_performance(train=True)
# p = make_metrics(predicted,actual,"gaussian")
if __name__ == "__main__":
pyunit_utils.standalone_test(pyunit_make_metrics)
else:
pyunit_make_metrics()
| Disable unused test for now. | Disable unused test for now.
| Python | apache-2.0 | spennihana/h2o-3,jangorecki/h2o-3,michalkurka/h2o-3,h2oai/h2o-dev,h2oai/h2o-dev,mathemage/h2o-3,michalkurka/h2o-3,jangorecki/h2o-3,spennihana/h2o-3,spennihana/h2o-3,h2oai/h2o-3,h2oai/h2o-dev,michalkurka/h2o-3,h2oai/h2o-3,mathemage/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,jangorecki/h2o-3,h2oai/h2o-3,spennihana/h2o-3,h2oai/h2o-3,h2oai/h2o-dev,michalkurka/h2o-3,jangorecki/h2o-3,spennihana/h2o-3,spennihana/h2o-3,h2oai/h2o-dev,spennihana/h2o-3,michalkurka/h2o-3,jangorecki/h2o-3,jangorecki/h2o-3,mathemage/h2o-3,mathemage/h2o-3,mathemage/h2o-3,mathemage/h2o-3,h2oai/h2o-dev,h2oai/h2o-dev,h2oai/h2o-3,jangorecki/h2o-3,h2oai/h2o-3,h2oai/h2o-3,mathemage/h2o-3 | ---
+++
@@ -15,10 +15,10 @@
response = "AGE"
predictors = range(1,fr.ncol)
- model = H2OGradientBoostingEstimator()
- model.train(x=predictors,y=response,training_frame=fr)
+# model = H2OGradientBoostingEstimator()
+# model.train(x=predictors,y=response,training_frame=fr)
- p = model.model_performance(train=True)
+# p = model.model_performance(train=True)
# p = make_metrics(predicted,actual,"gaussian")
if __name__ == "__main__": |
11443eda1a192c0f3a4aa8225263b4e312fa5a55 | spam_lists/exceptions.py | spam_lists/exceptions.py | # -*- coding: utf-8 -*-
class SpamListsError(Exception):
'''There was an error during testing a url or host'''
class UnknownCodeError(SpamListsError):
'''The classification code from the service was not recognized'''
class UnathorizedAPIKeyError(SpamListsError):
'''The API key used to query the service was not authorized'''
| # -*- coding: utf-8 -*-
class SpamListsError(Exception):
'''There was an error during testing a url or host'''
class UnknownCodeError(SpamListsError, KeyError):
'''The classification code from the service was not recognized'''
class UnathorizedAPIKeyError(SpamListsError):
'''The API key used to query the service was not authorized'''
| Make UnknownCodeError additionally extend KeyError | Make UnknownCodeError additionally extend KeyError
| Python | mit | piotr-rusin/spam-lists | ---
+++
@@ -3,7 +3,7 @@
class SpamListsError(Exception):
'''There was an error during testing a url or host'''
-class UnknownCodeError(SpamListsError):
+class UnknownCodeError(SpamListsError, KeyError):
'''The classification code from the service was not recognized'''
class UnathorizedAPIKeyError(SpamListsError): |
8b4cc54e55ac222f444c512b6dc1b1d55475cddb | rusts.py | rusts.py | #!/usr/bin/env python2
import valve.source.a2s
SERVER="163.172.17.175"
PORT=30616
def playerList(server):
server = valve.source.a2s.ServerQuerier(server)
info = server.info()
players = server.players()
for p in players['players']:
if p["name"]:
print(p["name"]) + " (" + str(int((p["duration"]))) + "s)"
if __name__ == "__main__":
playerList((unicode(SERVER), PORT))
| #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import valve.source.a2s
SERVER="163.172.17.175"
PORT=30616
def playerList(server):
"""Retreive player and limited server/game information and print the results
Specifically, this retrieves information re: a Rust server.
----------------------------
Rust - ServerName.com
----------------------------
Rust Version 1234
----------------------------
Player1: 2 hr 40 min
Player2: 2 hr 52 min
Player3: 1 hr 59 min
Player4: 2 hr 39 min
----------------------------
4 players \ 50 max
----------------------------"""
server = valve.source.a2s.ServerQuerier(server)
players = server.players()
num_players, max_players, server_name, version = server.info()["player_count"], \
server.info()["max_players"], \
server.info()["server_name"], \
server.info()["version"]
line_sep = "-" * 28
print(line_sep)
print(server_name)
print(line_sep)
print("Rust Version " + version)
print(line_sep)
for player in sorted(players["players"],
key=lambda player: player["name"]):
player_name = player["name"]
player_minutes = int(player["duration"]) / 60
player_hours, player_minutes = divmod(player_minutes, 60)
print "%12s:\t %d hr %02d min" % (player_name, player_hours, player_minutes)
print(line_sep)
print "%d players \\ %d max" % (num_players, max_players)
print(line_sep)
if __name__ == "__main__":
playerList((unicode(SERVER), PORT))
| Update server info, game info, add pretty print, general cleanup. | Update server info, game info, add pretty print, general cleanup.
| Python | unlicense | saildata/steamscript,lluis/steamscript,oleerik/steamscript | ---
+++
@@ -1,17 +1,54 @@
#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
+
import valve.source.a2s
SERVER="163.172.17.175"
PORT=30616
def playerList(server):
+ """Retreive player and limited server/game information and print the results
+
+ Specifically, this retrieves information re: a Rust server.
+
+ ----------------------------
+ Rust - ServerName.com
+ ----------------------------
+ Rust Version 1234
+ ----------------------------
+ Player1: 2 hr 40 min
+ Player2: 2 hr 52 min
+ Player3: 1 hr 59 min
+ Player4: 2 hr 39 min
+ ----------------------------
+ 4 players \ 50 max
+ ----------------------------"""
+
server = valve.source.a2s.ServerQuerier(server)
- info = server.info()
players = server.players()
+ num_players, max_players, server_name, version = server.info()["player_count"], \
+ server.info()["max_players"], \
+ server.info()["server_name"], \
+ server.info()["version"]
- for p in players['players']:
- if p["name"]:
- print(p["name"]) + " (" + str(int((p["duration"]))) + "s)"
+ line_sep = "-" * 28
+
+ print(line_sep)
+ print(server_name)
+ print(line_sep)
+ print("Rust Version " + version)
+ print(line_sep)
+
+ for player in sorted(players["players"],
+ key=lambda player: player["name"]):
+ player_name = player["name"]
+ player_minutes = int(player["duration"]) / 60
+ player_hours, player_minutes = divmod(player_minutes, 60)
+ print "%12s:\t %d hr %02d min" % (player_name, player_hours, player_minutes)
+
+ print(line_sep)
+ print "%d players \\ %d max" % (num_players, max_players)
+ print(line_sep)
if __name__ == "__main__":
playerList((unicode(SERVER), PORT)) |
c8ad21096311971e985ac5705af280a09d66aa15 | setup.py | setup.py | from setuptools import setup, find_packages
import os
import os.path as op
import uuid
ver_file = os.path.join('popylar', 'version.py')
with open(ver_file) as f:
exec(f.read())
popylar_path = op.join(op.expanduser('~'), '.popylar')
uid = uuid.uuid1()
fhandle = open(popylar_path, 'a')
fhandle.write(uid)
fhandle.close()
PACKAGES = find_packages()
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,
requires=REQUIRES)
if __name__ == '__main__':
setup(**opts)
| from setuptools import setup, find_packages
import os
import os.path as op
import uuid
ver_file = os.path.join('popylar', 'version.py')
with open(ver_file) as f:
exec(f.read())
popylar_path = op.join(op.expanduser('~'), '.popylar')
uid = uuid.uuid1()
fhandle = open(popylar_path, 'a')
fhandle.write(uid.hex)
fhandle.close()
PACKAGES = find_packages()
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,
requires=REQUIRES)
if __name__ == '__main__':
setup(**opts)
| Use the hex representation of the UUID. | Use the hex representation of the UUID.
| Python | bsd-2-clause | popylar/popylar | ---
+++
@@ -11,7 +11,7 @@
uid = uuid.uuid1()
fhandle = open(popylar_path, 'a')
-fhandle.write(uid)
+fhandle.write(uid.hex)
fhandle.close()
PACKAGES = find_packages() |
9c4cac1eb19cb05fa03fd163cef348331e00820c | setup.py | setup.py | """CodeJail: manages execution of untrusted code in secure sandboxes."""
from setuptools import setup
setup(
name="codejail",
version="3.0.1",
packages=['codejail'],
zip_safe=False,
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Ubuntu",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.8',
],
)
| """CodeJail: manages execution of untrusted code in secure sandboxes."""
from setuptools import setup
setup(
name="codejail",
version="3.0.2",
packages=['codejail'],
install_requires=['six'],
zip_safe=False,
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Ubuntu",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.8',
],
)
| Add required dependency on "six" package | Add required dependency on "six" package | Python | apache-2.0 | edx/codejail | ---
+++
@@ -4,8 +4,9 @@
setup(
name="codejail",
- version="3.0.1",
+ version="3.0.2",
packages=['codejail'],
+ install_requires=['six'],
zip_safe=False,
classifiers=[
"License :: OSI Approved :: Apache Software License", |
0c1463324d4bdee685fb8ac767168413cc4ee2d0 | setup.py | setup.py | #!/usr/bin/env python
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.version_info < (2,5):
raise NotImplementedError("Sorry, you need at least Python 2.5 or Python 3.x")
import contexter
with contexter.Contexter() as ctx:
long_description = ''.join(ctx << open('README.rst'))
setup(name='contexter',
version=contexter.__version__,
description=contexter.__doc__,
long_description=long_description,
author=contexter.__author__,
author_email='marc@gsites.de',
url='https://bitbucket.org/defnull/contexter',
py_modules=['contexter'],
license='MIT',
platforms = 'any',
classifiers=['Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
| #!/usr/bin/env python
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.version_info < (2,5):
raise NotImplementedError("Sorry, you need at least Python 2.5 or Python 3.x")
import contexter
with contexter.Contexter() as ctx:
long_description = ' '.join(ctx << open('README.rst')).rstrip()
setup(name='contexter',
version=contexter.__version__,
description=contexter.__doc__.replace('\n', '\n ').rstrip(),
long_description=long_description,
author=contexter.__author__,
author_email='marc@gsites.de',
url='https://bitbucket.org/defnull/contexter',
py_modules=['contexter'],
license='MIT',
platforms = 'any',
classifiers=['Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
| Indent and strip package metadata strings. | Indent and strip package metadata strings.
The Python package metadata was not being correctly formatted due to the
presence of unindented lines. I think setuptools should be responsible
for this formatting, but it seems easier to just fix it here.
With this change, it becomes possible for the standard pkg_resources
parser to read the PKG-INFO metadata for this project.
| Python | mit | defnull/contexter | ---
+++
@@ -12,11 +12,11 @@
import contexter
with contexter.Contexter() as ctx:
- long_description = ''.join(ctx << open('README.rst'))
+ long_description = ' '.join(ctx << open('README.rst')).rstrip()
setup(name='contexter',
version=contexter.__version__,
- description=contexter.__doc__,
+ description=contexter.__doc__.replace('\n', '\n ').rstrip(),
long_description=long_description,
author=contexter.__author__,
author_email='marc@gsites.de', |
57c62f4107ba53445e7368bfb870fe393bd19dde | setup.py | setup.py | import codecs
from setuptools import find_packages, setup
import digestive
setup(
name='digestive',
version=digestive.__version__, # TODO: don't read this from (uninstalled) module
url='https://github.com/akaIDIOT/Digestive',
packages=find_packages(),
description='Run several digest algorithms on the same data efficiently',
author='Mattijs Ugen',
author_email=codecs.encode('nxnvqvbg@hfref.abercyl.tvguho.pbz', 'rot_13'),
license='ISC',
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'License :: OSI Approved :: ISC License (ISCL)',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3 :: Only',
],
install_requires=(
'decorator~=4.0',
'pyyaml~=5.0'
),
entry_points={
'console_scripts': {
'digestive = digestive.main:main'
}
}
)
| import codecs
from setuptools import find_packages, setup
import digestive
setup(
name='digestive',
version=digestive.__version__, # TODO: don't read this from (uninstalled) module
url='https://github.com/akaIDIOT/Digestive',
packages=find_packages(),
description='Run several digest algorithms on the same data efficiently',
author='Mattijs Ugen',
author_email=codecs.encode('nxnvqvbg@hfref.abercyl.tvguho.pbz', 'rot_13'),
license='ISC',
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'License :: OSI Approved :: ISC License (ISCL)',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3 :: Only',
],
install_requires=(
'decorator~=4.0',
'pyyaml~=5.1'
),
entry_points={
'console_scripts': {
'digestive = digestive.main:main'
}
}
)
| Update pyyaml dep to 5.1+ | Update pyyaml dep to 5.1+
Allows to turn off automatic sorting of dict keys.
| Python | isc | akaIDIOT/Digestive | ---
+++
@@ -25,7 +25,7 @@
],
install_requires=(
'decorator~=4.0',
- 'pyyaml~=5.0'
+ 'pyyaml~=5.1'
),
entry_points={
'console_scripts': { |
20e447005b70d29fc9f3852bcd526fc6fb337ea3 | setup.py | setup.py | from distutils.core import setup
setup(
name = 'pycolors2',
py_modules = ['colors',],
version = '0.0.3',
author = 'Chris Gilmer',
author_email = 'chris.gilmer@gmail.com',
maintainer = 'Chris Gilmer',
maintainer_email = 'chris.gilmer@gmail.com',
url = 'http://github.com/chrisgilmerproj/pycolors2',
license = 'MIT license',
description = """ Tool to color code python output """,
long_description = open('README.markdown').read(),
requires = [],
classifiers = (
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System',
'Topic :: Terminals',
'Topic :: Utilities',
),
)
| from distutils.core import setup
setup(
name = 'pycolors2',
py_modules = ['colors',],
version = '0.0.4',
author = 'Chris Gilmer',
author_email = 'chris.gilmer@gmail.com',
maintainer = 'Chris Gilmer',
maintainer_email = 'chris.gilmer@gmail.com',
url = 'http://github.com/chrisgilmerproj/pycolors2',
license = 'MIT license',
description = """ Tool to color code python output """,
long_description = open('README.markdown').read(),
requires = [],
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System',
'Topic :: Terminals',
'Topic :: Utilities',
],
)
| Fix version and classifiers tuple to list | Fix version and classifiers tuple to list
| Python | mit | chrisgilmerproj/pycolors2 | ---
+++
@@ -3,7 +3,7 @@
setup(
name = 'pycolors2',
py_modules = ['colors',],
- version = '0.0.3',
+ version = '0.0.4',
author = 'Chris Gilmer',
author_email = 'chris.gilmer@gmail.com',
maintainer = 'Chris Gilmer',
@@ -17,7 +17,7 @@
long_description = open('README.markdown').read(),
requires = [],
- classifiers = (
+ classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
@@ -35,5 +35,5 @@
'Topic :: System',
'Topic :: Terminals',
'Topic :: Utilities',
- ),
+ ],
) |
f430bfecc2a4022967260ff4cb80e3cb9ff84790 | setup.py | setup.py | #!/usr/bin/python
#
# 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.
import gettext
import os
import subprocess
import setuptools
setuptools.setup(
name='heat_jeos',
version='1',
description='The heat-jeos project provides services for creating '
'(J)ust (E)nough (O)perating (S)ystem images',
license='Apache License (2.0)',
author='Heat API Developers',
author_email='discuss@heat-api.org',
url='http://heat-api.org.org/',
packages=setuptools.find_packages(exclude=['bin']),
include_package_data=True,
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.6',
'Environment :: No Input/Output (Daemon)',
],
scripts=['bin/heat-jeos'],
py_modules=[])
| #!/usr/bin/python
#
# 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.
import gettext
import os
import subprocess
import setuptools
setuptools.setup(
name='heat-jeos',
version='1',
description='The heat-jeos project provides services for creating '
'(J)ust (E)nough (O)perating (S)ystem images',
license='Apache License (2.0)',
author='Heat API Developers',
author_email='discuss@heat-api.org',
url='http://heat-api.org.org/',
packages=setuptools.find_packages(exclude=['bin']),
include_package_data=True,
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.6',
'Environment :: No Input/Output (Daemon)',
],
scripts=['bin/heat-jeos'],
py_modules=[])
| Change name from heat_jeos to heat-jeos | Change name from heat_jeos to heat-jeos
Signed-off-by: Jeff Peeler <d776211e63e47e40d00501ffdb86a800e0782fea@redhat.com>
| Python | apache-2.0 | sdake/heat-jeos,steveb/heat-cfntools,openstack/heat-cfntools,bbandaru/heat-cfntools,steveb/heat-cfntools | ---
+++
@@ -20,7 +20,7 @@
import setuptools
setuptools.setup(
- name='heat_jeos',
+ name='heat-jeos',
version='1',
description='The heat-jeos project provides services for creating '
'(J)ust (E)nough (O)perating (S)ystem images', |
23a082d4035eec48f1b0aba08fcec5ea9d73b848 | setup.py | setup.py | from setuptools import setup
setup(
name='tablo',
description='A PostGIS table to feature service app for Django',
keywords='feature service, map server, postgis, django',
version='1.3.0',
packages=['tablo', 'tablo.migrations', 'tablo.interfaces', 'tablo.interfaces.arcgis'],
install_requires=[
'Django>=1.11.19,<2.0', 'sqlparse>=0.1.18', 'pyproj', 'six', 'pandas==0.24.*',
'django-tastypie==0.14.*', 'psycopg2', 'Pillow>=2.9.0', 'django-storages>=1.5.2',
'boto3>=1.4.4', 'sqlalchemy==1.3.*', 'geoalchemy2==0.6.*'
],
test_suite='tablo.tests.runtests.runtests',
tests_require=['django-nose', 'rednose'],
url='http://github.com/consbio/tablo',
license='BSD',
)
| from setuptools import setup
setup(
name='tablo',
description='A PostGIS table to feature service app for Django',
keywords='feature service, map server, postgis, django',
version='1.3.0',
packages=['tablo', 'tablo.migrations', 'tablo.interfaces', 'tablo.interfaces.arcgis'],
install_requires=[
'Django>=1.11.28,<2.0', 'sqlparse>=0.1.18', 'pyproj', 'six', 'pandas==0.24.*',
'django-tastypie==0.14.*', 'psycopg2', 'Pillow>=2.9.0', 'django-storages>=1.5.2',
'boto3>=1.4.4', 'sqlalchemy==1.3.*', 'geoalchemy2==0.6.*'
],
test_suite='tablo.tests.runtests.runtests',
tests_require=['django-nose', 'rednose'],
url='http://github.com/consbio/tablo',
license='BSD',
)
| Upgrade Django for security vulnerability | Upgrade Django for security vulnerability | Python | bsd-3-clause | consbio/tablo | ---
+++
@@ -7,7 +7,7 @@
version='1.3.0',
packages=['tablo', 'tablo.migrations', 'tablo.interfaces', 'tablo.interfaces.arcgis'],
install_requires=[
- 'Django>=1.11.19,<2.0', 'sqlparse>=0.1.18', 'pyproj', 'six', 'pandas==0.24.*',
+ 'Django>=1.11.28,<2.0', 'sqlparse>=0.1.18', 'pyproj', 'six', 'pandas==0.24.*',
'django-tastypie==0.14.*', 'psycopg2', 'Pillow>=2.9.0', 'django-storages>=1.5.2',
'boto3>=1.4.4', 'sqlalchemy==1.3.*', 'geoalchemy2==0.6.*'
], |
ca56c84b90e0ab7553afb27a23648f5d43fe2176 | tests/functional/firefox/desktop/test_all.py | tests/functional/firefox/desktop/test_all.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
from pages.firefox.desktop.all import FirefoxDesktopBasePage
@pytest.mark.skip_if_firefox(reason='Download button is not shown for up-to-date Firefox browsers.')
@pytest.mark.nondestructive
@pytest.mark.parametrize(('slug', 'locale'), [
('', None),
('customize', None),
('fast', 'de'),
('trust', None)])
def test_download_button_is_displayed(slug, locale, base_url, selenium):
locale = locale or 'en-US'
page = FirefoxDesktopBasePage(selenium, base_url, locale, slug=slug).open()
assert page.download_button.is_displayed
| # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
from pages.firefox.desktop.all import FirefoxDesktopBasePage
@pytest.mark.skip_if_firefox(reason='Download button is not shown for up-to-date Firefox browsers.')
@pytest.mark.nondestructive
@pytest.mark.parametrize(('slug', 'locale'), [
('', 'de'),
('customize', None),
('fast', 'de'),
('trust', None)])
def test_download_button_is_displayed(slug, locale, base_url, selenium):
locale = locale or 'en-US'
page = FirefoxDesktopBasePage(selenium, base_url, locale, slug=slug).open()
assert page.download_button.is_displayed
| Fix locale for old Firefox desktop page functional test | Fix locale for old Firefox desktop page functional test
| Python | mpl-2.0 | mozilla/bedrock,sgarrity/bedrock,mkmelin/bedrock,kyoshino/bedrock,gerv/bedrock,Sancus/bedrock,alexgibson/bedrock,sgarrity/bedrock,MichaelKohler/bedrock,MichaelKohler/bedrock,MichaelKohler/bedrock,alexgibson/bedrock,kyoshino/bedrock,alexgibson/bedrock,ericawright/bedrock,schalkneethling/bedrock,sgarrity/bedrock,alexgibson/bedrock,Sancus/bedrock,schalkneethling/bedrock,schalkneethling/bedrock,pascalchevrel/bedrock,ericawright/bedrock,craigcook/bedrock,mkmelin/bedrock,craigcook/bedrock,sylvestre/bedrock,MichaelKohler/bedrock,mozilla/bedrock,Sancus/bedrock,mkmelin/bedrock,hoosteeno/bedrock,craigcook/bedrock,gerv/bedrock,kyoshino/bedrock,flodolo/bedrock,mozilla/bedrock,kyoshino/bedrock,pascalchevrel/bedrock,sylvestre/bedrock,ericawright/bedrock,flodolo/bedrock,schalkneethling/bedrock,gerv/bedrock,mozilla/bedrock,craigcook/bedrock,ericawright/bedrock,hoosteeno/bedrock,sylvestre/bedrock,Sancus/bedrock,flodolo/bedrock,hoosteeno/bedrock,pascalchevrel/bedrock,hoosteeno/bedrock,sgarrity/bedrock,sylvestre/bedrock,flodolo/bedrock,mkmelin/bedrock,gerv/bedrock,pascalchevrel/bedrock | ---
+++
@@ -10,7 +10,7 @@
@pytest.mark.skip_if_firefox(reason='Download button is not shown for up-to-date Firefox browsers.')
@pytest.mark.nondestructive
@pytest.mark.parametrize(('slug', 'locale'), [
- ('', None),
+ ('', 'de'),
('customize', None),
('fast', 'de'),
('trust', None)]) |
773568ab481588fada2b84c8bf9deb5c870290b7 | setup.py | setup.py |
from setuptools import setup, find_packages
setup(
name = "v1pysdk",
version = "0.1",
description = "VersionOne API client",
author = "Joe Koberg (VersionOne, Inc.)",
author_email = "Joe.Koberg@versionone.com",
license = "MIT/BSD",
keywords = "versionone v1 api sdk",
url = "http://github.com/VersionOne/v1pysdk",
packages = [
'v1pysdk',
],
install_requires = [
'elementtree',
'testtools',
'iso8601',
],
test_suite = "v1pysdk.tests",
)
|
from setuptools import setup, find_packages
setup(
name = "v1pysdk",
version = "0.1",
description = "VersionOne API client",
author = "Joe Koberg (VersionOne, Inc.)",
author_email = "Joe.Koberg@versionone.com",
license = "MIT/BSD",
keywords = "versionone v1 api sdk",
url = "http://github.com/VersionOne/v1pysdk",
packages = [
'v1pysdk',
],
install_requires = [
'elementtree',
'testtools',
'iso8601',
'python-ntlm',
],
test_suite = "v1pysdk.tests",
)
| Add python-ntlm as a dependency | Add python-ntlm as a dependency
| Python | bsd-3-clause | coddingtonbear/VersionOne.SDK.Python,versionone/VersionOne.SDK.Python,doubleO8/versionone-sdk-spoon,aarcro/VersionOne.SDK.Python | ---
+++
@@ -22,6 +22,7 @@
'elementtree',
'testtools',
'iso8601',
+ 'python-ntlm',
],
test_suite = "v1pysdk.tests", |
f6d086aa0be14dd2f0c8d87e728939053408f2c9 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name = "py-trello",
version = "0.2.3",
description = 'Python wrapper around the Trello API',
long_description = open('README.rst').read(),
author = 'Richard Kolkovich',
author_email = 'richard@sigil.org',
url = 'https://trello.com/board/py-trello/4f145d87b2f9f15d6d027b53',
keywords = 'python',
license = 'BSD License',
classifiers = [
"Development Status :: 4 - Beta",
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'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',
],
install_requires = ["requests", "requests-oauthlib >= 0.4.1", "dateutil"],
packages = find_packages(),
include_package_data = True,
)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
| #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name = "py-trello",
version = "0.2.3",
description = 'Python wrapper around the Trello API',
long_description = open('README.rst').read(),
author = 'Richard Kolkovich',
author_email = 'richard@sigil.org',
url = 'https://trello.com/board/py-trello/4f145d87b2f9f15d6d027b53',
keywords = 'python',
license = 'BSD License',
classifiers = [
"Development Status :: 4 - Beta",
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'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',
],
install_requires = ["requests", "requests-oauthlib >= 0.4.1", "python-dateutil"],
packages = find_packages(),
include_package_data = True,
)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
| Change requirement dateutil to python-dateutil. | Change requirement dateutil to python-dateutil.
| Python | bsd-3-clause | gchp/py-trello,WoLpH/py-trello,mehdy/py-trello,portante/py-trello,ntrepid8/py-trello,nMustaki/py-trello,merlinpatt/py-trello,sarumont/py-trello,Wooble/py-trello | ---
+++
@@ -24,7 +24,7 @@
'Programming Language :: Python 3',
'Programming Language :: Python 3.3',
],
- install_requires = ["requests", "requests-oauthlib >= 0.4.1", "dateutil"],
+ install_requires = ["requests", "requests-oauthlib >= 0.4.1", "python-dateutil"],
packages = find_packages(),
include_package_data = True,
) |
744cbe22784b7b9db537ce89ddf3b55b72980da2 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='typogrify',
version='2.0.0',
packages=find_packages(),
author='Christian Metts',
author_email='xian@mintchaos.com',
license='BSD',
description='Typography related template filters for Django & Jinja2 applications',
long_description=open('README.rst').read(),
url='https://github.com/mintchaos/typogrify',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Framework :: Django',
'Topic :: Utilities'
],
install_requires=['smartypants>=1.6']
)
| #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='typogrified',
version='0.0.0',
packages=find_packages(),
author='Justin Mayer',
author_email='entroP@gmail.com',
license='BSD',
description='Filters to enhance web typography, including support for Django & Jinja templates',
long_description=open('README.rst').read(),
url='https://github.com/justinmayer/typogrify',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Framework :: Django',
'Framework :: Flask',
'Topic :: Utilities'
],
install_requires=['smartypants>=1.6']
)
| Prepare new package for PyPI publication | Prepare new package for PyPI publication
| Python | bsd-3-clause | Chimrod/typogrify | ---
+++
@@ -2,17 +2,16 @@
from setuptools import setup, find_packages
-
setup(
- name='typogrify',
- version='2.0.0',
+ name='typogrified',
+ version='0.0.0',
packages=find_packages(),
- author='Christian Metts',
- author_email='xian@mintchaos.com',
+ author='Justin Mayer',
+ author_email='entroP@gmail.com',
license='BSD',
- description='Typography related template filters for Django & Jinja2 applications',
+ description='Filters to enhance web typography, including support for Django & Jinja templates',
long_description=open('README.rst').read(),
- url='https://github.com/mintchaos/typogrify',
+ url='https://github.com/justinmayer/typogrify',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
@@ -21,6 +20,7 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Framework :: Django',
+ 'Framework :: Flask',
'Topic :: Utilities'
],
|
011949b266ab33df8c0f9bec29ba693824e7d8ef | setup.py | setup.py | #!/usr/bin/env python3
import sys
from distutils.core import setup
setup(
name='pathlib',
version=open('VERSION.txt').read().strip(),
py_modules=['pathlib'],
license='MIT License',
description='Object-oriented filesystem paths',
long_description=open('README.txt').read(),
author='Antoine Pitrou',
author_email='solipsis@pitrou.net',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Filesystems',
],
download_url='https://pypi.python.org/pypi/pathlib/',
url='http://readthedocs.org/docs/pathlib/',
)
| #!/usr/bin/env python3
import sys
from distutils.core import setup
setup(
name='pathlib',
version=open('VERSION.txt').read().strip(),
py_modules=['pathlib'],
license='MIT License',
description='Object-oriented filesystem paths',
long_description=open('README.txt').read(),
author='Antoine Pitrou',
author_email='solipsis@pitrou.net',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Filesystems',
],
download_url='https://pypi.python.org/pypi/pathlib/',
url='http://readthedocs.org/docs/pathlib/',
)
| Add classifier for Python 3.3 | Add classifier for Python 3.3
| Python | mit | pombreda/pathlib | ---
+++
@@ -20,6 +20,7 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
+ 'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Filesystems',
], |
a248756d67d55388503c4e0a1788e0546bf6905c | setup.py | setup.py | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
requires = [
'pyramid',
'pyramid_debugtoolbar',
'waitress',
]
setup(name='yith-library-server',
version='0.0',
description='yith-library-server',
long_description=README + '\n\n' + CHANGES,
classifiers=[
"Programming Language :: Python",
"Framework :: Pylons",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
],
author='',
author_email='',
url='',
keywords='web pyramid pylons',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=requires,
tests_require=requires,
test_suite="yithlibraryserver",
entry_points = """\
[paste.app_factory]
main = yithlibraryserver:main
""",
)
| import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
requires = [
'pymongo',
'pyramid',
'pyramid_debugtoolbar',
'waitress',
]
setup(name='yith-library-server',
version='0.0',
description='yith-library-server',
long_description=README + '\n\n' + CHANGES,
classifiers=[
"Programming Language :: Python",
"Framework :: Pylons",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
],
author='',
author_email='',
url='',
keywords='web pyramid pylons',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=requires,
tests_require=requires,
test_suite="yithlibraryserver",
entry_points = """\
[paste.app_factory]
main = yithlibraryserver:main
""",
)
| Add pymongo as a dependency | Add pymongo as a dependency
| Python | agpl-3.0 | lorenzogil/yith-library-server,Yaco-Sistemas/yith-library-server,Yaco-Sistemas/yith-library-server,Yaco-Sistemas/yith-library-server,lorenzogil/yith-library-server,lorenzogil/yith-library-server | ---
+++
@@ -7,6 +7,7 @@
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
requires = [
+ 'pymongo',
'pyramid',
'pyramid_debugtoolbar',
'waitress', |
d3650454eed490e4c91216b26463ae135c47e305 | setup.py | setup.py | import os, os.path, sys, shutil
from distutils.sysconfig import get_python_inc
from distutils.core import setup, Extension
from distutils.command.build_ext import build_ext
libs = ['user32']
setup(name="pyHook", version="1.1",
author="Peter Parente",
author_email="parente@cs.unc.edu",
url="http://www.cs.unc.edu/Research/assist/",
description="pyHook: Python wrapper for out-of-context input hooks in Windows",
packages = ['pyHook'],
ext_modules = [Extension('pyHook._cpyHook', ['pyHook/cpyHook.i'], libraries=libs)],
data_files=[('Lib/site-packages/pyHook', ["pyHook/LICENSE.txt"])]
) | '''pyHook: Python wrapper for out-of-context input hooks in Windows
The pyHook package provides callbacks for global mouse and keyboard events in Windows. Python
applications register event handlers for user input events such as left mouse down, left mouse up,
key down, etc. and set the keyboard and/or mouse hook. The underlying C library reports information
like the time of the event, the name of the window in which the event occurred, the value of the
event, any keyboard modifiers, etc.
'''
classifiers = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python
Topic :: System :: Monitoring
Topic :: Software Development :: Libraries :: Python Modules
Operating System :: Microsoft :: Windows
"""
from distutils.core import setup, Extension
libs = ['user32']
doclines = __doc__.split('\n')
setup(name='pyHook',
version='1.1',
author='Peter Parente',
author_email='parente@cs.unc.edu',
url='http://www.cs.unc.edu/~parente',
download_url='http://www.sourceforge.net/projects/uncassist',
license='http://www.opensource.org/licenses/mit-license.php',
platforms=['Win32'],
description = doclines[0],
classifiers = filter(None, classifiers.split('\n')),
long_description = ' '.join(doclines[2:]),
packages = ['pyHook'],
ext_modules = [Extension('pyHook._cpyHook', ['pyHook/cpyHook.i'], libraries=libs)],
data_files=[('Lib/site-packages/pyHook', ['pyHook/LICENSE.txt'])]
) | Put in specific metadata to register with pyPI | Put in specific metadata to register with pyPI
| Python | mit | carolus-rex/pyhook_3000,Answeror/pyhook_py3k | ---
+++
@@ -1,16 +1,39 @@
-import os, os.path, sys, shutil
-from distutils.sysconfig import get_python_inc
+'''pyHook: Python wrapper for out-of-context input hooks in Windows
+
+The pyHook package provides callbacks for global mouse and keyboard events in Windows. Python
+applications register event handlers for user input events such as left mouse down, left mouse up,
+key down, etc. and set the keyboard and/or mouse hook. The underlying C library reports information
+like the time of the event, the name of the window in which the event occurred, the value of the
+event, any keyboard modifiers, etc.
+'''
+
+classifiers = """\
+Development Status :: 5 - Production/Stable
+Intended Audience :: Developers
+License :: OSI Approved :: MIT License
+Programming Language :: Python
+Topic :: System :: Monitoring
+Topic :: Software Development :: Libraries :: Python Modules
+Operating System :: Microsoft :: Windows
+"""
+
from distutils.core import setup, Extension
-from distutils.command.build_ext import build_ext
libs = ['user32']
+doclines = __doc__.split('\n')
-setup(name="pyHook", version="1.1",
- author="Peter Parente",
- author_email="parente@cs.unc.edu",
- url="http://www.cs.unc.edu/Research/assist/",
- description="pyHook: Python wrapper for out-of-context input hooks in Windows",
+setup(name='pyHook',
+ version='1.1',
+ author='Peter Parente',
+ author_email='parente@cs.unc.edu',
+ url='http://www.cs.unc.edu/~parente',
+ download_url='http://www.sourceforge.net/projects/uncassist',
+ license='http://www.opensource.org/licenses/mit-license.php',
+ platforms=['Win32'],
+ description = doclines[0],
+ classifiers = filter(None, classifiers.split('\n')),
+ long_description = ' '.join(doclines[2:]),
packages = ['pyHook'],
ext_modules = [Extension('pyHook._cpyHook', ['pyHook/cpyHook.i'], libraries=libs)],
- data_files=[('Lib/site-packages/pyHook', ["pyHook/LICENSE.txt"])]
+ data_files=[('Lib/site-packages/pyHook', ['pyHook/LICENSE.txt'])]
) |
09ec38cdf1bf6be59f6961fbcbf9847e2b29ccfe | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
import colors
setup(
name='ansicolors',
version=colors.__version__,
description='ANSI colors for Python',
long_description=open('README.rst').read(),
author='Giorgos Verigakis',
author_email='verigak@gmail.com',
url='http://github.com/verigak/colors/',
license='ISC',
py_modules=['colors'],
classifiers=[
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Programming Language :: Python'
]
)
| #!/usr/bin/env python
from setuptools import setup
import colors
setup(
name='ansicolors',
version=colors.__version__,
description='ANSI colors for Python',
long_description=open('README.rst').read(),
author='Giorgos Verigakis',
author_email='verigak@gmail.com',
url='http://github.com/verigak/colors/',
license='ISC',
py_modules=['colors'],
classifiers=[
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3'
]
)
| Add requirement for version 2.6 and higher | Add requirement for version 2.6 and higher
Fixes #1 | Python | isc | Vietworm/colors,verigak/colors,jonathaneunice/colors,pombredanne/colors,grnet/colors | ---
+++
@@ -19,6 +19,8 @@
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
- 'Programming Language :: Python'
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3'
]
) |
8fdb05f6327249fe945b5310b7a3ca585eddc5d0 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='glue',
version='0.9',
url='http://github.com/jorgebastida/glue',
license='BSD',
author='Jorge Bastida',
author_email='me@jorgebastida.com',
description='Glue is a simple command line tool to generate sprites.',
long_description=('Glue is a simple command line tool to generate '
'sprites using any kind of source images like '
'PNG, JPEG or GIF. Glue will generate a unique PNG '
'file containing every source image and a map file '
'including the necessary information to use it.'),
keywords = "glue sprites css cocos2d",
packages = find_packages(),
platforms='any',
install_requires=[
'Pillow>=2.2,<2.3',
'Jinja2>=2.7,<2.8'
],
tests_require=[
'cssutils>=0.9,<1.0'
],
test_suite='tests',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities'
],
entry_points = {
'console_scripts': [
'glue = glue.bin:main',
]
},
zip_safe = False
)
| from setuptools import setup, find_packages
setup(
name='glue',
version='0.9',
url='http://github.com/jorgebastida/glue',
license='BSD',
author='Jorge Bastida',
author_email='me@jorgebastida.com',
description='Glue is a simple command line tool to generate sprites.',
long_description=('Glue is a simple command line tool to generate '
'sprites using any kind of source images like '
'PNG, JPEG or GIF. Glue will generate a unique PNG '
'file containing every source image and a map file '
'including the necessary information to use it.'),
keywords = "glue sprites css cocos2d",
packages = find_packages(),
platforms='any',
install_requires=[
'Pillow>=2.2,<2.3',
'Jinja2>=2.7,<2.8',
'argparse>=1.2'
],
tests_require=[
'cssutils>=0.9,<1.0'
],
test_suite='tests',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities'
],
entry_points = {
'console_scripts': [
'glue = glue.bin:main',
]
},
zip_safe = False
)
| Add argparse 1.2 for python <2.7 | Add argparse 1.2 for python <2.7
| Python | bsd-3-clause | WillsB3/glue,zhiqinyigu/glue,dext0r/glue,jorgebastida/glue,dext0r/glue,beni55/glue,jorgebastida/glue,zhiqinyigu/glue,WillsB3/glue,beni55/glue | ---
+++
@@ -18,7 +18,8 @@
platforms='any',
install_requires=[
'Pillow>=2.2,<2.3',
- 'Jinja2>=2.7,<2.8'
+ 'Jinja2>=2.7,<2.8',
+ 'argparse>=1.2'
],
tests_require=[
'cssutils>=0.9,<1.0' |
36e678daf3c9d619f6e6013a33d59104f61e291a | setup.py | setup.py | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
requirements = [
]
test_requirements = [
]
setup(
name='adb_android',
version='0.5.0',
description="Enables android adb in your python script",
long_description='This python package is a wrapper for standard android adb\
implementation. It allows you to execute android adb commands in your \
python script.',
author='Viktor Malyi',
author_email='v.stratus@gmail.com',
url='https://github.com/vmalyi/adb_android',
packages=[
'adb_android',
],
package_dir={'adb_android':'adb_android'},
include_package_data=True,
install_requires=requirements,
license="GNU",
keywords='adb, android',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Topic :: Software Development :: Testing',
'Intended Audience :: Developers'
],
test_suite='tests',
)
| #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
requirements = [
]
test_requirements = [
]
setup(
name='adb_android',
version='1.0.0',
description="Enable android adb in your python script",
long_description='This python package is a wrapper for standard android adb\
implementation. It allows you to execute android adb commands in your \
python script.',
author='Viktor Malyi',
author_email='v.stratus@gmail.com',
url='https://github.com/vmalyi/adb_android',
packages=[
'adb_android',
],
package_dir={'adb_android':'adb_android'},
include_package_data=True,
install_requires=requirements,
license="GNU",
keywords='adb, android',
classifiers=[
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Topic :: Software Development :: Testing',
'Intended Audience :: Developers'
],
test_suite='tests',
)
| Increase package version to 1.0.0 | Increase package version to 1.0.0
Change-Id: I8f5b3ec5a1a1f49a0c0a111ff16bb48f917221fb
| Python | bsd-3-clause | vmalyi/adb_android | ---
+++
@@ -12,8 +12,8 @@
setup(
name='adb_android',
- version='0.5.0',
- description="Enables android adb in your python script",
+ version='1.0.0',
+ description="Enable android adb in your python script",
long_description='This python package is a wrapper for standard android adb\
implementation. It allows you to execute android adb commands in your \
python script.',
@@ -29,7 +29,6 @@
license="GNU",
keywords='adb, android',
classifiers=[
- 'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Topic :: Software Development :: Testing', |
a0adfab8c2fdac2f2b8bad8b1f036bd35b27a06c | setup.py | setup.py | import re
import setuptools
import sys
if not sys.version_info >= (3, 5):
exit("Sorry, Python must be later than 3.5.")
setuptools.setup(
name="tensorflow-qnd",
version=re.search(r'__version__ *= *"([0-9]+\.[0-9]+\.[0-9]+)" *\n',
open("qnd/__init__.py").read()).group(1),
description="Quick and Dirty TensorFlow command framework",
long_description=open("README.md").read(),
license="Public Domain",
author="Yota Toyama",
author_email="raviqqe@gmail.com",
url="https://github.com/raviqqe/tensorflow-qnd/",
packages=["qnd"],
install_requires=["gargparse"],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: Public Domain",
"Programming Language :: Python :: 3.5",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: System :: Networking",
],
)
| import re
import setuptools
import sys
if not sys.version_info >= (3, 5):
exit("Sorry, Python must be later than 3.5.")
setuptools.setup(
name="tensorflow-qnd",
version=re.search(r'__version__ *= *"([0-9]+\.[0-9]+\.[0-9]+)" *\n',
open("qnd/__init__.py").read()).group(1),
description="Quick and Dirty TensorFlow command framework",
long_description=open("README.md").read(),
license="Public Domain",
author="Yota Toyama",
author_email="raviqqe@gmail.com",
url="https://github.com/raviqqe/tensorflow-qnd/",
packages=["qnd"],
install_requires=["gargparse"],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: Public Domain",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: System :: Networking",
],
)
| Add Python 3.6 to topics | Add Python 3.6 to topics
| Python | unlicense | raviqqe/tensorflow-qnd,raviqqe/tensorflow-qnd | ---
+++
@@ -24,6 +24,7 @@
"Intended Audience :: Developers",
"License :: Public Domain",
"Programming Language :: Python :: 3.5",
+ "Programming Language :: Python :: 3.6",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: System :: Networking",
], |
ab864d340999fcbfad5677cbb3d0da301e1bce45 | setup.py | setup.py |
from setuptools import setup, find_packages
setup(
name = "django-overextends",
version = __import__("overextends").__version__,
author = "Stephen McDonald",
author_email = "stephen.mc@gmail.com",
description = ("A Django reusable app providing the ability to use "
"circular template inheritance."),
long_description = open("README.rst").read(),
url = "http://github.com/stephenmcd/django-overextends",
zip_safe = False,
include_package_data = True,
packages = find_packages(),
install_requires = [
"sphinx-me >= 0.1.2",
"django >= 1.8, < 1.10",
],
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Framework :: Django",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Internet :: WWW/HTTP :: Site Management",
]
)
|
from setuptools import setup, find_packages
setup(
name = "django-overextends",
version = __import__("overextends").__version__,
author = "Stephen McDonald",
author_email = "stephen.mc@gmail.com",
description = ("A Django reusable app providing the ability to use "
"circular template inheritance."),
long_description = open("README.rst").read(),
url = "http://github.com/stephenmcd/django-overextends",
zip_safe = False,
include_package_data = True,
packages = find_packages(),
install_requires = [
"sphinx-me >= 0.1.2",
"django >= 1.8, <= 1.10",
],
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Framework :: Django",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Internet :: WWW/HTTP :: Site Management",
]
)
| Allow Django 1.10 in installation | Allow Django 1.10 in installation
| Python | bsd-2-clause | dwaynebailey/django-overextends | ---
+++
@@ -16,7 +16,7 @@
packages = find_packages(),
install_requires = [
"sphinx-me >= 0.1.2",
- "django >= 1.8, < 1.10",
+ "django >= 1.8, <= 1.10",
],
classifiers = [
"Development Status :: 5 - Production/Stable", |
70bd7c85bb0860d24b6a7d6291f2b24d5dc0a3bb | setup.py | setup.py | #!/usr/bin/env python
# Copyright 2014-2015 Boxkite Inc.
# This file is part of the DataCats package and is released under
# the terms of the GNU Affero General Public License version 3.0.
# See LICENSE.txt or http://www.fsf.org/licensing/licenses/agpl-3.0.html
from setuptools import setup
import sys
install_requires = [
'setuptools',
'docopt',
'docker-py>=1.2.1',
'clint', # to output colored text to terminal
'requests>=2.5.2', # help with docker-py requirement
'lockfile',
'watchdog' # For lesscd
]
exec(open("datacats/version.py").read())
setup(
name='datacats',
version=__version__,
description='CKAN Data Catalog Developer Tools built on Docker',
license='AGPL3',
author='Boxkite',
author_email='contact@boxkite.ca',
url='https://github.com/datacats/datacats',
packages=[
'datacats',
'datacats.tests',
'datacats.cli',
],
install_requires=install_requires,
include_package_data=True,
test_suite='datacats.tests',
zip_safe=False,
entry_points="""
[console_scripts]
datacats=datacats.cli.main:main
datacats-lesscd=datacats.cli.lesscd:main
""",
)
| #!/usr/bin/env python
# Copyright 2014-2015 Boxkite Inc.
# This file is part of the DataCats package and is released under
# the terms of the GNU Affero General Public License version 3.0.
# See LICENSE.txt or http://www.fsf.org/licensing/licenses/agpl-3.0.html
from setuptools import setup
from os.path import realpath, dirname
from os import chdir
import sys
install_requires = [
'setuptools',
'docopt',
'docker-py>=1.2.1',
'clint', # to output colored text to terminal
'requests>=2.5.2', # help with docker-py requirement
'lockfile',
'watchdog' # For lesscd
]
chdir(dirname(realpath(__file__)))
execfile("datacats/version.py")
setup(
name='datacats',
version=__version__,
description='CKAN Data Catalog Developer Tools built on Docker',
license='AGPL3',
author='Boxkite',
author_email='contact@boxkite.ca',
url='https://github.com/datacats/datacats',
packages=[
'datacats',
'datacats.tests',
'datacats.cli',
],
install_requires=install_requires,
include_package_data=True,
test_suite='datacats.tests',
zip_safe=False,
entry_points="""
[console_scripts]
datacats=datacats.cli.main:main
datacats-lesscd=datacats.cli.lesscd:main
""",
)
| Change to directory of current file before getting version | Change to directory of current file before getting version
| Python | agpl-3.0 | datacats/datacats,JJediny/datacats,deniszgonjanin/datacats,wardi/datacats,datacats/datacats,poguez/datacats,deniszgonjanin/datacats,datawagovau/datacats,JackMc/datacats,JJediny/datacats,JackMc/datacats,datawagovau/datacats,reneenoble/datacats,poguez/datacats,wardi/datacats,reneenoble/datacats | ---
+++
@@ -7,6 +7,8 @@
# See LICENSE.txt or http://www.fsf.org/licensing/licenses/agpl-3.0.html
from setuptools import setup
+from os.path import realpath, dirname
+from os import chdir
import sys
install_requires = [
@@ -19,7 +21,9 @@
'watchdog' # For lesscd
]
-exec(open("datacats/version.py").read())
+chdir(dirname(realpath(__file__)))
+
+execfile("datacats/version.py")
setup(
name='datacats', |
3ccf8471291ddfc39c7d86caa659ef4eab27bc13 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='check_ups_apc.py',
version='0.10',
description='Nagios Check for APC USVs',
author='Lukas Schauer',
author_email='l.schauer@cygnusnetworks.de',
license='Apache 2.0',
packages=['ups_apc_snmp'],
scripts=['check_ups_apc'],
install_requires=['configparser', 'nagiosplugin', 'pysnmp'])
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='check_ups_apc.py',
version='0.10',
description='Nagios Check for APC USVs',
author='Lukas Schauer',
author_email='l.schauer@cygnusnetworks.de',
license='Apache 2.0',
packages=['ups_apc_snmp'],
scripts=['check_ups_apc'],
zip_safe=False,
install_requires=['configparser', 'nagiosplugin', 'pysnmp'])
| Change zip_safe to false for manual source install | Change zip_safe to false for manual source install
Fixes #1
| Python | apache-2.0 | CygnusNetworks/check_ups_apc.py,CygnusNetworks/check_ups_apc.py | ---
+++
@@ -11,4 +11,5 @@
license='Apache 2.0',
packages=['ups_apc_snmp'],
scripts=['check_ups_apc'],
+ zip_safe=False,
install_requires=['configparser', 'nagiosplugin', 'pysnmp']) |
d198b96b1e5b35d1362694cd842d2804f31de7e2 | 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='nova_limits',
version='0.5.2',
author='Kevin L. Mitchell',
author_email='kevin.mitchell@rackspace.com',
description="Nova-specific rate-limit class for turnstile",
license='Apache License (2.0)',
py_modules=['nova_limits'],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Paste',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware',
],
url='https://github.com/klmitch/nova_limits',
long_description=read('README.rst'),
entry_points={
'console_scripts': [
'limit_class = nova_limits:limit_class',
],
},
install_requires=[
'argparse',
'msgpack-python',
'nova',
'turnstile',
],
tests_require=[
'mox',
'unittest2>=0.5.1',
],
)
| import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='nova_limits',
version='0.5.2',
author='Kevin L. Mitchell',
author_email='kevin.mitchell@rackspace.com',
description="Nova-specific rate-limit class for turnstile",
license='Apache License (2.0)',
py_modules=['nova_limits'],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Paste',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware',
],
url='https://github.com/klmitch/nova_limits',
long_description=read('README.rst'),
entry_points={
'console_scripts': [
'limit_class = nova_limits:limit_class',
],
},
install_requires=[
'argparse',
'msgpack-python',
'nova',
'turnstile',
],
tests_require=[
'mox',
'nose',
'unittest2>=0.5.1',
],
)
| Add nose to list of test requirements. | Add nose to list of test requirements.
| Python | apache-2.0 | klmitch/nova_limits | ---
+++
@@ -38,6 +38,7 @@
],
tests_require=[
'mox',
+ 'nose',
'unittest2>=0.5.1',
],
) |
e1f2f32b87f28f948e9f8321df910700f5a5ece2 | 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.rst'), encoding='utf-8') as f:
long_description = f.read()
version = {}
with open(path.join(here, 'emv', "__init__.py")) as fp:
exec(fp.read(), version)
setup(name='emv',
version=version['__version__'],
description='EMV Smartcard Protocol Library',
long_description=long_description,
license='MIT',
author='Russ Garrett',
author_email='russ@garrett.co.uk',
url='https://github.com/russss/python-emv',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3'
],
keywords='smartcard emv payment',
packages=['emv', 'emv.protocol', 'emv.command'],
install_requires=['enum', 'argparse', 'pyscard'],
entry_points={
'console_scripts': {
'emvtool=emv.command.client:run'
}
}
)
| from setuptools import setup
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
readme_rst = path.join(here, 'README.rst')
if path.isfile(readme_rst):
with open(readme_rst, encoding='utf-8') as f:
long_description = f.read()
else:
long_description = ''
version = {}
with open(path.join(here, 'emv', "__init__.py")) as fp:
exec(fp.read(), version)
setup(name='emv',
version=version['__version__'],
description='EMV Smartcard Protocol Library',
long_description=long_description,
license='MIT',
author='Russ Garrett',
author_email='russ@garrett.co.uk',
url='https://github.com/russss/python-emv',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3'
],
keywords='smartcard emv payment',
packages=['emv', 'emv.protocol', 'emv.command'],
install_requires=['enum', 'argparse', 'pyscard'],
entry_points={
'console_scripts': {
'emvtool=emv.command.client:run'
}
}
)
| Handle pandoc-generated readme file not being present | Handle pandoc-generated readme file not being present
| Python | mit | russss/python-emv | ---
+++
@@ -4,8 +4,13 @@
here = path.abspath(path.dirname(__file__))
-with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
- long_description = f.read()
+readme_rst = path.join(here, 'README.rst')
+
+if path.isfile(readme_rst):
+ with open(readme_rst, encoding='utf-8') as f:
+ long_description = f.read()
+else:
+ long_description = ''
version = {}
with open(path.join(here, 'emv', "__init__.py")) as fp: |
38359ccf2e1269ea01ecb0df274ff47ea18b4e19 | setup.py | setup.py | from os.path import join
from setuptools import setup, find_packages
long_description = (open('README.rst').read() +
open('CHANGES.rst').read() +
open('TODO.rst').read())
def get_version():
with open(join('model_utils', '__init__.py')) as f:
for line in f:
if line.startswith('__version__ ='):
return line.split('=')[1].strip().strip('"\'')
setup(
name='django-model-utils',
version=get_version(),
description='Django model mixins and utilities',
long_description=long_description,
author='Carl Meyer',
author_email='carl@oddbird.net',
url='https://github.com/carljm/django-model-utils/',
packages=find_packages(),
install_requires=['django>=1.4.2'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Framework :: Django',
],
zip_safe=False,
tests_require=["Django>=1.4.2"],
test_suite='runtests.runtests'
)
| from os.path import join
from setuptools import setup, find_packages
long_description = (open('README.rst').read() +
open('CHANGES.rst').read() +
open('TODO.rst').read())
def get_version():
with open(join('model_utils', '__init__.py')) as f:
for line in f:
if line.startswith('__version__ ='):
return line.split('=')[1].strip().strip('"\'')
setup(
name='django-model-utils',
version=get_version(),
description='Django model mixins and utilities',
long_description=long_description,
author='Carl Meyer',
author_email='carl@oddbird.net',
url='https://github.com/carljm/django-model-utils/',
packages=find_packages(),
install_requires=['Django>=1.4.2'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Framework :: Django',
],
zip_safe=False,
tests_require=["Django>=1.4.2"],
test_suite='runtests.runtests'
)
| Fix case of Django dependency. Thanks Travis Swicegood. | Fix case of Django dependency. Thanks Travis Swicegood.
| Python | bsd-3-clause | yeago/django-model-utils,carljm/django-model-utils,timmygee/django-model-utils,timmygee/django-model-utils,yeago/django-model-utils,nemesisdesign/django-model-utils,nemesisdesign/django-model-utils,patrys/django-model-utils,patrys/django-model-utils,carljm/django-model-utils | ---
+++
@@ -23,7 +23,7 @@
author_email='carl@oddbird.net',
url='https://github.com/carljm/django-model-utils/',
packages=find_packages(),
- install_requires=['django>=1.4.2'],
+ install_requires=['Django>=1.4.2'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment', |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.