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 |
|---|---|---|---|---|---|---|---|---|---|---|
a7340268cd5bf19d81668595c2cec5e707873737 | tests/test_objects.py | tests/test_objects.py | import sys
from funcy.objects import *
### @cached_property
def test_set_cached_property():
class A(object):
@cached_property
def prop(self):
return 7
a = A()
assert a.prop == 7
a.prop = 42
assert a.prop == 42
### Monkey tests
def test_monkey():
class A(object... | import sys
from funcy.objects import *
### @cached_property
def test_set_cached_property():
calls = [0]
class A(object):
@cached_property
def prop(self):
calls[0] += 1
return 7
a = A()
assert a.prop == 7
assert a.prop == 7
assert calls == [1]
a.p... | Test that @cached_property really caches | Test that @cached_property really caches
| Python | bsd-3-clause | musicpax/funcy,ma-ric/funcy,Suor/funcy | ---
+++
@@ -5,16 +5,22 @@
### @cached_property
def test_set_cached_property():
+ calls = [0]
+
class A(object):
@cached_property
def prop(self):
+ calls[0] += 1
return 7
a = A()
assert a.prop == 7
+ assert a.prop == 7
+ assert calls == [1]
... |
5a4eca867882299ce3ad8b0cc15c39b4ada61c0a | PublicWebServicesAPI_AND_servercommandScripts/addInfoToCSVreport.py | PublicWebServicesAPI_AND_servercommandScripts/addInfoToCSVreport.py | #!/usr/bin/env python3
from csv import reader
from sys import stdin
from xmlrpc.client import ServerProxy
from ssl import create_default_context, Purpose
# #TODO Add a note about which report this example works with.
host="https://localhost:9192/rpc/api/xmlrpc" # If not localhost then this address will need to b... | #!/usr/bin/env python3
from csv import reader
from sys import stdin
from xmlrpc.client import ServerProxy
from ssl import create_default_context, Purpose
# Script to add user account notes to account_configurations.csv
host="https://localhost:9192/rpc/api/xmlrpc" # If not localhost then this address will need to ... | Add relevant notes and documentation to addInfoToCSVReport.py | Update: Add relevant notes and documentation to addInfoToCSVReport.py
| Python | mit | PaperCutSoftware/PaperCutExamples,PaperCutSoftware/PaperCutExamples,PaperCutSoftware/PaperCutExamples,PaperCutSoftware/PaperCutExamples,PaperCutSoftware/PaperCutExamples,PaperCutSoftware/PaperCutExamples | ---
+++
@@ -7,22 +7,23 @@
from ssl import create_default_context, Purpose
-# #TODO Add a note about which report this example works with.
-
+# Script to add user account notes to account_configurations.csv
host="https://localhost:9192/rpc/api/xmlrpc" # If not localhost then this address will need to be whitel... |
587f6c77153235e3defcc6b0b6598634e1ee2828 | lib/sqlalchemy/dialects/__init__.py | lib/sqlalchemy/dialects/__init__.py | # dialects/__init__.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
__all__ = (
"firebird",
"mssql",
"mysql",
"oracle",
"postgr... | # dialects/__init__.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
__all__ = (
"firebird",
"mssql",
"mysql",
"oracle",
"postgr... | Load external firebird or sybase dialect if available | Load external firebird or sybase dialect if available
Fixes: #5318
Extension of I1660abb11c02656fbf388f2f9c4257075111be58
Change-Id: I32b678430497327f9b08f821bd345a2557e34b1f
| Python | mit | monetate/sqlalchemy,j5int/sqlalchemy,j5int/sqlalchemy,zzzeek/sqlalchemy,sqlalchemy/sqlalchemy,monetate/sqlalchemy | ---
+++
@@ -35,15 +35,21 @@
if dialect == "firebird":
try:
module = __import__("sqlalchemy_firebird")
- dialect = "dialect"
- except:
+ except ImportError:
module = __import__("sqlalchemy.dialects.firebird").dialects
+ ... |
f4c01d85eb5a3873ea80e24b3dae50bd3ab87f4a | llvmlite/binding/linker.py | llvmlite/binding/linker.py | from __future__ import print_function, absolute_import
from ctypes import c_int, c_char_p, POINTER
from . import ffi
def link_modules(dst, src):
dst.verify()
src.verify()
with ffi.OutputString() as outerr:
err = ffi.lib.LLVMPY_LinkModules(dst, src, outerr)
# The underlying module was destr... | from __future__ import print_function, absolute_import
from ctypes import c_int, c_char_p, POINTER
from . import ffi
def link_modules(dst, src):
with ffi.OutputString() as outerr:
err = ffi.lib.LLVMPY_LinkModules(dst, src, outerr)
# The underlying module was destroyed
src.detach()
... | Remove unnecessary verify. We should let user run the verification instead of doing it in linkage. | Remove unnecessary verify.
We should let user run the verification instead of doing it in linkage.
| Python | bsd-2-clause | numba/llvmlite,numba/llvmlite,numba/llvmlite,numba/llvmlite | ---
+++
@@ -4,8 +4,6 @@
def link_modules(dst, src):
- dst.verify()
- src.verify()
with ffi.OutputString() as outerr:
err = ffi.lib.LLVMPY_LinkModules(dst, src, outerr)
# The underlying module was destroyed |
60b039aabb94c1e5a50bb19bb7267a0fd3ceaa86 | mollie/api/objects/list.py | mollie/api/objects/list.py | from .base import Base
class List(Base):
current = None
def __init__(self, result, object_type):
Base.__init__(self, result)
self.object_type = object_type
def __len__(self):
"""Return the count field."""
return int(self['count'])
def get_object_name(self):
r... | from .base import Base
class List(Base):
current = None
def __init__(self, result, object_type):
Base.__init__(self, result)
self.object_type = object_type
def __len__(self):
"""Return the count field."""
return int(self['count'])
def get_object_name(self):
r... | Drop obsoleted support for offset. | Drop obsoleted support for offset.
| Python | bsd-2-clause | mollie/mollie-api-python | ---
+++
@@ -39,8 +39,3 @@
if 'count' not in self:
return None
return int(self['count'])
-
- def get_offset(self):
- if 'offset' not in self:
- return None
- return self['offset'] |
ba211a0037aa26d5d1fc9cb7a0de55a46b481a82 | prometapi/bicikeljproxy/management/commands/bicikelj_fetch_citybikes.py | prometapi/bicikeljproxy/management/commands/bicikelj_fetch_citybikes.py | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import os
import sys
class Command(BaseCommand):
help = 'Fetch bicikelj XMLs and store them in order not to storm on official servers'
def handle(self, *args, **options):
from prometapi.bicikeljproxy.models import ... | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import os
import sys
class Command(BaseCommand):
help = 'Fetch bicikelj XMLs and store them in order not to storm on official servers'
def handle(self, *args, **options):
from prometapi.bicikeljproxy.models import ... | Print data when citybikes throws error. | Print data when citybikes throws error.
| Python | agpl-3.0 | zejn/prometapi,izacus/prometapi,zejn/prometapi,izacus/prometapi | ---
+++
@@ -13,7 +13,10 @@
import urllib
#timestamp, data = fetch_xmls()
+ print 'fetch', 'http://api.citybik.es/bicikelj.json'
foreign_data = urllib.urlopen('http://api.citybik.es/bicikelj.json').read()
+
+ print [foreign_data]
data = convert_citybikes(foreign_data)
timestamp = datetime.da... |
fbbee24a71f840131748bc8ca1cadc7759c58d52 | molo/core/content_import/api/urls.py | molo/core/content_import/api/urls.py | from django.conf.urls import url
from molo.core.content_import.api import admin_views
urlpatterns = [
url(r"^import-articles/$", admin_views.ArticleImportView.as_view(), name="article-import"),
url(r"^parent/$", admin_views.ChooseParentView.as_view(model_admin=admin_views.ArticleModelAdmin()), name="test-par... | from django.conf.urls import url
from molo.core.content_import.api import admin_views
urlpatterns = [
url(r"^import-articles/$", admin_views.ArticleImportView.as_view(), name="article-import"),
url(r"^parent/$", admin_views.ArticleChooserView.as_view(model_admin=admin_views.ArticleModelAdmin()), name="test-p... | Fix name of Aritlce Parent Chooser view as used by the URLs | Fix name of Aritlce Parent Chooser view as used by the URLs
| Python | bsd-2-clause | praekelt/molo,praekelt/molo,praekelt/molo,praekelt/molo | ---
+++
@@ -5,5 +5,5 @@
urlpatterns = [
url(r"^import-articles/$", admin_views.ArticleImportView.as_view(), name="article-import"),
- url(r"^parent/$", admin_views.ChooseParentView.as_view(model_admin=admin_views.ArticleModelAdmin()), name="test-parent"),
+ url(r"^parent/$", admin_views.ArticleChooserVi... |
ce97f7677a84db351e3d2cadf01691fc879a8fbe | profile/files/applications/report/fedora/check_updates.py | profile/files/applications/report/fedora/check_updates.py | dnf_failure = False
base = dnf.Base()
try:
base.read_all_repos()
base.fill_sack()
upgrades = base.sack.query().upgrades().run()
except:
dnf_failure = True
if dnf_failure:
pkg_output = -1
else:
pkg_output = len(upgrades)
| dnf_failure = False
base = dnf.Base()
base.conf.substitutions.update_from_etc("/")
try:
base.read_all_repos()
base.fill_sack()
upgrades = base.sack.query().upgrades().run()
except:
dnf_failure = True
if dnf_failure:
pkg_output = -1
else:
pkg_output = len(upgrades)
| Read custom variables (Required to support CentOS Stream) | Read custom variables (Required to support CentOS Stream)
| Python | apache-2.0 | norcams/himlar,tanzr/himlar,raykrist/himlar,norcams/himlar,norcams/himlar,TorLdre/himlar,tanzr/himlar,tanzr/himlar,raykrist/himlar,TorLdre/himlar,norcams/himlar,TorLdre/himlar,raykrist/himlar,mikaeld66/himlar,mikaeld66/himlar,mikaeld66/himlar,tanzr/himlar,TorLdre/himlar,raykrist/himlar,tanzr/himlar,norcams/himlar,raykr... | ---
+++
@@ -1,5 +1,6 @@
dnf_failure = False
base = dnf.Base()
+base.conf.substitutions.update_from_etc("/")
try:
base.read_all_repos() |
56af29b28ff236c4380a11e4c498ae2c61917e62 | tests/test_level_standards.py | tests/test_level_standards.py | import sys
def test_level_standards(logging, log):
"""
Ensure that the standard log levels work
"""
import logging_levels.standards
del sys.modules['logging_levels.standards'] # Force module to re-import
assert logging.TRACE == 8
assert logging.VERBOSE == 9
log.verbose("I've ... | import sys
def test_level_standards(logging, log):
"""
Ensure that the standard log levels work
"""
import logging_levels.standards
del sys.modules['logging_levels.standards'] # Force module to re-import
assert logging.TRACE == 5
assert logging.VERBOSE == 7
log.verbose("I've ... | Fix standards tests for log levels | Fix standards tests for log levels
| Python | mit | six8/logging-levels | ---
+++
@@ -7,8 +7,8 @@
import logging_levels.standards
del sys.modules['logging_levels.standards'] # Force module to re-import
- assert logging.TRACE == 8
- assert logging.VERBOSE == 9
+ assert logging.TRACE == 5
+ assert logging.VERBOSE == 7
log.verbose("I've said too much")
... |
5085e2f8c97ecab6617b4f7b0c8250095d47b22d | boardinghouse/templatetags/boardinghouse.py | boardinghouse/templatetags/boardinghouse.py | from django import template
from ..schema import is_shared_model as _is_shared_model
from ..schema import get_schema_model
Schema = get_schema_model()
register = template.Library()
@register.filter
def is_schema_aware(obj):
return obj and not _is_shared_model(obj)
@register.filter
def is_shared_model(obj):
... | from django import template
from ..schema import is_shared_model as _is_shared_model
from ..schema import _get_schema
register = template.Library()
@register.filter
def is_schema_aware(obj):
return obj and not _is_shared_model(obj)
@register.filter
def is_shared_model(obj):
return obj and _is_shared_model(o... | Remove a database access from the template tag. | Remove a database access from the template tag.
--HG--
branch : schema-invitations
| Python | bsd-3-clause | schinckel/django-boardinghouse,schinckel/django-boardinghouse,schinckel/django-boardinghouse | ---
+++
@@ -1,9 +1,7 @@
from django import template
from ..schema import is_shared_model as _is_shared_model
-from ..schema import get_schema_model
-
-Schema = get_schema_model()
+from ..schema import _get_schema
register = template.Library()
@@ -16,8 +14,8 @@
return obj and _is_shared_model(obj)
@re... |
b2b6874e044b6984f8b0a300963ff340df62abc9 | ycml/transformers/base.py | ycml/transformers/base.py | import logging
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from ..utils import Timer
__all__ = ['PureTransformer', 'identity']
logger = logging.getLogger(__name__)
# Helper class. A transformer that only does transformation and does not need to fit any internal parameters.
class ... | import logging
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from ..utils import Timer
__all__ = ['PureTransformer', 'identity']
logger = logging.getLogger(__name__)
# Helper class. A transformer that only does transformation and does not need to fit any internal parameters.
class ... | Add `**kwargs` support to transformers | Add `**kwargs` support to transformers
| Python | apache-2.0 | skylander86/ycml | ---
+++
@@ -22,9 +22,9 @@
def fit(self, X, y=None, **fit_params): return self
- def transform(self, X, y=None):
+ def transform(self, X, **kwargs):
timer = Timer()
- transformed = self._transform(X, y)
+ transformed = self._transform(X, **kwargs)
if self.nparray: transfo... |
538ae3b96399e207e38bdf53bdd1c8f738b82e33 | tests/test_pagination.py | tests/test_pagination.py | from hn import HN
hn = HN()
def test_pagination_top():
"""
This test checks if the pagination works for the front page by comparing
number of stories in 2 pages.
"""
assert len(hn.get_stories(page_limit=2)) == 2 * 30
def test_pagination_newest():
"""
This test checks if the pagination wo... | from hn import HN
hn = HN()
def test_pagination_top_for_2_pages():
"""
This test checks if the pagination works for the front page by comparing
number of stories in 2 page.
"""
stories = hn.get_stories(page_limit=2)
assert len(stories) == 2 * 30
def test_pagination_newest_for_3_pages():
... | Add test cases for unexpected page_limit | Add test cases for unexpected page_limit
| Python | mit | brunocappelli/HackerNewsAPI,karan/HackerNewsAPI,brunocappelli/HackerNewsAPI,karan/HackerNewsAPI,brunocappelli/HackerNewsAPI | ---
+++
@@ -2,25 +2,44 @@
hn = HN()
-def test_pagination_top():
+def test_pagination_top_for_2_pages():
"""
This test checks if the pagination works for the front page by comparing
- number of stories in 2 pages.
+ number of stories in 2 page.
"""
- assert len(hn.get_stories(page_limit=2)... |
7d894c2faa2d9dfac8eec5389ecb500a8f5f8e63 | bin/pymodules/apitest/jscomponent.py | bin/pymodules/apitest/jscomponent.py | import json
import rexviewer as r
import naali
import urllib2
from componenthandler import DynamiccomponentHandler
class JavascriptHandler(DynamiccomponentHandler):
GUINAME = "Javascript Handler"
def __init__(self):
DynamiccomponentHandler.__init__(self)
self.jsloaded = False
def onChang... | import json
import rexviewer as r
import naali
import urllib2
from componenthandler import DynamiccomponentHandler
class JavascriptHandler(DynamiccomponentHandler):
GUINAME = "Javascript Handler"
def __init__(self):
DynamiccomponentHandler.__init__(self)
self.jsloaded = False
def onChang... | Add placeable to javascript context | Add placeable to javascript context
| Python | apache-2.0 | realXtend/tundra,antont/tundra,realXtend/tundra,AlphaStaxLLC/tundra,AlphaStaxLLC/tundra,pharos3d/tundra,AlphaStaxLLC/tundra,pharos3d/tundra,BogusCurry/tundra,AlphaStaxLLC/tundra,jesterKing/naali,pharos3d/tundra,antont/tundra,BogusCurry/tundra,BogusCurry/tundra,realXtend/tundra,jesterKing/naali,antont/tundra,antont/tund... | ---
+++
@@ -35,11 +35,17 @@
except AttributeError:
pass
else:
- ctx['touchable'] = ent.touchable
+ ctx['touchable'] = ent.touchable
+ try:
+ ent.placeable
+ except:
+ pass
+ ... |
4c922ea8e2ebd6e2ffb001f4733fcf7fa5edc250 | shuup_workbench/wsgi.py | shuup_workbench/wsgi.py | # This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
"""
WSGI config for shuup_workbench project.
It exposes the WSGI callable as a module-lev... | # This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
"""
WSGI config for shuup_workbench project.
It exposes the WSGI callable as a module-lev... | Mark env setter line as noqa | workbench: Mark env setter line as noqa
| Python | agpl-3.0 | shoopio/shoop,suutari-ai/shoop,shoopio/shoop,shoopio/shoop,suutari-ai/shoop,suutari-ai/shoop | ---
+++
@@ -14,7 +14,7 @@
"""
import os
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shuup_workbench.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shuup_workbench.settings") # noqa
from django.core.wsgi import get_wsgi_application # noqa (E402)
application = get_wsgi_application() |
92221186166c0d7d6a593eb38fb4b0845c23634b | eue.py | eue.py | #!/usr/bin/env python
import os
import sys
from bottle import route,run,template,static_file
#from lib import mydb
base=os.path.dirname(os.path.realpath(__file__))
dom0s = []
capacity = []
def getDataStructure():
return {
"title" : "",
"page" : "login.tpl",
"nav" : True
}
@route('/st... | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import os
import sys
from bottle import route, run, template, static_file, get, post
from lib import eueauth
def getDataStructure():
""" initialize a default dict passed to templates """
return {
"title": "",
"page": "login.tpl",
"nav": True... | Fix module import problem, make code more pep compliant, add utf8 encoding | Fix module import problem, make code more pep compliant, add utf8 encoding
| Python | agpl-3.0 | david-guenault/eue-ng,david-guenault/eue-ng,david-guenault/eue-ng,david-guenault/eue-ng,david-guenault/eue-ng,david-guenault/eue-ng | ---
+++
@@ -1,38 +1,51 @@
#!/usr/bin/env python
+#-*- coding:utf-8 -*-
+
import os
import sys
-from bottle import route,run,template,static_file
-#from lib import mydb
+from bottle import route, run, template, static_file, get, post
+from lib import eueauth
-base=os.path.dirname(os.path.realpath(__file__))
-
-do... |
4e66e9ff016ffc392caf4edb5735b77f518ba2b4 | alignak_backend/models/uipref.py | alignak_backend/models/uipref.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Resource information of host
"""
def get_name():
"""
Get name of this resource
:return: name of this resource
:rtype: str
"""
return 'uipref'
def get_schema():
"""
Schema structure of this resource
:return: schema dictionnary
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Resource information of host
"""
def get_name():
"""
Get name of this resource
:return: name of this resource
:rtype: str
"""
return 'uipref'
def get_schema():
"""
Schema structure of this resource
:return: schema dictionnary
... | Update UI preferences model (list) | Update UI preferences model (list)
| Python | agpl-3.0 | Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend | ---
+++
@@ -48,7 +48,7 @@
'default': ''
},
'data': {
- 'type': 'string',
+ 'type': 'list',
'ui': {
'title': "User name",
'visible': True,
@@ -56,7 +56,7 @@
'searchab... |
901a45b36f58312dd1a12c6f48a472cf73e4482c | model/sample/__init__.py | model/sample/__init__.py | # -*- coding: utf-8 -*-
from flask.ext.babel import gettext
from ..division import Division
import user
division = Division(
name='sample',
display_name=gettext("Beispielsektion"),
user_class=user.User,
debug_only=True
)
| # -*- coding: utf-8 -*-
from flask.ext.babel import gettext
from ..division import Division
import user
division = Division(
name='sample',
display_name=gettext("Beispielsektion"),
user_class=user.User,
init_context=user.init_context,
debug_only=True
)
| Add missing init_context to sample divison | Add missing init_context to sample divison
| Python | mit | MarauderXtreme/sipa,agdsn/sipa,lukasjuhrich/sipa,fgrsnau/sipa,MarauderXtreme/sipa,agdsn/sipa,fgrsnau/sipa,agdsn/sipa,fgrsnau/sipa,lukasjuhrich/sipa,agdsn/sipa,lukasjuhrich/sipa,lukasjuhrich/sipa,MarauderXtreme/sipa | ---
+++
@@ -8,5 +8,6 @@
name='sample',
display_name=gettext("Beispielsektion"),
user_class=user.User,
+ init_context=user.init_context,
debug_only=True
) |
c80fc3c31003e6ecec049ac2e1ca370e58ab2b3c | mediasync/processors/yuicompressor.py | mediasync/processors/yuicompressor.py | from django.conf import settings
from mediasync import JS_MIMETYPES
import os
from subprocess import Popen, PIPE
def _yui_path(settings):
if not hasattr(settings, 'MEDIASYNC'):
return None
path = settings.MEDIASYNC.get('YUI_COMPRESSOR_PATH', None)
if path:
path = os.path.realpath(os.path.ex... | from django.conf import settings
from mediasync import CSS_MIMETYPES, JS_MIMETYPES
import os
from subprocess import Popen, PIPE
def _yui_path(settings):
if not hasattr(settings, 'MEDIASYNC'):
return None
path = settings.MEDIASYNC.get('YUI_COMPRESSOR_PATH', None)
if path:
path = os.path.real... | Replace incorrect JS_MIMETYPES with CSS_MIMETYPES | Replace incorrect JS_MIMETYPES with CSS_MIMETYPES
| Python | bsd-3-clause | sunlightlabs/django-mediasync,mntan/django-mediasync,mntan/django-mediasync,sunlightlabs/django-mediasync,sunlightlabs/django-mediasync,mntan/django-mediasync | ---
+++
@@ -1,5 +1,5 @@
from django.conf import settings
-from mediasync import JS_MIMETYPES
+from mediasync import CSS_MIMETYPES, JS_MIMETYPES
import os
from subprocess import Popen, PIPE
@@ -12,7 +12,7 @@
return path
def css_minifier(filedata, content_type, remote_path, is_active):
- is_css = (conte... |
a3241e33f189cee4f7b5955e880ca3cc18e2694f | before_after_filesystem_snapshot.py | before_after_filesystem_snapshot.py | def snapshot(before_dict, after_dict):
'''before_after_snapshot is a simple function that returns which files were
unchanged, modified, added or removed from an input dictionary (before_dict)
and an output dictionary (after_dict). Both these dictionaries have file
names as the keys and their hashes as the... | def snapshot(before_dict, after_dict):
'''before_after_snapshot is a simple function that returns which files were
unchanged, modified, added or removed from an input dictionary (before_dict)
and an output dictionary (after_dict). Both these dictionaries have file
names as the keys and their hashes as the... | Add function to generate artifact rules. | Add function to generate artifact rules.
Adds a function to before_after_filesystem_snapshot.py called
generate_artifact_rules.
| Python | mit | in-toto/layout-web-tool,in-toto/layout-web-tool,in-toto/layout-web-tool | ---
+++
@@ -25,3 +25,40 @@
# Returning the snapshot of the new file system
return (sorted(unchanged_files), sorted(modified_files), sorted(added_files),
sorted(removed_files))
+
+def generate_artifact_rules(snapshot):
+ '''
+ Generate Artifact Rules given which files have been added, which have been
+ rem... |
2745423ce5a7e9963038a529337a1d71d4465cba | core/views.py | core/views.py | from django.conf import settings
from django.views.static import serve
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_view_exempt
import json
import os
from projects.models import Project
from projects.tasks import update_docs
from projects.utils import get_project_path, find_file
... | from django.conf import settings
from django.views.static import serve
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_view_exempt
import json
import os
from projects.models import Project
from projects.tasks import update_docs
from projects.utils import get_project_path, find_file
... | Fix empty file names messin stuff up. | Fix empty file names messin stuff up.
| Python | mit | clarkperkins/readthedocs.org,kenwang76/readthedocs.org,pombredanne/readthedocs.org,LukasBoersma/readthedocs.org,davidfischer/readthedocs.org,raven47git/readthedocs.org,royalwang/readthedocs.org,mhils/readthedocs.org,sils1297/readthedocs.org,gjtorikian/readthedocs.org,nyergler/pythonslides,nyergler/pythonslides,fujita-s... | ---
+++
@@ -20,10 +20,12 @@
update_docs.delay(slug=project.slug)
return HttpResponse('Build Started')
-def serve_docs(request, username, project_slug, filename="index.html"):
+def serve_docs(request, username, project_slug, filename):
proj = Project.objects.get(slug=project_slug, user__username=usern... |
2327eb0c4db7d6b771777e8d73ec99a8e324391a | printzone.py | printzone.py | #!/usr/bin/env python
import dns.query
import dns.zone
import sys
from optparse import OptionParser
parser = OptionParser()
parser.add_option("--server", dest="dns_server",
help="DNS server to query.",
type="string")
parser.add_option("--zone", dest="dns_zone",
h... | #!/usr/bin/env python
import dns.query
import dns.zone
import sys
from optparse import OptionParser
parser = OptionParser()
parser.add_option("--server", dest="dns_server",
help="DNS server to query.",
type="string")
parser.add_option("--zone", dest="dns_zone",
h... | Split the XFR output into an array of values. | Split the XFR output into an array of values.
Had to split on \n. Need to go through the code more and figure out why it doesn't actually present itself
upon printing
| Python | bsd-3-clause | jforman/python-ddns | ---
+++
@@ -21,7 +21,14 @@
z = dns.zone.from_xfr(dns.query.xfr(options.dns_server, options.dns_zone))
names = z.nodes.keys()
names.sort()
+ zone_xfr_array = []
for n in names:
- print z[n].to_text(n)
+ current_record = z[n].to_text(n)
+ for split_record in current_record.sp... |
c3571bf950862a17a0d2938167a3cb9912fab6d9 | setup.py | setup.py | import os
from setuptools import setup, find_packages
import uuid
from jirafs_list_table import __version__ as version_string
requirements_path = os.path.join(
os.path.dirname(__file__),
'requirements.txt',
)
try:
from pip.req import parse_requirements
requirements = [
str(req.req) for req in... | import os
from setuptools import setup, find_packages
import uuid
from jirafs_list_table import __version__ as version_string
requirements_path = os.path.join(
os.path.dirname(__file__),
'requirements.txt',
)
try:
from pip.req import parse_requirements
requirements = [
str(req.req) for req in... | Use the proper entry point name. | Use the proper entry point name.
| Python | mit | coddingtonbear/jirafs-list-table | ---
+++
@@ -43,7 +43,7 @@
include_package_data=True,
packages=find_packages(),
entry_points={
- 'jirafs_list_table': [
+ 'jirafs_plugins': [
'list_table = jirafs_list_table.plugin:Plugin',
]
}, |
3577007a2b48ca410a0a34a10f64adcdb3537912 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from distutils.core import setup
here = os.path.dirname(__file__)
def get_long_desc():
return open(os.path.join(here, 'README.rst')).read()
# Function borrowed from carljm.
def get_version():
fh = open(os.path.join(here, "gcframe", "__init__.py"))
try:
for lin... | # -*- coding: utf-8 -*-
import os
from distutils.core import setup
here = os.path.dirname(__file__)
def get_long_desc():
return open(os.path.join(here, 'README.rst')).read()
# Function borrowed from carljm.
def get_version():
fh = open(os.path.join(here, "gcframe", "__init__.py"))
try:
for lin... | Update the classification to production/stable. | Update the classification to production/stable.
| Python | bsd-3-clause | benspaulding/django-gcframe | ---
+++
@@ -35,7 +35,7 @@
'gcframe.tests',
],
classifiers=[
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers', |
3c94fc8a784420740caa8831363b6ebb8b1d6095 | django_archive/archivers/__init__.py | django_archive/archivers/__init__.py | from .tarball import TarballArchiver
from .zipfile import ZipArchiver
TARBALL = TarballArchiver.UNCOMPRESSED
TARBALL_GZ = TarballArchiver.GZ
TARBALL_BZ2 = TarballArchiver.BZ2
TARBALL_XZ = TarballArchiver.XZ
ZIP = 'zip'
def get_archiver(fmt):
"""
Return the class corresponding with the provided archival form... | from .tarball import TarballArchiver
from .zipfile import ZipArchiver
TARBALL = TarballArchiver.UNCOMPRESSED
TARBALL_GZ = TarballArchiver.GZ
TARBALL_BZ2 = TarballArchiver.BZ2
TARBALL_XZ = TarballArchiver.XZ
ZIP = 'zip'
FORMATS = (
(TARBALL, "Tarball (.tar)"),
(TARBALL_GZ, "gzip-compressed Tarball (.tar.gz)")... | Add tuple containing all supported archive formats and their human-readable description. | Add tuple containing all supported archive formats and their human-readable description.
| Python | mit | nathan-osman/django-archive,nathan-osman/django-archive | ---
+++
@@ -7,6 +7,14 @@
TARBALL_BZ2 = TarballArchiver.BZ2
TARBALL_XZ = TarballArchiver.XZ
ZIP = 'zip'
+
+FORMATS = (
+ (TARBALL, "Tarball (.tar)"),
+ (TARBALL_GZ, "gzip-compressed Tarball (.tar.gz)"),
+ (TARBALL_BZ2, "bzip2-compressed Tarball (.tar.bz2)"),
+ (TARBALL_XZ, "xz-compressed Tarball (.tar.x... |
ee494fd205c58029960d4a5702f59418c8110eb3 | django_iceberg/context_processors.py | django_iceberg/context_processors.py | # -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
from django_iceberg.auth_utils import init_iceberg, get_conf_class
def iceberg_settings(request):
"""
Defines some template variables in context
"""
conf = get_conf_class(request)
if not conf:
ICEBERG_API_URL_FUL... | # -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
from django_iceberg.auth_utils import init_iceberg, get_conf_class
def iceberg_settings(request):
"""
Defines some template variables in context
"""
conf = get_conf_class(request)
if not conf:
ICEBERG_API_URL_FUL... | Add username to context in iceberg_settings context processor | Add username to context in iceberg_settings context processor
| Python | mit | izberg-marketplace/django-izberg,izberg-marketplace/django-izberg,Iceberg-Marketplace/django-iceberg,Iceberg-Marketplace/django-iceberg | ---
+++
@@ -28,6 +28,7 @@
if request.user.is_authenticated():
res['access_token'] = init_iceberg(request).access_token
+ res['username'] = init_iceberg(request).username
else:
res['ICEBERG_ENV'] = None
res['access_token'] = "anonymous" |
ac5b383520286c1c9d1aadc9a46fb900e4227b55 | setup.py | setup.py | from setuptools import find_packages
from setuptools import setup
setup(
name='caravan',
version='0.0.3.dev0',
description='Light python framework for AWS SWF',
long_description=open('README.rst').read(),
keywords='AWS SWF workflow distributed background task',
author='Pior Bastida',
autho... | from setuptools import find_packages
from setuptools import setup
setup(
name='caravan',
version='0.0.3.dev0',
description='Light python framework for AWS SWF',
long_description=open('README.rst').read(),
keywords='AWS SWF workflow distributed background task',
author='Pior Bastida',
autho... | Set pypi development status to Pre-Alpha | Set pypi development status to Pre-Alpha
| Python | mit | pior/caravan | ---
+++
@@ -26,7 +26,7 @@
]
},
classifiers=[
- "Development Status :: 5 - Production/Stable",
+ "Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent", |
4e20ea7d100d1611b018d5dede4a17915959d6f1 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
execfile('police_api/version.py')
setup(
name='police-api-client',
version=__version__, # NOQA
description='Python client library for the Police API',
long_description=open('README.rst').read(),
author='Rock Kitchen Harris',
l... | #!/usr/bin/env python
from setuptools import setup, find_packages
execfile('police_api/version.py')
setup(
name='police-api-client',
version=__version__, # NOQA
description='Python client library for the Police API',
long_description=open('README.rst').read(),
author='Rock Kitchen Harris',
l... | Include package data in release | Include package data in release
| Python | mit | rkhleics/police-api-client-python | ---
+++
@@ -14,6 +14,7 @@
url='https://github.com/rkhleics/police-api-client-python',
download_url='https://github.com/rkhleics/police-api-client-python/downloads',
packages=find_packages(),
+ include_package_data=True,
install_requires=[
'requests==2.0.0',
], |
47dedd31b9ee0f768ca3f9f781133458ddc99f4f | setup.py | setup.py | from setuptools import setup
name = 'turbasen'
VERSION = '2.5.0'
setup(
name=name,
packages=[name],
version=VERSION,
description='Client for Nasjonal Turbase REST API',
long_description='Documentation: https://turbasenpy.readthedocs.io/',
author='Ali Kaafarani',
author_email='ali.kaafarani... | from setuptools import setup
name = 'turbasen'
VERSION = '2.5.0'
setup(
name=name,
packages=[name],
version=VERSION,
description='Client for Nasjonal Turbase REST API',
long_description='Documentation: https://turbasenpy.readthedocs.io/',
author='Ali Kaafarani',
author_email='ali.kaafarani... | Add sphinx to dev requirements | Add sphinx to dev requirements
| Python | mit | Turbasen/turbasen.py | ---
+++
@@ -26,6 +26,6 @@
],
install_requires=['requests>=2.10.0,<3'],
extras_require={
- 'dev': ['ipython', 'flake8'],
+ 'dev': ['sphinx', 'ipython', 'flake8'],
}
) |
8e934707349079353b00d8a8be8c99431b357595 | setup.py | setup.py | from setuptools import setup, find_packages
def listify(filename):
return filter(None, open(filename, 'r').read().split('\n'))
setup(
name="vumi",
version="0.4.0a",
url='http://github.com/praekelt/vumi',
license='BSD',
description="Super-scalable messaging engine for the delivery of SMS, "
... | from setuptools import setup, find_packages
def listify(filename):
return filter(None, open(filename, 'r').read().split('\n'))
setup(
name="vumi",
version="0.4.0a",
url='http://github.com/praekelt/vumi',
license='BSD',
description="Super-scalable messaging engine for the delivery of SMS, "
... | Include Twisted plugin in install. | Include Twisted plugin in install.
| Python | bsd-3-clause | TouK/vumi,TouK/vumi,harrissoerja/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,harrissoerja/vumi,vishwaprakashmishra/xmatrix,vishwaprakashmishra/xmatrix | ---
+++
@@ -16,9 +16,12 @@
long_description=open('README.rst', 'r').read(),
author='Praekelt Foundation',
author_email='dev@praekeltfoundation.org',
- packages=find_packages(exclude=['environments']),
+ packages=find_packages(exclude=['environments']) + ['twisted.plugins'],
+ package_data={'tw... |
fb1d6d40446a6f51d146c2d426b3a7e5509441f6 | setup.py | setup.py | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_f:
README = readme_f.read()
with open('tests/requirements.txt') as test_requirements_f:
TEST_REQUIREMENTS = test_requirements_f.readlines()
setup(
name=... | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_f:
README = readme_f.read()
with open('tests/requirements.txt') as test_requirements_f:
TEST_REQUIREMENTS = test_requirements_f.readlines()
setup(
name=... | Change trove classifier to show project is now stable | Change trove classifier to show project is now stable
| Python | mit | cdown/srt | ---
+++
@@ -26,7 +26,7 @@
zip_safe=False,
keywords='srt',
classifiers=[
- 'Development Status :: 2 - Pre-Alpha',
+ 'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: Public Domain',
'Operating System :: OS Independent', |
66a44d74fa4af27c9d0de86865fc32352c684183 | setup.py | setup.py | import os
import sys
from os.path import join as pjoin
from setuptools import setup
from setuptools import Command
from subprocess import call
def read_version_string():
version = None
sys.path.insert(0, pjoin(os.getcwd()))
from log_formatters import __version__
version = __version__
sys.path.po... | import os
import sys
from setuptools import setup
def read_version_string():
version = None
current_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, current_dir)
from log_formatters import __version__
version = __version__
sys.path.pop(0)
return version
setup(
nam... | Add a correct dir to sys.path, remove unused imports. | Add a correct dir to sys.path, remove unused imports.
| Python | apache-2.0 | Kami/python-extra-log-formatters | ---
+++
@@ -1,16 +1,13 @@
import os
import sys
-from os.path import join as pjoin
-
from setuptools import setup
-from setuptools import Command
-from subprocess import call
def read_version_string():
version = None
- sys.path.insert(0, pjoin(os.getcwd()))
+ current_dir = os.path.abspath(os.path.... |
cb84aa95759234ff2d7f8aa6b67e28eab382f9cc | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
version = "0.10"
setup(
name="pycoinnet",
version=version,
packages=[
"pycoinnet",
"pycoinnet.examples",
"pycoinnet.helpers",
"pycoinnet.peer",
"pycoinnet.peer.tests",
"pycoinnet.peergroup",
"pycoin... | #!/usr/bin/env python
from setuptools import setup
version = "0.19"
REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()]
setup(
name="pycoinnet",
version=version,
packages=[
"pycoinnet",
"pycoinnet.examples",
"pycoinnet.helpers",
"pycoinnet.peer",
... | Include the requirements.txt contents in install_requires. | Include the requirements.txt contents in install_requires.
| Python | mit | antiface/pycoinnet,antiface/pycoinnet,richardkiss/pycoinnet,richardkiss/pycoinnet | ---
+++
@@ -2,7 +2,9 @@
from setuptools import setup
-version = "0.10"
+version = "0.19"
+
+REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()]
setup(
name="pycoinnet",
@@ -12,9 +14,7 @@
"pycoinnet.examples",
"pycoinnet.helpers",
"pycoinnet.peer",
- ... |
0f464b995968acbc4685b90472ef2af260b67381 | setup.py | setup.py | from setuptools import setup, find_packages
version = '1.2.0'
setup(name="Miro Community",
version=version,
packages=find_packages(),
author='Participatory Culture Foundation',
license='AGPLv3',
install_requires=['django==1.2.1'])
| from setuptools import setup, find_packages
version = '1.2.0'
setup(name="Miro Community",
version=version,
packages=find_packages(),
author='Participatory Culture Foundation',
license='AGPLv3',
install_requires=['django==1.2.5'])
| Upgrade requirements to be Django 1.2.5 | Upgrade requirements to be Django 1.2.5
| Python | agpl-3.0 | pculture/mirocommunity,pculture/mirocommunity,pculture/mirocommunity,pculture/mirocommunity | ---
+++
@@ -7,6 +7,6 @@
packages=find_packages(),
author='Participatory Culture Foundation',
license='AGPLv3',
- install_requires=['django==1.2.1'])
+ install_requires=['django==1.2.5'])
|
70cf8c4c49a12caf68ea3f5d1d6b138e21673981 | setup.py | setup.py | #!/usr/bin/env python
"""
Install wagtailsettings using setuptools
"""
from wagtailsettings import __version__
with open('README.rst', 'r') as f:
readme = f.read()
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setupt... | #!/usr/bin/env python
"""
Install wagtailsettings using setuptools
"""
from wagtailsettings import __version__
with open('README.rst', 'r') as f:
readme = f.read()
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setupt... | Install wagtail only if needed. | Install wagtail only if needed.
In my case, I'm using not yet released to pypi wagtail, from master branch, and this setup script tries to install old wagtail and old django. | Python | bsd-2-clause | salvadormrf/wagtailsettings,salvadormrf/wagtailsettings | ---
+++
@@ -24,7 +24,10 @@
author_email='tim@takeflight.com.au',
url='https://bitbucket.org/takeflight/wagtailsettings',
- install_requires=['wagtail>=0.6'],
+ install_requires=[],
+ extras_require={
+ 'full': ['wagtail>=0.6'],
+ },
zip_safe=False,
license='BSD License',
|
8f8c20859828e887699e3acda4671d113cb4b011 | setup.py | setup.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as fp:
readme = fp.read()
with open('HISTORY.rst') as fp:
history = fp.read()
setup(
name='pySRA',
version='0.4.10',
description='Site Response Analysis with Python',
long_descripti... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as fp:
readme = fp.read()
with open('HISTORY.rst') as fp:
history = fp.read()
setup(
name='pySRA',
version='0.4.10',
description='Site Response Analysis with Python',
long_descripti... | Add pandas as optional dependency. | Add pandas as optional dependency.
| Python | mit | arkottke/pysra | ---
+++
@@ -26,6 +26,9 @@
'setuptools',
'typing',
],
+ extras_require={
+ 'dataframe': ['pandas'],
+ },
keywords='site response',
license='MIT',
classifiers=[ |
2a6dbe27150c6d82daee48f054936088467f431f | setup.py | setup.py | from setuptools import setup
setup(
name="rotterdam",
version="0.3.2",
description=(
"Simple distributed job queue via redis."
),
author="William Glass",
author_email="william.glass@gmail.com",
url="http://github.com/wglass/rotterdam",
packages=["rotterdam"],
include_package... | from setuptools import setup
setup(
name="rotterdam",
version="0.3.2",
description=(
"Simple asynchronous job queue via redis."
),
author="William Glass",
author_email="william.glass@gmail.com",
url="http://github.com/wglass/rotterdam",
packages=["rotterdam"],
include_packag... | Split out the dependencies of client and server. | Split out the dependencies of client and server.
| Python | mit | wglass/rotterdam | ---
+++
@@ -4,7 +4,7 @@
name="rotterdam",
version="0.3.2",
description=(
- "Simple distributed job queue via redis."
+ "Simple asynchronous job queue via redis."
),
author="William Glass",
author_email="william.glass@gmail.com",
@@ -19,14 +19,15 @@
"bin/rotterdamct... |
cd27849acae57a0382f66116771491576177a39e | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
__VERSION__ = '0.2.4'
long_description = "See https://furtive.readthedocs.org"
setup(name='Furtive',
version=__VERSION__,
description='File Integrity Verification System',
author='Derrick Bryant',
author_email='dbryant4@gmail.com',
... | #!/usr/bin/env python
from distutils.core import setup
__VERSION__ = '0.2.4'
long_description = """
Github: https://github.com/dbryant4/furtive
"""
setup(name='Furtive',
version=__VERSION__,
description='File Integrity Verification System',
author='Derrick Bryant',
author_email='dbryant4@gma... | Add links to github project page | Add links to github project page
| Python | mit | dbryant4/furtive | ---
+++
@@ -4,7 +4,9 @@
__VERSION__ = '0.2.4'
-long_description = "See https://furtive.readthedocs.org"
+long_description = """
+Github: https://github.com/dbryant4/furtive
+"""
setup(name='Furtive',
version=__VERSION__,
@@ -16,6 +18,7 @@
packages=['furtive'],
scripts=['scripts/furtive'],... |
e725a8ec2a0c998e9eeca100dfb6eb49035c343c | setup.py | setup.py | from setuptools import setup
setup(name='sms_auth_service',
version='0.0.1',
description='An SMS backed authorization micro-service',
packages=['sms_auth_service'],
author='Flowroute Developers',
url='https://github.com/flowroute/two_factor_auth_python_demo',
author_email='developer... | from setuptools import setup
setup(name='sms_auth_service',
version='0.0.1',
description='An SMS backed authorization micro-service',
packages=['sms_auth_service'],
author='Flowroute Developers',
license='MIT',
url='https://github.com/flowroute/sms-verification',
author_email=... | Add license information, and update project url. | Add license information, and update project url.
| Python | mit | flowroute/sms-verification,flowroute/sms-verification,flowroute/sms-verification | ---
+++
@@ -5,6 +5,7 @@
description='An SMS backed authorization micro-service',
packages=['sms_auth_service'],
author='Flowroute Developers',
- url='https://github.com/flowroute/two_factor_auth_python_demo',
+ license='MIT',
+ url='https://github.com/flowroute/sms-verification',
... |
ed6d7fdbf24780baa1afa60961fc4bd22354ae8f | setup.py | setup.py | import os
from setuptools import setup, find_packages
from ghtools import __version__
requirements = [
'requests==1.1.0',
'argh==0.23.0'
]
python_scripts = [
'browse',
'list-members',
'login',
'migrate-project',
'migrate-wiki',
'migrate-teams',
'org',
'repo',
'status',
]
... | import os
from setuptools import setup, find_packages
from ghtools import __version__
requirements = [
'requests==2.2.1',
'argh==0.23.0'
]
python_scripts = [
'browse',
'list-members',
'login',
'migrate-project',
'migrate-wiki',
'migrate-teams',
'org',
'repo',
'status',
]
... | Upgrade requests library to version 2.1.1 | Upgrade requests library to version 2.1.1
Upgrade the `requests` library to match the version provided by Ubuntu
Trusty, version 2.1.1.
This is to prevent a conflict on Ubuntu Trusty between system Python
libraries and Pip libraries.
Specifically, Pip relies on the `IncompleteRead` module that is exported
by `reques... | Python | mit | alphagov/ghtools | ---
+++
@@ -4,7 +4,7 @@
from ghtools import __version__
requirements = [
- 'requests==1.1.0',
+ 'requests==2.2.1',
'argh==0.23.0'
]
|
d4137375513e22e9fda3ad6abb53e99492101727 | setup.py | setup.py | from setuptools import setup, find_packages
# Prevent "TypeError: 'NoneType' object is not callable" error
# when running python setup.py test
# (see http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
try:
import multiprocessing
except ImportError:
pass
setup(
name='cmakelists_parsing',
ve... | from setuptools import setup, find_packages
# Prevent "TypeError: 'NoneType' object is not callable" error
# when running python setup.py test
# (see http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
try:
import multiprocessing
except ImportError:
pass
setup(
name='cmakelists_parsing',
ve... | Fix entry point for pretty printing script. | Fix entry point for pretty printing script.
| Python | mit | ijt/cmakelists_parsing,wjwwood/parse_cmake | ---
+++
@@ -23,7 +23,7 @@
include_package_data=True,
entry_points = {
'console_scripts': [
- 'pprint_cmakelists = my_package.some_module:main_func',
+ 'pprint_cmakelists = cmakelists_parsing.parsing:main',
]
})
|
c48c0a3c032eb92c7e10d42466381f15c643bbe2 | setup.py | setup.py | from setuptools import setup, find_packages
import os
from osuapi import __version__ as version, __title__ as name, __author__ as author, __license__ as license
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
try:
import pypandoc
with open('README.md') as readme_md:
... | from setuptools import setup, find_packages
import os
from osuapi import __version__ as version, __title__ as name, __author__ as author, __license__ as license
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
try:
import pypandoc
with open('README.md') as readme_md:
... | Add warning if large_description is not generated | Add warning if large_description is not generated
| Python | mit | khazhyk/osuapi | ---
+++
@@ -11,6 +11,7 @@
with open('README.md') as readme_md:
readme = pypandoc.convert_text(readme_md.read(), 'rst', 'markdown')
except:
+ print("WARNING: Did not create pypi readme")
readme = None
setup( |
d8d62288da0339bb0b5414d18eca8aab24b61238 | setup.py | setup.py | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'regetron is a simple shell for playing with regular expressions',
'author': 'Zed A. Shaw',
'url': 'https://gitorious.org/regetron/regetron',
'download_url': 'http://pypi.python.org/pypi/regetro... | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'regetron is a simple shell for playing with regular expressions',
'author': 'Zed A. Shaw',
'url': 'https://gitorious.org/regetron/regetron',
'download_url': 'http://pypi.python.org/pypi/regetro... | Bump version number for the next release. | Bump version number for the next release.
| Python | bsd-3-clause | Sean1708/Regetron3.0,Sean1708/Regetron3.0 | ---
+++
@@ -9,7 +9,7 @@
'url': 'https://gitorious.org/regetron/regetron',
'download_url': 'http://pypi.python.org/pypi/regetron',
'author_email': 'zedshaw@zedshaw.com',
- 'version': '1.0',
+ 'version': '1.1',
'install_requires': [],
'packages': ['regetron'],
'scripts': ['bin/regetron'], |
462efd1a2ee217b8a70d1769f2fae9265f54fc4f | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="adbons",
version="0.0.1",
author="Daniel Bälz",
author_email="me@dbaelz.de",
description="""A wrapper for the Android adb tool.
It's just adb on steroids""",
license="BSD",
packages=find_packages(),
include_package_data=Tr... | from setuptools import setup, find_packages
setup(
name="adbons",
version="0.0.1",
author="Daniel Bälz",
author_email="me@dbaelz.de",
description="""A wrapper for the Android adb tool.
It's just adb on steroids""",
license="BSD",
packages=find_packages(),
include_package_data=Tr... | Add pyyaml and use lower case lib names | Add pyyaml and use lower case lib names
| Python | bsd-2-clause | dbaelz/adbons | ---
+++
@@ -11,7 +11,8 @@
packages=find_packages(),
include_package_data=True,
install_requires=[
- "Click"
+ "click",
+ "pyyaml"
],
entry_points={
'console_scripts': ['adbons=src.adbons:cli'] |
1cbf66453e2808e8c15628b41e37e96c93cc77db | great_expectations_airflow/hooks/db_hook.py | great_expectations_airflow/hooks/db_hook.py | from airflow.hooks.dbapi_hook import DbApiHook
import great_expectations as ge
class ExpectationMySQLHook(DbApiHook):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def get_ge_df(self, dataset_name, **kwargs):
self.log.info("Connecting to dataset {dataset} on {uri}".f... | import great_expectations as ge
from airflow.hooks.mysql_hook import MySqlHook
class ExpectationMySQLHook(MySqlHook):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def get_ge_df(self, dataset_name, **kwargs):
self.log.info("Connecting to dataset {dataset} on {uri}".f... | Make sure hook can actually be instantiated (generic DbApiHook cannot) | Make sure hook can actually be instantiated (generic DbApiHook cannot)
| Python | apache-2.0 | great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations | ---
+++
@@ -1,8 +1,8 @@
-from airflow.hooks.dbapi_hook import DbApiHook
import great_expectations as ge
+from airflow.hooks.mysql_hook import MySqlHook
-class ExpectationMySQLHook(DbApiHook):
+class ExpectationMySQLHook(MySqlHook):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kw... |
3443a7355888a9a4fbd6b9de8c8f84c88643e5af | confluent_client/setup.py | confluent_client/setup.py | from setuptools import setup
setup(
name='confluent_client',
version='0.1.1',
author='Jarrod Johnson',
author_email='jbjohnso@us.ibm.com',
url='http://xcat.sf.net/',
packages=['confluent'],
install_requires=['confluent_common>=0.1.1'],
scripts=['bin/confetty'],
)
| from setuptools import setup
setup(
name='confluent_client',
version='0.1.2',
author='Jarrod Johnson',
author_email='jbjohnso@us.ibm.com',
url='http://xcat.sf.net/',
packages=['confluent'],
install_requires=['confluent_common>=0.1.0'],
scripts=['bin/confetty'],
)
| Refresh package data to assure better pyghmi and confetty | Refresh package data to assure better pyghmi and confetty
| Python | apache-2.0 | jufm/confluent,chenglch/confluent,whowutwut/confluent,jjohnson42/confluent,xcat2/confluent,chenglch/confluent,whowutwut/confluent,michaelfardu/thinkconfluent,whowutwut/confluent,michaelfardu/thinkconfluent,jufm/confluent,jufm/confluent,xcat2/confluent,michaelfardu/thinkconfluent,chenglch/confluent,chenglch/confluent,jj... | ---
+++
@@ -2,11 +2,11 @@
setup(
name='confluent_client',
- version='0.1.1',
+ version='0.1.2',
author='Jarrod Johnson',
author_email='jbjohnso@us.ibm.com',
url='http://xcat.sf.net/',
packages=['confluent'],
- install_requires=['confluent_common>=0.1.1'],
+ install_requires=['c... |
e68aaef747f5a2ced06f74249d49d0ed81551d23 | test/test_functionality.py | test/test_functionality.py | """
Tests of overall functionality
"""
import pytest
import toolaudit
import yaml
def test_simple_audit(capsys):
"""
Check simple audit gives the expected output
"""
app = toolaudit.application.ToolauditApp()
try:
app.run(kitlist_file='test/example.yaml')
except SystemExit:
pa... | """
Tests of overall functionality
"""
import pytest
import toolaudit
import yaml
def test_simple_audit(capsys, monkeypatch):
"""
Check simple audit gives the expected output
"""
def mockreturn(path):
return '9c3bb3efa8095f36aafd9bf3a698efe439505021'
monkeypatch.setattr(toolaudit.readers,... | Use mocking to fix the result of hashing files | Use mocking to fix the result of hashing files
| Python | mit | jstutters/toolaudit | ---
+++
@@ -7,10 +7,13 @@
import yaml
-def test_simple_audit(capsys):
+def test_simple_audit(capsys, monkeypatch):
"""
Check simple audit gives the expected output
"""
+ def mockreturn(path):
+ return '9c3bb3efa8095f36aafd9bf3a698efe439505021'
+ monkeypatch.setattr(toolaudit.readers, ... |
6de9b3215ac9d3a2b5dc97af5e5fe02886d4bfe1 | pywikibot/families/wikitech_family.py | pywikibot/families/wikitech_family.py | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The Wikitech family
class Family(family.Family):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikitech'
self.langs = {
'en': 'wikitech.wikimedia.org',
}
def version(s... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The Wikitech family
class Family(family.Family):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikitech'
self.langs = {
'en': 'wikitech.wikimedia.org',
}
def version(s... | Remove overide of default scriptpath | Remove overide of default scriptpath
| Python | mit | pywikibot/core-migration-example | ---
+++
@@ -17,6 +17,3 @@
def version(self, code):
return '1.21wmf8'
-
- def scriptpath(self, code):
- return '' |
4a032ece106d4b3b3764420197453afd33475bf6 | donut/modules/permissions/helpers.py | donut/modules/permissions/helpers.py | import flask
from donut.modules.groups import helpers as groups
def has_permission(user_id, permission_id):
'''
Returns True if [user_id] holds a position that directly
or indirectly (through a position relation) grants
them [permission_id]. Otherwise returns False.
'''
if not (isinstance(u... | import flask
from donut.modules.groups import helpers as groups
def has_permission(user_id, permission_id):
'''
Returns True if [user_id] holds a position that directly
or indirectly (through a position relation) grants
them [permission_id]. Otherwise returns False.
'''
if not (isinstance(u... | Fix failing test and make lint | Fix failing test and make lint
| Python | mit | ASCIT/donut-python,ASCIT/donut,ASCIT/donut,ASCIT/donut-python,ASCIT/donut | ---
+++
@@ -18,6 +18,7 @@
pos_ids = [row['pos_id'] for row in result]
for pos_id in pos_ids:
holders = groups.get_position_holders(pos_id)
- if {'user_id': user_id} in holders:
+ holders = [row['user_id'] for row in holders]
+ if user_id in holders:
return True
... |
dd5a292320f657a4b5e776c6e0d99fad5916e6e6 | source/fiblist/conf/urls.py | source/fiblist/conf/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from lists.views import home_page
from core.views import custom_server_error
# error pages
# handler400 = 'core.views.custom_bad_request'
# handler403 = 'core.views.custom_permission_denied'
# handler404 = 'core.views.custom_page_not_found'
# ... | from django.conf.urls import include, url
from django.contrib import admin
from lists.views import home_page
# from core.views import custom_server_error
# error pages
# handler400 = 'core.views.custom_bad_request'
# handler403 = 'core.views.custom_permission_denied'
# handler404 = 'core.views.custom_page_not_found'
... | Remove customer server error view temporarily. | Remove customer server error view temporarily.
| Python | unlicense | nicorellius/fiblist,nicorellius/fiblist | ---
+++
@@ -2,7 +2,7 @@
from django.contrib import admin
from lists.views import home_page
-from core.views import custom_server_error
+# from core.views import custom_server_error
# error pages
# handler400 = 'core.views.custom_bad_request' |
30ffff16e5dd4eec6e5128a277a677834470be73 | scikits/learn/tests/test_cross_val.py | scikits/learn/tests/test_cross_val.py | """ Test the cross_val module
"""
import numpy as np
import nose
from .. import cross_val
def test_kfold():
# Check that errors are raise if there is not enough samples
nose.tools.assert_raises(AssertionError, cross_val.KFold, 3, 3)
y = [0, 0, 1, 1, 2]
nose.tools.assert_raises(AssertionError, cross_... | """ Test the cross_val module
"""
import numpy as np
import nose
from ..base import BaseEstimator
from .. import cross_val
class MockClassifier(BaseEstimator):
"""Dummy classifier to test the cross-validation
"""
def __init__(self, a=0):
self.a = a
def fit(self, X, Y, **params):
... | Add a smoke test for cross_val_score | TEST: Add a smoke test for cross_val_score
| Python | bsd-3-clause | mjgrav2001/scikit-learn,marcocaccin/scikit-learn,jmschrei/scikit-learn,ycaihua/scikit-learn,sarahgrogan/scikit-learn,xubenben/scikit-learn,appapantula/scikit-learn,mehdidc/scikit-learn,bikong2/scikit-learn,cainiaocome/scikit-learn,hsiaoyi0504/scikit-learn,Titan-C/scikit-learn,hsuantien/scikit-learn,kmike/scikit-learn,V... | ---
+++
@@ -5,7 +5,32 @@
import nose
+from ..base import BaseEstimator
from .. import cross_val
+
+class MockClassifier(BaseEstimator):
+ """Dummy classifier to test the cross-validation
+
+ """
+ def __init__(self, a=0):
+ self.a = a
+
+ def fit(self, X, Y, **params):
+ self._set_... |
106833059bc2dad8a284de50e153bf673d2e3b4b | premis_event_service/urls.py | premis_event_service/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns(
'premis_event_service.views',
# begin CODA Family url structure >
(r'^APP/$', 'app'),
# node urls
# (r'^APP/node/$', 'node'),
# (r'^APP/node/(?P<identifier>.+?)/$', 'node'),
# event urls
(r'^APP/event/$', 'app_event'),
... | try:
from django.conf.urls import patterns, url
except ImportError:
from django.conf.urls.defaults import * # In case of Django<=1.3
urlpatterns = patterns(
'premis_event_service.views',
# begin CODA Family url structure >
(r'^APP/$', 'app'),
# node urls
# (r'^APP/node/$', 'node'),
# (... | Support new and old Django urlconf imports | Support new and old Django urlconf imports
| Python | bsd-3-clause | unt-libraries/django-premis-event-service,unt-libraries/django-premis-event-service,unt-libraries/django-premis-event-service | ---
+++
@@ -1,4 +1,7 @@
-from django.conf.urls.defaults import *
+try:
+ from django.conf.urls import patterns, url
+except ImportError:
+ from django.conf.urls.defaults import * # In case of Django<=1.3
urlpatterns = patterns(
'premis_event_service.views', |
d902045e991cc778dabe31e34a6dcd119e19ccd0 | attributes/license/main.py | attributes/license/main.py | from utilities import url_to_json
def run(project_id, repo_path, cursor, **options):
query = 'SELECT url FROM projects WHERE id = ' + str(project_id)
cursor.execute(query)
record = cursor.fetchone()
full_url = record[0].rstrip()
json_response = url_to_json(full_url, headers={
'Accept'... | from core import tokenize
from utilities import url_to_json
def run(project_id, repo_path, cursor, **options):
query = 'SELECT url FROM projects WHERE id = ' + str(project_id)
cursor.execute(query)
record = cursor.fetchone()
full_url = tokenize(record[0].rstrip())
json_response = url_to_json(full... | Update license attribute to return binary and raw result | Update license attribute to return binary and raw result
| Python | apache-2.0 | RepoReapers/reaper,RepoReapers/reaper,RepoReapers/reaper,RepoReapers/reaper | ---
+++
@@ -1,3 +1,4 @@
+from core import tokenize
from utilities import url_to_json
@@ -6,18 +7,14 @@
cursor.execute(query)
record = cursor.fetchone()
- full_url = record[0].rstrip()
+ full_url = tokenize(record[0].rstrip())
json_response = url_to_json(full_url, headers={
'Ac... |
61cce2cd23c798a8604274335d9637e8ebce1385 | api/v2/views/image.py | api/v2/views/image.py | from core.models import Application as Image
from api import permissions
from api.v2.serializers.details import ImageSerializer
from api.v2.views.base import AuthOptionalViewSet
from api.v2.views.mixins import MultipleFieldLookup
class ImageViewSet(MultipleFieldLookup, AuthOptionalViewSet):
"""
API endpoint... | from core.models import Application as Image
from api import permissions
from api.v2.serializers.details import ImageSerializer
from api.v2.views.base import AuthOptionalViewSet
from api.v2.views.mixins import MultipleFieldLookup
class ImageViewSet(MultipleFieldLookup, AuthOptionalViewSet):
"""
API endpoint... | Add 'Machine Identifier' for easy support lookups in Troposphere | Add 'Machine Identifier' for easy support lookups in Troposphere
| Python | apache-2.0 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | ---
+++
@@ -25,7 +25,9 @@
serializer_class = ImageSerializer
search_fields = ('id', 'name', 'versions__change_log', 'tags__name',
- 'tags__description', 'created_by__username', 'versions__machines__instance_source__provider__location')
+ 'tags__description', 'create... |
358f244b397f11cdf9f89304356ac45b4c6621b5 | __init__.py | __init__.py | #! /usr/bin/env python
# coding=utf-8
import os.path
import subprocess
class SubTask():
def __init__(self, output_dir, log):
self.__output_dir = output_dir
self.__log = log
self.__wd = os.path.dirname(os.path.realpath(__file__))
self.__init_done = False
print "__init__"
... | #! /usr/bin/env python
# coding=utf-8
import os.path
import subprocess
class SubTask():
def __init__(self, output_dir, log):
self.__output_dir = output_dir
self.__log = log
self.__wd = os.path.dirname(os.path.realpath(__file__))
self.__init_done = False
print "__init__"
... | Add return value: tcc path. | Add return value: tcc path.
| Python | apache-2.0 | lugovskoy/dts-sample-compile | ---
+++
@@ -31,15 +31,8 @@
return True
- def __result(self, output_dir, retcode):
- return {
- 'gcc': os.path.join(output_dir, 'bin'),
- 'passed': retcode == 0
- }
-
-
def run(self, q, args):
print "run"
script = os.path.join(self.__wd, 'conf_and_... |
61ca14440f39106b6109b96919b520e40170b1f3 | examples/tour_examples/xkcd_tour.py | examples/tour_examples/xkcd_tour.py | from seleniumbase import BaseCase
class MyTestClass(BaseCase):
def test_basic(self):
self.open('https://xkcd.com/1117/')
self.assert_element('img[alt="My Sky"]')
self.create_shepherd_tour()
self.add_tour_step("Welcome to XKCD!")
self.add_tour_step("This is the XKCD logo.",... | from seleniumbase import BaseCase
class MyTestClass(BaseCase):
def test_basic(self):
self.open('https://xkcd.com/1117/')
self.assert_element('img[alt="My Sky"]')
self.create_shepherd_tour()
self.add_tour_step("Welcome to XKCD!")
self.add_tour_step("This is the XKCD logo.",... | Update a SeleniumBase tour example | Update a SeleniumBase tour example
| Python | mit | mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase | ---
+++
@@ -12,11 +12,10 @@
self.add_tour_step("Here's the daily webcomic.", "#comic img")
self.add_tour_step("This is the title.", "#ctitle", alignment="top")
self.add_tour_step("Click here for the next comic.", 'a[rel="next"]')
- self.add_tour_step("Or here for the previous comic."... |
671cd368c9730e7c15005df4e476e86d80bf0b8e | array/rotate-image.py | array/rotate-image.py | # You are given an n x n 2D matrix that represents an image. Rotate the image by 90 degrees clockwise
# solve with O(1) additional memory
def rotate_image(a):
n = len(a)
if a is None or n < 1:
return a
else:
for i in range(n/2):
for j in range(i, n-i-1):
temp = a[i][j]
a[i][j] = a[n-1-j][i]
a[n-... | # You are given an n x n 2D matrix that represents an image. Rotate the image by 90 degrees clockwise
# solve with O(1) additional memory
def rotate_image(a):
n = len(a)
if a is None or n < 1:
return a
else:
for i in range(n/2): # loop through all squares one by one
for j in range(i, n-i-1): # loop through ... | Add test cases and comments | Add test cases and comments
| Python | mit | derekmpham/interview-prep,derekmpham/interview-prep | ---
+++
@@ -7,11 +7,34 @@
if a is None or n < 1:
return a
else:
- for i in range(n/2):
- for j in range(i, n-i-1):
- temp = a[i][j]
- a[i][j] = a[n-1-j][i]
- a[n-1-j][i] = a[n-1-i][n-1-j]
- a[n-1-i][n-1-j] = a[j][n-1-i]
- a[j][n-1-i] = temp
+ for i in range(n/2): # loop through all squares o... |
d68f391d15927db65ea4e62d67bd9faf37b5deaf | file_process/utils/get_reference.py | file_process/utils/get_reference.py | from __future__ import absolute_import
from .twobit import TwoBitFile
def get_reference_allele(chrom, start, hg19_path):
twobit_file = TwoBitFile(hg19_path)
end = start + 1
refallele = twobit_file[chrom][start:end]
return refallele
| from __future__ import absolute_import
from .twobit import TwoBitFile
def get_reference_allele(chrom, start, hg19_path):
twobit_file = TwoBitFile(hg19_path)
end = start + 1
try:
refallele = twobit_file[chrom][start:end]
except TypeError:
refallele = 'N'
return refallele
| Return N for ref allele in pos uncovered by ref | Return N for ref allele in pos uncovered by ref
This arose during processing of a CGI var file originating from LFR
data (not sure, but LFR is an advanced technique, so it's possible CGI
is calling some positions that aren't called in reference).
| Python | mit | PersonalGenomesOrg/archive-genevieve-201505,PersonalGenomesOrg/archive-genevieve-201505,PersonalGenomesOrg/archive-genevieve-201505 | ---
+++
@@ -5,5 +5,8 @@
def get_reference_allele(chrom, start, hg19_path):
twobit_file = TwoBitFile(hg19_path)
end = start + 1
- refallele = twobit_file[chrom][start:end]
+ try:
+ refallele = twobit_file[chrom][start:end]
+ except TypeError:
+ refallele = 'N'
return refallele |
461522c3b79202c915544466272d3bb2a3d0ecbe | api/radar_api/serializers/meta.py | api/radar_api/serializers/meta.py | from radar.models.users import User
from radar.serializers.fields import StringField, IntegerField
from radar.serializers.models import ModelSerializer
class TinyUserSerializer(ModelSerializer):
id = IntegerField()
username = StringField()
email = StringField()
first_name = StringField()
last_name... | from radar.models.users import User
from radar.serializers.fields import StringField, IntegerField, DateTimeField
from radar.serializers.models import ModelSerializer
class TinyUserSerializer(ModelSerializer):
id = IntegerField()
username = StringField()
email = StringField()
first_name = StringField(... | Add created and modified date mixins | Add created and modified date mixins
| Python | agpl-3.0 | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | ---
+++
@@ -1,5 +1,5 @@
from radar.models.users import User
-from radar.serializers.fields import StringField, IntegerField
+from radar.serializers.fields import StringField, IntegerField, DateTimeField
from radar.serializers.models import ModelSerializer
@@ -39,5 +39,13 @@
return model_exclude
-cl... |
71d6176b1468a5bf9aef1ced5214c32b69efaf50 | apps/countdown/views.py | apps/countdown/views.py | from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponse
from django.utils.http import urlencode
import json
import urllib2
def index(request, year, month, day, hour, text):
params = {
'year': year,
'month': int(month) - 1, #JS takes month... | from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponse
from django.utils.http import urlencode
import json
import urllib2
def index(request, year, month, day, hour, text):
params = {
'year': year,
'month': int(month) - 1, #JS takes month... | Fix bug in countdonw hours calculation | Fix bug in countdonw hours calculation
| Python | bsd-3-clause | Teknologforeningen/tf-info,Teknologforeningen/tf-info,Teknologforeningen/tf-info | ---
+++
@@ -15,7 +15,7 @@
'month': int(month) - 1, #JS takes months in retarded format...
'day': day,
'text': text,
- 'hour': int(hour) - 1 #JS also takes hours in retarded format...
+ 'hour': int(hour)
}
return render_to_response('countdown/index.html', params, context_instance=RequestContext(reques... |
bde0363b51bfa7bb6facac1185c9a687ff952e36 | artifacts/exceptions.py | artifacts/exceptions.py | # -*- coding: utf-8 -*-
#
# Artifacts - Artifactory Search Client
#
# Copyright 2015 Smarter Travel
#
# Available under the MIT license. See LICENSE for details.
#
"""
artifacts.exceptions
~~~~~~~~~~~~~~~~~~~~
Exceptions raised by the Artifacts library.
"""
from __future__ import print_function, division
class Art... | # -*- coding: utf-8 -*-
#
# Artifacts - Artifactory Search Client
#
# Copyright 2015 Smarter Travel
#
# Available under the MIT license. See LICENSE for details.
#
"""
artifacts.exceptions
~~~~~~~~~~~~~~~~~~~~
Exceptions raised by the Artifacts library.
"""
from __future__ import print_function, division
__all__ = ... | Add __all__ variable to enforce ordering in docs | Add __all__ variable to enforce ordering in docs
| Python | mit | smarter-travel-media/stac | ---
+++
@@ -16,13 +16,20 @@
from __future__ import print_function, division
+__all__ = [
+ 'ArtifactsError',
+ 'ArtifactoryApiError',
+ 'NoReleaseArtifactsError',
+ 'NoArtifactVersionsError'
+]
+
class ArtifactsError(RuntimeError):
- """Base for all exceptions raised by the Artifacts library"""... |
784fb8591cd1a66de1adac9626d8c4fb02d8e01e | examples/customization/pwd-cd-and-system/utils.py | examples/customization/pwd-cd-and-system/utils.py | """Utility for changing directories and execution of commands in a subshell."""
import os, shlex, subprocess
def chdir(debugger, args, result, dict):
"""Change the working directory, or cd to ${HOME}."""
dir = args.strip()
if dir:
os.chdir(args)
else:
os.chdir(os.path.expanduser('~'))
... | """Utility for changing directories and execution of commands in a subshell."""
import os, shlex, subprocess
# Store the previous working directory for the 'cd -' command.
class Holder:
"""Holds the _prev_dir_ class attribute for chdir() function."""
_prev_dir_ = None
@classmethod
def prev_dir(cls):
... | Add 'cd -' feature to change to the previous working directory. | Add 'cd -' feature to change to the previous working directory.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@141846 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb | ---
+++
@@ -2,13 +2,37 @@
import os, shlex, subprocess
+# Store the previous working directory for the 'cd -' command.
+class Holder:
+ """Holds the _prev_dir_ class attribute for chdir() function."""
+ _prev_dir_ = None
+
+ @classmethod
+ def prev_dir(cls):
+ return cls._prev_dir_
+
+ @cla... |
c1ed5eb96b04ca0af2ad8f26023d8cbaa4a75eda | rx/concurrency/threadpoolscheduler.py | rx/concurrency/threadpoolscheduler.py | import logging
from concurrent.futures import ThreadPoolExecutor
from rx.core import Scheduler, Disposable
from rx.disposables import SingleAssignmentDisposable, CompositeDisposable
from .timeoutscheduler import TimeoutScheduler
log = logging.getLogger("Rx")
class ThreadPoolScheduler(TimeoutScheduler):
"""A sc... | from concurrent.futures import ThreadPoolExecutor
from rx.core import Scheduler
from .newthreadscheduler import NewThreadScheduler
class ThreadPoolScheduler(NewThreadScheduler):
"""A scheduler that schedules work via the thread pool."""
class ThreadPoolThread:
"""Wraps a concurrent future as a thre... | Make thread pool scheduler behave as a pooled new thread scheduler | Make thread pool scheduler behave as a pooled new thread scheduler
| Python | mit | ReactiveX/RxPY,ReactiveX/RxPY | ---
+++
@@ -1,32 +1,32 @@
-import logging
from concurrent.futures import ThreadPoolExecutor
-from rx.core import Scheduler, Disposable
-from rx.disposables import SingleAssignmentDisposable, CompositeDisposable
+from rx.core import Scheduler
-from .timeoutscheduler import TimeoutScheduler
-
-log = logging.getLog... |
71b73151c358d2c3d6ceae80d6a2287143085065 | arxiv_vanity/scraper/arxiv_ids.py | arxiv_vanity/scraper/arxiv_ids.py | import re
ARXIV_ID_PATTERN = r"([a-z\-]+(?:\.[A-Z]{2})?/\d{7}|\d+\.\d+)(v\d+)?"
ARXIV_ID_RE = re.compile(ARXIV_ID_PATTERN)
ARXIV_URL_RE = re.compile(fr"arxiv.org/[^\/]+/({ARXIV_ID_PATTERN})(\.pdf)?", re.I)
ARXIV_DOI_RE = re.compile(fr"^(?:arxiv:)?({ARXIV_ID_PATTERN})$", re.I)
ARXIV_VANITY_RE = re.compile(
fr"(?:lo... | import re
ARXIV_ID_PATTERN = r"([a-z\-]+(?:\.[A-Z]{2})?/\d{7}|\d+\.\d+)(v\d+)?"
ARXIV_ID_RE = re.compile(ARXIV_ID_PATTERN, re.I)
ARXIV_URL_RE = re.compile(fr"arxiv.org/[^\/]+/({ARXIV_ID_PATTERN})(\.pdf)?", re.I)
ARXIV_DOI_RE = re.compile(fr"^(?:arxiv:)?({ARXIV_ID_PATTERN})$", re.I)
ARXIV_VANITY_RE = re.compile(
fr... | Handle capital "V" in URL | Handle capital "V" in URL
| Python | apache-2.0 | arxiv-vanity/arxiv-vanity,arxiv-vanity/arxiv-vanity,arxiv-vanity/arxiv-vanity,arxiv-vanity/arxiv-vanity | ---
+++
@@ -1,7 +1,7 @@
import re
ARXIV_ID_PATTERN = r"([a-z\-]+(?:\.[A-Z]{2})?/\d{7}|\d+\.\d+)(v\d+)?"
-ARXIV_ID_RE = re.compile(ARXIV_ID_PATTERN)
+ARXIV_ID_RE = re.compile(ARXIV_ID_PATTERN, re.I)
ARXIV_URL_RE = re.compile(fr"arxiv.org/[^\/]+/({ARXIV_ID_PATTERN})(\.pdf)?", re.I)
ARXIV_DOI_RE = re.compile(fr"^(... |
358fcbf44903d817f115d4df1074a89a9f151c9c | pythonforandroid/recipes/pymunk/__init__.py | pythonforandroid/recipes/pymunk/__init__.py | from os.path import join
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class PymunkRecipe(CompiledComponentsPythonRecipe):
name = "pymunk"
version = '5.5.0'
url = 'https://pypi.python.org/packages/source/p/pymunk/pymunk-{version}.zip'
depends = ['cffi', 'setuptools']
call_host... | from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class PymunkRecipe(CompiledComponentsPythonRecipe):
name = "pymunk"
version = "6.0.0"
url = "https://pypi.python.org/packages/source/p/pymunk/pymunk-{version}.zip"
depends = ["cffi", "setuptools"]
call_hostpython_via_targetpython =... | Update Pymunk recipe to 6.0.0 | Update Pymunk recipe to 6.0.0
| Python | mit | PKRoma/python-for-android,kronenpj/python-for-android,kronenpj/python-for-android,PKRoma/python-for-android,PKRoma/python-for-android,kronenpj/python-for-android,kivy/python-for-android,kronenpj/python-for-android,kivy/python-for-android,kronenpj/python-for-android,kivy/python-for-android,kivy/python-for-android,kivy/p... | ---
+++
@@ -1,20 +1,16 @@
-from os.path import join
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class PymunkRecipe(CompiledComponentsPythonRecipe):
name = "pymunk"
- version = '5.5.0'
- url = 'https://pypi.python.org/packages/source/p/pymunk/pymunk-{version}.zip'
- depends =... |
a9fb5d3899e5f7f9c0b964a2eaa0f74df33dc52f | scrapple/utils/exceptions.py | scrapple/utils/exceptions.py | """
scrapple.utils.exceptions
~~~~~~~~~~~~~~~~~~~~~~~~~
Functions related to handling exceptions in the input arguments
"""
import re
def check_arguments(args):
"""
Validates the arguments passed through the CLI commands.
:param args: The arguments passed in the CLI, parsed by the docopt module
:return: None
... | """
scrapple.utils.exceptions
~~~~~~~~~~~~~~~~~~~~~~~~~
Functions related to handling exceptions in the input arguments
"""
import re
class InvalidType(ValueError):
"""Exception class for invalid type in arguments."""
pass
def check_arguments(args):
"""
Validates the arguments passed through the CLI commands.... | Add custom error class 'InvalidType' | Add custom error class 'InvalidType'
| Python | mit | AlexMathew/scrapple,scrappleapp/scrapple,AlexMathew/scrapple,AlexMathew/scrapple,scrappleapp/scrapple | ---
+++
@@ -6,6 +6,11 @@
"""
import re
+
+class InvalidType(ValueError):
+ """Exception class for invalid type in arguments."""
+ pass
+
def check_arguments(args):
@@ -19,7 +24,7 @@
projectname_re = re.compile(r'[^a-zA-Z0-9_]')
if args['genconfig']:
if args['--type'] not in ['scraper', 'crawler']:
- ... |
0757efde915acdf651231bc345c4c1f3ca67d921 | work/print-traceback.py | work/print-traceback.py | #!/usr/bin/python3
from pprint import pprint
import json
import sys
def get(obj, path):
try:
for part in path:
obj = obj[part]
return obj
except KeyError:
return None
if __name__ == '__main__':
if len(sys.argv) >= 2:
paths = [sys.argv[1].split('.')]
else:
... | #!/usr/bin/python3
from pprint import pprint
import json
import sys
def get(obj, path):
try:
for part in path:
obj = obj[part]
return obj
except KeyError:
return None
def display(obj):
for path in paths:
subobj = get(obj, path)
if subobj is not None:
... | Allow multiple lines of traceback. | Allow multiple lines of traceback.
| Python | mit | ammongit/scripts,ammongit/scripts,ammongit/scripts,ammongit/scripts | ---
+++
@@ -12,6 +12,18 @@
except KeyError:
return None
+def display(obj):
+ for path in paths:
+ subobj = get(obj, path)
+ if subobj is not None:
+ obj = subobj
+ break
+
+ if isinstance(obj, str):
+ print(obj)
+ else:
+ pprint(obj)
+
if __n... |
88e91100cf191b5320ed20678aca835601f7031c | doc/ext/cinder_autodoc.py | doc/ext/cinder_autodoc.py | from __future__ import print_function
import gettext
import os
gettext.install('cinder')
from cinder import utils
def setup(app):
print("**Autodocumenting from %s" % os.path.abspath(os.curdir))
rv = utils.execute('./doc/generate_autodoc_index.sh')
print(rv[0])
| # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the ... | Add Apache 2.0 license to source file | Add Apache 2.0 license to source file
Source code should be licensed under the Apache 2.0 license.
All source files should have the licensing header.
Change-Id: I67df47560d87182265ec4fa973bddaf356829fc1
| Python | apache-2.0 | eharney/cinder,Datera/cinder,j-griffith/cinder,phenoxim/cinder,phenoxim/cinder,mahak/cinder,openstack/cinder,Datera/cinder,mahak/cinder,openstack/cinder,ge0rgi/cinder,j-griffith/cinder,eharney/cinder | ---
+++
@@ -1,3 +1,15 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,... |
26b79c227ac13bcad686bec6670f585b2d202e33 | module/plugins/accounts/ReloadCc.py | module/plugins/accounts/ReloadCc.py | from module.plugins.Account import Account
from module.common.json_layer import json_loads
class ReloadCc(Account):
__name__ = "ReloadCc"
__version__ = "0.1"
__type__ = "account"
__description__ = """Reload.Cc account plugin"""
__author_name__ = ("Reload Team")
__author_mail__ = ("hello... | from module.plugins.Account import Account
from module.common.json_layer import json_loads
class ReloadCc(Account):
__name__ = "ReloadCc"
__version__ = "0.1"
__type__ = "account"
__description__ = """Reload.Cc account plugin"""
__author_name__ = ("Reload Team")
__author_mail__ = ("hello... | Change self.accounts to self.info for getting the cached password hash | Change self.accounts to self.info for getting the cached password hash
| Python | agpl-3.0 | vuolter/pyload,vuolter/pyload,pyblub/pyload,pyblub/pyload,vuolter/pyload | ---
+++
@@ -37,7 +37,7 @@
pwd = "pwd=%s" % self.accounts[user]['password']
try:
- pwd = "hash=%s" % self.accounts[user]['pwdhash']
+ pwd = "hash=%s" % self.infos[user]['pwdhash']
except Exception:
pass
|
b56c1cb1185c8d20276688f29509947cb46a26d4 | test/test_compiled.py | test/test_compiled.py | """
Test compiled module
"""
import os
import platform
import sys
import jedi
from .helpers import cwd_at
@cwd_at('test/extensions')
def test_completions():
if platform.architecture()[0] == '64bit':
package_name = "compiled%s%s" % sys.version_info[:2]
sys.path.insert(0, os.getcwd())
if os... | """
Test compiled module
"""
import os
import platform
import sys
import jedi
from .helpers import cwd_at
@cwd_at('test/extensions')
def test_completions():
if platform.architecture()[0] == '64bit':
package_name = "compiled%s%s" % sys.version_info[:2]
sys.path.insert(0, os.getcwd())
if os... | Add test with standard lib | Add test with standard lib
math.cos( should return <Param: x @0,0>
| Python | mit | WoLpH/jedi,WoLpH/jedi,dwillmer/jedi,jonashaag/jedi,mfussenegger/jedi,flurischt/jedi,mfussenegger/jedi,dwillmer/jedi,jonashaag/jedi,tjwei/jedi,tjwei/jedi,flurischt/jedi | ---
+++
@@ -20,7 +20,8 @@
@cwd_at('test/extensions')
-def test_call_signatures():
+def test_call_signatures_extension():
+ # with a cython extension
if platform.architecture()[0] == '64bit':
package_name = "compiled%s%s" % sys.version_info[:2]
sys.path.insert(0, os.getcwd())
@@ -31,3 +3... |
85d0bc9fbb20daeff9aa48a83be1823fa346cb9c | tests/test_helpers.py | tests/test_helpers.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
import types
from rakuten_ws.webservice import RakutenWebService
from rakuten_ws.base import RakutenAPIResponse
@pytest.mark.online
def test_response(credentials):
ws = RakutenWebService(**credentials)
response = ws.ichiba.item.sea... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
import types
from rakuten_ws.webservice import RakutenWebService
from rakuten_ws.base import RakutenAPIResponse
@pytest.mark.online
def test_response(credentials):
ws = RakutenWebService(**credentials)
response = ws.ichiba.item.sea... | Fix tests for Python 3 | Fix tests for Python 3
| Python | mit | alexandriagroup/rakuten-ws | ---
+++
@@ -30,5 +30,5 @@
# within a generator
assert isinstance(items, types.GeneratorType)
# The iteration should switch to the next page
- assert items.next()['page'] == 1
- assert items.next()['page'] == 2
+ assert next(items)['page'] == 1
+ assert next(items)['page'] == 2 |
36477e0737897fd717e3cbde4b05cb210d335440 | tests/test_refresh.py | tests/test_refresh.py | # vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# See LICENSE comming with the source of python-quilt for details.
import os
from .helpers import make_file
from unittest import TestCase
import quilt.refresh
from quilt.db import Db, Patch
from quilt... | # vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# See LICENSE comming with the source of python-quilt for details.
import os
from helpers import make_file
from unittest import TestCase
import quilt.refresh
from quilt.db import Db, Patch
from quilt.... | Use “helpers” as independent module for “tests.runtests” environment | Use “helpers” as independent module for “tests.runtests” environment
| Python | mit | bjoernricks/python-quilt | ---
+++
@@ -6,7 +6,7 @@
import os
-from .helpers import make_file
+from helpers import make_file
from unittest import TestCase
import quilt.refresh |
1083201467c2305966dd2c36e9d7b147ced891e2 | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/customlogging.py | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/customlogging.py | from .request import GLOBALS
from django.conf import settings
import logging
class GrayFilter(logging.Filter): # pragma: no cover
def filter(self, record):
if hasattr(GLOBALS, "user") and GLOBALS.user:
record.user_id = GLOBALS.user.id
record.env = settings.STATIC_LOGGING.get("env")
... | import logging
from django.conf import settings
from .request import GLOBALS
class GrayFilter(logging.Filter): # pragma: no cover
def filter(self, record):
# check for request._cached_user before accessing the user object,
# this means django.contrib.auth.middleware.get_user has returned.
... | Fix recursive logging error wheni GrayFilter is in use and "django" logger is at DEBUG leve | Fix recursive logging error wheni GrayFilter is in use and "django" logger is at DEBUG leve
| Python | apache-2.0 | Benoss/django-cookiecutter,Benoss/django-cookiecutter,Benoss/django-cookiecutter,Benoss/django-cookiecutter | ---
+++
@@ -1,12 +1,16 @@
+import logging
+
+from django.conf import settings
+
from .request import GLOBALS
-from django.conf import settings
-import logging
class GrayFilter(logging.Filter): # pragma: no cover
-
def filter(self, record):
- if hasattr(GLOBALS, "user") and GLOBALS.user:
+ # ... |
f18957ca1986317e8987183633c39f1987e316c4 | pgcontents/__init__.py | pgcontents/__init__.py | from .checkpoints import PostgresCheckpoints
from .pgmanager import PostgresContentsManager
__all__ = [
'PostgresCheckpoints',
'PostgresContentsManager',
]
| # Do this first so that we bail early with a useful message if the user didn't
# specify [ipy3] or [ipy4].
try:
import IPython # noqa
except ImportError:
raise ImportError(
"No IPython installation found.\n"
"To install pgcontents with the latest Jupyter Notebook"
" run 'pip install pgc... | Add warning if IPython isn't installed. | DOC: Add warning if IPython isn't installed.
| Python | apache-2.0 | quantopian/pgcontents | ---
+++
@@ -1,3 +1,16 @@
+# Do this first so that we bail early with a useful message if the user didn't
+# specify [ipy3] or [ipy4].
+try:
+ import IPython # noqa
+except ImportError:
+ raise ImportError(
+ "No IPython installation found.\n"
+ "To install pgcontents with the latest Jupyter Noteb... |
cc44afdca3ebcdaeed3555f161d3e0a1992c19eb | planet/api/__init__.py | planet/api/__init__.py | # Copyright 2017 Planet Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # Copyright 2017 Planet Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Put api.__version__ back in after version shuffle | Put api.__version__ back in after version shuffle
| Python | apache-2.0 | planetlabs/planet-client-python,planetlabs/planet-client-python | ---
+++
@@ -18,6 +18,7 @@
from .client import (ClientV1)
from .utils import write_to_file
from . import filters
+from .__version__ import __version__ # NOQA
__all__ = [
ClientV1, APIException, BadQuery, InvalidAPIKey, |
268c4dce6cfa59e10cff7f4bf8456276c2e11f7d | main.py | main.py | #!/usr/bin/env python2.7
#coding: utf8
"""
KSP Add-on Version Checker.
"""
# Copyright 2014 Dimitri "Tyrope" Molenaars
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use self file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.... | #!/usr/bin/env python2.7
#coding: utf8
"""
KSP Add-on Version Checker.
"""
# Copyright 2014 Dimitri "Tyrope" Molenaars
# 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.... | Create config paths if needed, find files and (for now) report remotes. | Create config paths if needed, find files and (for now) report remotes.
| Python | apache-2.0 | tyrope/KSP-addon-version-checker | ---
+++
@@ -7,7 +7,7 @@
# Copyright 2014 Dimitri "Tyrope" Molenaars
# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use self file except in compliance with the License.
+# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
... |
9fe11538a9d74ff235b530a71d2399fe6c03a88a | tests/rules_tests/FromRulesComputeTest.py | tests/rules_tests/FromRulesComputeTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromRulesComputeTest(TestCase):
pass
if __name__ == '__main__':
main()
| #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
from grammpy.exceptions.NotASingleSymbolException import NotASingleSymbolException
from grammpy.exceptions.CantCreateSingleRuleExcepti... | Add tests to compute from rules property | Add tests to compute from rules property
| Python | mit | PatrikValkovic/grammpy | ---
+++
@@ -9,10 +9,67 @@
from unittest import main, TestCase
from grammpy import Rule
+from grammpy.exceptions.NotASingleSymbolException import NotASingleSymbolException
+from grammpy.exceptions.CantCreateSingleRuleException import CantCreateSingleRuleException
+
+
+class OneRule(Rule):
+ rules = [([0], [1])]... |
fbfae080cc59e2faae4c8ece21e4aa2970efee1e | encmass.py | encmass.py | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# GENHERNQUIST.ENCMASS
# Laura L Watkins [lauralwatkins@gmail.com]
# -----------------------------------------------------------------------------
import numpy as np
from astropy import units as u
from scipy import sp... | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# GENHERNQUIST.ENCMASS
# Laura L Watkins [lauralwatkins@gmail.com]
# -----------------------------------------------------------------------------
import numpy as np
from astropy import units as u
from scipy import sp... | Fix error in enclosed mass calculation and fix unit handling. | Fix error in enclosed mass calculation and fix unit handling.
| Python | bsd-2-clause | lauralwatkins/genhernquist | ---
+++
@@ -25,10 +25,10 @@
a = (3.-gamma)/alpha
b = (gamma-beta)/alpha
- y = (r/rs)**alpha
+ y = ((r/rs).to(u.dimensionless_unscaled).value)**alpha
fn = lambda x: x**a * special.hyp2f1(a, -b, 1+a, -x)/a
- encmass = (4*np.pi*norm*rs**3*fn(y.value)).to(u.Msun)
+ encmass = (... |
5ee3eb2f68e4af8e70ea383b067fe67ffd4800bf | loadsbroker/webapp/__init__.py | loadsbroker/webapp/__init__.py | import os
import tornado.web
from loadsbroker.webapp.api import RootHandler, RunHandler
from loadsbroker.webapp.views import GrafanaHandler
_GRAFANA = os.path.join(os.path.dirname(__file__), 'grafana')
application = tornado.web.Application([
(r"/api", RootHandler),
(r"/api/run/(.*)", RunHandler),
(r"/da... | import os
import tornado.web
from loadsbroker.webapp.api import RootHandler, RunHandler
from loadsbroker.webapp.views import GrafanaHandler
_GRAFANA = os.path.join(os.path.dirname(__file__), 'grafana')
application = tornado.web.Application([
(r"/api", RootHandler),
(r"/api/run/(.*)", RunHandler),
(r"/da... | Set the `default_filename` for `GrafanaHandler`. | Set the `default_filename` for `GrafanaHandler`.
| Python | apache-2.0 | loads/loads-broker,loads/loads-broker,loads/loads-broker,loads/loads-broker | ---
+++
@@ -10,5 +10,5 @@
application = tornado.web.Application([
(r"/api", RootHandler),
(r"/api/run/(.*)", RunHandler),
- (r"/dashboards/run/(.*)", GrafanaHandler, {"path": _GRAFANA})
+ (r"/dashboards/run/(.*)", GrafanaHandler, {"path": _GRAFANA, "default_filename": "index.html"})
]) |
ddd8f1a8fab0f77943d7a47e1d154d1104add26e | ievv_opensource/ievv_batchframework/rq_tasks.py | ievv_opensource/ievv_batchframework/rq_tasks.py | from __future__ import absolute_import
import django_rq
from ievv_opensource.ievv_batchframework.models import BatchOperation
from ievv_opensource.ievv_batchframework import batchregistry
import logging
class BatchActionGroupTask(object):
abstract = True
def run_actiongroup(self, actiongroup_name, batchop... | import django_rq
from ievv_opensource.ievv_batchframework.models import BatchOperation
from ievv_opensource.ievv_batchframework import batchregistry
import logging
class BatchActionGroupTask(object):
abstract = True
def run_actiongroup(self, actiongroup_name, batchoperation_id, **kwargs):
try:
... | Remove dependency on the future lib. | Remove dependency on the future lib.
| Python | bsd-3-clause | appressoas/ievv_opensource,appressoas/ievv_opensource,appressoas/ievv_opensource,appressoas/ievv_opensource,appressoas/ievv_opensource | ---
+++
@@ -1,5 +1,3 @@
-from __future__ import absolute_import
-
import django_rq
from ievv_opensource.ievv_batchframework.models import BatchOperation |
1d74d333cdf6d25150afc93febc8141ea3c655b0 | sirius/LI_V00/lattice.py | sirius/LI_V00/lattice.py | #!/usr/bin/env python3
import math as _math
import numpy as _np
import pyaccel as _pyaccel
import mathphys as _mp
from . import optics_mode_M0 as _optics_mode_M0
_default_optics_mode = _optics_mode_M0
_energy = 0.15e9 #[eV]
_emittance = 170.3329758677203e-09 #[m rad]
_energy_spread = 0.005
_single_bunch_charge = 1e-9... | #!/usr/bin/env python3
import math as _math
import numpy as _np
import pyaccel as _pyaccel
import mathphys as _mp
from . import optics_mode_M0 as _optics_mode_M0
_default_optics_mode = _optics_mode_M0
_energy = 0.15e9 #[eV]
_emittance = 170.3329758677203e-09 #[m rad]
_energy_spread = 0.005
_single_bunch_charge = 1e-9... | Change Linac pulse duration interval to 150 ns | Change Linac pulse duration interval to 150 ns
| Python | mit | lnls-fac/sirius | ---
+++
@@ -12,7 +12,7 @@
_energy_spread = 0.005
_single_bunch_charge = 1e-9 #[Coulomb]
_multi_bunch_charge = 3e-9 #[Coulomb]
-_pulse_duration_interval = [150e-9,300e-9] #[seconds]
+_pulse_duration_interval = 150e-9 #[seconds]
_frequency = 3e9 #[Hz]
def create_lattice(**kwargs): |
144264fcf06b24c8676e99bff5abb08e7bc936fb | comics/comics/fminus.py | comics/comics/fminus.py | from comics.aggregator.crawler import GoComicsComCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "F Minus"
language = "en"
url = "http://www.gocomics.com/fminus"
start_date = "1999-09-01"
rights = "Tony Carrillo"
class Crawler(GoComicsComCrawle... | from comics.aggregator.crawler import GoComicsComCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "F Minus"
language = "en"
url = "http://www.gocomics.com/fminus"
start_date = "1999-09-01"
rights = "Tony Carrillo"
class Crawler(GoComicsComCrawle... | Update history capability for "F Minus" | Update history capability for "F Minus"
| Python | agpl-3.0 | jodal/comics,datagutten/comics,jodal/comics,jodal/comics,jodal/comics,datagutten/comics,datagutten/comics,datagutten/comics | ---
+++
@@ -11,7 +11,7 @@
class Crawler(GoComicsComCrawlerBase):
- history_capable_date = "2001-02-02"
+ history_capable_date = "2005-05-10"
schedule = "Mo,Tu,We,Th,Fr,Sa,Su"
time_zone = "US/Mountain"
|
7168d7dc1695228e7711124395f41c3d52651a04 | conanfile.py | conanfile.py | from conans import ConanFile, CMake
from conans.tools import load
import re
def get_version():
try:
content = load("CMakeLists.txt")
version = re.search(r"^\s*project\(resource_pool\s+VERSION\s+([^\s]+)", content, re.M).group(1)
return version.strip()
except Exception:
return N... | from conans import ConanFile, CMake
from conans.tools import load
import re
def get_version():
try:
content = load("CMakeLists.txt")
version = re.search(r"^\s*project\(resource_pool\s+VERSION\s+([^\s]+)", content, re.M).group(1)
return version.strip()
except Exception:
return N... | Use boost 1.71.0 for conan | Use boost 1.71.0 for conan
https://github.com/conan-io/conan-center-index/issues/214#issuecomment-564074114
| Python | mit | elsid/resource_pool,elsid/resource_pool,elsid/resource_pool | ---
+++
@@ -22,7 +22,7 @@
exports_sources = 'include/*', 'CMakeLists.txt', 'resource_poolConfig.cmake', 'LICENCE', 'AUTHORS'
generators = 'cmake_paths'
- requires = 'boost/1.70.0@conan/stable'
+ requires = 'boost/1.71.0@conan/stable'
def _configure_cmake(self):
cmake = CMake(self) |
dd739126181b29493c9d1d90a7e40eac09c23666 | app/models.py | app/models.py | # -*- coding: utf-8 -*-
"""
app.models
~~~~~~~~~~
Provides the SQLAlchemy models
"""
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
import savalidation.validators as val
from datetime import datetime as dt
from app import db
from savalidation... | # -*- coding: utf-8 -*-
"""
app.models
~~~~~~~~~~
Provides the SQLAlchemy models
"""
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
import savalidation.validators as val
from datetime import datetime as dt
from app import db
from savalidation... | Add unique constraint to rid | Add unique constraint to rid | Python | mit | reubano/hdxscraper-hdro,reubano/hdxscraper-hdro,reubano/hdxscraper-hdro | ---
+++
@@ -24,7 +24,7 @@
db.DateTime, nullable=False, default=dt.utcnow(), onupdate=dt.utcnow())
# other keys
- rid = db.Column(db.String(16), nullable=False, index=True)
+ rid = db.Column(db.String(16), nullable=False, index=True, unique=True)
country = db.Column(db.String(32), nullable=F... |
4ac335e2ac69f634d51ab8b84805947fe2b87fc5 | app.py | app.py | #!notify/bin/python3
import os
import sys
from pushbullet import Pushbullet
def create_note(title, content):
api_key = os.environ["PB_API_KEY"]
pb = Pushbullet(api_key)
pb.push_note(title, content)
if len(sys.argv) >= 3:
title = sys.argv[1]
body = sys.argv[2]
create_note(title, body)
else:
... | #!notify/bin/python3
import hug
import os
from pushbullet import Pushbullet
@hug.cli()
def create_note(title: hug.types.text, content: hug.types.text):
api_key = os.environ["PB_API_KEY"]
pb = Pushbullet(api_key)
pb.push_note(title, content)
if __name__ == '__main__':
create_note.interface.cli()
| Migrate command line interface to hug | Migrate command line interface to hug
| Python | isc | tildecross/tildex-notify | ---
+++
@@ -1,19 +1,16 @@
#!notify/bin/python3
+import hug
import os
-import sys
from pushbullet import Pushbullet
-def create_note(title, content):
+@hug.cli()
+def create_note(title: hug.types.text, content: hug.types.text):
api_key = os.environ["PB_API_KEY"]
pb = Pushbullet(api_key)
pb.push... |
fe768f5d8c1081f69acd8cf656aa618da7caf93b | cbpos/mod/currency/views/config.py | cbpos/mod/currency/views/config.py | from PySide import QtGui
import cbpos
from cbpos.mod.currency.models.currency import Currency
class CurrencyConfigPage(QtGui.QWidget):
label = 'Currency'
def __init__(self):
super(CurrencyConfigPage, self).__init__()
self.default = QtGui.QComboBox()
... | from PySide import QtGui
import cbpos
import cbpos.mod.currency.controllers as currency
from cbpos.mod.currency.models.currency import Currency
class CurrencyConfigPage(QtGui.QWidget):
label = 'Currency'
def __init__(self):
super(CurrencyConfigPage, self).__init__()
... | Handle unset default currency better | Handle unset default currency better
| Python | mit | coinbox/coinbox-mod-currency | ---
+++
@@ -2,6 +2,7 @@
import cbpos
+import cbpos.mod.currency.controllers as currency
from cbpos.mod.currency.models.currency import Currency
class CurrencyConfigPage(QtGui.QWidget):
@@ -22,7 +23,7 @@
def populate(self):
session = cbpos.database.session()
- default_id = cbpos... |
2c2eac755245562446161e355d3436d6e662147c | notification/backends/email.py | notification/backends/email.py | from django.conf import settings
from django.core.mail import EmailMessage
from notification.backends.base import NotificationBackend
class EmailBackend(NotificationBackend):
sensitivity = 2
slug = u'email'
display_name = u'E-mail'
formats = ['short.txt', 'full.txt']
def email_for_user(self, rec... | from django.conf import settings
from django.core.mail import EmailMessage
from notification.backends.base import NotificationBackend
class EmailBackend(NotificationBackend):
sensitivity = 3
slug = u'email'
display_name = u'E-mail'
formats = ['short.txt', 'full.txt']
def email_for_user(self, rec... | Set notification.backends.EmailBackend.sensitivity = 3, so that it has a different sensitivity from the WebBackend | Set notification.backends.EmailBackend.sensitivity = 3, so that it has a different sensitivity from the WebBackend
| Python | mit | theatlantic/django-notification,theatlantic/django-notification | ---
+++
@@ -5,7 +5,7 @@
class EmailBackend(NotificationBackend):
- sensitivity = 2
+ sensitivity = 3
slug = u'email'
display_name = u'E-mail'
formats = ['short.txt', 'full.txt'] |
85faea2a9185924d1255e84aad1489f7e3627d13 | django_lightweight_queue/utils.py | django_lightweight_queue/utils.py | from django.db import models
from django.conf import settings
from django.utils.importlib import import_module
from django.core.exceptions import MiddlewareNotUsed
from django.utils.functional import memoize
from django.utils.module_loading import module_has_submodule
from . import app_settings
def get_path(path):
... | from django.db import models
from django.conf import settings
from django.utils.importlib import import_module
from django.core.exceptions import MiddlewareNotUsed
from django.utils.functional import memoize
from django.utils.module_loading import module_has_submodule
from . import app_settings
def get_path(path):
... | Add setproctitle wrapper so it's optional. | Add setproctitle wrapper so it's optional.
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@thread.com>
| Python | bsd-3-clause | prophile/django-lightweight-queue,prophile/django-lightweight-queue,thread/django-lightweight-queue,lamby/django-lightweight-queue,thread/django-lightweight-queue | ---
+++
@@ -28,6 +28,12 @@
return middleware
+try:
+ from setproctitle import setproctitle
+except ImportError:
+ def setproctitle(title):
+ pass
+
get_path = memoize(get_path, {}, 1)
get_backend = memoize(get_backend, {}, 0)
get_middleware = memoize(get_middleware, {}, 0) |
694079aa480072e97043f968547941404f303c75 | array/quick-sort.py | array/quick-sort.py | # Sort list using recursion
def quick_sort(lst):
if len(lst) == 0:
print []
left = []
right = []
pivot = lst[0]
# compare first element in list to the rest
for i in range(1, len(lst)):
if lst[i] < pivot:
left.append(lst[i])
else:
right.append(lst[i])
| # Sort list using recursion
def quick_sort(lst):
if len(lst) == 0:
print []
left = []
right = []
pivot = lst[0]
# compare first element in list to the rest
for i in range(1, len(lst)):
if lst[i] < pivot:
left.append(lst[i])
else:
right.append(lst[i])
# recursion
print quick_sort(left) + pivot + ... | Apply recursion to quick sort | Apply recursion to quick sort
| Python | mit | derekmpham/interview-prep,derekmpham/interview-prep | ---
+++
@@ -15,4 +15,5 @@
else:
right.append(lst[i])
-
+ # recursion
+ print quick_sort(left) + pivot + quick_sort(right) |
5345cfddc24303a7d27b61865306775f93bb908c | django_lightweight_queue/utils.py | django_lightweight_queue/utils.py | from django.utils.importlib import import_module
from django.core.exceptions import MiddlewareNotUsed
from django.utils.functional import memoize
from . import app_settings
def get_path(path):
module_name, attr = path.rsplit('.', 1)
module = import_module(module_name)
return getattr(module, attr)
def g... | from django.db.models import get_apps
from django.core.exceptions import MiddlewareNotUsed
from django.utils.importlib import import_module
from django.utils.functional import memoize
from django.utils.module_loading import module_has_submodule
from . import app_settings
def get_path(path):
module_name, attr = pa... | Add utility to import all submodules of all apps. | Add utility to import all submodules of all apps.
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@thread.com>
| Python | bsd-3-clause | thread/django-lightweight-queue,thread/django-lightweight-queue,prophile/django-lightweight-queue,prophile/django-lightweight-queue,lamby/django-lightweight-queue | ---
+++
@@ -1,6 +1,8 @@
+from django.db.models import get_apps
+from django.core.exceptions import MiddlewareNotUsed
from django.utils.importlib import import_module
-from django.core.exceptions import MiddlewareNotUsed
from django.utils.functional import memoize
+from django.utils.module_loading import module_has_... |
5853c4449ff3e2ac04e96ab8c601609b4b24f267 | flaskapp.py | flaskapp.py | import io
import dont_tread_on_memes
import flask
app = flask.Flask(__name__)
@app.route("/", defaults={"caption": "tread on"})
@app.route("/<caption>/")
def main(caption):
flag = dont_tread_on_memes.dont_me(caption)
data = io.BytesIO()
flag.save(data, "PNG")
data.seek(0)
return flask.send_file... | import io
import dont_tread_on_memes
import flask
app = flask.Flask(__name__)
@app.route("/", defaults={"caption": "tread on"})
@app.route("/<caption>/")
def main(caption):
# Color argument
color = flask.request.args.get("color")
if color is None:
color = "black"
# Allow disabling of forma... | Implement some URL parameter options | Implement some URL parameter options
| Python | mit | controversial/dont-tread-on-memes | ---
+++
@@ -10,7 +10,18 @@
@app.route("/", defaults={"caption": "tread on"})
@app.route("/<caption>/")
def main(caption):
- flag = dont_tread_on_memes.dont_me(caption)
+ # Color argument
+ color = flask.request.args.get("color")
+ if color is None:
+ color = "black"
+
+ # Allow disabling of f... |
f225ffecf061470b877388d26c1605248b9611da | ygorcam.py | ygorcam.py | #!/usr/bin/env python
import tempfile
import subprocess
import web
urls = ("/camera", "Camera")
app = web.application(urls, globals())
class Camera(object):
def GET(self):
with tempfile.NamedTemporaryFile(suffix=".jpg") as tfp:
process = subprocess.Popen(["picamera", "-o", tfp.name])
... | #!/usr/bin/env python
import tempfile
import subprocess
import web
urls = ("/camera", "Camera")
app = web.application(urls, globals())
class Camera(object):
def GET(self):
with tempfile.NamedTemporaryFile(suffix=".jpg") as tfp:
process = subprocess.Popen(["raspistill", "-o", tfp.name])
... | Use raspistill and provide some additional error info | Use raspistill and provide some additional error info
| Python | mit | f0rk/ygorcam | ---
+++
@@ -12,11 +12,11 @@
class Camera(object):
def GET(self):
with tempfile.NamedTemporaryFile(suffix=".jpg") as tfp:
- process = subprocess.Popen(["picamera", "-o", tfp.name])
+ process = subprocess.Popen(["raspistill", "-o", tfp.name])
stdout, stderr = process.co... |
7a290359a0800c8f94da2b3f74dcb7153c4c27ed | nomnom/tests/functional_tests.py | nomnom/tests/functional_tests.py | from django_webtest import WebTest
from bs4 import BeautifulSoup
from django.contrib.admin.models import User
class NomnomTest(WebTest):
fixtures = ['users.json',]
def test_can_access_nomnom(self):
# An administrator visits the admin site
response = self.app.get('/admin/')
soup = Beaut... | from django_webtest import WebTest
from bs4 import BeautifulSoup
from django.contrib.admin.models import User
class NomnomTest(WebTest):
fixtures = ['users.json',]
def test_can_access_nomnom(self):
# An administrator visits the admin site
response = self.app.get('/admin/')
soup = Beaut... | Correct button text in functional test | Correct button text in functional test
| Python | mit | storyandstructure/django-nomnom | ---
+++
@@ -22,7 +22,7 @@
# As an administrator, I can click the Import button so that I can
# import files.
user = self.app.get('/admin/auth/user/', user="admin")
- assert 'NomNom Users' in user.click('Import users')
+ assert 'Import Users' in user.click('Import users')
... |
cc62a1eea746a7191b4a07a48dcf55f4c76787ee | asyncpg/__init__.py | asyncpg/__init__.py | import asyncio
from .protocol import Protocol
__all__ = ('connect',)
class Connection:
def __init__(self, protocol, transport, loop):
self._protocol = protocol
self._transport = transport
self._loop = loop
def get_settings(self):
return self._protocol.get_settings()
as... | import asyncio
from .protocol import Protocol
__all__ = ('connect',)
class Connection:
def __init__(self, protocol, transport, loop):
self._protocol = protocol
self._transport = transport
self._loop = loop
def get_settings(self):
return self._protocol.get_settings()
as... | Use loop.create_future if it exists | Use loop.create_future if it exists
| Python | apache-2.0 | MagicStack/asyncpg,MagicStack/asyncpg | ---
+++
@@ -16,12 +16,12 @@
return self._protocol.get_settings()
async def query(self, query):
- waiter = asyncio.Future(loop=self._loop)
+ waiter = _create_future(self._loop)
self._protocol.query(query, waiter)
return await waiter
async def prepare(self, query):... |
2b5d5d7f551d36af457ef357004dba2484e51572 | spec_cleaner/rpmbuild.py | spec_cleaner/rpmbuild.py | # vim: set ts=4 sw=4 et: coding=UTF-8
# We basically extend rpmcheck
from .rpmcheck import RpmCheck
class RpmBuild(RpmCheck):
"""
Replace various troublemakers in build phase
"""
def add(self, line):
# if user uses cmake directly just recommend him using the macros
if line.starts... | # vim: set ts=4 sw=4 et: coding=UTF-8
# We basically extend rpmcheck
from .rpmcheck import RpmCheck
class RpmBuild(RpmCheck):
"""
Replace various troublemakers in build phase
"""
def add(self, line):
# if user uses cmake directly just recommend him using the macros
if line.starts... | Fix repetitive adding of cmake macro recommendation | Fix repetitive adding of cmake macro recommendation
| Python | bsd-3-clause | plusky/spec-cleaner,plusky/spec-cleaner,plusky/spec-cleaner,plusky/spec-cleaner,pombredanne/spec-cleaner,pombredanne/spec-cleaner,plusky/spec-cleaner | ---
+++
@@ -11,7 +11,7 @@
def add(self, line):
# if user uses cmake directly just recommend him using the macros
- if line.startswith('cmake'):
+ if line.startswith('cmake') and not self.previous_line.startswith('# FIXME'):
self.lines.append('# FIXME: you should use %%cmake ... |
64b4c9e44c5305801f45e23efd2bc0843588afef | src/sentry/api/endpoints/organization_projects.py | src/sentry/api/endpoints/organization_projects.py | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.permissions import assert_perm
from sentry.api.serializers import serialize
from sentry.models import Project, Team
class OrganizationProjectsEndpoint(Or... | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.permissions import assert_perm
from sentry.api.serializers import serialize
from sentry.models import Project, Team
... | Add organization projects to docs | Add organization projects to docs
| Python | bsd-3-clause | ngonzalvez/sentry,argonemyth/sentry,imankulov/sentry,wujuguang/sentry,JackDanger/sentry,llonchj/sentry,BayanGroup/sentry,felixbuenemann/sentry,ifduyue/sentry,gencer/sentry,jean/sentry,gencer/sentry,gencer/sentry,jean/sentry,1tush/sentry,wujuguang/sentry,BuildingLink/sentry,imankulov/sentry,kevinastone/sentry,looker/sen... | ---
+++
@@ -2,6 +2,7 @@
from rest_framework.response import Response
+from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.permissions import assert_perm
from sentry.api.serializers import serialize
@@ -9,7 +10,17 @@
class OrganizationProje... |
1596e1cdd1a9907c6efa29e89b68f57e21b2fc01 | ibmcnx/doc/DataSources.py | ibmcnx/doc/DataSources.py | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | Create documentation of DataSource Settings | : Create documentation of DataSource Settings
Task-Url: | Python | apache-2.0 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ---
+++
@@ -18,4 +18,6 @@
for db in dbs:
t1 = ibmcnx.functions.getDSId( db )
- AdminConfig.list( t1 )
+ AdminConfig.show( t1 )
+ print '\n\n'
+ AdminConfig.showall( t1 ) |
ab8abaf874613a6d31ee0dad77f18e2cfc18db41 | docs/conf.py | docs/conf.py | from datetime import date
import guzzle_sphinx_theme
from pyinfra import __version__
copyright = 'Nick Barrett {0} — pyinfra v{1}'.format(
date.today().year,
__version__,
)
extensions = [
# Official
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
]
extensions.append('guzzle_sphinx_theme')
source... | from datetime import date
import guzzle_sphinx_theme
from pyinfra import __version__
copyright = 'Nick Barrett {0} — pyinfra v{1}'.format(
date.today().year,
__version__,
)
extensions = [
# Official
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.autosectionlabel',
]
autosectionlab... | Add sphinx autosection label plugin. | Add sphinx autosection label plugin.
| Python | mit | Fizzadar/pyinfra,Fizzadar/pyinfra | ---
+++
@@ -14,7 +14,9 @@
# Official
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
+ 'sphinx.ext.autosectionlabel',
]
+autosectionlabel_prefix_document = True
extensions.append('guzzle_sphinx_theme')
|
44297159b6539987ed8fcdb50cd5b3e367a9cdc2 | db/sql_server/pyodbc.py | db/sql_server/pyodbc.py | from django.db import connection
from django.db.models.fields import *
from south.db import generic
class DatabaseOperations(generic.DatabaseOperations):
"""
django-pyodbc (sql_server.pyodbc) implementation of database operations.
"""
def create_table(self, table_name, fields):
# Tweak stuff a... | from django.db import connection
from django.db.models.fields import *
from south.db import generic
class DatabaseOperations(generic.DatabaseOperations):
"""
django-pyodbc (sql_server.pyodbc) implementation of database operations.
"""
add_column_string = 'ALTER TABLE %s ADD %s;'
def create_ta... | Add column support for sql server | Add column support for sql server
| Python | apache-2.0 | smartfile/django-south,smartfile/django-south | ---
+++
@@ -6,6 +6,8 @@
"""
django-pyodbc (sql_server.pyodbc) implementation of database operations.
"""
+
+ add_column_string = 'ALTER TABLE %s ADD %s;'
def create_table(self, table_name, fields):
# Tweak stuff as needed |
a0d0d1312d95e1d6df2b8463b9df3ff4178c2802 | setup.py | setup.py | from distutils.core import setup
import glob,re
config_files = glob.glob('config/*.ini')
def get_version():
"""
Gets version from osg-configure script file
"""
buffer = open('scripts/osg-configure').read()
match = re.search("VERSION\s+=\s+'(.*)'", buffer)
return match.group(1)
setup(name='osg-configur... | from distutils.core import setup
import glob,re, os
config_files = glob.glob('config/*.ini')
def get_version():
"""
Gets version from osg-configure script file
"""
buffer = open('scripts/osg-configure').read()
match = re.search("VERSION\s+=\s+'(.*)'", buffer)
return match.group(1)
def get_test_files()... | Include test files when packaging osg-configure | Include test files when packaging osg-configure
git-svn-id: 8e6470fdf0410dbd375d7ca1c7e7b1f4e5857e13@14556 4e558342-562e-0410-864c-e07659590f8c
| Python | apache-2.0 | opensciencegrid/osg-configure,opensciencegrid/osg-configure,matyasselmeci/osg-configure,matyasselmeci/osg-configure | ---
+++
@@ -1,5 +1,5 @@
from distutils.core import setup
-import glob,re
+import glob,re, os
config_files = glob.glob('config/*.ini')
@@ -12,6 +12,16 @@
match = re.search("VERSION\s+=\s+'(.*)'", buffer)
return match.group(1)
+def get_test_files():
+ """
+ Gets the unit tests and configs for them
+ ... |
52c02ceda3c6430a2f4bbb3f9054180699baaa93 | setup.py | setup.py | # -*- encoding: utf-8 *-*
#!/usr/bin/env python
import sys
from setuptools import setup, Extension
from Cython.Distutils import build_ext
dependencies = ['pycrypto', 'msgpack-python', 'pbkdf2.py', 'xattr', 'paramiko', 'Pyrex', 'Cython']
if sys.version_info < (2, 7):
dependencies.append('argparse')
setup(name='da... | # -*- encoding: utf-8 *-*
#!/usr/bin/env python
import os
import sys
from glob import glob
from setuptools import setup, Extension
from setuptools.command.sdist import sdist
hashindex_sources = ['darc/hashindex.pyx', 'darc/_hashindex.c']
try:
from Cython.Distutils import build_ext
import Cython.Compiler.Main a... | Include Cython output in sdist | Include Cython output in sdist
| Python | bsd-3-clause | ionelmc/borg,pombredanne/attic,edgimar/borg,raxenak/borg,RonnyPfannschmidt/borg,RonnyPfannschmidt/borg,edgimar/borg,mhubig/borg,edgewood/borg,RonnyPfannschmidt/borg,edgewood/borg,raxenak/borg,RonnyPfannschmidt/borg,ionelmc/borg,RonnyPfannschmidt/borg,mhubig/borg,level323/borg,jborg/attic,jborg/attic,mhubig/borg,ionelmc... | ---
+++
@@ -1,10 +1,35 @@
# -*- encoding: utf-8 *-*
#!/usr/bin/env python
+import os
import sys
+from glob import glob
from setuptools import setup, Extension
-from Cython.Distutils import build_ext
+from setuptools.command.sdist import sdist
+hashindex_sources = ['darc/hashindex.pyx', 'darc/_hashindex.c']
-dep... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.