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 |
|---|---|---|---|---|---|---|---|---|---|---|
e6210d4d3fcdff4c9b4b22946e03062e01efd830 | pika/adapters/__init__.py | pika/adapters/__init__.py | from asyncore_connection import AsyncoreConnection
from blocking_connection import BlockingConnection
from tornado_connection import TornadoConnection
| # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MPL/
#
# Software distri... | Add the license block and BaseConnection | Add the license block and BaseConnection
| Python | bsd-3-clause | skftn/pika,shinji-s/pika,Zephor5/pika,zixiliuyue/pika,reddec/pika,pika/pika,renshawbay/pika-python3,vrtsystems/pika,knowsis/pika,fkarb/pika-python3,jstnlef/pika,Tarsbot/pika,vitaly-krugl/pika,hugoxia/pika,benjamin9999/pika | ---
+++
@@ -1,3 +1,53 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0
+#
+# The contents of this file are subject to the Mozilla Public License
+# Version 1.1 (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.mo... |
f7b1d233ed39eed24e3c1489738df01f700112e3 | tensorflow/contrib/tensorrt/__init__.py | tensorflow/contrib/tensorrt/__init__.py | # Copyright 2018 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 applica... | # Copyright 2018 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 applica... | Move the pylint message and fix comment length | Move the pylint message and fix comment length
| Python | apache-2.0 | paolodedios/tensorflow,lukeiwanski/tensorflow,alshedivat/tensorflow,kobejean/tensorflow,frreiss/tensorflow-fred,Xeralux/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,alsrgv/tensorflow,nburn42/tensorflow,meteorcloudy/tensorflow,Xeralux/tensorflow,paolodedios/tensorflow,ppwwyyxx/tensorflow,gaut... | ---
+++
@@ -18,16 +18,16 @@
from __future__ import division
from __future__ import print_function
-# pylint: disable=unused-import,wildcard-import
+# pylint: disable=unused-import,wildcard-import,g-import-not-at-top
try:
- from tensorflow.contrib.tensorrt.python import * # pylint: disable=import-not-at-top
+ ... |
dd21586d910dded2932f96b98d6d0588c18d2f58 | great_expectations/cli/cli_logging.py | great_expectations/cli/cli_logging.py | import logging
import warnings
warnings.filterwarnings("ignore")
###
# REVIEWER NOTE: THE ORIGINAL IMPLEMENTATION WAS HEAVY HANDED AND I BELIEVE WAS A TEMPORARY WORKAROUND.
# PLEASE CAREFULLY REVIEW TO ENSURE REMOVING THIS DOES NOT AFFECT DESIRED BEHAVIOR
###
logger = logging.getLogger("great_expectations.cli")
de... | import logging
import warnings
warnings.filterwarnings("ignore")
###
# REVIEWER NOTE: THE ORIGINAL IMPLEMENTATION WAS HEAVY HANDED AND I BELIEVE WAS A TEMPORARY WORKAROUND.
# PLEASE CAREFULLY REVIEW TO ENSURE REMOVING THIS DOES NOT AFFECT DESIRED BEHAVIOR
###
logger = logging.getLogger("great_expectations.cli")
de... | Set level on module logger instead | Set level on module logger instead
| Python | apache-2.0 | great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations | ---
+++
@@ -15,9 +15,10 @@
# Log to console with a simple formatter; used by CLI
formatter = logging.Formatter("%(message)s")
handler = logging.StreamHandler()
- handler.setLevel(level=logging.WARNING)
+
handler.setFormatter(formatter)
module_logger = logging.getLogger("great_expectations"... |
25f26842b8371b13b3fc9f4abf12dfba0b0408bc | shapely/tests/__init__.py | shapely/tests/__init__.py | # package
from test_doctests import test_suite
| from unittest import TestSuite
import test_doctests, test_prepared
def test_suite():
suite = TestSuite()
suite.addTest(test_doctests.test_suite())
suite.addTest(test_prepared.test_suite())
return suite
| Integrate tests of prepared geoms into main test suite. | Integrate tests of prepared geoms into main test suite.
git-svn-id: 1a8067f95329a7fca9bad502d13a880b95ac544b@1508 b426a367-1105-0410-b9ff-cdf4ab011145
| Python | bsd-3-clause | mindw/shapely,mindw/shapely,mouadino/Shapely,mouadino/Shapely,abali96/Shapely,jdmcbr/Shapely,abali96/Shapely,jdmcbr/Shapely | ---
+++
@@ -1,2 +1,10 @@
-# package
-from test_doctests import test_suite
+from unittest import TestSuite
+
+import test_doctests, test_prepared
+
+def test_suite():
+ suite = TestSuite()
+ suite.addTest(test_doctests.test_suite())
+ suite.addTest(test_prepared.test_suite())
+ return suite
+ |
4fc803a61b7c6322b079554bfec52b34b130b810 | config/urls.py | config/urls.py | """wuppdays URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | """yunity URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | Fix config to use yunity_swagger | Fix config to use yunity_swagger
| Python | agpl-3.0 | yunity/yunity-core,yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/yunity-core | ---
+++
@@ -1,4 +1,4 @@
-"""wuppdays URL Configuration
+"""yunity URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
@@ -18,10 +18,10 @@
from django.conf import settings
import yunity.api.urls
-import yuni... |
356cb63327ce578d31a0c0ee5201423a8ed0e9d2 | wensleydale/cli.py | wensleydale/cli.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import json
import click
from wensleydale import parser
@click.command()
@click.argument('path', type=str)
@click.argument('query', type=str)
@click.version_option()
def main(path, query, level=None, version=None):
'''
Mr Wen... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import json
import click
from wensleydale import parser
@click.command()
@click.argument('path', type=click.Path(exists=True))
@click.argument('query', type=str)
@click.version_option()
def main(path, query, level=None, version=None)... | Add file path existince checking | Add file path existince checking
| Python | mit | RishiRamraj/wensleydale | ---
+++
@@ -8,7 +8,7 @@
@click.command()
-@click.argument('path', type=str)
+@click.argument('path', type=click.Path(exists=True))
@click.argument('query', type=str)
@click.version_option()
def main(path, query, level=None, version=None): |
7eff20d706eb35513d8d1f420e59879e80400417 | pseudon/ast_translator.py | pseudon/ast_translator.py | from ast import AST
import yaml
class ASTTranslator:
def __init__(self, tree):
self.tree = tree
def translate(self):
return yaml.dump({'type': 'program', 'code': []})
| import ast
import yaml
class ASTTranslator:
def __init__(self, tree):
self.tree = tree
def translate(self):
return yaml.dump(self._translate_node(self.tree))
def _translate_node(self, node):
if isinstance(node, ast.AST):
return getattr('_translate_%s' % type(node).__... | Add a basic ast translator | Add a basic ast translator
| Python | mit | alehander42/pseudo-python | ---
+++
@@ -1,4 +1,4 @@
-from ast import AST
+import ast
import yaml
@@ -8,4 +8,20 @@
self.tree = tree
def translate(self):
- return yaml.dump({'type': 'program', 'code': []})
+ return yaml.dump(self._translate_node(self.tree))
+
+ def _translate_node(self, node):
+ if isi... |
3efd5bb62a6b6a6f62c74f3dba9f8b2833b76473 | knightos.py | knightos.py | import os
import requests
from sys import stderr, exit
from resources import get_resource_root
def get_key(platform):
if platform == "TI73": return 0x02
if platform == "TI83p" or platform == "TI83pSE": return 0x04
if platform == "TI84p" or platform == "TI84pSE": return 0x0A
if platform == "TI84pCSE": r... | import os
import requests
from sys import stderr, exit
from resources import get_resource_root
def get_key(platform):
if platform == "TI73": return 0x02
if platform == "TI83p" or platform == "TI83pSE": return 0x04
if platform == "TI84p" or platform == "TI84pSE": return 0x0A
if platform == "TI84pCSE": r... | Fix privledged page constant for TI-83+ | Fix privledged page constant for TI-83+
This closes https://github.com/KnightOS/KnightOS/issues/265
| Python | mit | KnightOS/sdk,KnightOS/sdk,KnightOS/sdk | ---
+++
@@ -16,7 +16,7 @@
def get_privileged(platform):
if platform == "TI73": return 0x1C
- if platform == "TI83p": return 0x3C
+ if platform == "TI83p": return 0x1C
if platform == "TI83pSE": return 0x7C
if platform == "TI84p": return 0x3C
if platform == "TI84pSE": return 0x7C |
df027db957b38656e3acf42d6065af34509ea053 | project/api/managers.py | project/api/managers.py | # Django
from django.contrib.auth.models import BaseUserManager
class UserManager(BaseUserManager):
def create_user(self, email, password='', person, **kwargs):
user = self.model(
email=email,
password='',
person=person,
is_active=True,
**kwargs... | # Django
from django.contrib.auth.models import BaseUserManager
class UserManager(BaseUserManager):
def create_user(self, email, password='', **kwargs):
user = self.model(
email=email,
password='',
is_active=True,
**kwargs
)
user.save(using=... | Revert "Update manager for Person requirement" | Revert "Update manager for Person requirement"
This reverts commit 1f7c21280b7135f026f1ff807ffc50c97587f6fd.
| Python | bsd-2-clause | barberscore/barberscore-api,dbinetti/barberscore,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore-django,dbinetti/barberscore | ---
+++
@@ -4,11 +4,10 @@
class UserManager(BaseUserManager):
- def create_user(self, email, password='', person, **kwargs):
+ def create_user(self, email, password='', **kwargs):
user = self.model(
email=email,
password='',
- person=person,
is_act... |
33a1df824ef3b339874e0a24d1c84ad05ebcb9e1 | cvui.py | cvui.py | # This is a documentation block with several lines
# so I can test how it works.
import cv2
def main():
print("cvui main");
if __name__ == '__main__':
main()
def random_number_generator(arg1, arg2):
"""
Summary line.
Extended description of function.
Parameters
----------
arg1 : ... | # This is a documentation block with several lines
# so I can test how it works.
import cv2
def main():
print("cvui main")
if __name__ == '__main__':
main()
def random_number_generator(arg1, arg2):
"""
Summary line.
Extended description of function.
Parameters
----------
arg1 : i... | Add draft of printf in python | Add draft of printf in python
| Python | mit | Dovyski/cvui,Dovyski/cvui,Dovyski/cvui | ---
+++
@@ -4,7 +4,7 @@
import cv2
def main():
- print("cvui main");
+ print("cvui main")
if __name__ == '__main__':
main()
@@ -34,8 +34,27 @@
cv2.namedWindow(window_name)
def text(where, x, y, text, font_scale = 0.4, color = 0xCECECE):
- cv2.putText(where, 'OpenCV', (x, y), cv2.FONT_HERSHE... |
9ecf7d7aa6f6d3a80ba2a327ee5b402b665a3e0c | test/tests/nodalkernels/high_order_time_integration/convergence_study.py | test/tests/nodalkernels/high_order_time_integration/convergence_study.py | import os
import csv
from collections import deque
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
schemes = ['implicit-euler', 'bdf2', 'crank-nicolson', 'dirk', 'explicit-euler', 'rk-2']
scheme_errors = {}
# Generate list of dts
dt = 1.0
dts = []
for i in range(0,10):
dts.append(dt)
dt = d... | import os
import csv
from collections import deque
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
schemes = ['implicit-euler', 'bdf2', 'crank-nicolson', 'dirk']
scheme_errors = {}
# Generate list of dts
dt = 1.0
dts = []
for i in range(0,5):
dts.append(dt)
dt = dt / 2.0
for scheme in sche... | Test fewer dts, only test implicit methods. | Test fewer dts, only test implicit methods.
The timesteps used here are not valid for explicit methods.
| Python | lgpl-2.1 | jessecarterMOOSE/moose,backmari/moose,giopastor/moose,andrsd/moose,jiangwen84/moose,sapitts/moose,Chuban/moose,friedmud/moose,milljm/moose,bwspenc/moose,sapitts/moose,nuclear-wizard/moose,idaholab/moose,liuwenf/moose,dschwen/moose,permcody/moose,joshua-cogliati-inl/moose,lindsayad/moose,nuclear-wizard/moose,stimpsonsg/... | ---
+++
@@ -6,14 +6,14 @@
import numpy as np
import matplotlib.pyplot as plt
-schemes = ['implicit-euler', 'bdf2', 'crank-nicolson', 'dirk', 'explicit-euler', 'rk-2']
+schemes = ['implicit-euler', 'bdf2', 'crank-nicolson', 'dirk']
scheme_errors = {}
# Generate list of dts
dt = 1.0
dts = []
-for i in range... |
3fed93e1c0c12dd98a1be7e024a4c637c5751549 | src/sentry/tasks/base.py | src/sentry/tasks/base.py | """
sentry.tasks.base
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from celery.task import task
from django_statsd.clients import statsd
from functools import wraps
def instrumented_task(name, queue, stat_suffix=None, ... | """
sentry.tasks.base
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from celery.task import task
from django_statsd.clients import statsd
from functools import wraps
def instrumented_task(name, queue, stat_suffix=None, ... | Change tasks key prefix to jobs.duration | Change tasks key prefix to jobs.duration
| Python | bsd-3-clause | gencer/sentry,korealerts1/sentry,JTCunning/sentry,fuziontech/sentry,wujuguang/sentry,jean/sentry,mvaled/sentry,jean/sentry,BuildingLink/sentry,zenefits/sentry,drcapulet/sentry,ewdurbin/sentry,TedaLIEz/sentry,fotinakis/sentry,nicholasserra/sentry,looker/sentry,gencer/sentry,BayanGroup/sentry,BuildingLink/sentry,mvaled/s... | ---
+++
@@ -12,7 +12,7 @@
def instrumented_task(name, queue, stat_suffix=None, **kwargs):
- statsd_key = 'tasks.{name}'.format(name=name)
+ statsd_key = 'jobs.duration.{name}'.format(name=name)
if stat_suffix:
statsd_key += '.{key}'.format(key=stat_suffix)
|
0c6a27b483fdfaf04c0481151d2c3e282e4eca4f | opps/images/templatetags/images_tags.py | opps/images/templatetags/images_tags.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
@register.simple_tag
def image_obj(image, **kwargs):
new = {}
... | Create template tag image obj on images receive obj image | Create template tag image obj on images
receive obj image
| Python | mit | jeanmask/opps,williamroot/opps,opps/opps,williamroot/opps,opps/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,YACOWS/opps,opps/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,opps/opps | ---
+++
@@ -10,3 +10,19 @@
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
+
+
+@register.simple_tag
+def image_obj(image, **kwargs):
+ new = {}
+ new['flip'] = image.flip
+ new['flop'] = image.flop
+ if image.halign:
+ new['halign'] = image... |
27eea99e2ca78f7af3fb308f91d377e70c53e3c4 | app.py | app.py | from flask import Flask, request, jsonify, send_from_directory
import os
import uuid
app = Flask(__name__)
UPLOAD_FOLDER = "uploads/"
@app.route("/")
def index():
return send_from_directory('static/', 'index.html')
@app.route("/<path:path>")
def serve_static_files(path):
return send_from_directory('static/', ... | from flask import Flask, request, jsonify, send_from_directory
import os
import uuid
app = Flask(__name__)
UPLOAD_FOLDER = "uploads/"
@app.route("/")
def index():
return send_from_directory('static/', 'index.html')
@app.route("/<path:path>")
def serve_static_files(path):
return send_from_directory('static/', ... | Update sounds list data view | Update sounds list data view
| Python | mit | spb201/turbulent-octo-rutabaga-api,spb201/turbulent-octo-rutabaga-api,spb201/turbulent-octo-rutabaga-api | ---
+++
@@ -17,7 +17,10 @@
if not os.path.isdir(UPLOAD_FOLDER):
os.mkdir(UPLOAD_FOLDER)
sounds = os.listdir(UPLOAD_FOLDER)
- return jsonify({'sounds': sounds})
+ _sounds = []
+ for sound in sounds:
+ _sounds.append({'title': sound, 'filename': sound})
+ return jsonify({'sounds': ... |
fb9a16917ba8f26caa0d941b181fa083fcb7a2da | bot.py | bot.py | from discord.ext.commands import Bot, CommandInvokeError
from discord.ext.commands.errors import CommandNotFound, MissingRequiredArgument
class BeattieBot(Bot):
async def reply(self, ctx, message):
return await ctx.send(f'{ctx.message.author.mention}\n{message}')
async def handle_error(self, ex... | from discord.ext.commands import Bot, CommandInvokeError
from discord.ext.commands.errors import CommandNotFound, MissingRequiredArgument
class BeattieBot(Bot):
async def reply(self, ctx, message):
return await ctx.send(f'{ctx.message.author.mention}\n{message}')
async def handle_error(self, ex... | Change isinstance check to duck typing because this is Python lol | Change isinstance check to duck typing because this is Python lol
| Python | mit | BeatButton/beattie-bot,BeatButton/beattie | ---
+++
@@ -11,9 +11,10 @@
elif not isinstance(exception, CommandNotFound):
await ctx.send('Generic error handler triggered. '
'This should never happen.')
- if isinstance(exception, CommandInvokeError):
- exception = exception.original
- ... |
fdb56c41b5151e9fc4ce3eb997b2bb88d16594c1 | pyalp/pyalp/contexts.py | pyalp/pyalp/contexts.py | #main/contexts.py
from django.core.urlresolvers import resolve
from cl_module.cl_module import ModuleManager
from flags.registry import get_flag_registry
from pyalp.skin import get_skin
def app_name(request):
return {'app_name': resolve(request.path).app_name}
def url_name(request):
return {'url_name': res... | #main/contexts.py
from os.path import join
import json
from django.core.urlresolvers import resolve
from django.conf import settings
from cl_module.cl_module import ModuleManager
from flags.registry import get_flag_registry
from pyalp.skin import get_skin
def app_name(request):
return {'app_name': resolve(reque... | Load the lan config from a json file | Load the lan config from a json file
| Python | mit | Mause/pyalp,Mause/pyalp,Mause/pyalp,Mause/pyalp | ---
+++
@@ -1,5 +1,9 @@
#main/contexts.py
+from os.path import join
+import json
+
from django.core.urlresolvers import resolve
+from django.conf import settings
from cl_module.cl_module import ModuleManager
from flags.registry import get_flag_registry
@@ -24,7 +28,15 @@
def lan(request):
# TODO: have t... |
9e7d3c35857600445cb6df42ba18d289dc0e37a9 | wsgi.py | wsgi.py |
from os import getenv
from webapp import create_app
from argparse import ArgumentParser
app = create_app(getenv('FLASK_CONFIG') or 'development')
def main():
parser = ArgumentParser()
parser.add_argument("-p", "--port", help="port number")
args = parser.parse_args()
port = int(args.port or None)
... |
from os import getenv
from webapp import create_app
from argparse import ArgumentParser
app = create_app(getenv('FLASK_CONFIG') or 'development')
def main():
parser = ArgumentParser()
parser.add_argument("-p", "--port", help="port number")
args = parser.parse_args()
port = int(args.port or 5000)
... | Fix in port number initialisation | Fix in port number initialisation
| Python | bsd-3-clause | aleksandergurin/news,aleksandergurin/news,aleksandergurin/news | ---
+++
@@ -11,7 +11,7 @@
parser = ArgumentParser()
parser.add_argument("-p", "--port", help="port number")
args = parser.parse_args()
- port = int(args.port or None)
+ port = int(args.port or 5000)
app.run(port=port)
if __name__ == "__main__": |
4a2bd50b6747eb00ddedd0d3e26f28cc43980b11 | tools/test-commands.py | tools/test-commands.py | #!/usr/bin/python
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost", 5001))
s.send("imei:123456789012345,tracker,151030080103,,F,000101.000,A,5443.3834,N,02512.9071,E,0.00,0;")
while True:
print s.recv(1024)
s.close()
| #!/usr/bin/python
import socket
import binascii
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost", 5001))
#s.send(binascii.unhexlify('68680f0504035889905831401700df1a00000d0a'))
s.send("imei:123456789012345,tracker,151030080103,,F,000101.000,A,5443.3834,N,02512.9071,E,0.00,0;")
while True:... | Extend script to test binary commands | Extend script to test binary commands
| Python | apache-2.0 | 5of9/traccar,jssenyange/traccar,tananaev/traccar,duke2906/traccar,AnshulJain1985/Roadcast-Tracker,tsmgeek/traccar,stalien/traccar_test,renaudallard/traccar,orcoliver/traccar,AnshulJain1985/Roadcast-Tracker,tsmgeek/traccar,joseant/traccar-1,ninioe/traccar,tananaev/traccar,5of9/traccar,renaudallard/traccar,al3x1s/traccar... | ---
+++
@@ -1,9 +1,11 @@
#!/usr/bin/python
import socket
+import binascii
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost", 5001))
+#s.send(binascii.unhexlify('68680f0504035889905831401700df1a00000d0a'))
s.send("imei:123456789012345,tracker,151030080103,,F,000101.000,A,5443.3834,N... |
841da00ffa000acec3e287b8b2af91147271b728 | cupy/array_api/_typing.py | cupy/array_api/_typing.py | """
This file defines the types for type annotations.
These names aren't part of the module namespace, but they are used in the
annotations in the function signatures. The functions in the module are only
valid for inputs that match the given type annotations.
"""
from cupy.cuda import Device as _Device
__all__ = [... | """
This file defines the types for type annotations.
These names aren't part of the module namespace, but they are used in the
annotations in the function signatures. The functions in the module are only
valid for inputs that match the given type annotations.
"""
from cupy.cuda import Device as _Device
__all__ = [... | Fix invalid parameter types used in `Dtype` | MAINT: Fix invalid parameter types used in `Dtype`
| Python | mit | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | ---
+++
@@ -18,10 +18,12 @@
"PyCapsule",
]
-from typing import Any, Literal, Sequence, Type, Union
+import sys
+from typing import Any, Literal, Sequence, Type, Union, TYPE_CHECKING
-from . import (
- Array,
+from . import Array
+from numpy import (
+ dtype,
int8,
int16,
int32,
@@ -39,9... |
7ef1d2fc9a99f0ac190206d5cb721dced0de5ad4 | speedchart.py | speedchart.py | from flask import Flask, render_template
from parser import Parser
import json
app = Flask(__name__)
@app.route("/")
def index():
parser = Parser()
data = parser.parse_all()
print json.dumps(data)
return render_template("index.html", data=data)
if __name__ == "__main__":
app.run(debug=True)
| from flask import Flask, render_template
from parser import Parser
import json
app = Flask(__name__)
@app.route("/")
def index():
parser = Parser()
data = parser.parse_all()
return render_template("index.html", data=data)
if __name__ == "__main__":
app.run(debug=True)
| Remove unnecessary printing of JSON in log | Remove unnecessary printing of JSON in log
| Python | mit | ruralocity/speedchart,ruralocity/speedchart | ---
+++
@@ -7,7 +7,6 @@
def index():
parser = Parser()
data = parser.parse_all()
- print json.dumps(data)
return render_template("index.html", data=data)
if __name__ == "__main__": |
3120f41f34735e0ab6f526f0a144fb3682d43391 | pymagicc/definitions/__init__.py | pymagicc/definitions/__init__.py | from os.path import dirname, join
import pandas as pd
_dtrm = pd.read_csv(join(dirname(__file__), "magicc_dattype_regionmode_regions.csv"))
region_cols = _dtrm.columns.to_series().apply(lambda x: x.startswith("Region"))
dattype_regionmode_regions = _dtrm.loc[:, ~region_cols].copy()
dattype_regionmode_regions["Regio... | from os.path import dirname, join
import pandas as pd
_dtrm = pd.read_csv(join(dirname(__file__), "magicc_dattype_regionmode_regions.csv"))
region_cols = _dtrm.columns.to_series().apply(lambda x: x.startswith("Region"))
dattype_regionmode_regions = _dtrm.loc[:, ~region_cols].copy()
dattype_regionmode_regions["Regio... | Update TODO for other definitions | Update TODO for other definitions | Python | agpl-3.0 | openclimatedata/pymagicc,openclimatedata/pymagicc | ---
+++
@@ -12,5 +12,6 @@
for raw in _dtrm.loc[:, region_cols].values.tolist()
]
+# TODO: do read ins for these too
emissions_units = {}
concentrations_units = {} |
f048d62b7831f0364093025c6bf9e3458d1a7b11 | projects/urls.py | projects/urls.py | from django.conf.urls import patterns, url
urlpatterns = patterns('projects.views',
url(r'^add/$', 'add_project', name='add_project'),
url(r'^edit/(?P<project_id>.*)/$', 'edit_project', name='edit_project'),
url(r'^status/(?P<project_id>.*)/$', 'edit_status', name='edit_status'),
url(r'^archive/$', 'p... | from django.conf.urls import patterns, url
urlpatterns = patterns('projects.views',
url(r'^add/$', 'add_project', name='add_project'),
url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit_project'),
url(r'^status/(?P<project_id>\d+)/$', 'edit_status', name='edit_status'),
url(r'^archive/', '... | Add url corresponding to the added view | Add url corresponding to the added view
| Python | mit | Hackfmi/Diaphanum,Hackfmi/Diaphanum | ---
+++
@@ -3,7 +3,8 @@
urlpatterns = patterns('projects.views',
url(r'^add/$', 'add_project', name='add_project'),
- url(r'^edit/(?P<project_id>.*)/$', 'edit_project', name='edit_project'),
- url(r'^status/(?P<project_id>.*)/$', 'edit_status', name='edit_status'),
- url(r'^archive/$', 'projects_arch... |
0c1ecf09d892e15ae02a92a1643e7cdb4ae95069 | unit_tests/test_ccs.py | unit_tests/test_ccs.py | #!/usr/bin/env python3
import pytest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_PacBio_log, parse_line
PARSABLE_LINES = [
'',
'ZMWs input... | #!/usr/bin/env python3
import pytest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_PacBio_log, parse_line
PARSABLE_LINES = [
'',
'ZMWs input... | Add tests for lines with both a count and percentage | Add tests for lines with both a count and percentage
| Python | mit | ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData | ---
+++
@@ -15,7 +15,9 @@
'ZMWs input (A) :',
'ZMWs input : 93',
'ZMWs input (A) : 93',
- 'Coefficient of correlation : 28.78%'
+ 'Coefficient of correlation : 28.78%',
+ 'ZMWs generating CCS (B) : 44 (47.31%)',
+ 'Coefficient of correlation (A) : 28.78%... |
9d5c534339c417842428d2a4dcca6c1745fb9770 | test/test_integration.py | test/test_integration.py | import unittest
import http.client
class TestStringMethods(unittest.TestCase):
def test_404NoConfig(self):
connRouter = http.client.HTTPConnection("localhost", 8666)
connRouter.request("GET", "/google")
response = connRouter.getresponse()
connRouter.close()
self.assertEqual... | import unittest
import http.client
class TestStringMethods(unittest.TestCase):
def test_404NoConfig(self):
connRouter = http.client.HTTPConnection("localhost", 8666)
connRouter.request("GET", "/google")
response = connRouter.getresponse()
connRouter.close()
self.assertEqual... | Use query parameters through the python library | Use query parameters through the python library | Python | apache-2.0 | dhiaayachi/dynx,dhiaayachi/dynx | ---
+++
@@ -13,7 +13,12 @@
def test_200NoConfig(self):
connRouter = http.client.HTTPConnection("localhost", 8666)
connConfig = http.client.HTTPConnection("localhost", 8888)
- connConfig.request("GET","/configure?location=/google&upstream=http://www.google.com&ttl=10")
+ params = {... |
7e4a8698532a79ec6338961e91e71c54c155f02a | demo/apps/catalogue/migrations/0011_auto_20160616_1335.py | demo/apps/catalogue/migrations/0011_auto_20160616_1335.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0013_make_rendition_upload_callable'),
('catalogue', '0010_auto_20160616_1048'),
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0013_make_rendition_upload_callable'),
('catalogue', '0010_auto_20160616_1048'),
... | Remove name field. It already exists | Remove name field. It already exists
| Python | mit | pgovers/oscar-wagtail-demo,pgovers/oscar-wagtail-demo | ---
+++
@@ -22,10 +22,5 @@
model_name='category',
name='image',
field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True),
- ),
- migrations.AddField(
- model_name='category',... |
18998011bb52616a3002ca298a64ea61c5727a76 | skeleton/website/jasyscript.py | skeleton/website/jasyscript.py | import konstrukteur.Konstrukteur
import jasy.asset.Manager2 as AssetManager
@task
def build(regenerate = False):
"""Generate source (development) version"""
# Initialize assets
AssetManager.AssetManager(profile, session)
# Build static website
konstrukteur.Konstrukteur.build(regenerate)
| import konstrukteur.Konstrukteur
import jasy.asset.Manager2 as AssetManager
@task
def build(regenerate = False):
"""Generate source (development) version"""
# Initialize assets
assetManager = AssetManager.AssetManager(profile, session)
# Build static website
konstrukteur.Konstrukteur.build(regenerate)
# Copy ... | Copy used assets to output path | Copy used assets to output path
| Python | mit | fastner/konstrukteur,fastner/konstrukteur,fastner/konstrukteur | ---
+++
@@ -6,7 +6,10 @@
"""Generate source (development) version"""
# Initialize assets
- AssetManager.AssetManager(profile, session)
+ assetManager = AssetManager.AssetManager(profile, session)
# Build static website
konstrukteur.Konstrukteur.build(regenerate)
+
+ # Copy assets to build path
+ assetMana... |
fe442d84140b0a588c6a8490b58a10995df58f17 | tests/optimizers/test_constant_optimizer.py | tests/optimizers/test_constant_optimizer.py | """Test suite for optimizers.constant."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import ast
import pytest
from pycc.asttools import parse
from pycc.optimizers import constant
source = """
ONE = 1
TWO = 2
T... | """Test suite for optimizers.constant."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import ast
import pytest
from pycc.asttools import parse
from pycc.optimizers import constant
source = """
ONE = 1
TWO = 2
T... | Fix test to use new optimizer interface | Fix test to use new optimizer interface
Signed-off-by: Kevin Conway <3473c1f185ca03eadc40ad288d84425b54fd7d57@gmail.com>
| Python | apache-2.0 | kevinconway/pycc,kevinconway/pycc | ---
+++
@@ -38,7 +38,7 @@
def test_constant_inliner(node):
"""Test that constant values are inlined."""
- constant.ConstantOptimizer()(node)
+ constant.optimize(node)
# Check assignment values using constants.
assert node.body[2].value.n == 3 |
b2396e90d9da252766979c154e6f98707dda6e0c | python/helpers/profiler/_prof_imports.py | python/helpers/profiler/_prof_imports.py | import sys
IS_PY3K = False
try:
if sys.version_info[0] >= 3:
IS_PY3K = True
except AttributeError:
pass #Not all versions have sys.version_info
if IS_PY3K:
# noinspection PyUnresolvedReferences
from thriftpy3 import TSerialization
# noinspection PyUnresolvedReferences
from thriftpy3... | import sys
IS_PY3K = False
try:
if sys.version_info[0] >= 3:
IS_PY3K = True
except AttributeError:
pass #Not all versions have sys.version_info
if IS_PY3K:
# noinspection PyUnresolvedReferences
from thriftpy3 import TSerialization
# noinspection PyUnresolvedReferences
from thriftpy3... | Remove JSON serialization usages (PY-16388, PY-16389) | Remove JSON serialization usages (PY-16388, PY-16389)
| Python | apache-2.0 | orekyuu/intellij-community,MER-GROUP/intellij-community,semonte/intellij-community,da1z/intellij-community,slisson/intellij-community,xfournet/intellij-community,youdonghai/intellij-community,wreckJ/intellij-community,blademainer/intellij-community,robovm/robovm-studio,lucafavatella/intellij-community,salguarnieri/inte... | ---
+++
@@ -13,14 +13,14 @@
# noinspection PyUnresolvedReferences
from thriftpy3 import TSerialization
# noinspection PyUnresolvedReferences
- from thriftpy3.protocol import TJSONProtocol, TBinaryProtocol
+ from thriftpy3.protocol import TBinaryProtocol
# noinspection PyUnresolvedReferences
... |
f300f3b31dcdefa91fa8fe46bdaab2d2490ac06a | snd/image_board/serializers.py | snd/image_board/serializers.py | from django.contrib.auth.models import User
from .models import ContentItem, Profile, Comment, Hashtag, ContentHashTag, Like
from rest_framework import serializers
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id', 'url', 'username', 'email', 'la... | from django.contrib.auth.models import User
from .models import ContentItem, Profile, Comment, Hashtag, ContentHashTag, Like
from rest_framework import serializers
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id', 'url', 'username', 'email', 'la... | Add URLs to each searializer | Add URLs to each searializer
| Python | mit | SNDjango/server,SNDjango/server,SNDjango/server | ---
+++
@@ -12,35 +12,35 @@
class ProfileSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Profile
- fields = ('user', 'personal_info', 'job_title', 'department', 'location', 'expertise',
+ fields = ('id', 'url', 'user', 'personal_info', 'job_title', 'department', 'l... |
f68daf88cd7fb6cad64a72ef48af5b9b616ca4c6 | StudentsListHandler.py | StudentsListHandler.py | __author__ = 'Mael Beuget, Pierre Monnin & Thibaut Smith'
from BaseHandler import *
import logging
from XMLAnalyser import XMLAnalyser
from google.appengine.api import memcache
class StudentsListHandler(BaseHandler):
def __init__(self, request=None, response=None):
self.initialize(request, response)
... | __author__ = 'Mael Beuget, Pierre Monnin & Thibaut Smith'
from BaseHandler import *
import logging
from XMLAnalyser import XMLAnalyser
from google.appengine.api import memcache
class StudentsListHandler(BaseHandler):
def __init__(self, request=None, response=None):
self.initialize(request, response)
... | Change memcache expiration timing to 1 week | Change memcache expiration timing to 1 week
| Python | mit | Videl/absentees-blackboard,Videl/absentees-blackboard | ---
+++
@@ -21,7 +21,7 @@
logging.error("CACHE MISS StudentsListHandler l. 24")
parser = XMLAnalyser()
groups = parser.get_members()
- memcache.set("group_list", groups, time=7200);
+ memcache.set("group_list", groups, time=604800);
to_display = ... |
85db49b33f793a1ed5c66684996862fa8f1614b1 | web/geosearch/tests/test_bag_dataset.py | web/geosearch/tests/test_bag_dataset.py | import unittest
from datapunt_geosearch import config
from datapunt_geosearch import datasource
class TestBAGDataset(unittest.TestCase):
def test_query(self):
x = 120993
y = 485919
ds = datasource.BagDataSource(dsn=config.DSN_BAG)
results = ds.query(x, y)
self.assertEqua... | import unittest
from datapunt_geosearch import config
from datapunt_geosearch import datasource
class TestBAGDataset(unittest.TestCase):
def test_query(self):
x = 120993
y = 485919
ds = datasource.BagDataSource(dsn=config.DSN_BAG)
results = ds.query(x, y)
self.assertEqua... | Remove WKPB from geosearch - also change other test | Remove WKPB from geosearch - also change other test
| Python | mpl-2.0 | DatapuntAmsterdam/datapunt_geosearch,DatapuntAmsterdam/datapunt_geosearch | ---
+++
@@ -12,7 +12,7 @@
ds = datasource.BagDataSource(dsn=config.DSN_BAG)
results = ds.query(x, y)
- self.assertEqual(len(results['features']), 7)
+ self.assertEqual(len(results['features']), 6)
self.assertIn('distance', results['features'][0]['properties'])
def tes... |
0df8a958b479e01d9c931bd4ca185c68720e14e6 | analyser/api.py | analyser/api.py | import os
import json
import requests
import rethinkdb as r
from flask import Blueprint, current_app
from utils.decorators import validate, require
from utils.validators import validate_url
from krunchr.vendors.rethinkdb import db
from .parser import Parser
from .tasks import get_file
endpoint = Blueprint('analys... | import os
import json
import requests
import rethinkdb as r
from flask import Blueprint, current_app
from utils.decorators import validate, require
from utils.validators import validate_url
from krunchr.vendors.rethinkdb import db
from .parser import Parser
from .tasks import get_file, push_data
endpoint = Bluepr... | Use a chord in order to start tasks | Use a chord in order to start tasks
| Python | apache-2.0 | vtemian/kruncher | ---
+++
@@ -12,7 +12,7 @@
from krunchr.vendors.rethinkdb import db
from .parser import Parser
-from .tasks import get_file
+from .tasks import get_file, push_data
endpoint = Blueprint('analyse_url', __name__)
@@ -33,7 +33,8 @@
if fields:
break
- task_id = get_file.delay(url, current_app.config... |
1fd2aef4fcaabddcb533ffe2f999e55d1e3ce7fe | docs/source/conf.py | docs/source/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import subprocess
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
subprocess.call('cd ..; doxygen', shell=True)
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
def set... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import subprocess
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
subprocess.call('cd ..; doxygen', shell=True)
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
def se... | Fix build with Sphinx 4. | Fix build with Sphinx 4.
`add_stylesheet` was deprecated in 1.8 and removed in 4.0 [1]. The
replacement, `add_css_file` was added in 1.0, which is older than any
version required by `breathe`.
[1] https://www.sphinx-doc.org/en/master/extdev/deprecated.html?highlight=add_stylesheet
| Python | bsd-3-clause | xtensor-stack/xtl,xtensor-stack/xtl | ---
+++
@@ -15,8 +15,10 @@
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+
def setup(app):
- app.add_stylesheet("main_stylesheet.css")
+ app.add_css_file("main_stylesheet.css")
+
extensions = ['breathe']
breathe_projects = { 'xtl': '../xml' }
@@ -35,4 +37,3 @@
pygments_style = 'sphinx'
... |
8bcc4fe29468868190dcfcbea5438dc0aa638387 | sweetercat/test_utils.py | sweetercat/test_utils.py | from __future__ import division
from utils import absolute_magnitude, plDensity, hz
def test_absolute_magnitude():
m = 10
assert isinstance(absolute_magnitude(1, 1), float)
assert absolute_magnitude(1, m) > m
assert absolute_magnitude(1, m) == 15
assert absolute_magnitude(0.1, m) == m
assert a... | from __future__ import division
import pytest
import pandas as pd
from utils import absolute_magnitude, plDensity, hz, readSC
def test_absolute_magnitude():
m = 10
assert isinstance(absolute_magnitude(1, 1), float)
assert absolute_magnitude(1, m) > m
assert absolute_magnitude(1, m) == 15
assert ab... | Add couple more utils tests. | Add couple more utils tests.
| Python | mit | DanielAndreasen/SWEETer-Cat,DanielAndreasen/SWEETer-Cat | ---
+++
@@ -1,5 +1,7 @@
from __future__ import division
-from utils import absolute_magnitude, plDensity, hz
+import pytest
+import pandas as pd
+from utils import absolute_magnitude, plDensity, hz, readSC
def test_absolute_magnitude():
@@ -10,6 +12,8 @@
assert absolute_magnitude(0.1, m) == m
assert a... |
310cab802d7040dfb914ed60529d38011aa83ae8 | app/views.py | app/views.py | from flask import render_template, request, Blueprint
import json
from app.state import state
PROGRAMS_LIST = [
["ascii_text", "ASCII Text"],
["cheertree", "Cheertree"],
["cross", "Cross"],
["demo", "Demo"],
["dna", "DNA"],
["game_of_life", "Game... | from flask import render_template, request, Blueprint
import json
from app.state import state
PROGRAMS_LIST = [
["ascii_text", "ASCII Text"],
["cheertree", "Cheertree"],
["cross", "Cross"],
["demo", "Demo"],
["dna", "DNA"],
["game_of_life", "Game... | Fix typo broke trig program | Fix typo broke trig program
| Python | mit | njbbaer/unicorn-remote,njbbaer/unicorn-remote,njbbaer/unicorn-remote | ---
+++
@@ -19,7 +19,7 @@
["random_sparkles", "Random Sparkles"],
["simple", "Simple"],
["snow", "Snow"],
- ["tri", "Trig"],
+ ["trig", "Trig"],
]
|
bc74780d42dd63a1dee005fe78db45cc994392d2 | twisted/plugins/proxy.py | twisted/plugins/proxy.py | from zope.interface import implements
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker
from twisted.application import internet
from oauth_proxy import oauth_proxy
class OAuthProxyServiceMaker(object):
implements(IServiceMaker, IPlugin)
tapname = "oauth_proxy"
desc... | from zope.interface import implements
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker
from twisted.application import internet
from oauth_proxy import oauth_proxy
class OAuthProxyServiceMaker(object):
implements(IServiceMaker, IPlugin)
tapname = "oauth_proxy"
desc... | Allow specifying a port to actually work | Allow specifying a port to actually work
| Python | bsd-3-clause | mojodna/oauth-proxy | ---
+++
@@ -25,7 +25,7 @@
else:
token = tokenSecret = None
- port = options["port"]
+ port = int(options["port"])
credentials = oauth_proxy.OAuthCredentials(consumerKey, consumerSecret, token, tokenSecret)
credentialProvider = oauth_proxy.StaticOAuthCredentialProvider(credentials) |
11df95a61f93a8654817f9837226a33c98f34af8 | arguments.py | arguments.py | import argparse
"""
usage: mfh.py [-h] [-c | --client [PORT]] [-u] [-v]
Serve some sweet honey to the ubiquitous bots!
optional arguments:
-h, --help show this help message and exit
-c launch client with on port defined in settings
--client [PORT] port to start a client on
-u, --updater ... | import argparse
"""
usage: mfh.py [-h] [-c | --client [PORT]] [-u] [-v]
Serve some sweet honey to the ubiquitous bots!
optional arguments:
-h, --help show this help message and exit
-c launch client with on port defined in settings
--client [PORT] port to start a client on
-u, --updater ... | Add option for launching server | Add option for launching server
There was no option to start the server and you had to do it manually.
Now it can be started with:
1) -s with default configuration
2) --server <PORT> for manual port choice
| Python | mit | Zloool/manyfaced-honeypot | ---
+++
@@ -37,6 +37,22 @@
type=int,
)
+ server_group = parser.add_mutually_exclusive_group()
+
+ server_group.add_argument(
+ '-s',
+ action='store_true',
+ help='launch server with on port defined in settings',
+ )
+
+ server_group.add_argument(
+ '--s... |
8cef502afb45638d74306b2fcebec37f445b13c6 | Recorders.py | Recorders.py | from Measurement import Measurement
class Recorder(object):
def __init__(self, recorderType):
self.recorderType = recorderType
def record(self, measure: Measurement):
None
class PrintRecorder(Recorder):
def __init__(self, config):
Recorder.__init__(self, 'file')
self.form... | from Measurement import Measurement
class Recorder(object):
def __init__(self, recorderType):
self.recorderType = recorderType
def record(self, measure: Measurement):
None
class PrintRecorder(Recorder):
def __init__(self, config):
Recorder.__init__(self, 'file')
self.form... | Remove last slash from file path | Remove last slash from file path
| Python | mit | hectortosa/py-temperature-recorder | ---
+++
@@ -36,8 +36,8 @@
celsius=measure.get_celsius(),
fahrenheit=measure.get_fahrenheit(),
timestamp=measure.timestamp)
-
- file_path = self.container + measure.device_id.split('/')[-1] + '/' + self.extension
+
+ file_path = self.container + measure.... |
d05fdd1ed6657894ecc624777762b463a3ea69da | tests/basics/fun_name.py | tests/basics/fun_name.py | def Fun():
pass
class A:
def __init__(self):
pass
def Fun(self):
pass
try:
print(Fun.__name__)
print(A.__init__.__name__)
print(A.Fun.__name__)
print(A().Fun.__name__)
except AttributeError:
print('SKIP')
raise SystemExit
# __name__ of a bound native method is not ... | def Fun():
pass
class A:
def __init__(self):
pass
def Fun(self):
pass
try:
print(Fun.__name__)
print(A.__init__.__name__)
print(A.Fun.__name__)
print(A().Fun.__name__)
except AttributeError:
print('SKIP')
raise SystemExit
# __name__ of a bound native method is not ... | Add test for getting name of func with closed over locals. | tests/basics: Add test for getting name of func with closed over locals.
Tests correct decoding of the prelude to get the function name.
| Python | mit | pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython | ---
+++
@@ -22,3 +22,11 @@
str((1).to_bytes.__name__)
except AttributeError:
pass
+
+# name of a function that has closed over variables
+def outer():
+ x = 1
+ def inner():
+ return x
+ return inner
+print(outer.__name__) |
91fc886bf302f9850977c8d88abba3bffd51928b | tests/test_compliance.py | tests/test_compliance.py | #!/usr/bin/env python
import os.path
import nose.tools as nose
import pep8
def test_pep8():
'''all Python files should comply with PEP 8'''
for subdir_path, subdir_names, file_names in os.walk('.'):
if '.git' in subdir_names:
subdir_names.remove('.git')
for file_name in file_names... | #!/usr/bin/env python
import os.path
import nose.tools as nose
import pep8
import radon.complexity as radon
def test_pep8():
'''all Python files should comply with PEP 8'''
for subdir_path, subdir_names, file_names in os.walk('.'):
if '.git' in subdir_names:
subdir_names.remove('.git')
... | Add test generator for function complexity | Add test generator for function complexity
| Python | mit | caleb531/ssh-wp-backup,caleb531/ssh-wp-backup | ---
+++
@@ -3,6 +3,7 @@
import os.path
import nose.tools as nose
import pep8
+import radon.complexity as radon
def test_pep8():
@@ -18,3 +19,24 @@
total_errors = style_guide.input_file(file_path)
msg = '{} does not comply with PEP 8'.format(file_path)
yield n... |
315ad5f2f31f82f8d42d2a65fe4f056b4e3fcfd7 | tests/test_quickstart.py | tests/test_quickstart.py | import pytest
from lektor.quickstart import get_default_author
from lektor.quickstart import get_default_author_email
from lektor.utils import locate_executable
def test_default_author(os_user):
assert get_default_author() == "Lektor Test"
@pytest.mark.skipif(locate_executable("git") is None, reason="git not i... | import os
import pytest
from lektor.quickstart import get_default_author
from lektor.quickstart import get_default_author_email
from lektor.utils import locate_executable
def test_default_author(os_user):
assert get_default_author() == "Lektor Test"
@pytest.mark.skipif(locate_executable("git") is None, reason... | Add test case for when git is not available | Add test case for when git is not available
| Python | bsd-3-clause | lektor/lektor,lektor/lektor,lektor/lektor,lektor/lektor | ---
+++
@@ -1,3 +1,5 @@
+import os
+
import pytest
from lektor.quickstart import get_default_author
@@ -12,3 +14,9 @@
@pytest.mark.skipif(locate_executable("git") is None, reason="git not installed")
def test_default_author_email():
assert isinstance(get_default_author_email(), str)
+
+
+def test_default_a... |
f0c0f8816f93ec56cf16db3f5c2298a95e7e9181 | server/butler/server.py | server/butler/server.py | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
import gevent
import gevent.wsgi
import simplejson as json
from butler import service
from butler.options import Options
from butler.routing import Dispatcher
default_config_path = \
os.path.expanduser(os.path.join('~', '.config', ... | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
import gevent
import gevent.wsgi
import simplejson as json
from butler import service
from butler.options import Options
from butler.routing import Dispatcher
default_config_path = \
os.path.expanduser(os.path.join('~', '.config', ... | Rename 'config' service to 'options' | Rename 'config' service to 'options'
| Python | mit | knrafto/butler,knrafto/butler,knrafto/butler | ---
+++
@@ -25,7 +25,7 @@
def serve(config_path):
options = load_config(config_path)
services = list(service.find_all('butler.services'))
- services.append(service.static('config', options))
+ services.append(service.static('options', options))
delegates = service.start(services)
address = ... |
ce2f07e7fa5ac38235cbb6ea6c4fee3a60031246 | social_core/tests/backends/test_udata.py | social_core/tests/backends/test_udata.py | import json
from six.moves.urllib_parse import urlencode
from .oauth import OAuth2Test
class DatagouvfrOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.udata.DatagouvfrOAuth2'
user_data_url = 'https://www.data.gouv.fr/api/1/me/'
expected_username = 'foobar'
access_token_body = json.dumps... | import json
from six.moves.urllib_parse import urlencode
from .oauth import OAuth2Test
class DatagouvfrOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.udata.DatagouvfrOAuth2'
user_data_url = 'https://www.data.gouv.fr/api/1/me/'
expected_username = 'foobar'
access_token_body = json.dumps... | Fix tests for udata/datagouvfr backend | Fix tests for udata/datagouvfr backend
| Python | bsd-3-clause | python-social-auth/social-core,python-social-auth/social-core | ---
+++
@@ -11,7 +11,9 @@
expected_username = 'foobar'
access_token_body = json.dumps({
'access_token': 'foobar',
- 'token_type': 'bearer'
+ 'token_type': 'bearer',
+ 'first_name': 'foobar',
+ 'email': 'foobar@example.com'
})
request_token_body = urlencode({
... |
61be68b330c6e37a4f53b2441370c96c9aa13777 | PRESUBMIT.py | PRESUBMIT.py | # Copyright (c) 2015 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.
"""Top-level presubmit script for catapult.
See https://www.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the pres... | # Copyright 2015 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.
"""Top-level presubmit script for catapult.
See https://www.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmi... | Add a presubmit script that runs pylint in catapult/dashboard. | Add a presubmit script that runs pylint in catapult/dashboard.
Also, resolve current issues in catapult/dashboard that pylint warns about. (Note: these were also resolved in cl/95586698.)
Review URL: https://codereview.chromium.org/1188483002
| Python | bsd-3-clause | sahiljain/catapult,catapult-project/catapult,danbeam/catapult,SummerLW/Perf-Insight-Report,sahiljain/catapult,catapult-project/catapult,dstockwell/catapult,catapult-project/catapult-csm,SummerLW/Perf-Insight-Report,benschmaus/catapult,benschmaus/catapult,scottmcmaster/catapult,benschmaus/catapult,0x90sled/catapult,cata... | ---
+++
@@ -1,4 +1,4 @@
-# Copyright (c) 2015 The Chromium Authors. All rights reserved.
+# Copyright 2015 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.
@@ -29,6 +29,7 @@
def CheckChangeOnUpload(input_api, output_a... |
ae7960e2e3b7c3cd4bd63e55613e7a1f58b51949 | utils/http.py | utils/http.py | import httplib2
def url_exists(url):
"""Check that a url- when following redirection - exists.
This is needed because django's validators rely on python's urllib2
which in verions < 2.6 won't follow redirects.
"""
h = httplib2.Http()
try:
resp, content = h.request(url, method="HEAD")
... | import requests
def url_exists(url):
"""Check that a url (when following redirection) exists.
This is needed because Django's validators rely on Python's urllib2
which in verions < 2.6 won't follow redirects.
"""
try:
return 200 <= requests.head(url).status_code < 400
except requests.... | Switch to requests for checking if links are valid. | Switch to requests for checking if links are valid.
This should have the side effect of not caring about invalid SSL certs, for
https://unisubs.sifterapp.com/projects/12298/issues/557501/comments
| Python | agpl-3.0 | norayr/unisubs,eloquence/unisubs,norayr/unisubs,pculture/unisubs,wevoice/wesub,eloquence/unisubs,wevoice/wesub,pculture/unisubs,eloquence/unisubs,pculture/unisubs,ofer43211/unisubs,eloquence/unisubs,ReachingOut/unisubs,ujdhesa/unisubs,norayr/unisubs,ofer43211/unisubs,ujdhesa/unisubs,wevoice/wesub,ReachingOut/unisubs,uj... | ---
+++
@@ -1,16 +1,13 @@
-import httplib2
+import requests
def url_exists(url):
- """Check that a url- when following redirection - exists.
+ """Check that a url (when following redirection) exists.
- This is needed because django's validators rely on python's urllib2
+ This is needed because Django... |
f529c9f5092262f9089ad51831a8545d8f8650fa | workers/subscriptions.py | workers/subscriptions.py | import os
import telegram
from leonard import Leonard
if __name__ == '__main__':
os.chdir('../')
telegram_client = telegram.Bot(os.environ['BOT_TOKEN'])
bot = Leonard(telegram_client)
i = 0
while True:
if i % 10 == 0:
bot.collect_plugins()
for name, check, send in bot.... | import os
import time
import telegram
from leonard import Leonard
if __name__ == '__main__':
os.chdir('../')
telegram_client = telegram.Bot(os.environ['BOT_TOKEN'])
bot = Leonard(telegram_client)
bot.collect_plugins()
while True:
for name, check, send in bot.subscriptions:
sen... | Remove collecting plugins every second | Remove collecting plugins every second
| Python | mit | sevazhidkov/leonard | ---
+++
@@ -1,4 +1,5 @@
import os
+import time
import telegram
@@ -8,10 +9,8 @@
os.chdir('../')
telegram_client = telegram.Bot(os.environ['BOT_TOKEN'])
bot = Leonard(telegram_client)
- i = 0
+ bot.collect_plugins()
while True:
- if i % 10 == 0:
- bot.collect_plugins()... |
038bc954ed63db6df192de50483f218b037c2438 | searchlight/cmd/listener.py | searchlight/cmd/listener.py | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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 applica... | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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 applica... | Enable mutable config in searchlight | Enable mutable config in searchlight
New releases of oslo.config support a 'mutable' parameter to Opts.
oslo.service provides an option here Icec3e664f3fe72614e373b2938e8dee53cf8bc5e
allows services to tell oslo.service they want mutate_config_files to be
called by passing a parameter.
This commit is to use the same.... | Python | apache-2.0 | openstack/searchlight,openstack/searchlight,openstack/searchlight | ---
+++
@@ -26,7 +26,7 @@
def main():
service.prepare_service()
- launcher = os_service.ProcessLauncher(CONF)
+ launcher = os_service.ProcessLauncher(CONF, restart_method='mutate')
launcher.launch_service(
listener.ListenerService(),
workers=CONF.listener.workers) |
aed365f2f86090c22640c05e9fb2f821a6ab12a5 | minique_tests/conftest.py | minique_tests/conftest.py | import logging
import os
import pytest
from redis import Redis
from minique.utils import get_random_pronounceable_string
def pytest_configure() -> None:
logging.basicConfig(datefmt="%Y-%m-%d %H:%M:%S", level=logging.INFO)
@pytest.fixture()
def redis() -> Redis:
redis_url = os.environ.get("REDIS_URL")
... | import logging
import os
import pytest
from redis import Redis
from minique.utils import get_random_pronounceable_string
def pytest_configure() -> None:
logging.basicConfig(datefmt="%Y-%m-%d %H:%M:%S", level=logging.INFO)
@pytest.fixture(scope="session")
def redis_url() -> str:
url = os.environ.get("REDIS... | Make test fixtures more modular | Make test fixtures more modular
| Python | mit | valohai/minique | ---
+++
@@ -11,11 +11,16 @@
logging.basicConfig(datefmt="%Y-%m-%d %H:%M:%S", level=logging.INFO)
+@pytest.fixture(scope="session")
+def redis_url() -> str:
+ url = os.environ.get("REDIS_URL")
+ if not url: # pragma: no cover
+ pytest.skip("no REDIS_URL (required for redis fixture)")
+ return... |
b6f51e8873d1905da53027b73614f2eeb4c4ed3d | web/form/fields/validators.py | web/form/fields/validators.py | # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
from wtforms.validators import Optional
class OptionalIf(Optional):
# makes a field optional if some other... | # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
from wtforms.validators import Optional
class OptionalIf(Optional):
# makes a field optional if some other... | Add option to invert `OptionalIf` validator | Add option to invert `OptionalIf` validator
| Python | apache-2.0 | agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft | ---
+++
@@ -5,9 +5,10 @@
class OptionalIf(Optional):
- # makes a field optional if some other data is supplied
- def __init__(self, deciding_field, *args, **kwargs):
+ # makes a field optional if some other data is supplied or is not supplied
+ def __init__(self, deciding_field, invert=False, *args, ... |
1b31a86fcf5a449c67c20e4c971e6cb8b6bba126 | providers/org/ttu/apps.py | providers/org/ttu/apps.py | from share.provider import OAIProviderAppConfig
class AppConfig(OAIProviderAppConfig):
name = 'providers.org.ttu'
version = '0.0.1'
title = 'ttu'
long_title = 'Texas Tech Univeristy Libraries'
home_page = 'http://ttu-ir.tdl.org/'
url = 'http://ttu-ir.tdl.org/ttu-oai/request'
time_granulari... | from share.provider import OAIProviderAppConfig
class AppConfig(OAIProviderAppConfig):
name = 'providers.org.ttu'
version = '0.0.1'
title = 'ttu'
long_title = 'Texas Tech Univeristy Libraries'
home_page = 'http://ttu-ir.tdl.org/'
url = 'http://ttu-ir.tdl.org/ttu-oai/request'
time_granulari... | Add approved sets for Texas Tech | Add approved sets for Texas Tech
| Python | apache-2.0 | CenterForOpenScience/SHARE,aaxelb/SHARE,CenterForOpenScience/SHARE,CenterForOpenScience/SHARE,laurenbarker/SHARE,aaxelb/SHARE,laurenbarker/SHARE,zamattiac/SHARE,zamattiac/SHARE,aaxelb/SHARE,laurenbarker/SHARE,zamattiac/SHARE | ---
+++
@@ -9,3 +9,4 @@
home_page = 'http://ttu-ir.tdl.org/'
url = 'http://ttu-ir.tdl.org/ttu-oai/request'
time_granularity = False
+ approved_sets = ['col_2346_521', 'col_2346_469'] |
cad612fff70f89307cb4601e4dfca2c3b4a0b420 | test_suite.py | test_suite.py | import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
from django.core import management
apps = sys.argv[1:]
if not apps:
apps = [
'resources',
'forms',
'base',
]
management.call_command('test', *apps, interactive=False)
| import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
import django
if hasattr(django, 'setup'):
django.setup()
from django.core import management
apps = sys.argv[1:]
if not apps:
apps = [
'resources',
'forms',
'base',
]
management.call_command('test', *a... | Call setup() before testing on Django 1.7+ | Call setup() before testing on Django 1.7+
Signed-off-by: Don Naegely <e690a32c1e2176a2bfface09e204830e1b5491e3@gmail.com>
| Python | bsd-2-clause | chop-dbhi/serrano,chop-dbhi/serrano | ---
+++
@@ -2,6 +2,10 @@
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
+
+import django
+if hasattr(django, 'setup'):
+ django.setup()
from django.core import management
|
72fe5252a05f8afc8b2cc4e2f10a0572acb1a629 | wispy/tree.py | wispy/tree.py | """
wispy.tree
~~~~~~~~~~
Contains the AST nodes defined by *wispy*.
"""
# pylint: disable=no-init, too-few-public-methods, missing-docstring
class Node:
""" Base class for all CST nodes.
Exports a couple of attributes, which can be
find in any CST node:
* parent: the parent of this node... | """
wispy.tree
~~~~~~~~~~
Contains the AST nodes defined by *wispy*.
"""
# pylint: disable=no-init, too-few-public-methods, missing-docstring
# pylint: disable=protected-access
from inspect import Parameter as SignatureParameter, Signature
def make_signature(names):
""" Build a Signature object from... | Allow creating AST nodes using call syntax, through signatures. | Allow creating AST nodes using call syntax, through signatures.
By using Python 3's signatures, we can create AST nodes using
call syntax, as in Name(value=...). This also improves the
introspection.
| Python | apache-2.0 | RoPython/wispy | ---
+++
@@ -5,8 +5,43 @@
Contains the AST nodes defined by *wispy*.
"""
# pylint: disable=no-init, too-few-public-methods, missing-docstring
+# pylint: disable=protected-access
-class Node:
+from inspect import Parameter as SignatureParameter, Signature
+
+
+def make_signature(names):
+ """ Build a Signat... |
0c47a60185122dbea6ded2118305094d6917afb1 | tests/urls.py | tests/urls.py | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^edtf/', include('edtf.urls', namespace='edtf'))
]
| from django.conf.urls import include, url
urlpatterns = [
url(r'^edtf/', include('edtf.urls', namespace='edtf'))
]
| Remove admin site from test project. | Remove admin site from test project.
| Python | bsd-3-clause | unt-libraries/django-edtf,unt-libraries/django-edtf,unt-libraries/django-edtf | ---
+++
@@ -1,7 +1,5 @@
from django.conf.urls import include, url
-from django.contrib import admin
urlpatterns = [
- url(r'^admin/', admin.site.urls),
url(r'^edtf/', include('edtf.urls', namespace='edtf'))
] |
7a855a5cd09785a23061af1be13135ad23c4daf1 | runtests.py | runtests.py | #!/usr/bin/env python
import os
import sys
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
},
INSTALLED_APPS=(
... | #!/usr/bin/env python
import os
import sys
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
},
INSTALLED_APPS=(
... | Test with the default test runner for all Django versions. | Test with the default test runner for all Django versions.
| Python | bsd-2-clause | mlavin/django-selectable,affan2/django-selectable,mlavin/django-selectable,mlavin/django-selectable,affan2/django-selectable,affan2/django-selectable | ---
+++
@@ -19,7 +19,6 @@
SITE_ID=1,
SECRET_KEY='super-secret',
ROOT_URLCONF='selectable.tests.urls',
- TEST_RUNNER='django.test.simple.DjangoTestSuiteRunner',
)
|
e4f4ad313cb9d89114a1189861405148ef6f19ae | runtests.py | runtests.py | #!/usr/bin/env python
# Adapted from https://raw.githubusercontent.com/hzy/django-polarize/master/runtests.py
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
if not settings.configured:
settings.configure(
DATABASES={
'default': {
... | #!/usr/bin/env python
# Adapted from https://raw.githubusercontent.com/hzy/django-polarize/master/runtests.py
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
if not settings.configured:
settings.configure(
DATABASES={
'default': {
... | Update test config for django 1.11 | Update test config for django 1.11
| Python | bsd-3-clause | funkybob/django-flatblocks,funkybob/django-flatblocks | ---
+++
@@ -34,7 +34,10 @@
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
- 'debug': True
+ 'debug': True,
+ 'context_processors': [
+ 'django.contrib.auth.context_processors.auth',
+ ... |
0cd5deefc61f56351af24f6597a1509ea4b4b567 | settings.py | settings.py | import os
INTERVAL = int(os.environ.get('INTERVAL', 60))
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
AWS_REGION = os.environ.get('AWS_REGION', 'us-west-2')
ALERTS = os.environ['ALERTS']
ANALYTICS_KEY_NAME = os.environ['ANALYTICS_KEY_NAME']
FROM_EMAIL ... | import os
INTERVAL = int(os.environ.get('INTERVAL', 60))
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
AWS_REGION = os.environ.get('AWS_REGION', 'us-west-2')
ALERTS = os.environ['ALERTS']
ANALYTICS_KEY_NAME = os.environ['ANALYTICS_KEY_NAME']
FROM_EMAIL ... | Read log file from ENV and add full path for default | Read log file from ENV and add full path for default
| Python | mit | lorden/right-now-alerts | ---
+++
@@ -7,4 +7,5 @@
ALERTS = os.environ['ALERTS']
ANALYTICS_KEY_NAME = os.environ['ANALYTICS_KEY_NAME']
FROM_EMAIL = os.environ['FROM_EMAIL']
-LOG_FILE = 'rightnowalerts.log'
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+LOG_FILE = os.environ.get('LOG_FILE', BASE_DIR + '/rightnowaler... |
6c57f18e9f40f5dd54fc35ef2f34924ccc50ee76 | app/views.py | app/views.py | from app import app
from flask import render_template, request
from .looper import getNextLink
@app.route('/')
def index_page():
return render_template('index.html')
@app.route('/loop')
def loop_request():
link = request.args.get('link', '', type=str)
return getNextLink(link.strip())
| from app import app
from flask import render_template, request
from .looper import getNextLink
@app.route('/')
def index_page():
return render_template('index.html')
@app.route('/loop')
def loop_request():
if "unicode" in __builtins__:
str_type = unicode
else:
str_type = str
link = req... | Fix link being empty string in py2 if it's unicode | Fix link being empty string in py2 if it's unicode
Should fix any remaining Unicode errors.
| Python | mit | kartikanand/wikilooper,kartikanand/wikilooper,kartikanand/wikilooper | ---
+++
@@ -8,5 +8,9 @@
@app.route('/loop')
def loop_request():
- link = request.args.get('link', '', type=str)
+ if "unicode" in __builtins__:
+ str_type = unicode
+ else:
+ str_type = str
+ link = request.args.get('link', '', type=str_type)
return getNextLink(link.strip()) |
044b08b4097f5c1739ed8d212d1815edfc1468d1 | humbug/wsgi.py | humbug/wsgi.py | """
WSGI config for humbug project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | """
WSGI config for humbug project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | Remove more commented out example code | Remove more commented out example code
(imported from commit 83f7c8763d96af5341fe630d1d8be11eef1f33aa)
| Python | apache-2.0 | bowlofstew/zulip,EasonYi/zulip,so0k/zulip,jeffcao/zulip,babbage/zulip,souravbadami/zulip,krtkmj/zulip,Diptanshu8/zulip,sup95/zulip,easyfmxu/zulip,brockwhittaker/zulip,deer-hope/zulip,firstblade/zulip,esander91/zulip,johnny9/zulip,easyfmxu/zulip,peiwei/zulip,vaidap/zulip,lfranchi/zulip,Galexrt/zulip,guiquanz/zulip,dawra... | ---
+++
@@ -22,7 +22,3 @@
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
-
-# Apply WSGI middleware here.
-# from helloworld.wsgi import HelloWorldApplication
-# application = HelloWorldApplication(application) |
f96902bc16a4e3da7b85dd3d55371a6927dc0472 | src/office/views.py | src/office/views.py | from django.http import JsonResponse
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext_lazy as _
from graphene_django.views import GraphQLView
from rest_framework import status
from rest_framework.exceptions import APIException
from rest_framework_jwt.authentication impo... | from django.conf import settings
from django.http import JsonResponse
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext_lazy as _
from graphene_django.views import GraphQLView
from rest_framework import status
from rest_framework.exceptions import APIException
from rest_... | Fix for graphene ui on debug mode | Fix for graphene ui on debug mode
| Python | mit | wis-software/office-manager | ---
+++
@@ -1,3 +1,4 @@
+from django.conf import settings
from django.http import JsonResponse
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext_lazy as _
@@ -17,6 +18,9 @@
"""
def wrap(request, *args, **kwargs):
+ if settings.DEBUG:
+ ... |
10379c2210b39d507af61530c56c1dbfa8cf5307 | pbxplore/demo/__init__.py | pbxplore/demo/__init__.py | """
Demonstration files --- :mod:`pbxplore.demo`
============================================
PBxplore bundles a set of demonstration files. This module ease the access to
these files.
The path to the demonstration files is stored in :const:`DEMO_DATA_PATH`. This
constant can be accessed as :const:`pbxplore.demo.DEMO... | """
Demonstration files --- :mod:`pbxplore.demo`
============================================
PBxplore bundles a set of demonstration files. This module ease the access to
these files.
The path to the demonstration files is stored in :const:`DEMO_DATA_PATH`. This
constant can be accessed as :const:`pbxplore.demo.DEMO... | Add a function to list absolute path to demo files | Add a function to list absolute path to demo files
| Python | mit | jbarnoud/PBxplore,jbarnoud/PBxplore,pierrepo/PBxplore,HubLot/PBxplore,pierrepo/PBxplore,HubLot/PBxplore | ---
+++
@@ -10,9 +10,12 @@
:const:`pbxplore.DEMO_DATA_PATH`.
A list of the available demonstration files is available with the
-:func:`list_demo_files` function.
+:func:`list_demo_files` function. The same list with absolute path instead of
+file names is provided by :func:`list_demo_files_absolute`.
.. autofu... |
b7faf879e81df86e49ec47f1bcce1d6488f743b2 | medical_patient_species/tests/test_medical_patient_species.py | medical_patient_species/tests/test_medical_patient_species.py | # -*- coding: utf-8 -*-
# © 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
class TestMedicalPatientSpecies(TransactionCase):
def setUp(self):
super(TestMedicalPatientSpecies, self).setUp()
self.human = self.... | # -*- coding: utf-8 -*-
# © 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
from openerp.exceptions import Warning
class TestMedicalPatientSpecies(TransactionCase):
def setUp(self):
super(TestMedicalPatientSpecies, s... | Remove tests for is_person (default is False, human set to True in xml). Re-add test ensuring warning raised if trying to unlink Human. | [FIX] medical_patient_species: Remove tests for is_person (default is False, human set to True in xml).
Re-add test ensuring warning raised if trying to unlink Human.
| Python | agpl-3.0 | laslabs/vertical-medical,laslabs/vertical-medical | ---
+++
@@ -3,6 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
+from openerp.exceptions import Warning
class TestMedicalPatientSpecies(TransactionCase):
@@ -12,14 +13,7 @@
self.human = self.env.ref('medical_patient_specie... |
f9e1c2bd5976623bcebbb4b57fb011eb4d1737bc | support/appveyor-build.py | support/appveyor-build.py | #!/usr/bin/env python
# Build the project on AppVeyor.
import os
from download import Downloader
from subprocess import check_call
build = os.environ['BUILD']
cmake_command = ['cmake', '-DFMT_EXTRA_TESTS=ON', '-DCMAKE_BUILD_TYPE=' + os.environ['CONFIG']]
build_command = ['msbuild', '/m:4', '/p:Config=' + os.environ['... | #!/usr/bin/env python
# Build the project on AppVeyor.
import os
from subprocess import check_call
build = os.environ['BUILD']
config = os.environ['CONFIG']
cmake_command = ['cmake', '-DFMT_EXTRA_TESTS=ON', '-DCMAKE_BUILD_TYPE=' + config]
if build == 'mingw':
cmake_command.append('-GMinGW Makefiles')
build_comman... | Use preinstalled mingw on appveyor | Use preinstalled mingw on appveyor | Python | bsd-2-clause | lightslife/cppformat,blaquee/cppformat,mojoBrendan/fmt,alabuzhev/fmt,alabuzhev/fmt,wangshijin/cppformat,nelson4722/cppformat,cppformat/cppformat,cppformat/cppformat,alabuzhev/fmt,blaquee/cppformat,wangshijin/cppformat,Jopie64/cppformat,nelson4722/cppformat,lightslife/cppformat,cppformat/cppformat,seungrye/cppformat,Jop... | ---
+++
@@ -2,28 +2,18 @@
# Build the project on AppVeyor.
import os
-from download import Downloader
from subprocess import check_call
build = os.environ['BUILD']
-cmake_command = ['cmake', '-DFMT_EXTRA_TESTS=ON', '-DCMAKE_BUILD_TYPE=' + os.environ['CONFIG']]
-build_command = ['msbuild', '/m:4', '/p:Config='... |
c87b5f8392dc58d6fa1d5398245b4ffe9edb19c8 | praw/models/mod_action.py | praw/models/mod_action.py | """Provide the ModAction class."""
from typing import TYPE_CHECKING
from .base import PRAWBase
if TYPE_CHECKING: # pragma: no cover
from ... import praw
class ModAction(PRAWBase):
"""Represent a moderator action."""
@property
def mod(self) -> "praw.models.Redditor":
"""Return the :class:`.... | """Provide the ModAction class."""
from typing import TYPE_CHECKING, Union
from .base import PRAWBase
if TYPE_CHECKING: # pragma: no cover
from ... import praw
class ModAction(PRAWBase):
"""Represent a moderator action."""
@property
def mod(self) -> "praw.models.Redditor":
"""Return the :c... | Add str as a type for mod setter | Add str as a type for mod setter
| Python | bsd-2-clause | praw-dev/praw,praw-dev/praw | ---
+++
@@ -1,5 +1,5 @@
"""Provide the ModAction class."""
-from typing import TYPE_CHECKING
+from typing import TYPE_CHECKING, Union
from .base import PRAWBase
@@ -16,5 +16,5 @@
return self._reddit.redditor(self._mod) # pylint: disable=no-member
@mod.setter
- def mod(self, value: "praw.mode... |
b8e085c538b9eda06a831c78f55219ac4612a5da | model.py | model.py | import collections
LearningObject = collections.namedtuple(
'LearningObject',
['text', 'image'])
class Model(object):
def __init__(self, name):
self._name = name
self._objs = []
def add_object(self, text, image):
self._objs.append(LearningObject(text, image))
def write(self):
path = 'xml/... | import os
import collections
LearningObject = collections.namedtuple(
'LearningObject',
['text', 'image'])
class Model(object):
def __init__(self, name):
self._name = name
self._objs = []
def add_object(self, text, image):
self._objs.append(LearningObject(text, image))
def write(self):
if... | Make directory if it doesnt exist | Make directory if it doesnt exist
| Python | apache-2.0 | faskiri/google-drive-extract-images | ---
+++
@@ -1,3 +1,5 @@
+import os
+
import collections
LearningObject = collections.namedtuple(
@@ -12,7 +14,9 @@
def add_object(self, text, image):
self._objs.append(LearningObject(text, image))
- def write(self):
+ def write(self):
+ if not os.path.exists('xml'): os.mkdir('xml')
+
path = '... |
dd0405965f816a2a71bfb6d7a3f939691a6ab6d8 | ibmcnx/doc/DataSources.py | ibmcnx/doc/DataSources.py | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | Create documentation of DataSource Settings | 8: Create documentation of DataSource Settings
Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8 | Python | apache-2.0 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ---
+++
@@ -33,5 +33,5 @@
dsidlist.sort()
for dsid in dsidlist:
- print "AdminConfig.list( dsid ): "
- AdminConfig.showAttribute(dsid,"propertySet")
+ propertySet = AdminConfig.showAttribute(dsid,"propertySet")
+ propertyList = AdminConfig.list("J2EEResourceProperty", propertySet).splitlines() |
ba3655a8771978edcf73083446c47adafc677afc | bayesian_jobs/handlers/clean_postgres.py | bayesian_jobs/handlers/clean_postgres.py | from selinon import StoragePool
from cucoslib.models import WorkerResult, Analysis
from .base import BaseHandler
class CleanPostgres(BaseHandler):
""" Clean JSONB columns in Postgres """
def execute(self):
s3 = StoragePool.get_connected_storage('S3Data')
results = self.postgres.session.query... | from selinon import StoragePool
from cucoslib.models import WorkerResult, Analysis
from .base import BaseHandler
class CleanPostgres(BaseHandler):
""" Clean JSONB columns in Postgres """
def execute(self):
s3 = StoragePool.get_connected_storage('S3Data')
results = self.postgres.session.query... | Clean PostgreSQL - commit after each change not to keep state in memory | Clean PostgreSQL - commit after each change not to keep state in memory
| Python | apache-2.0 | fabric8-analytics/fabric8-analytics-jobs,fabric8-analytics/fabric8-analytics-jobs | ---
+++
@@ -31,4 +31,4 @@
entry.task_result = None
entry.error = True
- self.postgres.session.commit()
+ self.postgres.session.commit() |
bdd2570f9ba8963edb6fa1a57b3f0ad5b1703a13 | check_env.py | check_env.py | """ Run this file to check your python installation.
"""
from os.path import dirname, join
HERE = dirname(__file__)
def test_import_pandas():
import pandas
def test_pandas_version():
import pandas
version_found = pandas.__version__.split(".")
version_found = tuple(int(num) for num in version_found)
... | """ Run this file to check your python installation.
"""
from os.path import dirname, join
HERE = dirname(__file__)
def test_import_pandas():
import pandas
def test_pandas_version():
import pandas
version_found = pandas.__version__.split(".")
version_found = tuple(int(num) for num in version_found)
... | Fix path to test file. | Fix path to test file.
| Python | mit | jonathanrocher/pandas_tutorial,jonathanrocher/pandas_tutorial,jonathanrocher/pandas_tutorial | ---
+++
@@ -35,7 +35,7 @@
def test_read_html():
import pandas
- pandas.read_html(join(HERE, "demos", "climate_timeseries", "data",
+ pandas.read_html(join(HERE, "climate_timeseries", "data",
"sea_levels", "Obtaining Tide Gauge Data.html"))
|
cff7bb0fda7e126ce65701231cab0e67a5a2794c | endpoints.py | endpoints.py | import requests
class AlgoliaEndpoint(object):
"""Class used to call the Algolia API and parse the response."""
URL = "http://hn.algolia.com/api/v1/search_by_date"
@staticmethod
def get(tag, since, until=None, page=0):
"""Send a GET request to the endpoint.
Since Algolia only returns JSON, parse it... | import requests
class AlgoliaEndpoint(object):
"""Class used to call the Algolia API and parse the response."""
URL = "http://hn.algolia.com/api/v1/search_by_date"
@staticmethod
def get(tag, since, until=None, page=0):
"""Send a GET request to the endpoint.
Since Algolia only returns JSON, parse it... | Add Algolia API website in docstring. | Add Algolia API website in docstring.
| Python | bsd-2-clause | NiGhTTraX/hackernews-scraper | ---
+++
@@ -11,6 +11,8 @@
"""Send a GET request to the endpoint.
Since Algolia only returns JSON, parse it into a dict.
+
+ See http://hn.algolia.com/api for more details.
Params:
tag: Can be "story" or "comment". |
2718256bfbf57eba36c3f083dace32afbc101fd3 | python2/runner/writeln_decorator.py | python2/runner/writeln_decorator.py | #!/usr/bin/env python
# encoding: utf-8
import sys
import os
# Taken from legacy python unittest
class WritelnDecorator:
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self, stream):
self.stream = stream
def __getattr__(self, attr):
return getattr(sel... | #!/usr/bin/env python
# encoding: utf-8
import sys
import os
# Taken from legacy python unittest
class WritelnDecorator:
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self,stream):
self.stream = stream
def __getattr__(self, attr):
return getattr(self.... | Revert "PEP8: delete unused import" | Revert "PEP8: delete unused import"
This reverts commit ef48c713ec8686d1be3a66d8f41c498ae1361708.
| Python | mit | kjc/python_koans,erikld/Bobo,haroldtreen/python_koans,welenofsky/python_koans,EavesofIT/python_koans,bordeltabernacle/python_koans,gregmalcolm/python_koans,bohdan7/python_koans,Sam-Rowe/python-koans,Sam-Rowe/python-koans,PaulFranklin/python_koans,kimegitee/python-koans,kjc/python_koans,rameshugar/koans,PaulFranklin/pyt... | ---
+++
@@ -4,11 +4,10 @@
import sys
import os
-
# Taken from legacy python unittest
class WritelnDecorator:
"""Used to decorate file-like objects with a handy 'writeln' method"""
- def __init__(self, stream):
+ def __init__(self,stream):
self.stream = stream
def __getattr__(self, att... |
05e9c3e9c58732e68eacc0462f949c2525d670fe | tests/contrib/test_sqlalchemy_handler.py | tests/contrib/test_sqlalchemy_handler.py | # -*- coding: utf-8 -*-
import unittest
from flask.ext.sqlalchemy import SQLAlchemy
import flask_featureflags as feature_flags
from flask_featureflags.contrib.sqlalchemy import SQLAlchemyFeatureFlags
from tests.fixtures import app, feature_setup
db = SQLAlchemy(app)
SQLAlchemyHandler = SQLAlchemyFeatureFlags(db)
... | # -*- coding: utf-8 -*-
import unittest
from flask.ext.sqlalchemy import SQLAlchemy
import flask_featureflags as feature_flags
from flask_featureflags.contrib.sqlalchemy import SQLAlchemyFeatureFlags
from tests.fixtures import app, feature_setup
db = SQLAlchemy(app)
SQLAlchemyHandler = SQLAlchemyFeatureFlags(db)
... | Use add_handler instead of set handlers as a list. | Use add_handler instead of set handlers as a list.
| Python | apache-2.0 | jskulski/Flask-FeatureFlags,iromli/Flask-FeatureFlags,trustrachel/Flask-FeatureFlags | ---
+++
@@ -16,7 +16,7 @@
@classmethod
def setupClass(cls):
- feature_setup.handlers = [SQLAlchemyHandler]
+ feature_setup.add_handler(SQLAlchemyHandler)
@classmethod
def tearDownClass(cls): |
0e9acfe35396582f95c22994e061be871fdaf865 | tests/test_datapackage.py | tests/test_datapackage.py | import pytest
import datapackage
class TestDataPackage(object):
def test_schema(self):
descriptor = {}
schema = {'foo': 'bar'}
dp = datapackage.DataPackage(descriptor, schema=schema)
assert dp.schema.to_dict() == schema
def test_datapackage_attributes(self):
dp = datap... | import pytest
import datapackage
class TestDataPackage(object):
def test_init_uses_base_schema_by_default(self):
dp = datapackage.DataPackage()
assert dp.schema.title == 'DataPackage'
def test_schema(self):
descriptor = {}
schema = {'foo': 'bar'}
dp = datapackage.DataP... | Add tests to ensure DataPackage uses base schema by default | Add tests to ensure DataPackage uses base schema by default
| Python | mit | okfn/datapackage-model-py,sirex/datapackage-py,sirex/datapackage-py,okfn/datapackage-model-py,okfn/datapackage-py,datapackages/datapackage-py,datapackages/datapackage-py,okfn/datapackage-py | ---
+++
@@ -3,6 +3,10 @@
class TestDataPackage(object):
+ def test_init_uses_base_schema_by_default(self):
+ dp = datapackage.DataPackage()
+ assert dp.schema.title == 'DataPackage'
+
def test_schema(self):
descriptor = {}
schema = {'foo': 'bar'} |
cc17f806e3fcbc6974a9ee13be58585e681cc59a | jose/backends/__init__.py | jose/backends/__init__.py |
try:
from jose.backends.cryptography_backend import CryptographyRSAKey as RSAKey # noqa: F401
except ImportError:
try:
from jose.backends.pycrypto_backend import RSAKey # noqa: F401
except ImportError:
from jose.backends.rsa_backend import RSAKey # noqa: F401
try:
from jose.backends... |
try:
from jose.backends.cryptography_backend import CryptographyRSAKey as RSAKey # noqa: F401
except ImportError:
try:
from jose.backends.pycrypto_backend import RSAKey # noqa: F401
# time.clock was deprecated in python 3.3 in favor of time.perf_counter
# and removed in python 3.8. p... | Add fix for time.clock removal in 3.8 for pycrypto backend | Add fix for time.clock removal in 3.8 for pycrypto backend
| Python | mit | mpdavis/python-jose | ---
+++
@@ -4,6 +4,16 @@
except ImportError:
try:
from jose.backends.pycrypto_backend import RSAKey # noqa: F401
+
+ # time.clock was deprecated in python 3.3 in favor of time.perf_counter
+ # and removed in python 3.8. pycrypto was never updated for this. If
+ # time has no clock... |
abc95f3a10cd27ec67e982b187f7948d0dc83fe3 | corgi/sql.py | corgi/sql.py | from six.moves import configparser as CP
from sqlalchemy.engine.url import URL
from sqlalchemy.engine import create_engine
import os
import pandas as pd
def get_odbc_engine(name, odbc_filename='/etc/odbc.ini', database=None):
"""
Looks up the connection details in an odbc file and returns a SQLAlchemy engine i... | import os
from pathlib import Path
from six.moves import configparser as CP
import pandas as pd
from sqlalchemy.engine import create_engine
from sqlalchemy.engine.url import URL
home = str(Path.home())
def get_odbc_engine(name, odbc_filename=None, database=None):
"""
Looks up the connection details in an od... | Set the get_odbc_engine function to check etc, then user home for odbc file by default | Set the get_odbc_engine function to check etc, then user home for odbc file by default
| Python | mit | log0ymxm/corgi | ---
+++
@@ -1,16 +1,36 @@
+import os
+from pathlib import Path
+
from six.moves import configparser as CP
+
+import pandas as pd
+from sqlalchemy.engine import create_engine
from sqlalchemy.engine.url import URL
-from sqlalchemy.engine import create_engine
-import os
-import pandas as pd
-def get_odbc_engine(name... |
a46bc83eb16888e374f5f24080581818617539a2 | src/cards.py | src/cards.py | from random import seed as srand, randint
from time import time
srand(time())
class Card:
types = ("def", "atk")
limits = {"def": (1, 25), "atk": (1, 40)}
def __init__(self, type = None, value = None):
if type:
if not type in types:
print("ERROR: Invalid card type")
... | from random import seed as srand, randint
from time import time
srand(time())
class Card:
card_types = ("def", "atk")
card_limits = {"def": (1, 25), "atk": (1, 40)}
def __init__(self, card_type = None, card_value = None):
if card_type:
if not card_type in card_types:
p... | Change variable names to remove conflict with standard functions | Change variable names to remove conflict with standard functions
| Python | mit | TheUnderscores/card-fight-thingy | ---
+++
@@ -4,17 +4,18 @@
srand(time())
class Card:
- types = ("def", "atk")
- limits = {"def": (1, 25), "atk": (1, 40)}
+ card_types = ("def", "atk")
+ card_limits = {"def": (1, 25), "atk": (1, 40)}
- def __init__(self, type = None, value = None):
- if type:
- if not type in ty... |
063a655327cf0872e01170653604db6901d5aacd | pagebits/managers.py | pagebits/managers.py | from django.db import models
from django.core.cache import cache
from django.conf import settings
from .utils import bitgroup_cache_key
class BitGroupManager(models.Manager):
def get_group(self, slug):
""" Retrieve a group by slug, with caching """
key = bitgroup_cache_key(slug)
cached_g... | from django.db import models
from django.core.cache import cache
from django.conf import settings
from .utils import bitgroup_cache_key
class BitGroupManager(models.Manager):
def get_group(self, slug):
""" Retrieve a group by slug, with caching """
key = bitgroup_cache_key(slug)
cached_g... | Remove select related. Django 1.8 requires existing fields instead of ignoring missing ones. | Remove select related. Django 1.8 requires existing fields instead of ignoring missing ones.
| Python | bsd-3-clause | nngroup/django-pagebits,nngroup/django-pagebits | ---
+++
@@ -13,9 +13,8 @@
cached_group = cache.get(key)
if not cached_group:
- cached_group = self.get_queryset().select_related(
- 'bits',
- ).prefetch_related('bits__data').get(slug=slug)
+ cached_group = self.get_queryset() \
+ .pre... |
3c1f2c46485aee91dbf4c61b7b096c2cc4b28c06 | kcdc3/apps/pinata/urls.py | kcdc3/apps/pinata/urls.py | from django.conf.urls import patterns, include, url
from models import Page
urlpatterns = patterns('kcdc3.apps.pinata.views',
url(r'^$', 'page_view'),
url(r'^[0-9a-zA-Z_-]+/$', 'page_view'),
)
| from django.conf.urls import patterns, include, url
from models import Page
urlpatterns = patterns('kcdc3.apps.pinata.views',
url(r'^$', 'page_view'),
url(r'^[0-9a-zA-Z_-]+/$', 'page_view'),
url(r'^[0-9a-zA-Z_-]+/[0-9a-zA-Z_-]+/$', 'page_view'),
# Surely there's a better way to handle paths that contain several s... | Allow three-deep paths in Pinata | Allow three-deep paths in Pinata
| Python | mit | knowledgecommonsdc/kcdc3,knowledgecommonsdc/kcdc3,knowledgecommonsdc/kcdc3,knowledgecommonsdc/kcdc3,knowledgecommonsdc/kcdc3,knowledgecommonsdc/kcdc3 | ---
+++
@@ -5,5 +5,7 @@
url(r'^$', 'page_view'),
url(r'^[0-9a-zA-Z_-]+/$', 'page_view'),
+ url(r'^[0-9a-zA-Z_-]+/[0-9a-zA-Z_-]+/$', 'page_view'),
+ # Surely there's a better way to handle paths that contain several slashes
) |
65d3e588606f533b2d2934bf52439e586a01f2b4 | pdc/settings_test.py | pdc/settings_test.py | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
"""
Extra Django settings for test environment of pdc project.
"""
from settings import *
# Database settings
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'te... | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
"""
Extra Django settings for test environment of pdc project.
"""
from settings import *
# Database settings
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'te... | Use persistent test DB (--keepdb can skip migrations) | Use persistent test DB (--keepdb can skip migrations)
By default test database is in-memory (':memory:'), i.e. not saved on
disk, making it impossible to skip migrations to quickly re-run tests
with '--keepdb' argument.
| Python | mit | release-engineering/product-definition-center,release-engineering/product-definition-center,product-definition-center/product-definition-center,product-definition-center/product-definition-center,product-definition-center/product-definition-center,product-definition-center/product-definition-center,release-engineering/... | ---
+++
@@ -15,10 +15,7 @@
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.sqlite3',
- 'USER': '',
- 'PASSWORD': '',
- 'HOST': '',
- 'PORT': '',
+ 'TEST': {'NAME': 'test.sqlite3'},
}
}
|
0610628771df849119e6ed316dfa0f8107d8fe6e | src/WaveBlocksND/Utils.py | src/WaveBlocksND/Utils.py | """The WaveBlocks Project
Various small utility functions.
@author: R. Bourquin
@copyright: Copyright (C) 2012 R. Bourquin
@license: Modified BSD License
"""
from numpy import squeeze, asarray
def meshgrid_nd(arrays):
"""Like 'meshgrid()' but for arbitrary number of dimensions.
"""
arrays = tuple(map(s... | """The WaveBlocks Project
Various small utility functions.
@author: R. Bourquin
@copyright: Copyright (C) 2012, 2013 R. Bourquin
@license: Modified BSD License
"""
from numpy import squeeze, asarray, atleast_1d
def meshgrid_nd(arrays):
"""Like 'meshgrid()' but for arbitrary number of dimensions.
:param ar... | Allow 0-dimensional arrays for tensor meshgrids | Allow 0-dimensional arrays for tensor meshgrids
| Python | bsd-3-clause | WaveBlocks/WaveBlocksND,WaveBlocks/WaveBlocksND | ---
+++
@@ -3,22 +3,25 @@
Various small utility functions.
@author: R. Bourquin
-@copyright: Copyright (C) 2012 R. Bourquin
+@copyright: Copyright (C) 2012, 2013 R. Bourquin
@license: Modified BSD License
"""
-from numpy import squeeze, asarray
+from numpy import squeeze, asarray, atleast_1d
def meshgrid... |
fb9999b8dfcbc67da3a14ecbfed8fcd5676c0ea3 | akhet/demo/subscribers.py | akhet/demo/subscribers.py | from akhet.urlgenerator import URLGenerator
import pyramid.threadlocal as threadlocal
from pyramid.exceptions import ConfigurationError
from .lib import helpers
def includeme(config):
"""Configure all application-specific subscribers."""
config.add_subscriber(create_url_generator, "pyramid.events.ContextFound... | from akhet.urlgenerator import URLGenerator
import pyramid.threadlocal as threadlocal
from pyramid.exceptions import ConfigurationError
from .lib import helpers
def includeme(config):
"""Configure all application-specific subscribers."""
config.add_subscriber(create_url_generator, "pyramid.events.ContextFound... | Add renderer global 'r' as alias for 'request'. | Add renderer global 'r' as alias for 'request'.
| Python | mit | Pylons/akhet,Pylons/akhet,hlwsmith/akhet,hlwsmith/akhet,hlwsmith/akhet | ---
+++
@@ -30,6 +30,7 @@
request = event.get("request") or threadlocal.get_current_request()
if not request:
return
+ renderer_globals["r"] = request
#renderer_globals["c"] = request.tmpl_context
#try:
# renderer_globals["session"] = request.session |
c5c92c852d27fb370e4efdc631caf38ebcfdd8ba | tests/GIR/test_query_select.py | tests/GIR/test_query_select.py | # coding=utf-8
import sys
import struct
import unittest
from test_000_config import TestConfig
from test_001_connection import TestConnection
from gi.repository import Midgard
from gi.repository import GObject
class TestQuerySelect(unittest.TestCase):
def testSelectAdminPerson(self):
mgd = TestConnection.openC... | # coding=utf-8
import sys
import struct
import unittest
from test_000_config import TestConfig
from test_001_connection import TestConnection
from gi.repository import Midgard
from gi.repository import GObject
class TestQuerySelect(unittest.TestCase):
def setUp(self):
self.mgd = TestConnection.openConnection()... | Set MidgardConnection in setUp method | Set MidgardConnection in setUp method
| Python | lgpl-2.1 | piotras/midgard-core,piotras/midgard-core,midgardproject/midgard-core,midgardproject/midgard-core,midgardproject/midgard-core,midgardproject/midgard-core,piotras/midgard-core,piotras/midgard-core | ---
+++
@@ -10,19 +10,23 @@
from gi.repository import GObject
class TestQuerySelect(unittest.TestCase):
+ def setUp(self):
+ self.mgd = TestConnection.openConnection()
+
+ def tearDown(self):
+ return
+
def testSelectAdminPerson(self):
- mgd = TestConnection.openConnection()
st = Midgard.QueryS... |
264b7f26b872f4307c70cf6c68d84fdce620f5bb | utils/CIndex/completion_logger_server.py | utils/CIndex/completion_logger_server.py | #!/usr/bin/env python
import sys
from socket import *
from time import localtime, strftime
def main():
if len(sys.argv) < 4:
print "completion_logger_server.py <listen address> <listen port> <log file>"
exit(1)
host = sys.argv[1]
port = int(sys.argv[2])
buf = 1024 * 8
addr = (host,port)
# Creat... | #!/usr/bin/env python
import sys
from socket import *
from time import localtime, strftime
def main():
if len(sys.argv) < 4:
print "completion_logger_server.py <listen address> <listen port> <log file>"
exit(1)
host = sys.argv[1]
port = int(sys.argv[2])
buf = 1024 * 8
addr = (host,port)
# Creat... | Include sender address in completion log. | Include sender address in completion log.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@101358 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-cl... | ---
+++
@@ -29,8 +29,10 @@
break
else:
f.write(strftime("'%a, %d %b %Y %H:%M:%S' ", localtime()))
+ f.write("'{0}' ".format(addr[0]))
f.write(data)
f.write('\n')
+ f.flush()
# Close socket
UDPSock.close() |
d623b9904e4fa1967d8f83b45d39c9b57d2a4b0e | DDSP/Header.py | DDSP/Header.py | # The Header class contains the data structure of the Header class, and methods includes encapsulate, and decapsulate.
import struct
import random
from MessageType import MessageType
class Header:
"""docstring for Header"""
def __init__(self, type = MessageType.undefined):
self.type = type
sel... | # The Header class contains the data structure of the Header class, and methods includes encapsulate, and decapsulate.
import struct
import random
from MessageType import MessageType
class Header:
"""docstring for Header"""
def __init__(self, type = MessageType.undefined):
self.version = 1
sel... | Add a version field into the header. | Add a version field into the header.
| Python | mit | CharKwayTeow/ddsp | ---
+++
@@ -7,18 +7,20 @@
class Header:
"""docstring for Header"""
def __init__(self, type = MessageType.undefined):
+ self.version = 1
self.type = type
self.length = 0
self.port = 0
def encapsulate(self):
- return struct.pack("!BHH", self.type, self.length, ... |
9a850232e187080222e7d245c65264e9b3484ee8 | tests/test_git_mongo.py | tests/test_git_mongo.py | from unittest import TestCase
from datetime import datetime
from citools.mongo import get_database_connection
from citools.git import get_last_revision
class TestLastStoreRetrieval(TestCase):
def setUp(self):
TestCase.setUp(self)
self.db = get_database_connection(database="test_citools")
... | from unittest import TestCase
from datetime import datetime
from citools.mongo import get_database_connection
from citools.git import get_last_revision
from helpers import MongoTestCase
class TestLastStoreRetrieval(MongoTestCase):
def setUp(self):
super(TestLastStoreRetrieval, self).setUp()
sel... | Use MongoTestCase when we have it... | Use MongoTestCase when we have it...
| Python | bsd-3-clause | ella/citools,ella/citools | ---
+++
@@ -5,12 +5,13 @@
from citools.mongo import get_database_connection
from citools.git import get_last_revision
-class TestLastStoreRetrieval(TestCase):
+from helpers import MongoTestCase
+
+class TestLastStoreRetrieval(MongoTestCase):
def setUp(self):
- TestCase.setUp(self)
- self.db =... |
70138da1fa6a28d0e7b7fdf80ab894236c0f5583 | tests/test_tokenizer.py | tests/test_tokenizer.py | import unittest
from cobe.tokenizer import MegaHALTokenizer
class testMegaHALTokenizer(unittest.TestCase):
def setUp(self):
self.tokenizer = MegaHALTokenizer()
def testSplitEmpty(self):
self.assertEquals(len(self.tokenizer.split("")), 0)
def testSplitSentence(self):
words = self.... | import unittest
from cobe.tokenizer import MegaHALTokenizer
class testMegaHALTokenizer(unittest.TestCase):
def setUp(self):
self.tokenizer = MegaHALTokenizer()
def testSplitEmpty(self):
self.assertEquals(len(self.tokenizer.split("")), 0)
def testSplitSentence(self):
words = self.... | Make all the tokenizer unit tests assertEquals() on arrays | Make all the tokenizer unit tests assertEquals() on arrays
| Python | mit | LeMagnesium/cobe,tiagochiavericosta/cobe,pteichman/cobe,wodim/cobe-ng,meska/cobe,wodim/cobe-ng,meska/cobe,tiagochiavericosta/cobe,DarkMio/cobe,DarkMio/cobe,pteichman/cobe,LeMagnesium/cobe | ---
+++
@@ -11,35 +11,19 @@
def testSplitSentence(self):
words = self.tokenizer.split("hi.")
- self.assertEquals(len(words), 2)
- self.assertEquals(words[0], "HI")
- self.assertEquals(words[1], ".")
+ self.assertEquals(words, ["HI", "."])
def testSplitComma(self):
... |
5ccf3753882c6cbde98923fe535857afca4a7187 | webapp/calendars/forms.py | webapp/calendars/forms.py | from django import forms
from django.contrib.admin import widgets
from .models import Event
class LoginForm(forms.Form):
username = forms.CharField()
password = forms.CharField(widget=forms.PasswordInput())
class EventForm(forms.ModelForm):
class Meta:
model = Event
fields = (
... | from django import forms
from django.contrib.admin import widgets
from .models import Event
class LoginForm(forms.Form):
username = forms.CharField(label='Nazwa użytkownika');
password = forms.CharField(label='Hasło', widget=forms.PasswordInput())
class EventForm(forms.ModelForm):
class Meta:
mo... | Use Polish lables in login form. | Use Polish lables in login form.
Signed-off-by: Mariusz Fik <e22610367d206dca7aa58af34ebf008b556228c5@fidano.pl>
| Python | agpl-3.0 | Fisiu/calendar-oswiecim,Fisiu/calendar-oswiecim,hackerspace-silesia/calendar-oswiecim,firemark/calendar-oswiecim,firemark/calendar-oswiecim,hackerspace-silesia/calendar-oswiecim,firemark/calendar-oswiecim,hackerspace-silesia/calendar-oswiecim,Fisiu/calendar-oswiecim | ---
+++
@@ -4,8 +4,8 @@
class LoginForm(forms.Form):
- username = forms.CharField()
- password = forms.CharField(widget=forms.PasswordInput())
+ username = forms.CharField(label='Nazwa użytkownika');
+ password = forms.CharField(label='Hasło', widget=forms.PasswordInput())
class EventForm(forms.... |
c15875062be2b59c78fca9a224b0231986a37868 | feincms3/templatetags/feincms3_renderer.py | feincms3/templatetags/feincms3_renderer.py | from django import template
from django.utils.html import mark_safe
register = template.Library()
@register.simple_tag(takes_context=True)
def render_plugin(context, plugin):
"""
Render a single plugin. See :mod:`feincms3.renderer` for additional
details.
"""
return context['renderer'].render_plu... | from django import template
from django.utils.html import mark_safe
register = template.Library()
@register.simple_tag(takes_context=True)
def render_plugin(context, plugin):
"""
Render a single plugin. See :mod:`feincms3.renderer` for additional
details.
In general you should prefer
:func:`~fei... | Add note to render_plugin[s] that render_region should be preferred | Add note to render_plugin[s] that render_region should be preferred
| Python | bsd-3-clause | matthiask/feincms3,matthiask/feincms3,matthiask/feincms3 | ---
+++
@@ -9,6 +9,10 @@
"""
Render a single plugin. See :mod:`feincms3.renderer` for additional
details.
+
+ In general you should prefer
+ :func:`~feincms3.templatetags.feincms3_renderer.render_region` over this
+ tag.
"""
return context['renderer'].render_plugin_in_context(plugin,... |
f11f482688d6374a7771c40ce48f4f743cc98b9b | storage_service/common/apps.py | storage_service/common/apps.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.apps import AppConfig
class CommonAppConfig(AppConfig):
name = "common"
def ready(self):
import common.signals # noqa: F401
| # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.apps import AppConfig
from prometheus_client import Info
from storage_service import __version__
version_info = Info("version", "Archivematica Storage Service version info")
class CommonAppConfig(AppConfig):
name = "common"
def re... | Include application version info metric | Include application version info metric
| Python | agpl-3.0 | artefactual/archivematica-storage-service,artefactual/archivematica-storage-service,artefactual/archivematica-storage-service,artefactual/archivematica-storage-service | ---
+++
@@ -2,6 +2,12 @@
from __future__ import absolute_import
from django.apps import AppConfig
+from prometheus_client import Info
+
+from storage_service import __version__
+
+
+version_info = Info("version", "Archivematica Storage Service version info")
class CommonAppConfig(AppConfig):
@@ -9,3 +15,4 @@... |
fe5a980dd36c24008efe8e4900a675b568e5fb9d | setup.py | setup.py | from distutils.core import setup
setup(
name='ohmysportsfeedspy',
packages=['ohmysportsfeedspy'],
version='0.1.2',
author = ['Brad Barkhouse', 'MySportsFeeds'],
author_email='brad.barkhouse@mysportsfeeds.com',
url='https://github.com/MySportsFeeds/mysportsfeeds-python',
license='MIT',
d... | from distutils.core import setup
setup(
name='ohmysportsfeedspy',
packages=['ohmysportsfeedspy'],
version='0.1.3',
author = ['Brad Barkhouse', 'MySportsFeeds'],
author_email='brad.barkhouse@mysportsfeeds.com',
url='https://github.com/MySportsFeeds/mysportsfeeds-python',
license='MIT',
d... | Increment patch version to match submission to PyPI for pip install. | Increment patch version to match submission to PyPI for pip install.
| Python | mit | MySportsFeeds/mysportsfeeds-python | ---
+++
@@ -3,7 +3,7 @@
setup(
name='ohmysportsfeedspy',
packages=['ohmysportsfeedspy'],
- version='0.1.2',
+ version='0.1.3',
author = ['Brad Barkhouse', 'MySportsFeeds'],
author_email='brad.barkhouse@mysportsfeeds.com',
url='https://github.com/MySportsFeeds/mysportsfeeds-python', |
91550be5f866cd53bdff019f1be02af00a20a3e0 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='lightstep',
version='4.1.0',
description='LightStep Python OpenTracing Implementation',
long_description='',
author='LightStep',
license='',
install_requires=['thrift>=0.10.0,<0.12.0',
'jsonpickle',
... | from setuptools import setup, find_packages
setup(
name='lightstep',
version='4.1.0',
description='LightStep Python OpenTracing Implementation',
long_description='',
author='LightStep',
license='',
install_requires=['thrift>=0.10.0,<0.12.0',
'jsonpickle',
... | Enable latest version of basictracer | Enable latest version of basictracer | Python | mit | lightstephq/lightstep-tracer-python | ---
+++
@@ -10,7 +10,7 @@
install_requires=['thrift>=0.10.0,<0.12.0',
'jsonpickle',
'six',
- 'basictracer>=3.0,<3.1',
+ 'basictracer>=3.0,<4',
'googleapis-common-protos>=1.5.3,<2.0',
... |
327b4558d77256dd45f0e32be014960eb66734ff | setup.py | setup.py | from setuptools import find_packages, setup
from dichalcogenides import __version__
with open('README.rst', 'r') as f:
long_description = f.read()
setup(
name='dichalcogenides',
version=__version__,
author='Evan Sosenko',
author_email='razorx@evansosenko.com',
packages=find_packages(exclude=[... | import os
import re
from setuptools import find_packages, setup
from dichalcogenides import __version__
with open('README.rst', 'r') as f:
long_description = f.read()
if os.environ.get('READTHEDOCS') == 'True':
mocked = ['numpy', 'scipy']
mock_filter = lambda x: re.sub(r'>.+', '', x) not in mocked
else:
... | Remove mocked dependencies for readthedocs | Remove mocked dependencies for readthedocs
| Python | mit | razor-x/dichalcogenides | ---
+++
@@ -1,9 +1,17 @@
+import os
+import re
from setuptools import find_packages, setup
from dichalcogenides import __version__
with open('README.rst', 'r') as f:
long_description = f.read()
+
+if os.environ.get('READTHEDOCS') == 'True':
+ mocked = ['numpy', 'scipy']
+ mock_filter = lambda x: re.... |
94ed3cdb5234a79bc754c54721f41eaeec51b846 | setup.py | setup.py | from distutils.core import setup
from setuptools import find_packages
setup(name="django-image-cropping",
version="0.6.4",
description="A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
author="jonasvp",
author_email="jvp@jonasun... | from distutils.core import setup
from setuptools import find_packages
setup(name="django-image-cropping",
version="0.6.4",
description="A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
author="jonasvp",
author_email="jvp@jonasun... | Set Development Status to "Stable" | Set Development Status to "Stable"
| Python | bsd-3-clause | winzard/django-image-cropping,henriquechehad/django-image-cropping,winzard/django-image-cropping,henriquechehad/django-image-cropping,henriquechehad/django-image-cropping,winzard/django-image-cropping | ---
+++
@@ -15,7 +15,7 @@
],
test_suite='example.runtests.runtests',
classifiers=[
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers', |
682c02b01775a443ce17aa5ea9805e5be6fd120b | setup.py | setup.py | import os
from setuptools import setup, find_packages
def read(filename):
full_path = os.path.join(os.path.dirname(__file__), filename)
with open(full_path) as fd:
return fd.read()
setup(
name='nymms',
version='0.4.2',
author='Michael Barrett',
author_email='loki77@gmail.com',
lic... | import os
from setuptools import setup, find_packages
import glob
src_dir = os.path.dirname(__file__)
def read(filename):
full_path = os.path.join(src_dir, filename)
with open(full_path) as fd:
return fd.read()
setup(
name='nymms',
version='0.2.1',
author='Michael Barrett',
author_em... | Fix versioning and add scripts directory | Fix versioning and add scripts directory
| Python | bsd-2-clause | cloudtools/nymms | ---
+++
@@ -1,15 +1,18 @@
import os
from setuptools import setup, find_packages
+import glob
+
+src_dir = os.path.dirname(__file__)
def read(filename):
- full_path = os.path.join(os.path.dirname(__file__), filename)
+ full_path = os.path.join(src_dir, filename)
with open(full_path) as fd:
ret... |
b1fc016fa56ffc801659f6ba2d807694529cfa57 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from setuptools import setup
setup(
name = 'TracMasterTickets',
version = '2.1.1',
packages = ['mastertickets'],
package_data = { 'mastertickets': ['templates/*.html', 'htdocs/*.js', 'htdocs/*.css' ] },
author = "Noah Kantrowitz",
author_emai... | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from setuptools import setup
setup(
name = 'TracMasterTickets',
version = '2.1.1',
packages = ['mastertickets'],
package_data = { 'mastertickets': ['templates/*.html', 'htdocs/*.js', 'htdocs/*.css' ] },
author = "Noah Kantrowitz",
author_emai... | Change my email to avoid Yahoo, which decided to brake my scraper script recently. | Change my email to avoid Yahoo, which decided to brake my scraper script recently. | Python | bsd-3-clause | SpamExperts/trac-masterticketsplugin,SpamExperts/trac-masterticketsplugin,SpamExperts/trac-masterticketsplugin | ---
+++
@@ -10,7 +10,7 @@
package_data = { 'mastertickets': ['templates/*.html', 'htdocs/*.js', 'htdocs/*.css' ] },
author = "Noah Kantrowitz",
- author_email = "coderanger@yahoo.com",
+ author_email = "noah@coderanger.net",
description = "Provides support for ticket dependencies and master tic... |
0e97763d49f449a9f0399ef1fded9e6c5997d8b0 | setup.py | setup.py | from setuptools import setup
setup(
name="sbq",
packages=["sbq"],
version="0.2.0",
description="Low-dependency package for automating bigquery queries.",
author="Colin Fuller",
author_email="colin@khanacademy.org",
url="github.com/cjfuller/sbq",
keywords=["bigquery"],
classifiers=[
... | from setuptools import setup
setup(
name="sbq",
packages=["sbq"],
version="0.2.0",
description="Low-dependency package for automating bigquery queries.",
author="Colin Fuller",
author_email="colin@khanacademy.org",
url="https://github.com/cjfuller/sbq",
keywords=["bigquery"],
classif... | Add a protocol to the url | Add a protocol to the url
| Python | mit | cjfuller/sbq | ---
+++
@@ -6,7 +6,7 @@
description="Low-dependency package for automating bigquery queries.",
author="Colin Fuller",
author_email="colin@khanacademy.org",
- url="github.com/cjfuller/sbq",
+ url="https://github.com/cjfuller/sbq",
keywords=["bigquery"],
classifiers=[
"Programmin... |
6e3d80d13864510cf2def7a20660a40daa793e5e | setup.py | setup.py | from setuptools import setup, find_packages
import journal
setup(
name = 'journal',
version = journal.__version__,
author = journal.__author__,
author... | from setuptools import setup, find_packages
import journal
setup(
name = 'journal',
version = journal.__version__,
author = journal.__author__,
author... | Add argparse as install requirement for 2.5/2.6 systems | Add argparse as install requirement for 2.5/2.6 systems
| Python | mit | askedrelic/journal | ---
+++
@@ -13,9 +13,10 @@
url = 'https://github.com/askedrelic/journal',
packages = find_packages(),
-test_suite = 'tests',
entry_points = """
[console_scripts]
-journal = journal.main:main"""
+journal = journal.main:main""",
+
+install_requires = ['argparse'],
)
|
721089bfa4fb6316344b41355a1a0bf9611e96a4 | setup.py | setup.py | # Haze
#
# Author: Joe Block <jpb@unixorn.net>
# License: Apache 2.0
from setuptools import setup, find_packages
name = "haze"
requirements = map(str.strip, open("requirements.txt").readlines())
setup(
name = name,
description = "Haze AWS utility functions",
packages = find_packages(),
version = "0.0.4",
d... | # Haze
#
# Author: Joe Block <jpb@unixorn.net>
# License: Apache 2.0
from setuptools import setup, find_packages
name = "haze"
requirements = map(str.strip, open("requirements.txt").readlines())
setup(
name = name,
author = "Joe Block",
author_email = "jpb@unixorn.net",
description = "Haze AWS utility functi... | Add author, author_email & url to make pypi happy | Add author, author_email & url to make pypi happy
| Python | apache-2.0 | unixorn/haze | ---
+++
@@ -10,10 +10,13 @@
setup(
name = name,
+ author = "Joe Block",
+ author_email = "jpb@unixorn.net",
description = "Haze AWS utility functions",
+ url = "https://github.com/unixorn/haze",
packages = find_packages(),
- version = "0.0.4",
- download_url = 'https://github.com/unixorn/haze/tarball... |
254bea654189dea4ce6d20c981670b775e2f4318 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
# TODO: put package requirements here
]
test_requirement... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
# TODO: put package requirements here
]
test_requirement... | Add tests. For exclude packages | Add tests. For exclude packages
| Python | mit | CloudHeads/lambda_utils | ---
+++
@@ -25,7 +25,10 @@
author="Cloudheads",
author_email='theguys@cloudheads.io',
url='https://github.com/CloudHeads/lambda_utils',
- packages=find_packages(exclude=('tests', )),
+ packages=find_packages(exclude=[
+ "tests",
+ "tests.*",
+ ]),
package_dir={'lambda_utils'... |
5610f1eaea6f7e2c72c823c9cf2f29b423ce1209 | setup.py | setup.py | import setuptools
REQUIREMENTS = [
"nose==1.3.0",
"python-dateutil==1.5",
]
if __name__ == "__main__":
setuptools.setup(
name="jsond",
version="0.0.1",
author="EDITD",
author_email="engineering@editd.com",
packages=setuptools.find_packages(),
scripts=[],
... | import setuptools
REQUIREMENTS = [
"nose==1.3.0",
"python-dateutil==1.5",
]
if __name__ == "__main__":
setuptools.setup(
name="jsond",
version="1.0.0",
author="EDITD",
author_email="engineering@editd.com",
packages=setuptools.find_packages(),
scripts=[],
... | Make the leap to v1 | Make the leap to v1
| Python | mit | EDITD/jsond | ---
+++
@@ -10,7 +10,7 @@
if __name__ == "__main__":
setuptools.setup(
name="jsond",
- version="0.0.1",
+ version="1.0.0",
author="EDITD",
author_email="engineering@editd.com",
packages=setuptools.find_packages(), |
15d0e080225586f06044a25dec485a5ebb65b799 | setup.py | setup.py | #!/usr/bin/python2.6
"""Setup file for r53."""
__author__ = 'memory@blank.org'
from setuptools import setup
setup(
name='r53',
version='0.1',
description='Command line script to synchronize Amazon Route53 DNS data.',
package_dir={'': 'src'},
install_requires=[
'boto',
'lxml',
... | #!/usr/bin/python2.6
"""Setup file for r53."""
__author__ = 'memory@blank.org'
from setuptools import setup
setup(
name='r53',
version='0.1',
description='Command line script to synchronize Amazon Route53 DNS data.',
package_dir={'': 'src'},
packages=['r53'],
install_requires=[
'boto'... | Add missing package declaration to distutils | Add missing package declaration to distutils
Through easy_install and pip, the r53 package is not included (just missing).
Declare it here so it will be included and prevent this:
[jed@js route53]$ r53
Traceback (most recent call last):
File /usr/local/bin/r53, line 9, in <module>
load_entry_point('r53==0.1', '... | Python | mit | coops/r53 | ---
+++
@@ -10,6 +10,7 @@
version='0.1',
description='Command line script to synchronize Amazon Route53 DNS data.',
package_dir={'': 'src'},
+ packages=['r53'],
install_requires=[
'boto',
'lxml', |
9df7efa09e5d27ef0b238b6f4091e99d63fadd82 | setup.py | setup.py | #!/usr/bin/env python2.6
import setuptools
setuptools.setup(
name='clicast',
version='0.4.5',
author='Max Zheng',
author_email='maxzheng.os @t gmail.com',
description=open('README.rst').read(),
entry_points={
'console_scripts': [
'cast = clicast.editor:cast',
],
},
install_requires=... | #!/usr/bin/env python2.6
import setuptools
setuptools.setup(
name='clicast',
version='0.4.5',
author='Max Zheng',
author_email='maxzheng.os @t gmail.com',
description='Broadcast messages for CLI tools, such as a warning for critical bug or notification about new features.',
long_description=open('READM... | Add long description / url | Add long description / url
| Python | mit | maxzheng/clicast | ---
+++
@@ -10,7 +10,10 @@
author='Max Zheng',
author_email='maxzheng.os @t gmail.com',
- description=open('README.rst').read(),
+ description='Broadcast messages for CLI tools, such as a warning for critical bug or notification about new features.',
+ long_description=open('README.rst').read(),
+
+ url='... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.