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 |
|---|---|---|---|---|---|---|---|---|---|---|
cc4be37ef6d1ed2b8d89f14a051514d56f05b43b | setup.py | setup.py | #!/usr/bin/env python
# coding=utf-8
__author__ = 'kulakov.ilya@gmail.com'
from setuptools import setup
setup(name="Power",
version="1.0",
description="Cross-platform system power status information.",
author="Ilya Kulakov",
author_email="kulakov.ilya@gmail.com",
url="https://github.com/Kentzo/Po... | #!/usr/bin/env python
# coding=utf-8
__author__ = 'kulakov.ilya@gmail.com'
from setuptools import setup
setup(name="Power",
version="1.0",
description="Cross-platform system power status information.",
author="Ilya Kulakov",
author_email="kulakov.ilya@gmail.com",
url="https://github.com/Kentzo/Po... | Fix wrong install requirement name. | Fix wrong install requirement name.
| Python | mit | Kentzo/Power | ---
+++
@@ -23,5 +23,5 @@
'Topic :: System :: Hardware',
'Topic :: System :: Monitoring'
],
- install_requires=['pyobjc-core == 2.3.2a0']
+ install_requires=['pyobjc == 2.3']
) |
6fd24b15375f836c591c435ce1ded9dc96dc24f5 | setup.py | setup.py | import os
from setuptools import setup
# Utility function to read the README file.
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "seqfile",
version = "0.0.1",
author = "Utkarsh Upadhyay",
author_email = "musical... | import os
from setuptools import setup
# Utility function to read the README file.
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "seqfile",
version = "0.0.1",
author = "Utkarsh Upadhyay",
author_email = "musical... | Include natsort as a dependency for tests. | Include natsort as a dependency for tests.
| Python | mit | musically-ut/seqfile | ---
+++
@@ -15,6 +15,8 @@
keywords = "file threadsafe sequence",
url = "https://github.com/musically-ut/seqfile",
packages = ['seqfile'],
+ setup_requires = ['nose>=1.0', 'natsort>=3.5.6'],
+ test_suite = 'nose.collector',
long_description = read('README.... |
58433fad565aaf4889f0c5144fc3b4694a61b896 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = "sanitize",
version = "0.33",
description = "bringing sanitiy to world of messed-up data",
author = "Aaron Swartz",
author_email = "me@aaronsw.com",
url='http://www.aaronsw.com/2002/sanitize/',
license=open('LICENCE').read(),
classifiers... | from setuptools import setup, find_packages
setup(
name = "sanitize",
version = "0.33",
description = "Bringing sanitiy to world of messed-up data",
author = "Aaron Swartz",
author_email = "me@aaronsw.com",
url='http://www.aaronsw.com/2002/sanitize/',
license=open('LICENCE').read(),
classifiers... | Make the first word of the package description capital | Make the first word of the package description capital
| Python | bsd-2-clause | Alir3z4/python-sanitize | ---
+++
@@ -3,7 +3,7 @@
setup(
name = "sanitize",
version = "0.33",
- description = "bringing sanitiy to world of messed-up data",
+ description = "Bringing sanitiy to world of messed-up data",
author = "Aaron Swartz",
author_email = "me@aaronsw.com",
url='http://www.aaronsw.com/2002/sanitize... |
6e0f2880c80150a71cc719ff652f1bfbde08a1fa | setup.py | setup.py | from setuptools import setup
try:
import ez_setup
ez_setup.use_setuptools()
except ImportError:
pass
setup(
name = "django-tsearch2",
version = "0.2",
packages = ['tsearch2', 'tsearch2.management', 'tsearch2.management.commands'],
author = "Henrique Carvalho Alves",
author_email = "hca... | from setuptools import setup
setup(
name = "django-tsearch2",
version = "0.2",
packages = ['tsearch2', 'tsearch2.management', 'tsearch2.management.commands'],
zip_safe = False,
author = "Henrique Carvalho Alves",
author_email = "hcarvalhoalves@gmail.com",
description = "TSearch2 support for... | Mark as zip_safe = False | Mark as zip_safe = False
| Python | bsd-3-clause | hcarvalhoalves/django-tsearch2 | ---
+++
@@ -1,15 +1,10 @@
from setuptools import setup
-try:
- import ez_setup
- ez_setup.use_setuptools()
-except ImportError:
- pass
-
setup(
name = "django-tsearch2",
version = "0.2",
packages = ['tsearch2', 'tsearch2.management', 'tsearch2.management.commands'],
+ zip_safe = False,
... |
600eef6ae431ad0b0e555832b3405be9d11ad8b6 | setup.py | setup.py | #!/usr/bin/env python
import sys
from setuptools import setup, find_packages
from exam import __version__
try:
import multiprocessing
except ImportError:
pass
install_requires = []
lint_requires = ['pep8', 'pyflakes']
tests_require = ['mock', 'nose', 'unittest2', 'describe==1.0.0beta1']
dependency_links = ... | #!/usr/bin/env python
import sys
from setuptools import setup, find_packages
from exam import __version__
try:
import multiprocessing
except ImportError:
pass
install_requires = ['mock']
lint_requires = ['pep8', 'pyflakes']
tests_require = ['nose', 'unittest2', 'describe==1.0.0beta1']
dependency_links = [
... | Declare mock as a requiement. | Declare mock as a requiement.
| Python | mit | gterzian/exam,Fluxx/exam,Fluxx/exam,gterzian/exam | ---
+++
@@ -10,9 +10,9 @@
except ImportError:
pass
-install_requires = []
+install_requires = ['mock']
lint_requires = ['pep8', 'pyflakes']
-tests_require = ['mock', 'nose', 'unittest2', 'describe==1.0.0beta1']
+tests_require = ['nose', 'unittest2', 'describe==1.0.0beta1']
dependency_links = [
'https... |
5acdff299ae3e65a0ab804d4d6ff3e058f6a3227 | setup.py | setup.py | import sys
from setuptools import setup, find_packages
setup(
name='chillin-server',
version='1.4.0',
description='Chillin AI Game Framework (Python Server)',
long_description='',
author='Koala',
author_email='mdan.hagh@gmail.com',
url='https://github.com/koala-team/Chillin-PyServer',
... | import sys
from setuptools import setup, find_packages
setup(
name='chillin-server',
version='1.4.0',
description='Chillin AI Game Framework (Python Server)',
long_description='',
author='Koala',
author_email='mdan.hagh@gmail.com',
url='https://github.com/koala-team/Chillin-PyServer',
... | Change koala-serializer version to 0.6.3 | Change koala-serializer version to 0.6.3
| Python | agpl-3.0 | koala-team/Chillin-PyServer | ---
+++
@@ -27,7 +27,7 @@
install_requires=[
'circuits==3.2',
'pydblite==3.0.4',
- 'koala-serializer==0.6.2',
+ 'koala-serializer==0.6.3',
'configparser==3.5.0',
'enum34==1.1.6'
], |
c451e87115bae4da01dd4c0ca3611433ee573220 | setup.py | setup.py | from setuptools import setup
setup(
name = 'taskcat',
packages = ['taskcat'],
description = 'An OpenSource Cloudformation Deployment Framework',
author = 'Tony Vattathil',
author_email = 'avattathil@gmail.com',
url = 'https://github.com/avattathil/taskcat.io',
version = '0.1.3',
download_url = 'https://github.com/avatt... | from setuptools import setup
setup(
name = 'taskcat',
packages = ['taskcat'],
description = 'An OpenSource Cloudformation Deployment Framework',
author = 'Tony Vattathil',
author_email = 'tonynv@amazon.com',
url = 'https://aws-quickstart.github.io/taskcat/',
version = '0.1.7',
download_url = 'https://github.com/aws-qui... | Update email in pip package | Update email in pip package
| Python | apache-2.0 | aws-quickstart/taskcat,aws-quickstart/taskcat,aws-quickstart/taskcat | ---
+++
@@ -4,10 +4,10 @@
packages = ['taskcat'],
description = 'An OpenSource Cloudformation Deployment Framework',
author = 'Tony Vattathil',
-author_email = 'avattathil@gmail.com',
-url = 'https://github.com/avattathil/taskcat.io',
-version = '0.1.3',
-download_url = 'https://github.com/avattathil/taskcat.io/ar... |
5e38dda82bfc2f9f59fb591a9dde6ab52929d62e | setup.py | setup.py | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
tests_require = []
setup(
name='Mule',
version='1.0',
author='DISQUS',
author_email='opensource@d... | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
import os.path
tests_require = []
setup(
name='Mule',
version='1.0',
author='DISQUS',
author_emai... | Use absolute path on find packages | Use absolute path on find packages
| Python | apache-2.0 | disqus/mule | ---
+++
@@ -7,8 +7,9 @@
use_setuptools()
from setuptools import setup, find_packages
+import os.path
+
tests_require = []
-
setup(
name='Mule',
version='1.0',
@@ -16,7 +17,7 @@
author_email='opensource@disqus.com',
url='http://github.com/disqus/mule',
description = 'Utilities fo... |
33691c04db2eb039a090bd85a811f3eaf80f315d | setup.py | setup.py |
import os
from setuptools import setup, find_packages
setup(
name = 'temps',
version = '0.1',
license = 'MIT',
description = 'Context managers for creating and cleaning up temporary directories and files.',
long_description = open(os.path.join(os.path.dirname(__file__),
... |
import os
from setuptools import setup, find_packages
setup(
name = 'temps',
version = '0.1.0',
license = 'MIT',
description = 'Context managers for creating and cleaning up temporary directories and files.',
long_description = open(os.path.join(os.path.dirname(__file__),
... | Use standard 3-part version number. | Use standard 3-part version number.
| Python | mit | todddeluca/temps | ---
+++
@@ -4,7 +4,7 @@
setup(
name = 'temps',
- version = '0.1',
+ version = '0.1.0',
license = 'MIT',
description = 'Context managers for creating and cleaning up temporary directories and files.',
long_description = open(os.path.join(os.path.dirname(__file__), |
67b8b26309f82130ab808ee6be5ede7260162b3b | setup.py | setup.py | import os
from setuptools import setup
version_file = open(os.path.join(os.path.dirname(__file__), 'VERSION'))
version = version_file.read().strip()
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
setup(
name='canvas_python_sdk',
version=version,
description='A python sdk for th... | import os
from setuptools import setup, find_packages
version_file = open(os.path.join(os.path.dirname(__file__), 'VERSION'))
version = version_file.read().strip()
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
setup(
name='canvas_python_sdk',
version=version,
description='A py... | Use find_packages helper to get everything except for tests. Add sphinx as an installation requirement. | Use find_packages helper to get everything except for tests. Add sphinx as an installation requirement.
| Python | mit | penzance/canvas_python_sdk | ---
+++
@@ -1,5 +1,5 @@
import os
-from setuptools import setup
+from setuptools import setup, find_packages
version_file = open(os.path.join(os.path.dirname(__file__), 'VERSION'))
version = version_file.read().strip()
@@ -12,7 +12,7 @@
author='Harvard University',
author_email='some_email_tbd@Harvard.... |
2c3dbcaaa4eee9b2d48670fe0db5094044eb49af | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
from glob import glob
from dh_syncserver import version
etcpath = "/etc"
setup(name='dh_syncserver',
version=version,
description='DenyHosts Synchronisation Server',
author='Jan-Pascal van Best',
author_email='janpascal@vanbest.org',
ur... | #!/usr/bin/env python
from setuptools import setup
from glob import glob
from dh_syncserver import version
etcpath = "/etc"
setup(name='dh_syncserver',
version=version,
description='DenyHosts Synchronisation Server',
author='Jan-Pascal van Best',
author_email='janpascal@vanbest.org',
ur... | Install static files, templates and docs | Install static files, templates and docs
| Python | agpl-3.0 | sergey-dryabzhinsky/denyhosts_sync,sergey-dryabzhinsky/denyhosts_sync,janpascal/denyhosts_sync,janpascal/denyhosts_sync,sergey-dryabzhinsky/denyhosts_sync,janpascal/denyhosts_sync | ---
+++
@@ -16,6 +16,11 @@
install_requires=["Twisted", "twistar", "ipaddr", "jinja2", "pygal", "GeoIP"],
scripts=['scripts/dh_syncserver'],
data_files=[
+ ('static/js', glob('static/js/*.js')),
+ ('static/css', glob('static/css/*.css')),
+ ('static/graph', glob('static/graph... |
c25297735f38d1e2a6ddb6878f919d192f9faedd | GcodeParser.py | GcodeParser.py | #!/usr/bin/env python
# coding=UTF-8
"""Module containing Gcode parsing functions"""
__author__ = "Dylan Armitage"
__email__ = "d.armitage89@gmail.com"
####---- Imports ----####
from pygcode import Line, GCodeLinearMove
def bounding_box(gcode_file):
"""Take in file of gcode, return dict of max and min bounding ... | #!/usr/bin/env python
# coding=UTF-8
"""Module containing Gcode parsing functions"""
__author__ = "Dylan Armitage"
__email__ = "d.armitage89@gmail.com"
####---- Imports ----####
from pygcode import Line, GCodeLinearMove
def bounding_box(gcode_file):
"""Take in file of gcode, return dict of max and min bounding ... | ADD function to return box gcode | ADD function to return box gcode
| Python | mit | RootAccessHackerspace/k40-laser-scripts,RootAccessHackerspace/k40-laser-scripts | ---
+++
@@ -15,7 +15,15 @@
def box_gcode(min_xy, max_xy):
"""Take in min/max coordinate tuples, return G0 commands to bound it"""
- raise NotImplemented
+ gcode = []
+ gcode.append(GCodeLinearMove(X=min_xy[0], Y=min_xy[1]))
+ gcode.append(GCodeLinearMove(X=max_xy[0], Y=min_xy[1]))
+ gcode.appen... |
dce5c6f7f7cfd2b7384aba5d887700bb90ab2e39 | app/timetables/admin.py | app/timetables/admin.py | from django.contrib import admin
from . import models
admin.site.register(models.Weekday)
admin.site.register(models.Meal)
admin.site.register(models.MealOption)
admin.site.register(models.Course)
admin.site.register(models.Timetable)
admin.site.register(models.Dish)
admin.site.register(models.Admin)
| from django.contrib import admin
from . import models
admin.site.register(models.Weekday)
admin.site.register(models.Meal)
admin.site.register(models.MealOption)
admin.site.register(models.Course)
admin.site.register(models.Timetable)
admin.site.register(models.Dish)
admin.site.register(models.Admin)
| Add extra space below ending of import | Add extra space below ending of import
| Python | mit | teamtaverna/core | ---
+++
@@ -1,6 +1,7 @@
from django.contrib import admin
from . import models
+
admin.site.register(models.Weekday)
admin.site.register(models.Meal) |
3bd2c8c48d81c22ca38b2c7a32ef9007eb8e2a8f | project/app/main.py | project/app/main.py | # -*- coding: utf-8 -*-
"""WSGI app setup."""
import os
import sys
if 'lib' not in sys.path:
# Add lib as primary libraries directory, with fallback to lib/dist
# and optionally to lib/dist.zip, loaded using zipimport.
sys.path[0:0] = ['lib', 'lib/dist', 'lib/dist.zip']
from tipfy import Tipfy
from config... | # -*- coding: utf-8 -*-
"""WSGI app setup."""
import os
import sys
if 'lib' not in sys.path:
# Add lib as primary libraries directory, with fallback to lib/dist
# and optionally to lib/dist.zip, loaded using zipimport.
sys.path[0:0] = ['lib', 'lib/dist', 'lib/dist.zip']
from tipfy import Tipfy
from config... | Enable appstats by default in dev too. | Enable appstats by default in dev too.
| Python | bsd-3-clause | pombreda/tipfy,adilhz/tipfy,google-code-export/tipfy,pombreda/tipfy,google-code-export/tipfy,google-code-export/tipfy,adilhz/tipfy,pombreda/tipfy | ---
+++
@@ -15,10 +15,8 @@
def enable_appstats(app):
"""Enables appstats middleware."""
- if debug:
- return
-
- from google.appengine.ext.appstats.recording import appstats_wsgi_middleware
+ from google.appengine.ext.appstats.recording import \
+ appstats_wsgi_middleware
app.wsgi_... |
b3362c05032b66592b8592ccb94a3ec3f10f815f | project/urls.py | project/urls.py | # Django
from django.conf.urls import (
include,
url,
)
from django.contrib import admin
from django.http import HttpResponse
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^api/', include('apps.api.urls')),
url(r'^api-auth/', include('rest_framework.urls')),
url(r'^robots.txt$', lambd... | # Django
from django.conf.urls import (
include,
url,
)
from django.contrib import admin
from django.http import HttpResponse
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^api/', include('apps.api.urls')),
url(r'... | Add media server to dev server | Add media server to dev server
| Python | bsd-2-clause | dbinetti/barberscore-django,barberscore/barberscore-api,dbinetti/barberscore,dbinetti/barberscore,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api | ---
+++
@@ -5,10 +5,12 @@
)
from django.contrib import admin
from django.http import HttpResponse
+from django.conf import settings
+from django.conf.urls.static import static
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^api/', include('apps.api.urls')),
url(r'^api-auth/', include('re... |
d730eb0c0df2fb6784f7adcce479c4c9588764b9 | spacy/ja/__init__.py | spacy/ja/__init__.py | # encoding: utf8
from __future__ import unicode_literals, print_function
from os import path
from ..language import Language
from ..attrs import LANG
from ..tokens import Doc
from .language_data import *
class Japanese(Language):
lang = 'ja'
def make_doc(self, text):
from janome.tokenizer import T... | # encoding: utf8
from __future__ import unicode_literals, print_function
from os import path
from ..language import Language
from ..attrs import LANG
from ..tokens import Doc
from .language_data import *
class Japanese(Language):
lang = 'ja'
def make_doc(self, text):
try:
from janome.t... | Raise custom ImportError if importing janome fails | Raise custom ImportError if importing janome fails | Python | mit | raphael0202/spaCy,recognai/spaCy,explosion/spaCy,Gregory-Howard/spaCy,recognai/spaCy,spacy-io/spaCy,recognai/spaCy,aikramer2/spaCy,Gregory-Howard/spaCy,honnibal/spaCy,recognai/spaCy,raphael0202/spaCy,explosion/spaCy,Gregory-Howard/spaCy,raphael0202/spaCy,aikramer2/spaCy,spacy-io/spaCy,Gregory-Howard/spaCy,raphael0202/s... | ---
+++
@@ -14,6 +14,9 @@
lang = 'ja'
def make_doc(self, text):
- from janome.tokenizer import Tokenizer
+ try:
+ from janome.tokenizer import Tokenizer
+ except ImportError:
+ raise ImportError("The Japanese tokenizer requires the Janome library: https://github.... |
f1dafecbafdb7dee7da5a5dea8a56b8b30e0fe1e | documents/urls.py | documents/urls.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
import documents.views
urlpatterns = [
url(r"^upload/(?P<slug>[^/]*)$",
documents.views.upload_file,
name="document_put"),
url(r"^multiple_upload/(?P<slug>[^/]*)$",
documents.views.upload_... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
import documents.views
urlpatterns = [
url(r"^upload/(?P<slug>[^/]*)$",
documents.views.upload_file,
name="document_put"),
url(r"^multiple_upload/(?P<slug>[^/]*)$",
documents.views.upload_... | Fix an url and use a callable instead of a string | Fix an url and use a callable instead of a string
| Python | agpl-3.0 | UrLab/DocHub,UrLab/DocHub,UrLab/beta402,UrLab/beta402,UrLab/beta402,UrLab/DocHub,UrLab/DocHub | ---
+++
@@ -18,7 +18,7 @@
name="document_edit"),
url(r"^(?P<pk>[^/]*)/reupload$",
- 'documents.views.document_reupload',
+ documents.views.document_reupload,
name="document_reupload"),
url(r"^(?P<pk>[^/]*)/download$", |
223872a6f894b429b3784365fe50e139e649d233 | chempy/electrochemistry/nernst.py | chempy/electrochemistry/nernst.py | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
import math
def nernst_potential(ion_conc_out, ion_conc_in, charge, T, constants=None, units=None):
"""
Calculates the Nernst potential using the Nernst equation for a particular
ion.
Parameters
----------
... | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
import math
def nernst_potential(ion_conc_out, ion_conc_in, charge, T,
constants=None, units=None, backend=math):
"""
Calculates the Nernst potential using the Nernst equation for a particular
i... | Add keyword arg for backend for log | Add keyword arg for backend for log
Can be used to switch out math module with other modules, ex. sympy for
symbolic answers
| Python | bsd-2-clause | bjodah/aqchem,bjodah/aqchem,bjodah/chempy,bjodah/chempy,bjodah/aqchem | ---
+++
@@ -3,7 +3,8 @@
import math
-def nernst_potential(ion_conc_out, ion_conc_in, charge, T, constants=None, units=None):
+def nernst_potential(ion_conc_out, ion_conc_in, charge, T,
+ constants=None, units=None, backend=math):
"""
Calculates the Nernst potential using the Nernst ... |
5ea19da9fdd797963a7b7f1f2fd8f7163200b4bc | easy_maps/conf.py | easy_maps/conf.py | # -*- coding: utf-8 -*-
import warnings
from django.conf import settings # pylint: disable=W0611
from appconf import AppConf
class EasyMapsSettings(AppConf):
CENTER = (-41.3, 32)
GEOCODE = 'easy_maps.geocode.google_v3'
ZOOM = 16 # See https://developers.google.com/maps/documentation/javascript/tutori... | # -*- coding: utf-8 -*-
import warnings
from django.conf import settings # pylint: disable=W0611
from appconf import AppConf
class EasyMapsSettings(AppConf):
CENTER = (-41.3, 32)
GEOCODE = 'easy_maps.geocode.google_v3'
ZOOM = 16 # See https://developers.google.com/maps/documentation/javascript/tutori... | Check is EASY_MAPS_GOOGLE_MAPS_API_KEY is not None before raising warning. | Check is EASY_MAPS_GOOGLE_MAPS_API_KEY is not None before raising warning.
| Python | mit | kmike/django-easy-maps,kmike/django-easy-maps,bashu/django-easy-maps,bashu/django-easy-maps | ---
+++
@@ -21,5 +21,5 @@
prefix = 'easy_maps'
holder = 'easy_maps.conf.settings'
-if hasattr(settings, 'EASY_MAPS_GOOGLE_MAPS_API_KEY'):
+if settings.EASY_MAPS_GOOGLE_MAPS_API_KEY is not None:
warnings.warn("EASY_MAPS_GOOGLE_MAPS_API_KEY is deprecated, use EASY_MAPS_GOOGLE_KEY", DeprecationW... |
2d74b55a0c110a836190af819b55673bce2300a0 | gaphor/ui/macosshim.py | gaphor/ui/macosshim.py | try:
import gi
gi.require_version("GtkosxApplication", "1.0")
except ValueError:
macos_init = None
else:
from gi.repository import GtkosxApplication
macos_app = GtkosxApplication.Application.get()
def open_file(macos_app, path, application):
if path == __file__:
return Fal... | try:
import gi
from gi.repository import Gtk
if Gtk.get_major_version() == 3:
gi.require_version("GtkosxApplication", "1.0")
else:
raise ValueError()
except ValueError:
macos_init = None
else:
from gi.repository import GtkosxApplication
macos_app = GtkosxApplication.Applica... | Fix macos shim for gtk 4 | Fix macos shim for gtk 4
| Python | lgpl-2.1 | amolenaar/gaphor,amolenaar/gaphor | ---
+++
@@ -1,7 +1,11 @@
try:
import gi
+ from gi.repository import Gtk
- gi.require_version("GtkosxApplication", "1.0")
+ if Gtk.get_major_version() == 3:
+ gi.require_version("GtkosxApplication", "1.0")
+ else:
+ raise ValueError()
except ValueError:
macos_init = None
else: |
4e3042ed2e76ab3563cfd0f53a20b82d9ec545c3 | masters/master.client.skia/master_site_config.py | masters/master.client.skia/master_site_config.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class Skia(Master.Master3):
project_name = 'Skia'
master_port = 8053
slave_port ... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class Skia(Master.Master3):
project_name = 'Skia'
master_port = 8084
slave_port ... | Change Skia ports again, again. | Change Skia ports again, again.
BUG=skia:761
Review URL: https://codereview.chromium.org/413273002
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@285363 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | ---
+++
@@ -10,9 +10,9 @@
class Skia(Master.Master3):
project_name = 'Skia'
- master_port = 8053
- slave_port = 8153
- master_port_alt = 8253
+ master_port = 8084
+ slave_port = 8184
+ master_port_alt = 8284
repo_url = 'https://skia.googlesource.com/skia.git'
production_host = None
is_production_... |
4a84fe0c774638b7a00d37864b6d634200512f99 | tests.py | tests.py | import unittest
from stacklogger import srcfile
class TestUtils(unittest.TestCase):
def test_srcfile(self):
self.assertTrue(srcfile("foo.py").endswith("foo.py"))
self.assertTrue(srcfile("foo.pyc").endswith("foo.py"))
self.assertTrue(srcfile("foo.pyo").endswith("foo.py"))
self.... | import inspect
import unittest
from stacklogger import srcfile
currentframe = inspect.currentframe
class FakeFrames(object):
def fake_method(self):
return currentframe()
@property
def fake_property(self):
return currentframe()
@classmethod
def fake_classmethod(cls):
... | Build fake frames for later testing. | Build fake frames for later testing.
| Python | isc | whilp/stacklogger | ---
+++
@@ -1,6 +1,29 @@
+import inspect
import unittest
from stacklogger import srcfile
+
+currentframe = inspect.currentframe
+
+class FakeFrames(object):
+
+ def fake_method(self):
+ return currentframe()
+
+ @property
+ def fake_property(self):
+ return currentframe()
+
+ @cl... |
40ece09df1d757af55a306e99d03f045fc23ac95 | git_update/__main__.py | git_update/__main__.py | #!/usr/bin/env python
"""Script for updating a directory of repositories."""
import logging
import os
import click
from .actions import update_repo
@click.command()
@click.option('-d', '--debug', help='Set DEBUG level logging.', is_flag=True)
@click.argument('dir', default='.')
def main(**kwargs):
"""Update rep... | #!/usr/bin/env python
"""Script for updating a directory of repositories."""
import logging
import os
import click
from .actions import update_repo
def set_logging(ctx, param, value):
"""Set logging level based on how many verbose flags."""
logging_level = (logging.root.getEffectiveLevel() - value * 10) or ... | Change to multiple verbose option | fix: Change to multiple verbose option
| Python | mit | e4r7hbug/git_update | ---
+++
@@ -8,8 +8,14 @@
from .actions import update_repo
+def set_logging(ctx, param, value):
+ """Set logging level based on how many verbose flags."""
+ logging_level = (logging.root.getEffectiveLevel() - value * 10) or 1
+ logging.basicConfig(level=logging_level, format='[%(levelname)s] %(name)s:%(f... |
4b485e601b4410561ee4b4a681e392f4d141a339 | runtests.py | runtests.py | #!/usr/bin/env python
import sys
import django
from django.conf import settings
if not settings.configured:
settings.configure(
AUTHENTICATION_BACKENDS=(
'django_authgroupex.auth.AuthGroupeXBackend',
),
DATABASES={
'default': {
'ENGINE': 'django.db.... | #!/usr/bin/env python
import sys
import django
from django.conf import settings
if not settings.configured:
settings.configure(
AUTHENTICATION_BACKENDS=(
'django_authgroupex.auth.AuthGroupeXBackend',
),
DATABASES={
'default': {
'ENGINE': 'django.db.... | Configure MIDDLEWARE_CLASSES in test settings | Configure MIDDLEWARE_CLASSES in test settings
Django 1.7 complained:
(1_7.W001) MIDDLEWARE_CLASSES is not set.
HINT: Django 1.7 changed the global defaults for the
MIDDLEWARE_CLASSES.
django.contrib.sessions.middleware.SessionMiddleware,
django.contrib.auth.middleware.AuthenticationMiddleware, and
... | Python | bsd-2-clause | Polytechnique-org/django-authgroupex | ---
+++
@@ -27,7 +27,8 @@
SITE_ID=1,
SECRET_KEY='this-is-just-for-tests-so-not-that-secret',
TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner',
- AUTHGROUPEX_LOGIN_REDIRECT_URL='/login-success/'
+ AUTHGROUPEX_LOGIN_REDIRECT_URL='/login-success/',
+ MIDDLEWARE_CLA... |
98be6419eed3dd6d0f056acbb31850291827ed46 | doc/make_version.py | doc/make_version.py |
print """
Version Info
============
To obtain version info::
from scan.version import __version__, version_history
print __version__
print version_history
"""
from scan.version import __version__, version_history
print "Version history::"
for line in version_history.splitlines():
print (" " + line... |
print """
Version Info
============
To obtain version info::
from scan.version import __version__, version_history
print __version__
print version_history
"""
import sys
sys.path.append("..")
from scan.version import __version__, version_history
print "Version history::"
for line in version_history.spli... | Include version detail in doc | Include version detail in doc
| Python | epl-1.0 | PythonScanClient/PyScanClient,PythonScanClient/PyScanClient | ---
+++
@@ -11,6 +11,8 @@
print version_history
"""
+import sys
+sys.path.append("..")
from scan.version import __version__, version_history
print "Version history::" |
48b1cfaadd7642706a576d8ba9bf38c297a2d873 | runtests.py | runtests.py | #!/usr/bin/env python
import django
from django.conf import settings
from django.core.management import call_command
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ALLOWED_HOSTS=[
'testserver',
],
INSTALLED_APPS=[
... | #!/usr/bin/env python
import django
from django.conf import settings
from django.core.management import call_command
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ALLOWED_HOSTS=[
'testserver',
],
INSTALLED_APPS=[
... | Add MIDDLEWARE_CLASSES to test settings | Add MIDDLEWARE_CLASSES to test settings
Squelches a warning when using Django 1.7.
| Python | mit | PSU-OIT-ARC/django-perms,wylee/django-perms | ---
+++
@@ -18,6 +18,7 @@
'permissions',
'permissions.tests',
],
+ MIDDLEWARE_CLASSES=[],
ROOT_URLCONF='permissions.tests.urls',
TEST_RUNNER='django_nose.NoseTestSuiteRunner'
) |
eba6e117c0a13b49219bb60e773f896b274b6601 | tests/_support/configs/collection.py | tests/_support/configs/collection.py | from spec import eq_
from invoke import ctask, Collection
@ctask
def collection(c):
c.run('false') # Ensures a kaboom if mocking fails
ns = Collection(collection)
ns.configure({'run': {'echo': True}})
| from spec import eq_
from invoke import ctask, Collection
@ctask
def go(c):
c.run('false') # Ensures a kaboom if mocking fails
ns = Collection(go)
ns.configure({'run': {'echo': True}})
| Fix test fixture to match earlier test change | Fix test fixture to match earlier test change
| Python | bsd-2-clause | singingwolfboy/invoke,kejbaly2/invoke,tyewang/invoke,frol/invoke,mattrobenolt/invoke,mkusz/invoke,pfmoore/invoke,mkusz/invoke,pyinvoke/invoke,kejbaly2/invoke,pfmoore/invoke,sophacles/invoke,frol/invoke,pyinvoke/invoke,mattrobenolt/invoke | ---
+++
@@ -4,9 +4,9 @@
@ctask
-def collection(c):
+def go(c):
c.run('false') # Ensures a kaboom if mocking fails
-ns = Collection(collection)
+ns = Collection(go)
ns.configure({'run': {'echo': True}}) |
c31c54624d7a46dfd9df96e32d2e07246868aecc | tomviz/python/DefaultITKTransform.py | tomviz/python/DefaultITKTransform.py | def transform_scalars(dataset):
"""Define this method for Python operators that
transform the input array."""
from tomviz import utils
import numpy as np
import itk
# Get the current volume as a numpy array.
array = utils.get_array(dataset)
# Set up some ITK variables
itk_image_typ... | import tomviz.operators
class DefaultITKTransform(tomviz.operators.CancelableOperator):
def transform_scalars(self, dataset):
"""Define this method for Python operators that transform the input
array. This example uses an ITK filter to add 10 to each voxel value."""
# Try imports to make... | Change the ITK example to use a simpler ITK filter | Change the ITK example to use a simpler ITK filter
| Python | bsd-3-clause | cjh1/tomviz,cryos/tomviz,mathturtle/tomviz,OpenChemistry/tomviz,cjh1/tomviz,thewtex/tomviz,thewtex/tomviz,cryos/tomviz,mathturtle/tomviz,thewtex/tomviz,cjh1/tomviz,cryos/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,mathturtle/tomviz | ---
+++
@@ -1,33 +1,55 @@
-def transform_scalars(dataset):
- """Define this method for Python operators that
- transform the input array."""
- from tomviz import utils
- import numpy as np
- import itk
+import tomviz.operators
- # Get the current volume as a numpy array.
- array = utils.get_arr... |
8d8b122ecbb306bb53de4ee350104e7627e8b362 | app/app/__init__.py | app/app/__init__.py | import os
from pyramid.config import Configurator
from sqlalchemy import engine_from_config
from .models import DBSession, Base
def main(global_config, **settings):
'''This function returns a Pyramid WSGI application.'''
settings['sqlalchemy.url'] = os.environ.get('DATABASE_URL')
engine = engine_from_con... | import os
from pyramid.config import Configurator
from sqlalchemy import engine_from_config
from .models import DBSession, Base
def main(global_config, **settings):
'''This function returns a Pyramid WSGI application.'''
settings['sqlalchemy.url'] = os.environ.get('DATABASE_URL')
engine = engine_from_con... | Add route for preview request | Add route for preview request
| Python | mit | recombinators/snapsat,recombinators/snapsat,recombinators/snapsat | ---
+++
@@ -16,6 +16,7 @@
config.add_static_view('static', 'static', cache_max_age=3600)
config.add_route('index', '/')
config.add_route('request_scene', '/request/{scene_id}')
+ config.add_route('request_preview', '/request_p/{scene_id}')
config.add_route('done', '/done')
config.add_route... |
49367b2077c1ba6e09e10c05653d0dfc0164b1b7 | programmingtheorems/python/theorem_of_summary.py | programmingtheorems/python/theorem_of_summary.py | #! /usr/bin/env python
# Copyright Lajos Katona
#
# 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... | #! /usr/bin/env python
# Copyright Lajos Katona
#
# 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... | Fix pep8 problem, extra new line after header | Fix pep8 problem, extra new line after header
Change-Id: I6503a000202d321300c5f3cea708d18cf228e77d
| Python | apache-2.0 | elajkat/hugradexam,elajkat/hugradexam | ---
+++
@@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+
def summary(start=1, end=10):
result = 0
for i in range(start, end): |
4a1c1361f154c3deb1d575b1e0c69acca7827b17 | dojango/__init__.py | dojango/__init__.py | VERSION = (0, 5, 6, 'final', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
if VERSION[3] != 'final':
version = '%s %... | VERSION = (0, 5, 7, 'alpha', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
if VERSION[3] != 'final':
version = '%s %... | Mark dojango as 0.5.7 alpha | Mark dojango as 0.5.7 alpha
| Python | bsd-3-clause | william-gr/dojango,william-gr/dojango,ricard33/dojango,ricard33/dojango,klipstein/dojango,ofirr/dojango,ofirr/dojango,klipstein/dojango,ricard33/dojango,william-gr/dojango,ofirr/dojango | ---
+++
@@ -1,4 +1,4 @@
-VERSION = (0, 5, 6, 'final', 0)
+VERSION = (0, 5, 7, 'alpha', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1]) |
0654d962918327e5143fb9250ad344de26e284eb | electrumx_server.py | electrumx_server.py | #!/usr/bin/env python3
#
# Copyright (c) 2016, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
'''Script to kick off the server.'''
import logging
import traceback
from server.env import Env
from server.controller import Contr... | #!/usr/bin/env python3
#
# Copyright (c) 2016, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
'''Script to kick off the server.'''
import logging
import traceback
from server.env import Env
from server.controller import Contr... | Remove logger name from logs | Remove logger name from logs
| Python | mit | thelazier/electrumx,shsmith/electrumx,shsmith/electrumx,erasmospunk/electrumx,erasmospunk/electrumx,thelazier/electrumx | ---
+++
@@ -19,8 +19,8 @@
def main():
'''Set up logging and run the server.'''
logging.basicConfig(level=logging.INFO,
- format='%(asctime)s %(levelname)-9s %(message)-100s '
- '%(name)s [%(filename)s:%(lineno)d]')
+ format='%(asct... |
94264880688f5e2f8dbf098108bb05c2c244048d | froide_campaign/listeners.py | froide_campaign/listeners.py | from .models import Campaign, InformationObject
def connect_info_object(sender, **kwargs):
reference = kwargs.get('reference')
if not reference:
return
if not reference.startswith('campaign:'):
return
namespace, campaign_value = reference.split(':', 1)
try:
campaign, slug =... | from .models import Campaign, InformationObject
def connect_info_object(sender, **kwargs):
reference = kwargs.get('reference')
if not reference:
return
if not reference.startswith('campaign:'):
return
namespace, campaign_value = reference.split(':', 1)
try:
campaign, slug =... | Save request in new m2m filed | Save request in new m2m filed
| Python | mit | okfde/froide-campaign,okfde/froide-campaign,okfde/froide-campaign | ---
+++
@@ -35,14 +35,14 @@
except InformationObject.DoesNotExist:
return
- if iobj.foirequest is not None:
- return
-
if iobj.publicbody != sender.public_body:
return
if not sender.public:
return
- iobj.foirequest = sender
+ if iobj.foirequest is None:
... |
a910cd19890ef02a08aeb05c8ba450b2c59f0352 | monitoring/nagios/plugin/__init__.py | monitoring/nagios/plugin/__init__.py | from monitoring.nagios.plugin.base import NagiosPlugin
from monitoring.nagios.plugin.snmp import NagiosPluginSNMP
from monitoring.nagios.plugin.secureshell import NagiosPluginSSH
from monitoring.nagios.plugin.database import NagiosPluginMSSQL
from monitoring.nagios.plugin.wmi import NagiosPluginWMI | from monitoring.nagios.plugin.base import NagiosPlugin
from monitoring.nagios.plugin.snmp import NagiosPluginSNMP
from monitoring.nagios.plugin.secureshell import NagiosPluginSSH
from monitoring.nagios.plugin.database import NagiosPluginMSSQL
from monitoring.nagios.plugin.wmi import NagiosPluginWMI
from monitoring.nagi... | Make NagiosPluginHTTP available from monitoring.nagios.plugin package. | Make NagiosPluginHTTP available from monitoring.nagios.plugin package.
| Python | mit | bigbrozer/monitoring.nagios,bigbrozer/monitoring.nagios | ---
+++
@@ -3,3 +3,4 @@
from monitoring.nagios.plugin.secureshell import NagiosPluginSSH
from monitoring.nagios.plugin.database import NagiosPluginMSSQL
from monitoring.nagios.plugin.wmi import NagiosPluginWMI
+from monitoring.nagios.plugin.http import NagiosPluginHTTP |
f794c6ed1f6be231d79ac35759ad76270c3e14e0 | brains/mapping/admin.py | brains/mapping/admin.py | from django.contrib import admin
from mapping.models import Location, Report
class LocationAdmin(admin.ModelAdmin):
fieldsets = ((None,
{'fields': (
('name', 'suburb'),
('x', 'y'),
'building_type'
)}
),)
list_display = ['name', 'x', 'y', 'suburb']
... | from django.contrib import admin
from mapping.models import Location, Report
class LocationAdmin(admin.ModelAdmin):
fieldsets = ((None,
{'fields': (
('name', 'suburb'),
('x', 'y'),
'building_type'
)}
),)
list_display = ['name', 'x', 'y', 'suburb']
... | Set everything on the report read only. | Set everything on the report read only.
| Python | bsd-3-clause | crisisking/udbraaains,crisisking/udbraaains,crisisking/udbraaains,crisisking/udbraaains | ---
+++
@@ -26,10 +26,14 @@
('is_ruined', 'is_illuminated', 'has_tree'),
('zombies_present', 'barricade_level'),
'players',
- ('reported_by', 'origin', 'reported_date')
+ ('reported_by', 'origin'),
+ 'reported_date',
)}
),)
- rea... |
e76bd7de6a0eb7f46e9e5ce3cdaec44943b848d2 | pagseguro/configs.py | pagseguro/configs.py | # coding: utf-8
class Config(object):
BASE_URL = "https://ws.pagseguro.uol.com.br"
VERSION = "/v2/"
CHECKOUT_SUFFIX = VERSION + "checkout"
NOTIFICATION_SUFFIX = VERSION + "transactions/notifications/%s"
TRANSACTION_SUFFIX = VERSION + "transactions/"
CHECKOUT_URL = BASE_URL + CHECKOUT_... | # coding: utf-8
class Config(object):
BASE_URL = "https://ws.pagseguro.uol.com.br"
VERSION = "/v2/"
CHECKOUT_SUFFIX = VERSION + "checkout"
CHARSET = "UTF-8" # ISO-8859-1
NOTIFICATION_SUFFIX = VERSION + "transactions/notifications/%s"
TRANSACTION_SUFFIX = VERSION + "transactions/"
... | Fix charset default to UTF-8 | Fix charset default to UTF-8 | Python | mit | vintasoftware/python-pagseguro,rochacbruno/python-pagseguro,rgcarrasqueira/python-pagseguro | ---
+++
@@ -5,6 +5,7 @@
BASE_URL = "https://ws.pagseguro.uol.com.br"
VERSION = "/v2/"
CHECKOUT_SUFFIX = VERSION + "checkout"
+ CHARSET = "UTF-8" # ISO-8859-1
NOTIFICATION_SUFFIX = VERSION + "transactions/notifications/%s"
TRANSACTION_SUFFIX = VERSION + "transactions/"
CHECKOUT_URL = ... |
08461a2f61b5a5981a6da9f6ef91a362eed92bfd | pycroft/__init__.py | pycroft/__init__.py | # -*- coding: utf-8 -*-
# Copyright (c) 2014 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.
"""
pycroft
~~~~~~~~~~~~~~
This package contains everything.
:copyrigh... | # -*- coding: utf-8 -*-
# Copyright (c) 2014 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.
"""
pycroft
~~~~~~~~~~~~~~
This package contains everything.
:copyrigh... | Fix config loader (bug in commit:5bdf6e47 / commit:eefe7561) | Fix config loader (bug in commit:5bdf6e47 / commit:eefe7561)
| Python | apache-2.0 | lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft | ---
+++
@@ -20,8 +20,11 @@
self._resource = "config.json"
def load(self):
- data = (pkgutil.get_data(self._package, self._resource) or
- pkgutil.get_data(self._package, self._resource+".default"))
+ data = None
+ try:
+ data = pkgutil.get_data(self._packa... |
92595871f908aa22d353a2490f851da23f3d1f64 | gitcd/Config/FilePersonal.py | gitcd/Config/FilePersonal.py | import os
import yaml
from gitcd.Config.Parser import Parser
from gitcd.Config.DefaultsPersonal import DefaultsPersonal
class FilePersonal:
loaded = False
filename = ".gitcd-personal"
parser = Parser()
defaults = DefaultsPersonal()
config = False
def setFilename(self, configFilename: str):
self.filen... | import os
import yaml
from gitcd.Config.Parser import Parser
from gitcd.Config.DefaultsPersonal import DefaultsPersonal
class FilePersonal:
loaded = False
filename = ".gitcd-personal"
parser = Parser()
defaults = DefaultsPersonal()
config = False
def setFilename(self, configFilename: str):
self.filen... | Add .gitcd-personal to .gitignore automaticly | Add .gitcd-personal to .gitignore automaticly
| Python | apache-2.0 | claudio-walser/gitcd,claudio-walser/gitcd | ---
+++
@@ -24,6 +24,23 @@
def write(self):
self.parser.write(self.filename, self.config)
+ # add .gitcd-personal to .gitignore
+ gitignore = ".gitignore"
+ if not os.path.isfile(gitignore):
+ gitignoreContent = self.filename
+ else:
+ with open(gitignore, "r") as gitignoreFile:
+ ... |
4dd86439d4c8393ac9c3bb6b958a1c8cb45b243a | gitfs/views/history_index.py | gitfs/views/history_index.py | from .view import View
class HistoryIndexView(View):
pass
| from .view import View
from errno import ENOENT
from stat import S_IFDIR
from gitfs import FuseMethodNotImplemented, FuseOSError
from log import log
class HistoryIndexView(View):
def getattr(self, path, fh=None):
'''
Returns a dictionary with keys identical to the stat C structure of
s... | Add mandatory methods to HistoryIndexView (refactor when working) | Add mandatory methods to HistoryIndexView (refactor when working)
| Python | apache-2.0 | PressLabs/gitfs,ksmaheshkumar/gitfs,rowhit/gitfs,PressLabs/gitfs,bussiere/gitfs | ---
+++
@@ -1,5 +1,40 @@
from .view import View
+
+from errno import ENOENT
+from stat import S_IFDIR
+
+from gitfs import FuseMethodNotImplemented, FuseOSError
+from log import log
class HistoryIndexView(View):
- pass
+
+ def getattr(self, path, fh=None):
+ '''
+ Returns a dictionary with ... |
26353ac1c70c1bf47d6f33a0ab8880ec0fb1a002 | examples/effects.py | examples/effects.py | import zounds
from zounds.spectral import time_stretch, pitch_shift
from zounds.ui import AppSettings
import argparse
sr = zounds.SR11025()
BaseModel = zounds.stft(resample_to=sr, store_resampled=True)
@zounds.simple_in_memory_settings
class Sound(BaseModel):
pass
if __name__ == '__main__':
parser = argpar... | Add an example of phase vocoder based time stretch and pitch shift capabilities | Add an example of phase vocoder based time stretch and pitch shift capabilities
| Python | mit | JohnVinyard/zounds,JohnVinyard/zounds,JohnVinyard/zounds,JohnVinyard/zounds | ---
+++
@@ -0,0 +1,44 @@
+import zounds
+from zounds.spectral import time_stretch, pitch_shift
+from zounds.ui import AppSettings
+import argparse
+
+sr = zounds.SR11025()
+BaseModel = zounds.stft(resample_to=sr, store_resampled=True)
+
+
+@zounds.simple_in_memory_settings
+class Sound(BaseModel):
+ pass
+
+
+if _... | |
36da7bdc8402494b5ef3588289739e1696ad6002 | docs/_ext/djangodummy/settings.py | docs/_ext/djangodummy/settings.py | # Settings file to allow parsing API documentation of Django modules,
# and provide defaults to use in the documentation.
#
# This file is placed in a subdirectory,
# so the docs root won't be detected by find_packages()
# Display sane URLs in the docs:
STATIC_URL = '/static/'
| # Settings file to allow parsing API documentation of Django modules,
# and provide defaults to use in the documentation.
#
# This file is placed in a subdirectory,
# so the docs root won't be detected by find_packages()
# Display sane URLs in the docs:
STATIC_URL = '/static/'
# Avoid error for missing the secret key... | Fix autodoc support with Django 1.5 | Fix autodoc support with Django 1.5
| Python | apache-2.0 | django-fluent/django-fluent-contents,ixc/django-fluent-contents,pombredanne/django-fluent-contents,django-fluent/django-fluent-contents,ixc/django-fluent-contents,pombredanne/django-fluent-contents,jpotterm/django-fluent-contents,edoburu/django-fluent-contents,edoburu/django-fluent-contents,jpotterm/django-fluent-conte... | ---
+++
@@ -6,3 +6,6 @@
# Display sane URLs in the docs:
STATIC_URL = '/static/'
+
+# Avoid error for missing the secret key
+SECRET_KEY = 'docs' |
9cefd4d933590dcea28cf221e6c5706c81cac882 | invocations/testing.py | invocations/testing.py | from invoke import ctask as task
@task
def test(ctx, module=None, runner='spec'):
"""
Run a Spec or Nose-powered internal test suite.
Say ``--module=foo``/``-m foo`` to just run ``tests/foo.py``.
Defaults to running the ``spec`` tool; may override by saying e.g.
``runner='nosetests'``.
"""
... | from invoke import ctask as task
@task(help={
'module': "Just runs tests/STRING.py.",
'runner': "Use STRING to run tests instead of 'spec'."
})
def test(ctx, module=None, runner='spec'):
"""
Run a Spec or Nose-powered internal test suite.
"""
# Allow selecting specific submodule
specific_m... | Move docstring arg bits into per-arg help | Move docstring arg bits into per-arg help
| Python | bsd-2-clause | mrjmad/invocations,singingwolfboy/invocations,pyinvoke/invocations,alex/invocations | ---
+++
@@ -1,15 +1,13 @@
from invoke import ctask as task
-@task
+@task(help={
+ 'module': "Just runs tests/STRING.py.",
+ 'runner': "Use STRING to run tests instead of 'spec'."
+})
def test(ctx, module=None, runner='spec'):
"""
Run a Spec or Nose-powered internal test suite.
-
- Say ``--mod... |
9aeece4a5e3e7e987a709a128509cc0d8dc11e9d | tests/conftest.py | tests/conftest.py | import mock
import pytest
from scrapi import settings
settings.DEBUG = True
settings.CELERY_ALWAYS_EAGER = True
settings.CELERY_EAGER_PROPAGATES_EXCEPTIONS = True
@pytest.fixture(autouse=True)
def harvester(monkeypatch):
import_mock = mock.MagicMock()
harvester_mock = mock.MagicMock()
import_mock.return... | import mock
import pytest
from scrapi import settings
from scrapi import database
database._manager = database.DatabaseManager(keyspace='test')
settings.DEBUG = True
settings.CELERY_ALWAYS_EAGER = True
settings.CELERY_EAGER_PROPAGATES_EXCEPTIONS = True
@pytest.fixture(autouse=True)
def harvester(monkeypatch):
... | Add pytest markers for cassandra tests | Add pytest markers for cassandra tests
| Python | apache-2.0 | icereval/scrapi,alexgarciac/scrapi,jeffreyliu3230/scrapi,erinspace/scrapi,fabianvf/scrapi,felliott/scrapi,ostwald/scrapi,fabianvf/scrapi,felliott/scrapi,mehanig/scrapi,erinspace/scrapi,CenterForOpenScience/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi | ---
+++
@@ -2,6 +2,11 @@
import pytest
from scrapi import settings
+from scrapi import database
+
+database._manager = database.DatabaseManager(keyspace='test')
+
+
settings.DEBUG = True
settings.CELERY_ALWAYS_EAGER = True
settings.CELERY_EAGER_PROPAGATES_EXCEPTIONS = True
@@ -14,8 +19,8 @@
import_mock.... |
00b5599e574740680e6c08884510ad605294fad2 | tests/conftest.py | tests/conftest.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Shared fixtures for :mod:`pytest`."""
from __future__ import print_function, absolute_import
import os
import pytest # noqa
import gryaml
from py2neo_compat import py2neo_ver
@pytest.fixture
def graphdb():
"""Fixture connecting to graphdb."""
if 'NEO4J_UR... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Shared fixtures for :mod:`pytest`."""
from __future__ import print_function, absolute_import
import os
import pytest # noqa
import gryaml
from py2neo_compat import py2neo_ver
@pytest.fixture
def graphdb():
"""Fixture connecting to graphdb."""
if 'NEO4J_UR... | Use `delete_all` instead of running cypher query | Use `delete_all` instead of running cypher query
| Python | mit | wcooley/python-gryaml | ---
+++
@@ -19,7 +19,7 @@
if 'NEO4J_URI' not in os.environ:
pytest.skip('Need NEO4J_URI environment variable set')
graphdb = gryaml.connect(uri=os.environ['NEO4J_URI'])
- graphdb.cypher.execute('MATCH (n) DETACH DELETE n')
+ graphdb.delete_all()
return graphdb
@pytest.yield_fixture |
0d1ab7106e438b418b575c4e0f6c22797158358a | tests/settings.py | tests/settings.py | DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db',
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'tests',
)
| DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db',
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'tests',
)
SECRET_KEY = 'abc123'
| Add required SECRET_KEY setting for Django 1.5+ | Add required SECRET_KEY setting for Django 1.5+
| Python | bsd-2-clause | bruth/django-preserialize,scottp-dpaw/django-preserialize | ---
+++
@@ -10,3 +10,5 @@
'django.contrib.contenttypes',
'tests',
)
+
+SECRET_KEY = 'abc123' |
99f8fc1ec43aa7a1b96b2d8446a77111dbc61195 | tests/test_cli.py | tests/test_cli.py | from mdformat._cli import run
def test_no_files_passed():
assert run(()) == 0
| from mdformat._cli import run
def test_no_files_passed():
assert run(()) == 0
def test_format(tmp_path):
unformatted_markdown = "\n\n# A header\n\n"
formatted_markdown = "# A header\n"
file_path = tmp_path / "test_markdown.md"
file_path.write_text(unformatted_markdown)
assert run((str(file_... | Add a test for formatting with cli | Add a test for formatting with cli
| Python | mit | executablebooks/mdformat | ---
+++
@@ -3,3 +3,13 @@
def test_no_files_passed():
assert run(()) == 0
+
+
+def test_format(tmp_path):
+ unformatted_markdown = "\n\n# A header\n\n"
+ formatted_markdown = "# A header\n"
+
+ file_path = tmp_path / "test_markdown.md"
+ file_path.write_text(unformatted_markdown)
+ assert run((s... |
af3dd1da24754e32c8a75165ab90d5178e68a548 | integrations/mailer/setup.py | integrations/mailer/setup.py | #!/usr/bin/env python
import setuptools
version = '3.3.0'
setuptools.setup(
name="alerta-mailer",
version=version,
description='Send emails from Alerta',
url='https://github.com/alerta/alerta-contrib',
license='MIT',
author='Nick Satterly',
author_email='nick.satterly@theguardian.com',
... | #!/usr/bin/env python
import setuptools
version = '3.3.1'
setuptools.setup(
name="alerta-mailer",
version=version,
description='Send emails from Alerta',
url='https://github.com/alerta/alerta-contrib',
license='MIT',
author='Nick Satterly',
author_email='nick.satterly@theguardian.com',
... | Increase the version number due this bugfix | Increase the version number due this bugfix
| Python | mit | msupino/alerta-contrib,msupino/alerta-contrib,alerta/alerta-contrib,alerta/alerta-contrib,alerta/alerta-contrib | ---
+++
@@ -2,7 +2,7 @@
import setuptools
-version = '3.3.0'
+version = '3.3.1'
setuptools.setup(
name="alerta-mailer", |
76087634d8c165657b35074e54ae7a8ee71f6f75 | tests/test_xorshift_rand.py | tests/test_xorshift_rand.py | # Copyright 2014 Anonymous7 from Reddit, Julian Andrews
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
from __future__ import absolute_import, division
import collections
import unittest
import eval7.xorshift_rand
class XorshiftRandTestCas... | # Copyright 2014 Anonymous7 from Reddit, Julian Andrews
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
from __future__ import absolute_import, division
import collections
import unittest
import eval7.xorshift_rand
class XorshiftRandTestCas... | Reduce sample count for xorshift_rand tests | Reduce sample count for xorshift_rand tests
| Python | mit | JulianAndrews/pyeval7,JulianAndrews/pyeval7 | ---
+++
@@ -12,9 +12,9 @@
class XorshiftRandTestCase(unittest.TestCase):
- SAMPLE_COUNT = 10000000
+ SAMPLE_COUNT = 1000000
BINS = 1000
- DELTA = 450
+ DELTA = 125
def check_uniform(self, counter):
expected_count = self.SAMPLE_COUNT / self.BINS |
e4fde66624f74c4b0bbfae7c7c11a50884a0a73c | pyfr/readers/base.py | pyfr/readers/base.py | # -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
import uuid
class BaseReader(object, metaclass=ABCMeta):
@abstractmethod
def __init__(self):
pass
@abstractmethod
def _to_raw_pyfrm(self):
pass
def to_pyfrm(self):
mesh = self._to_raw_pyfrm()
# Add ... | # -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
import uuid
import numpy as np
class BaseReader(object, metaclass=ABCMeta):
@abstractmethod
def __init__(self):
pass
@abstractmethod
def _to_raw_pyfrm(self):
pass
def to_pyfrm(self):
mesh = self._to_raw_pyf... | Fix the HDF5 type of mesh_uuid for imported meshes. | Fix the HDF5 type of mesh_uuid for imported meshes.
| Python | bsd-3-clause | BrianVermeire/PyFR,Aerojspark/PyFR | ---
+++
@@ -2,6 +2,8 @@
from abc import ABCMeta, abstractmethod
import uuid
+
+import numpy as np
class BaseReader(object, metaclass=ABCMeta):
@@ -17,6 +19,6 @@
mesh = self._to_raw_pyfrm()
# Add metadata
- mesh['mesh_uuid'] = str(uuid.uuid4())
+ mesh['mesh_uuid'] = np.array(... |
7e448e9267c375195f3fcd5c80ed9e602cce0c91 | genes/posix/commands.py | genes/posix/commands.py | from genes.process.commands import get_env_run
from .traits import only_posix
run = get_env_run()
@only_posix()
def chmod(*args):
# FIXME: this is ugly, name the args
run(['chmod'] + list(*args))
| from genes.process.commands import get_env_run
from .traits import only_posix
run = get_env_run()
@only_posix()
def chmod(*args):
# FIXME: this is ugly, name the args
run(['chmod'] + list(args))
| Fix args to list. Args is a tuple, list takes a tuple | Fix args to list. Args is a tuple, list takes a tuple | Python | mit | hatchery/genepool,hatchery/Genepool2 | ---
+++
@@ -7,4 +7,4 @@
@only_posix()
def chmod(*args):
# FIXME: this is ugly, name the args
- run(['chmod'] + list(*args))
+ run(['chmod'] + list(args)) |
0af3f7ddd1912d18d502ca1795c596397d9cd495 | python/triple-sum.py | python/triple-sum.py |
# A special triplet is defined as: a <= b <= c for
# a in list_a, b in list_b, and c in list_c
def get_num_special_triplets(list_a, list_b, list_c):
num_special_triplets = 0
for b in list_b:
len_a_candidates = len([a for a in list_a if a <= b])
len_c_candidates = len([c for c in list_c if c <... |
# A special triplet is defined as: a <= b <= c for
# a in list_a, b in list_b, and c in list_c
def get_num_special_triplets(list_a, list_b, list_c):
# remove duplicates and sort lists
list_a = sorted(set(list_a))
list_b = sorted(set(list_b))
list_c = sorted(set(list_c))
num_special_triplets = 0
... | Sort lists prior to computing len of candidates | Sort lists prior to computing len of candidates
| Python | mit | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank | ---
+++
@@ -3,19 +3,31 @@
# A special triplet is defined as: a <= b <= c for
# a in list_a, b in list_b, and c in list_c
def get_num_special_triplets(list_a, list_b, list_c):
+ # remove duplicates and sort lists
+ list_a = sorted(set(list_a))
+ list_b = sorted(set(list_b))
+ list_c = sorted(set(list_c)... |
90cbe055e9f0722de7619fbd777a10e2b95d63b3 | tests/constants_test.py | tests/constants_test.py | import unittest
from mtglib.constants import base_url, card_flags
class DescribeConstants(unittest.TestCase):
def should_have_base_url(self):
url = ('http://gatherer.wizards.com/Pages/Search/Default.aspx'
'?output=standard&action=advanced&')
assert base_url == url
def should_h... | import unittest
from nose.tools import eq_
from mtglib.constants import base_url, card_flags
class DescribeConstants(unittest.TestCase):
def should_have_base_url(self):
url = ('http://gatherer.wizards.com/Pages/Search/Default.aspx'
'?output=standard&action=advanced&')
eq_(base_url... | Use helper function for testing equality. | Use helper function for testing equality.
| Python | mit | chigby/mtg,chigby/mtg | ---
+++
@@ -1,4 +1,6 @@
import unittest
+
+from nose.tools import eq_
from mtglib.constants import base_url, card_flags
@@ -7,8 +9,8 @@
def should_have_base_url(self):
url = ('http://gatherer.wizards.com/Pages/Search/Default.aspx'
'?output=standard&action=advanced&')
- asser... |
2daee974533d1510a17280cddb5a4dfc147338fa | tests/level/test_map.py | tests/level/test_map.py | import unittest
from hunting.level.map import LevelTile, LevelMap
class TestPathfinding(unittest.TestCase):
def test_basic_diagonal(self):
level_map = LevelMap()
level_map.set_map([[LevelTile() for _ in range(0, 5)] for _ in range(0, 5)])
self.assertEqual([(1, 1), (2, 2), (3, 3), (4, 4)]... | import unittest
from hunting.level.map import LevelTile, LevelMap
class TestPathfinding(unittest.TestCase):
def test_basic_diagonal(self):
level_map = LevelMap([[LevelTile() for _ in range(0, 5)] for _ in range(0, 5)])
self.assertEqual([(1, 1), (2, 2), (3, 3), (4, 4)], level_map.a_star_path(0, 0... | Add test for force_pathable_endpoint pathfind param | Add test for force_pathable_endpoint pathfind param
This parameter is intended to allow pathing to adjacent squares
of an unpassable square. This is necessary because if you want to
pathfind to a monster which blocks a square, you don't want to
actually go *onto* the square, you just want to go next to it,
presumably ... | Python | mit | MoyTW/RL_Arena_Experiment | ---
+++
@@ -5,17 +5,21 @@
class TestPathfinding(unittest.TestCase):
def test_basic_diagonal(self):
- level_map = LevelMap()
- level_map.set_map([[LevelTile() for _ in range(0, 5)] for _ in range(0, 5)])
+ level_map = LevelMap([[LevelTile() for _ in range(0, 5)] for _ in range(0, 5)])
... |
822cc689ce44b1c43ac118b2a13c6d0024d2e194 | tests/raw_text_tests.py | tests/raw_text_tests.py | from nose.tools import istest, assert_equal
from mammoth.raw_text import extract_raw_text_from_element
from mammoth import documents
@istest
def raw_text_of_text_element_is_value():
assert_equal("Hello", extract_raw_text_from_element(documents.Text("Hello")))
@istest
def raw_text_of_paragraph_is_terminated_wit... | from nose.tools import istest, assert_equal
from mammoth.raw_text import extract_raw_text_from_element
from mammoth import documents
@istest
def text_element_is_converted_to_text_content():
element = documents.Text("Hello.")
result = extract_raw_text_from_element(element)
assert_equal("Hello.", result)... | Make raw text tests consistent with mammoth.js | Make raw text tests consistent with mammoth.js
| Python | bsd-2-clause | mwilliamson/python-mammoth | ---
+++
@@ -5,18 +5,50 @@
@istest
-def raw_text_of_text_element_is_value():
- assert_equal("Hello", extract_raw_text_from_element(documents.Text("Hello")))
+def text_element_is_converted_to_text_content():
+ element = documents.Text("Hello.")
+
+ result = extract_raw_text_from_element(element)
+
+ as... |
fd5387f1bb8ac99ed421c61fdff777316a4d3191 | tests/test_publisher.py | tests/test_publisher.py | import pytest
import pika
from mettle.settings import get_settings
from mettle.publisher import publish_event
def test_long_routing_key():
settings = get_settings()
conn = pika.BlockingConnection(pika.URLParameters(settings.rabbit_url))
chan = conn.channel()
exchange = settings['state_exchange']
... | import pytest
import pika
from mettle.settings import get_settings
from mettle.publisher import publish_event
@pytest.mark.xfail(reason="Need RabbitMQ fixture")
def test_long_routing_key():
settings = get_settings()
conn = pika.BlockingConnection(pika.URLParameters(settings.rabbit_url))
chan = conn.chann... | Mark test as xfail so that releases can be cut | Mark test as xfail so that releases can be cut
| Python | mit | yougov/mettle,yougov/mettle,yougov/mettle,yougov/mettle | ---
+++
@@ -5,6 +5,7 @@
from mettle.publisher import publish_event
+@pytest.mark.xfail(reason="Need RabbitMQ fixture")
def test_long_routing_key():
settings = get_settings()
conn = pika.BlockingConnection(pika.URLParameters(settings.rabbit_url)) |
53636a17cd50d704b7b4563d0b23a474677051f4 | hub/prototype/config.py | hub/prototype/config.py | # put this into ~/.alphahub/config.py and make sure it's
# not readable by anyone else (it contains passwords!)
# the host we run on and want to receive packets on; note
# that "localhost" is probably the wrong thing here, you
# want your actual host name here so the sockets bind the
# right way and receive packets fr... | # put this into ~/.alphahub/config.py and make sure it's
# not readable by anyone else (it contains passwords!)
# the host we run on and want to receive packets on; note
# that "localhost" is probably the wrong thing here, you
# want your actual host name here so the sockets bind the
# right way and receive packets fr... | Make sure we give an example for two servers. | Make sure we give an example for two servers.
| Python | agpl-3.0 | madprof/alpha-hub | ---
+++
@@ -15,6 +15,7 @@
SERVERS = {
"some.game.server.tld": (42, "somesecret"),
+ "some.other.game.tld": (543, "monkeyspam"),
}
# the other hubs we echo to; note that we don't yet change |
d185407ac4caf5648ef4c12eab83fec81c307407 | tests/test_trackable.py | tests/test_trackable.py | # -*- coding: utf-8 -*-
"""
test_trackable
~~~~~~~~~~~~~~
Trackable tests
"""
import pytest
from utils import authenticate, logout
pytestmark = pytest.mark.trackable()
def test_trackable_flag(app, client):
e = 'matt@lp.com'
authenticate(client, email=e)
logout(client)
authenticate(clie... | # -*- coding: utf-8 -*-
"""
test_trackable
~~~~~~~~~~~~~~
Trackable tests
"""
import pytest
from utils import authenticate, logout
pytestmark = pytest.mark.trackable()
def test_trackable_flag(app, client):
e = 'matt@lp.com'
authenticate(client, email=e)
logout(client)
authenticate(clie... | Add mock X-Forwarded-For header in trackable tests | Add mock X-Forwarded-For header in trackable tests
| Python | mit | pawl/flask-security,reustle/flask-security,jonafato/flask-security,asmodehn/flask-security,quokkaproject/flask-security,LeonhardPrintz/flask-security-fork,dommert/flask-security,LeonhardPrintz/flask-security-fork,fuhrysteve/flask-security,CodeSolid/flask-security,simright/flask-security,inveniosoftware/flask-security-f... | ---
+++
@@ -17,12 +17,12 @@
e = 'matt@lp.com'
authenticate(client, email=e)
logout(client)
- authenticate(client, email=e)
+ authenticate(client, email=e, headers={'X-Forwarded-For': '127.0.0.1'})
with app.app_context():
user = app.security.datastore.find_user(email=e)
as... |
3bd9214465547ff6cd0f7ed94edf8dacf10135b5 | registration/backends/simple/urls.py | registration/backends/simple/urls.py | """
URLconf for registration and activation, using django-registration's
one-step backend.
If the default behavior of these views is acceptable to you, simply
use a line like this in your root URLconf to set up the default URLs
for registration::
(r'^accounts/', include('registration.backends.simple.urls')),
Thi... | """
URLconf for registration and activation, using django-registration's
one-step backend.
If the default behavior of these views is acceptable to you, simply
use a line like this in your root URLconf to set up the default URLs
for registration::
(r'^accounts/', include('registration.backends.simple.urls')),
Thi... | Clean up an import in simple backend URLs. | Clean up an import in simple backend URLs.
| Python | bsd-3-clause | dirtycoder/django-registration,ubernostrum/django-registration,myimages/django-registration,tdruez/django-registration,awakeup/django-registration | ---
+++
@@ -20,7 +20,7 @@
from django.conf.urls import include, url
from django.views.generic.base import TemplateView
-from registration.backends.simple.views import RegistrationView
+from .views import RegistrationView
urlpatterns = [ |
d2eb124651862d61f28519a5d9dc0ab1a0133fb7 | remotecv/result_store/redis_store.py | remotecv/result_store/redis_store.py | from redis import Redis
from remotecv.result_store import BaseStore
from remotecv.utils import logger
class ResultStore(BaseStore):
WEEK = 604800
redis_instance = None
def __init__(self, config):
super(ResultStore, self).__init__(config)
if not ResultStore.redis_instance:
R... | from redis import Redis
from remotecv.result_store import BaseStore
from remotecv.utils import logger
class ResultStore(BaseStore):
WEEK = 604800
redis_instance = None
def __init__(self, config):
super(ResultStore, self).__init__(config)
if not ResultStore.redis_instance:
R... | Make compatible with py-redis 3.x | Make compatible with py-redis 3.x
Fixes https://github.com/thumbor/remotecv/issues/25
| Python | mit | thumbor/remotecv | ---
+++
@@ -25,4 +25,8 @@
result = self.serialize(points)
logger.debug("Points found: %s", result)
redis_key = "thumbor-detector-%s" % key
- self.storage.setex(redis_key, result, 2 * self.WEEK)
+ self.storage.setex(
+ name=redis_key,
+ value=result,
+ ... |
73ce10193c497fdffee178ab877d173287417047 | climlab/__init__.py | climlab/__init__.py | __version__ = '0.4.0'
# This list defines all the modules that will be loaded if a user invokes
# from climLab import *
# totally out of date!
#__all__ = ["constants", "thermo", "orbital_table",
# "long_orbital_table", "insolation", "ebm",
# "column", "convadj"]
#from climlab import radiation... | __version__ = '0.4.1dev'
# This list defines all the modules that will be loaded if a user invokes
# from climLab import *
# totally out of date!
#__all__ = ["constants", "thermo", "orbital_table",
# "long_orbital_table", "insolation", "ebm",
# "column", "convadj"]
#from climlab import radiat... | Increment version number to 0.4.1dev | Increment version number to 0.4.1dev
| Python | mit | brian-rose/climlab,brian-rose/climlab,cjcardinale/climlab,cjcardinale/climlab,cjcardinale/climlab | ---
+++
@@ -1,4 +1,4 @@
-__version__ = '0.4.0'
+__version__ = '0.4.1dev'
# This list defines all the modules that will be loaded if a user invokes
# from climLab import * |
4dfbe6ea079b32644c9086351f911ce1a2b2b0e1 | easy_maps/geocode.py | easy_maps/geocode.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.utils.encoding import smart_str
from geopy import geocoders
from geopy.exc import GeocoderServiceError
class Error(Exception):
pass
def google_v3(address):
"""
Given an address, return ``(computed_address, (latitude, longitude))``... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.utils.encoding import smart_str
from geopy import geocoders
from geopy.exc import GeocoderServiceError
class Error(Exception):
pass
def google_v3(address):
"""
Given an address, return ``(computed_address, (latitude, longitude))`... | Resolve the 500 error when google send a no results info | Resolve the 500 error when google send a no results info
| Python | mit | duixteam/django-easy-maps,kmike/django-easy-maps,Gonzasestopal/django-easy-maps,kmike/django-easy-maps,bashu/django-easy-maps,bashu/django-easy-maps,Gonzasestopal/django-easy-maps | ---
+++
@@ -3,6 +3,7 @@
from django.utils.encoding import smart_str
from geopy import geocoders
from geopy.exc import GeocoderServiceError
+
class Error(Exception):
pass
@@ -16,6 +17,9 @@
try:
g = geocoders.GoogleV3()
address = smart_str(address)
- return g.geocode(address, ex... |
47dc3c9af512b89525048564f32e71b012ed2f19 | elevator/__init__.py | elevator/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__title__ = "Elevator"
__author__ = "Oleiade"
__license__ = "BSD"
from client import Elevator
| Update : bind client Elevator class to package root | Update : bind client Elevator class to package root
| Python | mit | oleiade/Elevator | ---
+++
@@ -0,0 +1,9 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+__title__ = "Elevator"
+__author__ = "Oleiade"
+__license__ = "BSD"
+
+
+from client import Elevator | |
7c6f1bfca63ea0db8e07156b5122d0986b9cd1a5 | backend/breach/tests/test_sniffer.py | backend/breach/tests/test_sniffer.py | from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
self.sniffer = Sniffer(self.endpoint, '147.102.239.229', 'dionyziz.com', 'wlan0', '8080')
@patch('breach.sniffer.request... | from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
sniffer_params = {
'snifferendpoint': self.endpoint,
'sourceip': '147.102.239.229',
'host... | Update sniffer tests with new argument passing | Update sniffer tests with new argument passing
| Python | mit | dimkarakostas/rupture,dionyziz/rupture,esarafianou/rupture,dionyziz/rupture,esarafianou/rupture,dimkarakostas/rupture,dimriou/rupture,dimriou/rupture,dimriou/rupture,dionyziz/rupture,esarafianou/rupture,dionyziz/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimriou/rupture,dionyziz/rupture,dimriou/rupture,esarafi... | ---
+++
@@ -7,7 +7,15 @@
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
- self.sniffer = Sniffer(self.endpoint, '147.102.239.229', 'dionyziz.com', 'wlan0', '8080')
+ sniffer_params = {
+ 'snifferendpoint': self.endpoint,
+ 'sourceip'... |
34e17142f565cfc27c15522212c4240944cb4001 | sauce/lib/helpers.py | sauce/lib/helpers.py | # -*- coding: utf-8 -*-
"""WebHelpers used in SAUCE.
@author: moschlar
"""
from tg import url as tgurl
from webhelpers import date, feedgenerator, html, number, misc, text
import re, textwrap
#log = logging.getLogger(__name__)
# shortcut for links
link_to = html.tags.link_to
def link(label, url='', **attrs):
... | # -*- coding: utf-8 -*-
"""WebHelpers used in SAUCE.
@author: moschlar
"""
from datetime import datetime
from tg import url as tgurl
#from webhelpers import date, feedgenerator, html, number, misc, text
import webhelpers as w
from webhelpers.html.tags import link_to
from webhelpers.text import truncate
from webhel... | Replace my own helper functions with webhelper ones | Replace my own helper functions with webhelper ones
| Python | agpl-3.0 | moschlar/SAUCE,moschlar/SAUCE,moschlar/SAUCE,moschlar/SAUCE | ---
+++
@@ -4,48 +4,27 @@
@author: moschlar
"""
+from datetime import datetime
+
from tg import url as tgurl
-from webhelpers import date, feedgenerator, html, number, misc, text
+#from webhelpers import date, feedgenerator, html, number, misc, text
-import re, textwrap
+import webhelpers as w
+
+from webhelpe... |
c12f040fe9b0bbc3e47aed8f942de04216251f51 | importer/loaders.py | importer/loaders.py | import xlrd
import os
base_loader_error = 'The Loader class can only be used by extending it.'
excel_extensions = [
'.xls',
'.xlsx',
]
class Loader(object):
def __init__(self, file_info, autoload=True):
self.filename = file_info.path
if autoload is True:
return self.open()... | from django.conf import settings
import xlrd
import os
base_loader_error = 'The Loader class can only be used by extending it.'
extensions = getattr(
settings,
'IMPORTER_EXTENSIONS',
{
'excel': ('.xls', '.xlsx'),
}
)
class Loader(object):
def __init__(self, file_info, autoload=True):
... | Allow configuration of extensions for types. | Allow configuration of extensions for types.
| Python | mit | monokrome/django-drift | ---
+++
@@ -1,3 +1,5 @@
+from django.conf import settings
+
import xlrd
import os
@@ -5,10 +7,13 @@
base_loader_error = 'The Loader class can only be used by extending it.'
-excel_extensions = [
- '.xls',
- '.xlsx',
-]
+extensions = getattr(
+ settings,
+ 'IMPORTER_EXTENSIONS',
+ {
+ 'e... |
25993238cb18212a2b83b2d6b0aa98939d38f192 | scripts/lwtnn-split-keras-network.py | scripts/lwtnn-split-keras-network.py | #!/usr/bin/env python3
"""
Convert a keras model, saved with model.save(...) to a weights and
architecture component.
"""
import argparse
def get_args():
d = '(default: %(default)s)'
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('model')
parser.add_argument('-w','--weight-fi... | #!/usr/bin/env python3
"""
Convert a keras model, saved with model.save(...) to a weights and
architecture component.
"""
import argparse
def get_args():
d = '(default: %(default)s)'
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('model')
parser.add_argument('-w','--weight-fi... | Remove Keras from network splitter | Remove Keras from network splitter
Keras isn't as stable as h5py and json. This commit removes the keras dependency from the network splitting function.
| Python | mit | lwtnn/lwtnn,lwtnn/lwtnn,lwtnn/lwtnn | ---
+++
@@ -17,11 +17,16 @@
def run():
args = get_args()
- import keras
- m = keras.models.load_model(args.model)
- m.save_weights(args.weight_file_name)
- with open(args.architecture_file_name,'w') as arch:
- arch.write(m.to_json(indent=2))
+ from h5py import File
+ import json
+ ... |
dfeb82974768e96efc4cba1388ac4bf098d3fbf4 | UM/Qt/Bindings/MeshFileHandlerProxy.py | UM/Qt/Bindings/MeshFileHandlerProxy.py | from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal
from UM.Application import Application
from UM.Logger import Logger
class MeshFileHandlerProxy(QObject):
def __init__(self, parent = None):
super().__init__(parent)
self._mesh_handler = Application.getInstance().getMeshFileHandle... | from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal
from UM.Application import Application
from UM.Logger import Logger
class MeshFileHandlerProxy(QObject):
def __init__(self, parent = None):
super().__init__(parent)
self._mesh_handler = Application.getInstance().getMeshFileHandle... | Update the supported file types list exposed to QML to use the new dict correctly | Update the supported file types list exposed to QML to use the new dict correctly
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | ---
+++
@@ -10,19 +10,23 @@
@pyqtProperty("QStringList", constant=True)
def supportedReadFileTypes(self):
- fileTypes = []
- fileTypes.append("All Supported Files (*{0})(*{0})".format(' *'.join(self._mesh_handler.getSupportedFileTypesRead())))
+ file_types = []
+ all_types = []... |
3916efe4a017fe9e0fb1c5fe09b99f374d7a4060 | instana/__init__.py | instana/__init__.py | """
Instana sensor and tracer. It consists of two modules that can be used as entry points:
- sensor: activates the meter to collect and transmit all kind of built-in metrics
- tracer: OpenTracing tracer implementation. It implicitly activates the meter
"""
__author__ = 'Instana Inc.'
__copyright__ = 'Copyright 2016 ... | """
Instana sensor and tracer. It consists of two modules that can be used as entry points:
- sensor: activates the meter to collect and transmit all kind of built-in metrics
- tracer: OpenTracing tracer implementation. It implicitly activates the meter
"""
__author__ = 'Instana Inc.'
__copyright__ = 'Copyright 2017 ... | Update module init file; begin version stamping here. | Update module init file; begin version stamping here.
| Python | mit | instana/python-sensor,instana/python-sensor | ---
+++
@@ -6,11 +6,11 @@
"""
__author__ = 'Instana Inc.'
-__copyright__ = 'Copyright 2016 Instana Inc.'
-__credits__ = ['Pavlo Baron']
+__copyright__ = 'Copyright 2017 Instana Inc.'
+__credits__ = ['Pavlo Baron', 'Peter Giacomo Lombardo']
__license__ = 'MIT'
-__version__ = '0.0.1'
-__maintainer__ = 'Pavlo Baron... |
67fd73f8f035ac0e13a64971d9d54662df46a77f | karm/test/__karmutil.py | karm/test/__karmutil.py | import sys
import os
def dcopid():
'''Get dcop id of karm. Fail if more than one instance running.'''
id = stdin = stdout = None
try:
( stdin, stdout ) = os.popen2( "dcop" )
l = stdout.readline()
while l:
if l.startswith( "karm" ):
if not id: id = l
else: raise "Only one instan... | import sys
import os
class KarmTestError( Exception ): pass
def dcopid():
'''Get dcop id of karm. Fail if more than one instance running.'''
id = stdin = stdout = None
( stdin, stdout ) = os.popen2( "dcop" )
l = stdout.readline()
while l:
if l.startswith( "karm" ):
if not id: id = l
else: r... | Add KarmTestError we can distinguish and print full tracebacks for unexpected errors. Delete exception trapping--let the test scripts do that. | Add KarmTestError we can distinguish and print full tracebacks for unexpected errors. Delete exception trapping--let the test scripts do that.
svn path=/trunk/kdepim/; revision=367066
| Python | lgpl-2.1 | lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi | ---
+++
@@ -1,24 +1,20 @@
import sys
import os
+
+class KarmTestError( Exception ): pass
def dcopid():
'''Get dcop id of karm. Fail if more than one instance running.'''
id = stdin = stdout = None
- try:
- ( stdin, stdout ) = os.popen2( "dcop" )
+ ( stdin, stdout ) = os.popen2( "dcop" )
+ l = stdout... |
f71676ab56e3f1b5a8fb1283cf08f5a170ee5bf2 | web/zoohackathon2016/report/models.py | web/zoohackathon2016/report/models.py | from __future__ import unicode_literals
from django.db import models
from model_utils import Choices
class Report(models.Model):
"""Store report information"""
REPORT_TYPES = Choices(
('A', 'Shop/Market'),
('B', 'Restaraunt/Eatery'),
('C', 'Live Animal Display'),
('D', 'Poachin... | from __future__ import unicode_literals
from django.db import models
from model_utils import Choices
class Report(models.Model):
"""Store report information"""
REPORT_TYPES = Choices(
('A', 'Shop/Market'),
('B', 'Restaurant/Eatery'),
('C', 'Live Animal Display'),
('D', 'Poachin... | Fix spelling of Restaurant in web backend | Fix spelling of Restaurant in web backend
| Python | apache-2.0 | gmuthetatau/zoohackathon2016,gmuthetatau/zoohackathon2016,gmuthetatau/zoohackathon2016 | ---
+++
@@ -7,7 +7,7 @@
"""Store report information"""
REPORT_TYPES = Choices(
('A', 'Shop/Market'),
- ('B', 'Restaraunt/Eatery'),
+ ('B', 'Restaurant/Eatery'),
('C', 'Live Animal Display'),
('D', 'Poaching'),
('E', 'Other'), |
3698f0a51056f32c7595c1baca578d25764cc768 | cnddh/config_prd.py | cnddh/config_prd.py |
AMBIENTE = u'linux'
PROD = False
DEBUG = False
LOG = False
LOGPATH = './Application.log'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_LOGIN = 'xxxxxxxx@cnddh.org.br'
EMAIL_PASSWORD = 'senha'
EMAIL_PORT = 587
DATABASE_URI = 'mysql://root:senha@localhost/cnddh_db'
ECHO = False
UPLOADS_DEFAULT_DEST = r'C:\Temp\u... |
AMBIENTE = u'linux'
PROD = False
DEBUG = False
LOG = False
LOGPATH = './Application.log'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_LOGIN = 'xxxxxxxx@cnddh.org.br'
EMAIL_PASSWORD = 'senha'
EMAIL_PORT = 587
DATABASE_URI = 'mysql://root:senha@localhost/cnddh_db'
ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = Fal... | Add some key in config | Add some key in config
| Python | apache-2.0 | dedeco/cnddh-denuncias,dedeco/cnddh-denuncias,dedeco/cnddh-denuncias | ---
+++
@@ -12,6 +12,7 @@
DATABASE_URI = 'mysql://root:senha@localhost/cnddh_db'
ECHO = False
+SQLALCHEMY_TRACK_MODIFICATIONS = False
UPLOADS_DEFAULT_DEST = r'C:\Temp\upload'
|
85ca0da68126da149438199a83fddf2befa18eea | src/psd_tools2/psd/color_mode_data.py | src/psd_tools2/psd/color_mode_data.py | """
Color mode data structure.
"""
from __future__ import absolute_import, unicode_literals
import attr
import logging
from psd_tools2.psd.base import ValueElement
from psd_tools2.utils import (
read_length_block, write_length_block, write_bytes
)
logger = logging.getLogger(__name__)
class ColorModeData(ValueEle... | """
Color mode data structure.
"""
from __future__ import absolute_import, unicode_literals
import attr
import logging
from psd_tools2.psd.base import ValueElement
from psd_tools2.utils import (
read_length_block, write_length_block, write_bytes
)
logger = logging.getLogger(__name__)
@attr.s(repr=False, slots=Tr... | Fix empty color mode write | Fix empty color mode write
| Python | mit | psd-tools/psd-tools,kmike/psd-tools,kmike/psd-tools | ---
+++
@@ -12,6 +12,7 @@
logger = logging.getLogger(__name__)
+@attr.s(repr=False, slots=True)
class ColorModeData(ValueElement):
"""
Color mode data section of the PSD file.
@@ -21,6 +22,8 @@
Duotone images also have this data, but the data format is undocumented.
"""
+ value = attr.i... |
7ea8a4110ec2b696ff8124e0881d8cf769d8c365 | src/puzzle/heuristics/analyze_word.py | src/puzzle/heuristics/analyze_word.py | import re
from data import warehouse
_WORD_REGEX = re.compile(r'^\w+$', re.IGNORECASE)
def score_word(word):
if not _valid(word):
return False
if word in warehouse.get('/words/unigram/trie'):
return 1
return .1
def _valid(word):
if not word:
return False
if not _WORD_REGEX.match(word):
r... | import re
from data import warehouse
_WORD_REGEX = re.compile(r'^\w+$', re.IGNORECASE)
def score_word(word):
if not _valid(word):
return False
if word in warehouse.get('/words/unigram'):
return 1
return .1
def _valid(word):
if not word:
return False
if not _WORD_REGEX.match(word):
return... | Use unigrams from warehouse module. | Use unigrams from warehouse module.
| Python | mit | PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge | ---
+++
@@ -8,7 +8,7 @@
def score_word(word):
if not _valid(word):
return False
- if word in warehouse.get('/words/unigram/trie'):
+ if word in warehouse.get('/words/unigram'):
return 1
return .1
|
19f4b7d46d3aa57bb81dc34e2639a4c192b58cb1 | meanrecipes/__main__.py | meanrecipes/__main__.py | #!/usr/bin/env python3
from flask import Flask, url_for, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/recipe/search/<term>')
def recipe(term=None):
ingredients = [[300.0, 'g', 'flour'], [400.5, 'kg', 'chocolate']]
method = ['Step 1', 'St... | #!/usr/bin/env python3
from flask import Flask, url_for, render_template, make_response
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/recipe/search/<term>')
def recipe(term=None):
ingredients = [[300.0, 'g', 'flour'], [400.5, 'kg', 'chocolate']]
method =... | Set application/json mimetype for response. | Set application/json mimetype for response.
| Python | bsd-2-clause | kkelk/MeanRecipes,kkelk/MeanRecipes,kkelk/MeanRecipes,kkelk/MeanRecipes | ---
+++
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-from flask import Flask, url_for, render_template
+from flask import Flask, url_for, render_template, make_response
app = Flask(__name__)
@app.route('/')
@@ -11,7 +11,9 @@
ingredients = [[300.0, 'g', 'flour'], [400.5, 'kg', 'chocolate']]
method = ['Step 1... |
511c0a480aa2353d30224f7dbde822a02a8dd2c4 | appengine_config.py | appengine_config.py | """Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Appstats... | """Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Appstats... | Switch Django version from 1.0 to 1.1 | Switch Django version from 1.0 to 1.1
| Python | apache-2.0 | riannucci/rietveldv2,riannucci/rietveldv2 | ---
+++
@@ -31,7 +31,7 @@
# Declare the Django version we need.
from google.appengine.dist import use_library
-use_library('django', '1.0')
+use_library('django', '1.1')
# Fail early if we can't import Django 1.x. Log identifying information.
import django |
d237c121955b7249e0e2ab5580d2abc2d19b0f25 | noveltorpedo/models.py | noveltorpedo/models.py | from django.db import models
class Author(models.Model):
name = models.CharField(max_length=255)
def __str__(self):
return self.name
class Story(models.Model):
author = models.ForeignKey(Author, on_delete=models.CASCADE)
title = models.CharField(max_length=255)
contents = models.TextFie... | from django.db import models
class Author(models.Model):
name = models.CharField(max_length=255)
def __str__(self):
return self.name
class Story(models.Model):
authors = models.ManyToManyField(Author)
title = models.CharField(max_length=255)
contents = models.TextField(default='')
... | Allow a story to have many authors | Allow a story to have many authors
| Python | mit | NovelTorpedo/noveltorpedo,NovelTorpedo/noveltorpedo,NovelTorpedo/noveltorpedo,NovelTorpedo/noveltorpedo | ---
+++
@@ -9,7 +9,7 @@
class Story(models.Model):
- author = models.ForeignKey(Author, on_delete=models.CASCADE)
+ authors = models.ManyToManyField(Author)
title = models.CharField(max_length=255)
contents = models.TextField(default='')
|
8b33c216b2da4a7bf480d79675325134777db9ae | wsme/release.py | wsme/release.py | name = "WSME"
version = "0.3"
description = "Web Services Made Easy"
author = "Christophe de Vienne"
email = "python-wsme@googlegroups.com"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
| name = "WSME"
version = "0.3"
description = """Web Services Made Easy makes it easy to \
implement multi-protocol webservices."""
author = "Christophe de Vienne"
email = "python-wsme@googlegroups.com"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
| Change a bit the short description to make it more explicit | Change a bit the short description to make it more explicit
| Python | mit | stackforge/wsme | ---
+++
@@ -1,7 +1,8 @@
name = "WSME"
version = "0.3"
-description = "Web Services Made Easy"
+description = """Web Services Made Easy makes it easy to \
+implement multi-protocol webservices."""
author = "Christophe de Vienne"
email = "python-wsme@googlegroups.com" |
0ac053e9c27f8381bb1aceff0bfdb12fc9c952cb | tests/test_config.py | tests/test_config.py | from pytest import fixture
from oshino.config import Config, RiemannConfig
@fixture
def base_config():
return Config({"riemann": {"host": "localhost",
"port": 5555
},
"interval": 5
})
@fixture
def incomplete_con... | from pytest import fixture
from oshino.config import Config, RiemannConfig
@fixture
def base_config():
return Config({"riemann": {"host": "localhost",
"port": 5555
},
"interval": 5
})
@fixture
def incomplete_con... | Test default values for Riemann | Test default values for Riemann
| Python | mit | CodersOfTheNight/oshino | ---
+++
@@ -30,3 +30,9 @@
def test_incomplete_config_get_riemann(self, incomplete_config):
assert isinstance(incomplete_config.riemann, RiemannConfig)
+
+ def test_riemann_default_host(self, incomplete_config):
+ assert incomplete_config.riemann.host == "localhost"
+
+ def test_riemann_de... |
c205742520f4d2882d666e13a06c487d886ec7bc | trac/web/__init__.py | trac/web/__init__.py | # With mod_python we'll have to delay importing trac.web.api until
# modpython_frontend.handler() has been called since the
# PYTHON_EGG_CACHE variable is set from there
#
# TODO: Remove this once the Genshi zip_safe issue has been resolved.
import os
from pkg_resources import get_distribution
if not os.path.isdir(get_... | # Workaround for http://bugs.python.org/issue6763 and
# http://bugs.python.org/issue5853 thread issues
import mimetypes
mimetypes.init()
# With mod_python we'll have to delay importing trac.web.api until
# modpython_frontend.handler() has been called since the
# PYTHON_EGG_CACHE variable is set from there
#
# TODO: Re... | Fix race condition during `mimetypes` initialization. | Fix race condition during `mimetypes` initialization.
Initial patch from Steven R. Loomis.
Closes #8629.
git-svn-id: 0d96b0c1a6983ccc08b3732614f4d6bfcf9cbb42@9740 af82e41b-90c4-0310-8c96-b1721e28e2e2
| Python | bsd-3-clause | rbaumg/trac,rbaumg/trac,rbaumg/trac,rbaumg/trac | ---
+++
@@ -1,8 +1,14 @@
+# Workaround for http://bugs.python.org/issue6763 and
+# http://bugs.python.org/issue5853 thread issues
+import mimetypes
+mimetypes.init()
+
# With mod_python we'll have to delay importing trac.web.api until
# modpython_frontend.handler() has been called since the
# PYTHON_EGG_CACHE vari... |
d8b3e511b00c9b5a8c7951e16d06173fe93d6501 | engine/util.py | engine/util.py | import json
import threading
import Queue
from datetime import datetime,date,timedelta
import time
from tornado import gen
from tornado.ioloop import IOLoop
@gen.coroutine
def async_sleep(seconds):
yield gen.Task(IOLoop.instance().add_timeout, time.time() + seconds)
def delayed(seconds):
def f(x):
time.slee... | import json
import threading
import Queue
from datetime import datetime,date,timedelta
import time
import numpy
from tornado import gen
from tornado.ioloop import IOLoop
@gen.coroutine
def async_sleep(seconds):
yield gen.Task(IOLoop.instance().add_timeout, time.time() + seconds)
def delayed(seconds):
def f(x)... | Fix conditions in JSON encoder | Fix conditions in JSON encoder
| Python | apache-2.0 | METASPACE2020/sm-engine,SpatialMetabolomics/SM_distributed,METASPACE2020/sm-engine,SpatialMetabolomics/SM_distributed,SpatialMetabolomics/SM_distributed,SpatialMetabolomics/SM_distributed | ---
+++
@@ -4,6 +4,7 @@
from datetime import datetime,date,timedelta
import time
+import numpy
from tornado import gen
from tornado.ioloop import IOLoop
@@ -37,13 +38,17 @@
class DateTimeEncoder(json.JSONEncoder):
'''Auxuliary class that lets us encode dates in json'''
def default(self, obj):
- ... |
43905a102092bdd50de1f8997cd19cb617b348b3 | tests/cart_tests.py | tests/cart_tests.py | import importlib
import os
import sys
import unittest
import code
import struct
code_path = os.path.dirname(__file__)
code_path = os.path.join(code_path, os.pardir)
sys.path.append(code_path)
import MOS6502
class TestCartHeaderParsing(unittest.TestCase):
def testMagic(self):
cpu = MOS6502.CPU()
c... | import importlib
import os
import sys
import unittest
import code
import struct
code_path = os.path.dirname(__file__)
code_path = os.path.join(code_path, os.pardir)
sys.path.append(code_path)
import MOS6502
class TestCartHeaderParsing(unittest.TestCase):
def testMagic(self):
cpu = MOS6502.CPU()
c... | Use the reset adder from the banks properly | Use the reset adder from the banks properly
| Python | bsd-2-clause | pusscat/refNes | ---
+++
@@ -23,6 +23,9 @@
self.assertEqual(cpu.rom.numRomBanks, 2)
self.assertEqual(cpu.rom.numVromBanks, 1)
+ startAddr = cpu.ReadMemWord(cpu.reset)
+ firstByte = cpu.ReadMemory(startAddr)
+ self.assertEqual(firstByte, 0x78)
if __name__ == '__main__': |
f0e8999ad139a8da8d3762ee1d318f23928edd9c | tests/modelstest.py | tests/modelstest.py | # Copyright (C) 2010 rPath, Inc.
import testsuite
testsuite.setup()
from testrunner import testcase
from rpath_repeater import models
class TestBase(testcase.TestCaseWithWorkDir):
pass
class ModelsTest(TestBase):
def testModelToXml(self):
files = models.ImageFiles([
models.ImageFile(tit... | # Copyright (C) 2010 rPath, Inc.
import testsuite
testsuite.setup()
from testrunner import testcase
from rpath_repeater import models
class TestBase(testcase.TestCaseWithWorkDir):
pass
class ModelsTest(TestBase):
def testModelToXml(self):
files = models.ImageFiles([
models.ImageFile(tit... | Fix test after metadata changes | Fix test after metadata changes
| Python | apache-2.0 | sassoftware/rpath-repeater | ---
+++
@@ -16,9 +16,7 @@
models.ImageFile(title="i1", sha1="s1", size=1),
models.ImageFile(title="i2", sha1="s2"),
])
- metadata = models.ImageMetadata(owner="me")
- files.append(metadata)
self.failUnlessEqual(files.toXml(),
- '<files><file><title>... |
face46431ce58600e99a745707a1cdf3ae2b34e2 | tests/test_fonts.py | tests/test_fonts.py | """
tests.test_fonts
~~~~~~~~~~~~~~~~~~~~~
Test fonts API.
:copyright: (c) 2018 Yoan Tournade.
:license: AGPL, see LICENSE for more details.
"""
import requests
def test_api_fonts_list(latex_on_http_api_url):
"""
The API list available fonts.
"""
r = requests.get("{}/fonts".format... | """
tests.test_fonts
~~~~~~~~~~~~~~~~~~~~~
Test fonts API.
:copyright: (c) 2018 Yoan Tournade.
:license: AGPL, see LICENSE for more details.
"""
import requests
def test_api_fonts_list(latex_on_http_api_url):
"""
The API list available fonts.
"""
r = requests.get("{}/fonts".format... | Update number of fonts in Docker image | Update number of fonts in Docker image
| Python | agpl-3.0 | YtoTech/latex-on-http,YtoTech/latex-on-http | ---
+++
@@ -24,4 +24,4 @@
assert "name" in font
assert "styles" in font
assert isinstance(font["styles"], list) is True
- assert len(fonts) == 421
+ assert len(fonts) == 2030 |
3a5fb18a385ffd0533da94632d917e3c0bcfb051 | tests/test_nulls.py | tests/test_nulls.py | from tests.models import EventWithNulls, EventWithNoNulls
import pytest
@pytest.mark.django_db
def test_recurs_can_be_explicitly_none_if_none_is_allowed():
# Check we can save None correctly
event = EventWithNulls.objects.create(recurs=None)
assert event.recurs is None
# Check we can deserialize None... | from recurrence import Recurrence
from tests.models import EventWithNulls, EventWithNoNulls
import pytest
@pytest.mark.django_db
def test_recurs_can_be_explicitly_none_if_none_is_allowed():
# Check we can save None correctly
event = EventWithNulls.objects.create(recurs=None)
assert event.recurs is None
... | Add a test for saving an empty recurrence object | Add a test for saving an empty recurrence object
I wasn't sure whether this would fail on models which don't
accept null values. Turns out it's allowed, so we should
make sure it stays allowed.
| Python | bsd-3-clause | linux2400/django-recurrence,linux2400/django-recurrence,django-recurrence/django-recurrence,Nikola-K/django-recurrence,FrankSalad/django-recurrence,Nikola-K/django-recurrence,FrankSalad/django-recurrence,django-recurrence/django-recurrence | ---
+++
@@ -1,3 +1,4 @@
+from recurrence import Recurrence
from tests.models import EventWithNulls, EventWithNoNulls
import pytest
@@ -17,3 +18,9 @@
def test_recurs_cannot_be_explicitly_none_if_none_is_disallowed():
with pytest.raises(ValueError):
EventWithNoNulls.objects.create(recurs=None)
+
+
+@... |
cd2e4cce080413feb7685ec9a788327b8bca9053 | tests/test_style.py | tests/test_style.py | import pkg_resources
import unittest
class CodeStyleTestCase(unittest.TestCase):
def test_code_style(self):
flake8 = pkg_resources.load_entry_point('flake8', 'console_scripts', 'flake8')
try:
flake8([])
except SystemExit as e:
if e.code != 0:
self.fa... | import logging
import pkg_resources
import unittest
class CodeStyleTestCase(unittest.TestCase):
def test_code_style(self):
logger = logging.getLogger('flake8')
logger.setLevel(logging.ERROR)
flake8 = pkg_resources.load_entry_point('flake8', 'console_scripts', 'flake8')
try:
... | Decrease noise from code-style test | Decrease noise from code-style test
| Python | mit | ministryofjustice/bai2 | ---
+++
@@ -1,9 +1,12 @@
+import logging
import pkg_resources
import unittest
class CodeStyleTestCase(unittest.TestCase):
def test_code_style(self):
+ logger = logging.getLogger('flake8')
+ logger.setLevel(logging.ERROR)
flake8 = pkg_resources.load_entry_point('flake8', 'console_scr... |
59e47de06a175084538140481c7a702ff020e919 | libvcs/__about__.py | libvcs/__about__.py | __title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/vcs-python/libvcs'
__pypi__ = 'https://pypi.org/project/libvcs/'
__email__ = 'tony@git-pull.com'
__license__ = 'MIT'
__copyright__ = 'Copyright 20... | __title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/vcs-python/libvcs'
__docs__ = 'https://libvcs.git-pull.com'
__tracker__ = 'https://github.com/vcs-python/libvcs/issues'
__pypi__ = 'https://pypi.o... | Add metadata for tracker and docs | Add metadata for tracker and docs
| Python | mit | tony/libvcs | ---
+++
@@ -4,6 +4,8 @@
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/vcs-python/libvcs'
+__docs__ = 'https://libvcs.git-pull.com'
+__tracker__ = 'https://github.com/vcs-python/libvcs/issues'
__pypi__ = 'https://pypi.org/project/libvcs/'
__email__ = 'tony@git-pull.com'
__lic... |
5cf8516db40a8581eb80a1fb64a0b11da37527dd | libxau/conanfile.py | libxau/conanfile.py | from conans import ConanFile, AutoToolsBuildEnvironment, tools
import os
class LibxauConan(ConanFile):
name = "libxau"
version = "1.0.8"
license = "Custom https://cgit.freedesktop.org/xorg/lib/libXau/tree/COPYING"
url = "https://github.com/trigger-happy/conan-packages"
description = "X11 authorisa... | from conans import ConanFile, AutoToolsBuildEnvironment, tools
import os
class LibxauConan(ConanFile):
name = "libxau"
version = "1.0.8"
license = "Custom https://cgit.freedesktop.org/xorg/lib/libXau/tree/COPYING"
url = "https://github.com/trigger-happy/conan-packages"
description = "X11 authorisa... | Fix incorrect libxau library name | Fix incorrect libxau library name
| Python | mit | trigger-happy/conan-packages | ---
+++
@@ -31,4 +31,4 @@
self.copy("include/*", dst=".", keep_path=True)
def package_info(self):
- self.cpp_info.libs = ["libXau"]
+ self.cpp_info.libs = ["Xau"] |
d8c1c7da47e2568cecc1fd6dff0fec7661b39125 | turbosms/routers.py | turbosms/routers.py |
class SMSRouter(object):
app_label = 'sms'
db_name = 'sms'
def db_for_read(self, model, **hints):
if model._meta.app_label == self.app_label:
return self.db_name
return None
def db_for_write(self, model, **hints):
if model._meta.app_label == self.app_label:
... |
class TurboSMSRouter(object):
app_label = 'turbosms'
db_name = 'turbosms'
def db_for_read(self, model, **hints):
if model._meta.app_label == self.app_label:
return self.db_name
return None
def db_for_write(self, model, **hints):
if model._meta.app_label == self... | Fix bug in sms router. | Fix bug in sms router.
| Python | isc | pmaigutyak/mp-turbosms | ---
+++
@@ -1,8 +1,8 @@
-class SMSRouter(object):
+class TurboSMSRouter(object):
- app_label = 'sms'
- db_name = 'sms'
+ app_label = 'turbosms'
+ db_name = 'turbosms'
def db_for_read(self, model, **hints):
|
5fade4bc26c2637a479a69051cee37a1a859c71a | load_hilma.py | load_hilma.py | #!/usr/bin/env python3
import xml.etree.ElementTree as ET
import sys
import pymongo
from pathlib import Path
import argh
from xml2json import etree_to_dict
from hilma_conversion import get_handler
hilma_to_dict = lambda notice: etree_to_dict(notice, get_handler)
def load_hilma_xml(inputfile, collection):
root = E... | #!/usr/bin/env python3
import xml.etree.ElementTree as ET
import sys
import pymongo
from pathlib import Path
import argh
from xml2json import etree_to_dict
from hilma_conversion import get_handler
hilma_to_dict = lambda notice: etree_to_dict(notice, get_handler)
def load_hilma_xml(inputfile, collection):
root = E... | Use the notice ID as priary key | Use the notice ID as priary key
Gentlemen, drop your DBs!
| Python | agpl-3.0 | jampekka/openhilma | ---
+++
@@ -18,11 +18,9 @@
notices = map(hilma_to_dict, notices)
- collection.ensure_index('ID', unique=True)
-
for n in notices:
# Use the ID as primary key
- n.update('_id', n['ID'])
+ n.update({'_id': n['ID']})
collection.save(n)
def sync_hilma_xml_directory(directory, mongo_uri=None, mongo_... |
816874f692c7ef9de5aa8782fab1747e96199229 | moksha/live/flot.py | moksha/live/flot.py | # This file is part of Moksha.
#
# Moksha is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Moksha is distributed in the hope that it... | # This file is part of Moksha.
#
# Moksha is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Moksha is distributed in the hope that it... | Clean up some LiveFlotWidget params | Clean up some LiveFlotWidget params
| Python | apache-2.0 | ralphbean/moksha,lmacken/moksha,lmacken/moksha,pombredanne/moksha,ralphbean/moksha,mokshaproject/moksha,pombredanne/moksha,mokshaproject/moksha,mokshaproject/moksha,pombredanne/moksha,mokshaproject/moksha,pombredanne/moksha,ralphbean/moksha,lmacken/moksha | ---
+++
@@ -22,9 +22,8 @@
class LiveFlotWidget(LiveWidget):
""" A live graphing widget """
topic = 'flot_example'
+ params = ['id', 'data', 'options', 'height', 'width', 'onmessageframe']
children = [FlotWidget('flot')]
- params = ['id', 'data', 'options', 'height', 'width',
- 'onco... |
cb5dc31aa3b77d2bf4aab08785749d24da80f325 | taggit_autosuggest_select2/models.py | taggit_autosuggest_select2/models.py | try:
from south.modelsinspector import add_ignored_fields
add_ignored_fields(["^taggit_autosuggest\.managers"])
except ImportError:
pass # without south this can fail silently
| try:
from south.modelsinspector import add_ignored_fields
add_ignored_fields(["^taggit_autosuggest_select2\.managers"])
except ImportError:
pass # without south this can fail silently
| Correct ignored module name for South. | Correct ignored module name for South.
| Python | mit | iris-edu/django-taggit-autosuggest-select2,kpantic/django-taggit-autosuggest-select2,iris-edu/django-taggit-autosuggest-select2,kpantic/django-taggit-autosuggest-select2,iris-edu-int/django-taggit-autosuggest-select2,iris-edu-int/django-taggit-autosuggest-select2,iris-edu/django-taggit-autosuggest-select2,iris-edu-int/... | ---
+++
@@ -1,6 +1,6 @@
try:
from south.modelsinspector import add_ignored_fields
- add_ignored_fields(["^taggit_autosuggest\.managers"])
+ add_ignored_fields(["^taggit_autosuggest_select2\.managers"])
except ImportError:
pass # without south this can fail silently
|
8bc2b19e9aef410832555fb9962c243f0d4aef96 | brink/decorators.py | brink/decorators.py | def require_request_model(cls, *args, validate=True, **kwargs):
"""
Makes a handler require that a request body that map towards the given model
is provided. Unless the ``validate`` option is set to ``False`` the data will
be validated against the model's fields.
The model will be passed to the han... | import asyncio
def require_request_model(cls, *args, validate=True, **kwargs):
"""
Makes a handler require that a request body that map towards the given model
is provided. Unless the ``validate`` option is set to ``False`` the data will
be validated against the model's fields.
The model will be ... | Add decorator for using websocket subhandlers | Add decorator for using websocket subhandlers
| Python | bsd-3-clause | brinkframework/brink | ---
+++
@@ -1,3 +1,6 @@
+import asyncio
+
+
def require_request_model(cls, *args, validate=True, **kwargs):
"""
Makes a handler require that a request body that map towards the given model
@@ -21,3 +24,39 @@
return await handler(request, *args, model, **kwargs)
return new_handler
... |
2501bb03e836ac29cc1defa8591446ff217771b2 | tests/test_model.py | tests/test_model.py | """Sample unittests."""
import unittest2 as unittest
from domain_models import model
from domain_models import fields
class User(model.DomainModel):
"""Example user domain model."""
id = fields.Int()
email = fields.String()
first_name = fields.Unicode()
last_name = fields.Unicode()
gender =... | """Sample unittests."""
import unittest2 as unittest
from domain_models import model
from domain_models import fields
class User(model.DomainModel):
"""Example user domain model."""
id = fields.Int()
email = fields.String()
first_name = fields.Unicode()
last_name = fields.Unicode()
gender =... | Fix of tests with unicode strings | Fix of tests with unicode strings
| Python | bsd-3-clause | ets-labs/domain_models,ets-labs/python-domain-models,rmk135/domain_models | ---
+++
@@ -35,7 +35,7 @@
self.assertEqual(user.id, 1)
self.assertEqual(user.email, 'example@example.com')
- self.assertEqual(user.first_name, u'John')
- self.assertEqual(user.last_name, u'Smith')
+ self.assertEqual(user.first_name, unicode('John'))
+ self.assertEqual(u... |
cb798ae8f7f6e810a87137a56cd04be76596a2dd | photutils/tests/test_psfs.py | photutils/tests/test_psfs.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import division
import numpy as np
from astropy.tests.helper import pytest
from photutils.psf import GaussianPSF
try:
from scipy import optimize
HAS_SCIPY = True
except ImportError:
HAS_SCIPY = False
widths = [0.001, 0.01,... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import division
import numpy as np
from astropy.tests.helper import pytest
from ..psf import GaussianPSF
try:
from scipy import optimize
HAS_SCIPY = True
except ImportError:
HAS_SCIPY = False
widths = [0.001, 0.01, 0.1, 1]
@... | Use relative imports for consistency; pep8 | Use relative imports for consistency; pep8
| Python | bsd-3-clause | larrybradley/photutils,astropy/photutils | ---
+++
@@ -1,11 +1,8 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import division
-
import numpy as np
-
from astropy.tests.helper import pytest
-from photutils.psf import GaussianPSF
-
+from ..psf import GaussianPSF
try:
from scipy import optimize
HAS_SCIPY = Tr... |
66df1b2719aa278c37f1c70ef550659c22d93d10 | tests/unit/fakes.py | tests/unit/fakes.py | # Copyright 2012 Intel Inc, OpenStack LLC.
# 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... | # Copyright 2012 Intel Inc, OpenStack Foundation.
# 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
#
# ... | Fix Copyright Headers - Rename LLC to Foundation | Fix Copyright Headers - Rename LLC to Foundation
One code change, rest are in headers
Change-Id: I73f59681358629e1ad74e49d3d3ca13fcb5c2eb1
| Python | apache-2.0 | openstack/oslo.i18n,varunarya10/oslo.i18n | ---
+++
@@ -1,4 +1,4 @@
-# Copyright 2012 Intel Inc, OpenStack LLC.
+# Copyright 2012 Intel Inc, OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
65fd070a88e06bb040e8c96babc6b4c86ca29730 | validatish/error.py | validatish/error.py | """
Module containing package exception classes.
"""
class Invalid(Exception):
def __init__(self, message, exceptions=None, validator=None):
Exception.__init__(self, message, exceptions)
self.message = message
self.exceptions = exceptions
self.validator = validator
def __str_... | """
Module containing package exception classes.
"""
class Invalid(Exception):
def __init__(self, message, exceptions=None, validator=None):
Exception.__init__(self, message, exceptions)
self.message = message
self.exceptions = exceptions
self.validator = validator
def __str_... | Hide Python 2.6 Exception.message deprecation warnings | Hide Python 2.6 Exception.message deprecation warnings
| Python | bsd-3-clause | ish/validatish,ish/validatish | ---
+++
@@ -20,7 +20,6 @@
return 'validatish.Invalid("%s", exceptions=%s, validator=%s)' % (self.message, self.exceptions, self.validator)
else:
return 'validatish.Invalid("%s", validator=%s)' % (self.message, self.validator)
-
@property
def errors(self):
@@ ... |
5c620a504327696b9cfe3ffc423ae7ae6e915e78 | dec02/dec02part1.py | dec02/dec02part1.py | # Advent of Code
# Dec 2, Part 1
# @geekygirlsarah
| # Advent of Code
# Dec 2, Part 1
# @geekygirlsarah
inputFile = "input.txt"
# Tracking vars
finalCode = ""
lastNumber = 5 # start here
tempNumber = 0
with open(inputFile) as f:
while True:
line = f.readline(-1)
if not line:
# print "End of file"
break
# print (... | Add 12/2 part 1 solution | Add 12/2 part 1 solution
| Python | mit | geekygirlsarah/adventofcode2016 | ---
+++
@@ -2,3 +2,49 @@
# Dec 2, Part 1
# @geekygirlsarah
+inputFile = "input.txt"
+
+# Tracking vars
+finalCode = ""
+lastNumber = 5 # start here
+tempNumber = 0
+
+with open(inputFile) as f:
+ while True:
+ line = f.readline(-1)
+ if not line:
+ # print "End of file"
+ ... |
356dd5294280db3334f86354202f0d68881254b9 | joerd/check.py | joerd/check.py | import zipfile
import tarfile
import shutil
import tempfile
from osgeo import gdal
def is_zip(tmp):
"""
Returns True if the NamedTemporaryFile given as the argument appears to be
a well-formed Zip file.
"""
try:
zip_file = zipfile.ZipFile(tmp.name, 'r')
test_result = zip_file.test... | import zipfile
import tarfile
import shutil
import tempfile
from osgeo import gdal
def is_zip(tmp):
"""
Returns True if the NamedTemporaryFile given as the argument appears to be
a well-formed Zip file.
"""
try:
zip_file = zipfile.ZipFile(tmp.name, 'r')
test_result = zip_file.test... | Return verifier function, not None. Also reset the temporary file to the beginning before verifying it. | Return verifier function, not None. Also reset the temporary file to the beginning before verifying it.
| Python | mit | mapzen/joerd,tilezen/joerd | ---
+++
@@ -34,10 +34,13 @@
tar = tarfile.open(tmp.name, mode='r:gz', errorlevel=2)
with tempfile.NamedTemporaryFile() as tmp_member:
shutil.copyfileobj(tar.extractfile(member_name), tmp_member)
+ tmp_member.seek(0)
return is_gdal(tmp_member)
... |
9353a5e2369e819c092c94d224b09c321f5b5ff0 | utils/get_collection_object_count.py | utils/get_collection_object_count.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
import sys, os
import argparse
from deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo
def main(argv=None):
parser = argparse.ArgumentParser(description='Print count of objects for a given collection.')
parser.add_argument('path', help="Nuxeo path to collection... | #!/usr/bin/env python
# -*- coding: utf8 -*-
import sys, os
import argparse
from deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo
def main(argv=None):
parser = argparse.ArgumentParser(description='Print count of objects for a given collection.')
parser.add_argument('path', help="Nuxeo path to collection... | Add option to count components | Add option to count components
| Python | bsd-3-clause | barbarahui/nuxeo-calisphere,barbarahui/nuxeo-calisphere | ---
+++
@@ -10,6 +10,7 @@
parser = argparse.ArgumentParser(description='Print count of objects for a given collection.')
parser.add_argument('path', help="Nuxeo path to collection")
parser.add_argument('--pynuxrc', default='~/.pynuxrc-prod', help="rcfile for use with pynux utils")
+ parser.add_argum... |
d84e6aa022ef5e256807738c35e5069a0a1380d7 | app/main/forms/frameworks.py | app/main/forms/frameworks.py | from flask.ext.wtf import Form
from wtforms import BooleanField
from wtforms.validators import DataRequired, Length
from dmutils.forms import StripWhitespaceStringField
class SignerDetailsForm(Form):
signerName = StripWhitespaceStringField('Full name', validators=[
DataRequired(message="You must provide t... | from flask.ext.wtf import Form
from wtforms import BooleanField
from wtforms.validators import DataRequired, Length
from dmutils.forms import StripWhitespaceStringField
class SignerDetailsForm(Form):
signerName = StripWhitespaceStringField('Full name', validators=[
DataRequired(message="You must provide t... | Add form for accepting contract variation | Add form for accepting contract variation
| Python | mit | alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend | ---
+++
@@ -25,3 +25,12 @@
'Authorisation',
validators=[DataRequired(message="You must confirm you have the authority to return the agreement.")]
)
+
+
+class AcceptAgreementVariationForm(Form):
+ accept_changes = BooleanField(
+ 'I accept these proposed changes',
+ validators=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.