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 |
|---|---|---|---|---|---|---|---|---|---|---|
8daf5c8402a981942165d62ccb6057a26ad73012 | cms/tests/fixture_loading.py | cms/tests/fixture_loading.py | # -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms... | # -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms... | Change test_fixture_load to check for rescanned placeholders | Change test_fixture_load to check for rescanned placeholders
| Python | bsd-3-clause | stefanw/django-cms,bittner/django-cms,robmagee/django-cms,jsma/django-cms,jeffreylu9/django-cms,AlexProfi/django-cms,Jaccorot/django-cms,yakky/django-cms,memnonila/django-cms,intgr/django-cms,andyzsf/django-cms,intip/django-cms,leture/django-cms,jrief/django-cms,SachaMPS/django-cms,SofiaReis/django-cms,Livefyre/django-... | ---
+++
@@ -11,7 +11,7 @@
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
-from cms.models import Page
+from cms.models import Page, Placeholder, CMSPlugin
class FixtureTestCase(NavextendersFixture, SettingsOverrideTestCase):
... |
cc380dc41f02735d49da95a099646b0b6bcc29fb | src/hocr/parser.py | src/hocr/parser.py | from .page import Page
import six
from bs4 import UnicodeDammit, BeautifulSoup
# from lxml.etree import fromstring
def parse(source):
"""Parse a HOCR stream into page elements.
@param[in] source
Either a file-like object or a filename of the HOCR text.
"""
# Corece the source into content.
... | from .page import Page
import six
from bs4 import UnicodeDammit, BeautifulSoup
# from lxml.etree import fromstring
def parse(source):
"""Parse a HOCR stream into page elements.
@param[in] source
Either a file-like object or a filename of the HOCR text.
"""
# Corece the source into content.
... | Add explicit usage of backend | Add explicit usage of backend
| Python | mit | concordusapps/python-hocr | ---
+++
@@ -21,7 +21,7 @@
# Parse the HOCR xml stream.
ud = UnicodeDammit(content, is_html=True)
- soup = BeautifulSoup(ud.unicode_markup)
+ soup = BeautifulSoup(ud.unicode_markup, 'lxml')
# Get all the pages and parse them into page elements.
return [Page(x) for x in soup.find_all(class... |
d8e3612d0defdd55253275e676ef57c22a25c3f7 | wishlist/admin.py | wishlist/admin.py | ## Django Admin
from django.contrib import admin
from wishlist.models import Item
#admin.site.register( Category )
#admin.site.register( Item )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "category", "sort_order", "price" )
list_filter = ( "is_active", "category" )
search_fields = ( 'name... | ## Django Admin
from django.contrib import admin
from wishlist.models import *
admin.site.register( Category )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "category", "sort_order", "price" )
list_filter = ( "is_active", "category" )
search_fields = ( 'name', )
list_per_page = 30
admin.si... | Update Django Admin interface to allow editing of Categories | Update Django Admin interface to allow editing of Categories
| Python | mit | cgarvey/django-mywishlist,cgarvey/django-mywishlist | ---
+++
@@ -1,10 +1,9 @@
## Django Admin
from django.contrib import admin
-from wishlist.models import Item
+from wishlist.models import *
-#admin.site.register( Category )
-#admin.site.register( Item )
+admin.site.register( Category )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "c... |
d1826b00f4b4944161c66e737978bdc87bb57b52 | polyaxon/libs/decorators.py | polyaxon/libs/decorators.py | class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
... | from django.conf import settings
class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@ignore_raw
def my_signal_handler(sender, instance=Non... | Add decorator for runner signals | Add decorator for runner signals
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | ---
+++
@@ -1,3 +1,6 @@
+from django.conf import settings
+
+
class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
@@ -20,4 +23,30 @@
return self.f(*args, **kwargs)
+class RunnerSignalDecorator(object):
+ """The `Runne... |
d19a6ea9da1f6fe3313a36d44d6e6b4e9749acaa | test/test_regression_17.py | test/test_regression_17.py | import pytest
import python_jsonschema_objects as pjo
@pytest.fixture
def test_class():
schema = {
'title': 'Example',
'properties': {
"claimed_by": {
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. ... | import pytest
import python_jsonschema_objects as pjo
@pytest.fixture
def test_class():
schema = {
'title': 'Example',
'properties': {
"claimed_by": {
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. ... | Fix an actual schema validation error in one of the tests | Fix an actual schema validation error in one of the tests
| Python | mit | cwacek/python-jsonschema-objects | ---
+++
@@ -12,7 +12,6 @@
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. The human agent that has claimed this robot.",
- "required": False
},
}
} |
31b69d9810fb694be005e21d9c1fc80574460d97 | promgen/tests/test_rules.py | promgen/tests/test_rules.py | from unittest import mock
from django.test import TestCase
from promgen import models, prometheus
_RULES = '''
# Service: Service 1
# Service URL: /service/1/
ALERT RuleName
IF up==0
FOR 1s
LABELS {severity="severe"}
ANNOTATIONS {service="http://example.com/service/1/", summary="Test case"}
'''.lstrip()
... | from unittest import mock
from django.test import TestCase
from promgen import models, prometheus
_RULES = '''
# Service: Service 1
# Service URL: /service/1/
ALERT RuleName
IF up==0
FOR 1s
LABELS {severity="severe"}
ANNOTATIONS {service="http://example.com/service/1/", summary="Test case"}
'''.lstrip()
... | Add test for copying rules with their labels and annotations | Add test for copying rules with their labels and annotations
| Python | mit | kfdm/promgen,kfdm/promgen,kfdm/promgen,kfdm/promgen | ---
+++
@@ -35,3 +35,10 @@
def test_write(self, mock_render):
result = prometheus.render_rules()
self.assertEqual(result, _RULES)
+
+ @mock.patch('django.db.models.signals.post_save')
+ def test_copy(self, mock_render):
+ service = models.Service.objects.create(name='Service 2', sh... |
c34f630bf1d4a6c77ec68f69428df930b0ade146 | pymc/examples/glm_robust.py | pymc/examples/glm_robust.py | import numpy as np
try:
import statsmodels.api as sm
except ImportError:
sys.exit(0)
from pymc import *
# Generate data
size = 50
true_intercept = 1
true_slope = 2
x = np.linspace(0, 1, size)
y = true_intercept + x*true_slope + np.random.normal(scale=.5, size=size)
# Add outliers
x = np.append(x, [.1, .15,... | import numpy as np
import sys
try:
import statsmodels.api as sm
except ImportError:
print "Example requires statsmodels"
sys.exit(0)
from pymc import *
# Generate data
size = 50
true_intercept = 1
true_slope = 2
x = np.linspace(0, 1, size)
y = true_intercept + x*true_slope + np.random.normal(scale=.5, s... | Add missing import and explanation of failure | Add missing import and explanation of failure
| Python | apache-2.0 | superbobry/pymc3,LoLab-VU/pymc,superbobry/pymc3,Anjum48/pymc3,hothHowler/pymc3,jameshensman/pymc3,wanderer2/pymc3,hothHowler/pymc3,MCGallaspy/pymc3,kmather73/pymc3,dhiapet/PyMC3,JesseLivezey/pymc3,kmather73/pymc3,tyarkoni/pymc3,clk8908/pymc3,jameshensman/pymc3,evidation-health/pymc3,MichielCottaar/pymc3,arunlodhi/pymc3... | ---
+++
@@ -1,8 +1,10 @@
import numpy as np
+import sys
try:
import statsmodels.api as sm
except ImportError:
+ print "Example requires statsmodels"
sys.exit(0)
from pymc import * |
d46c0a045b8cab7cb51e9fe2aefb4286da8266d6 | .ycm_extra_conf.py | .ycm_extra_conf.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
from subprocess import check_output
from shlex import split as sh_split
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "pri... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
from subprocess import check_output
from shlex import split as sh_split
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "pri... | Remove -DDWT_USE_HEADER_BAR from YCM configuration | Remove -DDWT_USE_HEADER_BAR from YCM configuration
The option does not exist anymore, so there is no reason to keep
it around.
| Python | mit | aperezdc/dwt,aperezdc/dwt | ---
+++
@@ -12,7 +12,6 @@
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "print-flags"]))
flags.extend(("-Qunused-arguments",
- "-DDWT_USE_HEADER_BAR=TRUE",
"-DDWT_USE_POPOVER=TRUE",
"-DDWT_USE_OVERLAY=TRUE"))
return { 'fl... |
3b1cab31872ba7ed335d1ea254c3c1a477020966 | extract_contamination.py | extract_contamination.py | import sys
import os
header = ['Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().... | import sys
import os
header = ['Sample', 'Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
if sample[-7:] == '_screen':
sample = sample[:-7]
with open(fi) as screen_results:
results = {... | Fix problem with finding sample name from fastqc_screen output | Fix problem with finding sample name from fastqc_screen output
| Python | apache-2.0 | pombo-lab/gamtools,pombo-lab/gamtools | ---
+++
@@ -1,10 +1,12 @@
import sys
import os
-header = ['Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
+header = ['Sample', 'Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
+ if ... |
ed9601b2899aef7fcadfe7306dc1320ce72f232c | raven/transport/requests.py | raven/transport/requests.py | """
raven.transport.requests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.transport.http import HTTPTransport
try:
import requests
has_requests = True
exc... | """
raven.transport.requests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.conf import defaults
from raven.transport.http import HTTPTransport
try:
import requ... | Add support for the verify_ssl, ca_certs and timeout parameters for the request transport. | Add support for the verify_ssl, ca_certs and timeout parameters for the request transport.
| Python | bsd-3-clause | dbravender/raven-python,johansteffner/raven-python,ronaldevers/raven-python,lepture/raven-python,dbravender/raven-python,jbarbuto/raven-python,johansteffner/raven-python,nikolas/raven-python,jbarbuto/raven-python,recht/raven-python,lepture/raven-python,akheron/raven-python,jmp0xf/raven-python,arthurlogilab/raven-python... | ---
+++
@@ -7,6 +7,7 @@
"""
from __future__ import absolute_import
+from raven.conf import defaults
from raven.transport.http import HTTPTransport
try:
@@ -20,14 +21,23 @@
scheme = ['requests+http', 'requests+https']
- def __init__(self, parsed_url):
+ def __init__(self, parsed_url, timeout=def... |
02ef868100ab190b5fa3bff5bad4891f21101ee2 | getkey/__init__.py | getkey/__init__.py | from __future__ import absolute_import
from .platforms import platform
__platform = platform()
getkey = __platform.getkey
keys = __platform.keys
key = keys # alias
bang = __platform.bang
# __all__ = [getkey, key, bang, platform]
__version__ = '0.6'
| from __future__ import absolute_import, print_function
import sys
from .platforms import platform, PlatformError
try:
__platform = platform()
except PlatformError as err:
print('Error initializing standard platform: {}'.format(err.args[0]),
file=sys.stderr)
else:
getkey = __platform.getkey
ke... | Handle test environment with no real stdin | Handle test environment with no real stdin
| Python | mit | kcsaff/getkey | ---
+++
@@ -1,11 +1,17 @@
-from __future__ import absolute_import
-from .platforms import platform
+from __future__ import absolute_import, print_function
+import sys
+from .platforms import platform, PlatformError
-__platform = platform()
-getkey = __platform.getkey
-keys = __platform.keys
-key = keys # alias
-ba... |
044e9a29e594db1b081175d20d9525151c870e41 | torchtext/data/pipeline.py | torchtext/data/pipeline.py | class Pipeline(object):
"""Defines a pipeline for transforming sequence data."""
def __init__(self, convert_token=None):
if convert_token is not None:
self.convert_token = convert_token
else:
self.convert_token = lambda x: x
self.pipes = [self]
def __call__(... | class Pipeline(object):
"""Defines a pipeline for transforming sequence data."""
def __init__(self, convert_token=None):
if convert_token is not None:
self.convert_token = convert_token
else:
self.convert_token = lambda x: x
self.pipes = [self]
def __call__(... | Return self in Pipeline add_after and add_before | Return self in Pipeline add_after and add_before
| Python | bsd-3-clause | pytorch/text,pytorch/text,pytorch/text,pytorch/text | ---
+++
@@ -23,9 +23,11 @@
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = pipeline.pipes[:] + self.pipes[:]
+ return self
def add_after(self, pipeline):
"""Add `pipeline` after this processing pipeline."""
if not isinsta... |
c54a1286200ce62ef5eddef436428c2244e94798 | totemlogs/elasticsearch.py | totemlogs/elasticsearch.py | from __future__ import absolute_import
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from functools import wraps
import logging
from elasticsearch import Elasticsearch
from conf.appconfig im... | from __future__ import absolute_import
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from functools import wraps
import logging
from elasticsearch import Elasticsearch
from conf.appconfig im... | Use POST instead of GET Request for ES Search API (Issue with query string size) | Use POST instead of GET Request for ES Search API (Issue with query string size)
| Python | mit | totem/totem-logs,totem/totem-logs,totem/totem-logs,totem/totem-logs | ---
+++
@@ -37,4 +37,5 @@
:rtype: elasticsearch.Elasticsearch
"""
return Elasticsearch(hosts=SEARCH_SETTINGS['host'],
- port=SEARCH_SETTINGS['port'])
+ port=SEARCH_SETTINGS['port'],
+ send_get_body_as='POST') |
396027e1b779304b085d60ba8d64877f96a51deb | src/webassets/filter/typescript.py | src/webassets/filter/typescript.py | import os
import subprocess
import tempfile
from webassets.filter import Filter
from webassets.exceptions import FilterError
__all__ = ('TypeScript',)
class TypeScript(Filter):
"""Compile `TypeScript <http://www.typescriptlang.org`_ to JavaScript.
TypeScript is an external tool written for NodeJS.
Th... | import os
import subprocess
import tempfile
from webassets.filter import Filter
from webassets.exceptions import FilterError
__all__ = ('TypeScript',)
class TypeScript(Filter):
"""Compile `TypeScript <http://www.typescriptlang.org`_ to JavaScript.
TypeScript is an external tool written for NodeJS.
Th... | Allow compilation even in debug mode | Allow compilation even in debug mode
| Python | bsd-2-clause | wijerasa/webassets,john2x/webassets,JDeuce/webassets,0x1997/webassets,glorpen/webassets,florianjacob/webassets,glorpen/webassets,aconrad/webassets,heynemann/webassets,john2x/webassets,wijerasa/webassets,heynemann/webassets,florianjacob/webassets,JDeuce/webassets,scorphus/webassets,heynemann/webassets,scorphus/webassets... | ---
+++
@@ -18,6 +18,7 @@
"""
name = 'typescript'
+ max_debug_level = None
options = {
'binary': 'TYPESCRIPT_BIN',
} |
35a15e06feca24872acb42c5395b58b2a1bed60e | byceps/services/snippet/transfer/models.py | byceps/services/snippet/transfer/models.py | """
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import NewType
from uuid import UUI... | """
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import NewType
from uuid import UUI... | Remove unused class method `Scope.for_global` | Remove unused class method `Scope.for_global`
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | ---
+++
@@ -21,10 +21,6 @@
class Scope:
type_: str
name: str
-
- @classmethod
- def for_global(cls) -> Scope:
- return cls('global', 'global')
@classmethod
def for_brand(cls, brand_id: BrandID) -> Scope: |
a3eef3be93e4328194997ea48c509105110145b8 | utils/management/commands/get_settings_values.py | utils/management/commands/get_settings_values.py | # Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your ... | # Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your ... | Allow for getting a settings value from a single server in the enviroment | Allow for getting a settings value from a single server in the enviroment
| Python | agpl-3.0 | pculture/unisubs,wevoice/wesub,ofer43211/unisubs,wevoice/wesub,eloquence/unisubs,eloquence/unisubs,norayr/unisubs,norayr/unisubs,pculture/unisubs,wevoice/wesub,pculture/unisubs,eloquence/unisubs,ReachingOut/unisubs,ujdhesa/unisubs,ReachingOut/unisubs,ofer43211/unisubs,norayr/unisubs,eloquence/unisubs,ujdhesa/unisubs,pc... | ---
+++
@@ -18,12 +18,22 @@
from django.core.management.base import BaseCommand
from django.conf import settings
+import optparse
import socket
class Command(BaseCommand):
- help = u'Test if Solr, Redis and Memcached are available'
+ help = u'Lists the settings values for a given setting name'
+ ... |
90bfdbe432763565d7e8ccc8b04e9d3440164557 | draftjs_exporter/constants.py | draftjs_exporter/constants.py | from __future__ import absolute_import, unicode_literals
# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
def __init__(self, *elements):
self.elements = tuple(elements)
def __getattr__(self, name):
if name not in self.elements:
raise AttributeError("'Enum' has no ... | from __future__ import absolute_import, unicode_literals
# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
def __init__(self, *elements):
self.elements = tuple(elements)
def __getattr__(self, name):
if name not in self.elements:
raise AttributeError("'Enum' has no ... | Remove unused pullquote block type | Remove unused pullquote block type
| Python | mit | springload/draftjs_exporter,springload/draftjs_exporter,springload/draftjs_exporter | ---
+++
@@ -25,7 +25,6 @@
UNORDERED_LIST_ITEM = 'unordered-list-item'
ORDERED_LIST_ITEM = 'ordered-list-item'
BLOCKQUOTE = 'blockquote'
- PULLQUOTE = 'pullquote'
CODE = 'code-block'
ATOMIC = 'atomic'
|
45510b1adc401244297fb281b8f6ecd22f7c4b0e | InvenTree/part/serializers.py | InvenTree/part/serializers.py | from rest_framework import serializers
from .models import Part
class PartSerializer(serializers.ModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
class Meta:
model = Part
fields = [
'ur... | from rest_framework import serializers
from .models import Part
class PartSerializer(serializers.ModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
def _category_name(self, part):
if part.category:
... | Add category info to part serializer | Add category info to part serializer
| Python | mit | inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree | ---
+++
@@ -8,16 +8,31 @@
Used when displaying all details of a single component.
"""
+ def _category_name(self, part):
+ if part.category:
+ return part.category.name
+ return ''
+
+ def _category_url(self, part):
+ if part.category:
+ return part.category... |
d99bdbd710c6b3bf0e1eeed5d2cf8f26790040ef | alembic/versions/38f01b0893b8_add_call_in_campaign_id_to_.py | alembic/versions/38f01b0893b8_add_call_in_campaign_id_to_.py | """Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchem... | """Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchem... | Initialize call_in_campaign_id column after adding | Initialize call_in_campaign_id column after adding
| Python | agpl-3.0 | OpenSourceActivismTech/call-power,spacedogXYZ/call-power,spacedogXYZ/call-power,18mr/call-congress,spacedogXYZ/call-power,OpenSourceActivismTech/call-power,spacedogXYZ/call-power,OpenSourceActivismTech/call-power,18mr/call-congress,18mr/call-congress,18mr/call-congress,OpenSourceActivismTech/call-power | ---
+++
@@ -23,6 +23,19 @@
sa.ForeignKey('campaign_campaign.id'),
nullable=True))
+ connection = op.get_bind()
+ campaign_call_in_numbers = connection.execute(
+ """SELECT campaign_phone_numbers.campaign_id, campaign_phone_nu... |
4ed8f05fa43f29a1881a23ae99fdc3ad8cd661b0 | grammpy/StringGrammar.py | grammpy/StringGrammar.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
retu... | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
retu... | Correct return of Terminal instance when parameter is string | Correct return of Terminal instance when parameter is string
| Python | mit | PatrikValkovic/grammpy | ---
+++
@@ -27,7 +27,10 @@
return super().term(StringGrammar.__to_string_arr(term))
def get_term(self, term=None):
- return super().get_term(StringGrammar.__to_string_arr(term))
+ res = super().get_term(StringGrammar.__to_string_arr(term))
+ if isinstance(term, str):
+ ... |
fdd69cb0b7b11fce9cfc70d85e51a29aaabc0ee0 | wagtailmenus/management/commands/autopopulate_main_menus.py | wagtailmenus/management/commands/autopopulate_main_menus.py | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't alread... | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't alread... | Use the root_page.depth to determine filter value to identify section root pages | Use the root_page.depth to determine filter value to identify section root pages
| Python | mit | rkhleics/wagtailmenus,ababic/wagtailmenus,rkhleics/wagtailmenus,ababic/wagtailmenus,rkhleics/wagtailmenus,ababic/wagtailmenus | ---
+++
@@ -33,5 +33,5 @@
menu.add_menu_items_for_pages(
site.root_page.get_descendants(
inclusive=options['add-home-links']
- ).filter(depth__lte=3)
+ ).filter(depth__lte=site.root_page.depth + 1)
) |
8b42fff2404794cf9f883f6dffa0fd1e9fa0c7a6 | chrome/test/nacl_test_injection/buildbot_nacl_integration.py | chrome/test/nacl_test_injection/buildbot_nacl_integration.py | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing... | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing... | Whitelist nacl_integration tests to run on new nacl integration bot. | Whitelist nacl_integration tests to run on new nacl integration bot.
BUG= none
TEST= none
Review URL: http://codereview.chromium.org/7050026
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@86021 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,zcbenz/cefode-chromium,ltilve/chromium,robclark/chromium,M4sse/chromium.src,hgl888/chromium-crosswalk,dushu1203/chromium.src,anirudhSK/chromium,chuan9/chromium-crosswalk,hujiajie/pa-chromium,timopulkkinen/BubbleFish,jaruba/chromium.... | ---
+++
@@ -11,14 +11,11 @@
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing on windows and enable.
- if (sys.platform in ['win32', 'cygwin'] and
- 'xp-nacl-chrome' not in pwd and 'win64-nacl-chrome' not in pwd): return
+ if sys.platform in ['win32', 'cygwin'] a... |
eadf9bf6ce1bf09c6551f4a54a0a32d6fb872ab3 | gaphor/ui/tests/test_recentfiles.py | gaphor/ui/tests/test_recentfiles.py | import pytest
from gi.repository import GLib
from gaphor.services.eventmanager import EventManager
from gaphor.ui.event import FileLoaded
from gaphor.ui.recentfiles import RecentFiles
class RecentManagerStub:
def __init__(self):
self.items = []
def add_full(self, uri, meta):
self.items.appen... | import pathlib
import pytest
from gi.repository import GLib
from gaphor.services.eventmanager import EventManager
from gaphor.ui.event import FileLoaded
from gaphor.ui.recentfiles import RecentFiles
class RecentManagerStub:
def __init__(self):
self.items = []
def add_full(self, uri, meta):
... | Fix tests in Windows: decoded_filename contains backslashes | Fix tests in Windows: decoded_filename contains backslashes
Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>
| Python | lgpl-2.1 | amolenaar/gaphor,amolenaar/gaphor | ---
+++
@@ -1,3 +1,5 @@
+import pathlib
+
import pytest
from gi.repository import GLib
@@ -33,9 +35,10 @@
filename = "/path name/with spaces"
uri = GLib.filename_to_uri(filename)
decoded_filename, hostname = GLib.filename_from_uri(uri)
+ decoded_posix_filename = pathlib.PurePath(decoded_filename... |
41ec266722eefb01b7e884696c7825bd5273e4ca | tests/test_diff.py | tests/test_diff.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from livemark.diff import _is_same_node, _next_noempty
from wdom.tests.util import TestCase
from wdom.parser import parse_html
class TestSameNode(TestCase):
def test_same_node(self):
node1_src = '<h1>A</h1>'
node1 = parse_html(node1_src)
nod... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from livemark.diff import _is_same_node, _next_noempty
from wdom.tests.util import TestCase
from wdom.parser import parse_html
class TestSameNode(TestCase):
def setUp(self):
self.src1 = '<h1>text1</h1>'
self.src2 = '<h1>text2</h1>'
self.src3... | Add test for same node check | Add test for same node check
| Python | mit | miyakogi/livemark | ---
+++
@@ -8,8 +8,38 @@
class TestSameNode(TestCase):
+ def setUp(self):
+ self.src1 = '<h1>text1</h1>'
+ self.src2 = '<h1>text2</h1>'
+ self.src3 = '<h2>text1</h2>'
+ self.text1 = 'text1'
+ self.text2 = 'text2'
+ self.node1 = parse_html(self.src1).firstChild
+ ... |
88d6728a157a260ed0b8ffc947c710d22a948efb | stock_transfer_restrict_lot/models/stock_move.py | stock_transfer_restrict_lot/models/stock_move.py | from openerp import models, fields, api, _
from openerp.exceptions import UserError
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
code = fields.Selection(
related='picking_id.picking_type_id.code',
string='Operation Type',
readonly=True)
@api.one
... | from openerp import models, fields, api, _
from openerp.exceptions import UserError
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
code = fields.Selection(
related='picking_id.picking_type_id.code',
string='Operation Type',
readonly=True)
@api.one
... | FIX stock transfer restrict lot when lost is reserved | FIX stock transfer restrict lot when lost is reserved
| Python | agpl-3.0 | ingadhoc/stock | ---
+++
@@ -18,7 +18,10 @@
for pack in self.pack_lot_ids:
quants = self.env['stock.quant'].search(
[('id', 'in', pack.lot_id.quant_ids.ids),
- ('location_id', '=', self.location_id.id)])
+ ('location_id', '=', self.location_id.... |
5ff983c1a464fc559cb13addb5316f99379472bf | tests/test_trip.py | tests/test_trip.py | #!/usr/bin/env python
import unittest
from parsemypsa.storage import objects
class TripTestCase(unittest.TestCase):
def setUp(self):
self.trip1 = objects.Trip.create(id=1, 1462731168, 200, 1000, 1, 0, 0)
def test_mileage_calculation(self):
self.trip1.calculate_mileage()
self.assertE... | #!/usr/bin/env python
import unittest
from playhouse.test_utils import test_database
from peewee import *
from parsemypsa.storage import objects
# Data for testing
test_db = SqliteDatabase(':memory:')
model_list = [objects.Alert, objects.VehiculeInformation, objects.Trip]
class TripTestCase(unittest.TestCase):
... | Fix unittests broken after ORM adoption | Fix unittests broken after ORM adoption
| Python | mit | klenje/parsemypsa | ---
+++
@@ -1,20 +1,30 @@
#!/usr/bin/env python
import unittest
+from playhouse.test_utils import test_database
+from peewee import *
from parsemypsa.storage import objects
+
+# Data for testing
+test_db = SqliteDatabase(':memory:')
+model_list = [objects.Alert, objects.VehiculeInformation, objects.Trip]
... |
9f356ed8f9b975eb82d44454a1e4482f2063b1b1 | server_dev.py | server_dev.py | import projects
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.html', projects=project_list)
@app.route('/blog')
def blog():
return "Flasktopress isn't quite ready yet, but we're stoked that ... | import projects
from flask import Flask, render_template, abort
app = Flask(__name__)
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.html', projects=project_list)
@app.route('/blog')
def blog():
return "Flasktopress isn't quite ready yet, but we're stoke... | Test if a project exists, load or 404 accordingly | Test if a project exists, load or 404 accordingly
| Python | mit | teslaworksumn/teslaworks.net,teslaworksumn/teslaworks.net | ---
+++
@@ -1,5 +1,5 @@
import projects
-from flask import Flask, render_template
+from flask import Flask, render_template, abort
app = Flask(__name__)
@@ -14,7 +14,12 @@
@app.route('/<project>')
def project(project):
- return "Bet you can't wait to join %s, huh?" % project
+ project_list = projects.... |
1890347d0dd5f831a8a9b4cd704dbdc0859d4997 | tmuxp/__about__.py | tmuxp/__about__.py | __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = '1.4.0'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__pypi__ = 'https://pypi.python.org/pypi/tmuxp'
__license__ = 'MIT'
__copyright__ = 'Copyright 201... | __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = 'dev'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__pypi__ = 'https://pypi.python.org/pypi/tmuxp'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-... | Change __version__ to dev until we tag | Change __version__ to dev until we tag
This is for sphinx linkcode links to work on our API page.
| Python | bsd-3-clause | tony/tmuxp | ---
+++
@@ -1,6 +1,6 @@
__title__ = 'tmuxp'
__package_name__ = 'tmuxp'
-__version__ = '1.4.0'
+__version__ = 'dev'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock' |
436195aad8c3e7a069066e9e1d4db6dfa9ac34db | devilry/addons/student/devilry_plugin.py | devilry/addons/student/devilry_plugin.py | from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from devilry.addons.dashboard.dashboardplugin_registry import registry, \
DashboardItem
import dashboardviews
def simpleview(request, *args):
return mark_safe(u"""S... | from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from devilry.addons.dashboard.dashboardplugin_registry import registry, \
DashboardItem
import dashboardviews
registry.register_important(DashboardItem(
title ... | Set title to 'Assignment' in student dashboard | Set title to 'Assignment' in student dashboard
| Python | bsd-3-clause | devilry/devilry-django,devilry/devilry-django,devilry/devilry-django,vegarang/devilry-django,vegarang/devilry-django,devilry/devilry-django | ---
+++
@@ -6,12 +6,7 @@
DashboardItem
import dashboardviews
-def simpleview(request, *args):
- return mark_safe(u"""Student dashboard-view(s) is not finished.
- <a href='%s'>Click here</a> for the
- main student view.""" % reverse('devilry-student-show-assignments'))
-
registry.register... |
2f37ae17eae3701eb205f5f524de3254f6d965e8 | tools/skp/page_sets/skia_worldjournal_nexus10.py | tools/skp/page_sets/skia_worldjournal_nexus10.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | Remove action_runner steps for worldjournal pageset to prevent crashes | Remove action_runner steps for worldjournal pageset to prevent crashes
BUG=skia:3196
NOTRY=true
Review URL: https://codereview.chromium.org/795173002
| Python | bsd-3-clause | OneRom/external_skia,VRToxin-AOSP/android_external_skia,Infinitive-OS/platform_external_skia,Hikari-no-Tenshi/android_external_skia,google/skia,PAC-ROM/android_external_skia,timduru/platform-external-skia,AOSP-YU/platform_external_skia,pcwalton/skia,vanish87/skia,Infinitive-OS/platform_external_skia,TeamExodus/external... | ---
+++
@@ -18,13 +18,6 @@
self.user_agent_type = 'tablet'
self.archive_data_file = 'data/skia_worldjournal_nexus10.json'
- def RunSmoothness(self, action_runner):
- action_runner.ScrollElement()
-
- def RunNavigateSteps(self, action_runner):
- action_runner.NavigateToPage(self)
- action_runner... |
a1c87c491bf936d441ef7fd79b531384fa174138 | simpleubjson/version.py | simpleubjson/version.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '{version}{tag}{build}'.format(
version='.'.jo... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '%(version)s%(tag)s%(build)s' % {
'version': '... | Fix compatibility with Python 2.5 | Fix compatibility with Python 2.5
| Python | bsd-2-clause | kxepal/simpleubjson,brainwater/simpleubjson,samipshah/simpleubjson,498888197/simpleubjson | ---
+++
@@ -8,8 +8,8 @@
#
__version_info__ = (0, 6, 0, 'dev', 0)
-__version__ = '{version}{tag}{build}'.format(
- version='.'.join(map(str, __version_info__[:3])),
- tag='-' + __version_info__[3] if __version_info__[3] else '',
- build='.' + str(__version_info__[4]) if __version_info__[4] else ''
-)
+__v... |
30f259dbd1c5c9963a5a75855188e4f668626fb7 | test/test_Spectrum.py | test/test_Spectrum.py | #!/usr/bin/env python
from __future__ import division, print_function
import pytest
import sys
# Add Spectrum location to path
sys.path.append('../')
import Spectrum
# Test using hypothesis
def test_spectrum_assigns_data():
x = [1,2,3,4,5,6]
y = [1,1,0.9,0.95,1,1]
z = 2200*x
spec = Spectrum.Spectru... | #!/usr/bin/env python
from __future__ import division, print_function
import pytest
import sys
# Add Spectrum location to path
sys.path.append('../')
import Spectrum
# Test using hypothesis
from hypothesis import given
import hypothesis.strategies as st
@given(st.lists(st.integers()), st.lists(st.floats()), st.list... | Add hypothesis test to test assignment | Add hypothesis test to test assignment
| Python | mit | jason-neal/spectrum_overload,jason-neal/spectrum_overload,jason-neal/spectrum_overload | ---
+++
@@ -9,12 +9,23 @@
import Spectrum
# Test using hypothesis
+from hypothesis import given
+import hypothesis.strategies as st
+
+@given(st.lists(st.integers()), st.lists(st.floats()), st.lists(st.floats()))
+def test_spectrum_assigns_hypothesis_data(x, y, z):
+
+ spec = Spectrum.Spectrum(x, y, z)
+ as... |
ff471c9eb9f13b7dbb0c704aca2a8338576d243a | examples/hello_world/hello_world.py | examples/hello_world/hello_world.py | #!/usr/bin/env python
# encoding: utf-8
"""
A Simple Example Flask Application
==================================
"""
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def foo():
return docum... | #!/usr/bin/env python
# encoding: utf-8
"""
A Simple Example Flask Application
==================================
"""
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def hello():
return doc... | Rename example foo method to hello and run in debug | Rename example foo method to hello and run in debug
| Python | unlicense | thisissoon/Flask-HAL,thisissoon/Flask-HAL | ---
+++
@@ -18,11 +18,11 @@
@app.route('/hello')
-def foo():
+def hello():
return document.Document(data={
'message': 'Hello World'
})
if __name__ == "__main__":
- app.run()
+ app.run(debug=True) |
0fd464dcd405faa356c18d69a0b7419c5cff0f21 | pmxbot/__init__.py | pmxbot/__init__.py | # -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'irc.freenode.net',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
... | # -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'localhost',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
other_... | Use IRC server on localhost by default | Use IRC server on localhost by default
| Python | bsd-3-clause | jamwt/diesel-pmxbot,jamwt/diesel-pmxbot | ---
+++
@@ -8,7 +8,7 @@
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
- server_host = 'irc.freenode.net',
+ server_host = 'localhost',
server_port = 6667,
use_ssl = False,
password = None, |
547e002534d3a9757c84bad7e125b9186dd78078 | tests/test_common.py | tests/test_common.py | import os, os.path
import ConfigParser
package = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import slack
class TestSlack(object):
def setup(self):
self.set_up_config()
self.set_up_slack()
def set_up_config(self):
search_paths = [os.path.expanduser('~/.slack'), '/e... | import os, os.path
import ConfigParser
package = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import slack
class TestSlack(object):
def setup(self):
self.set_up_config()
self.set_up_slack()
def set_up_config(self):
search_paths = [os.path.expanduser('~/.slack'), '/e... | Add new channel name for test. | Add new channel name for test.
| Python | mit | nabetama/slacky | ---
+++
@@ -23,7 +23,8 @@
else:
print('Authorization token not detected! The token is pulled from '\
'~/.slack, /etc/slack, or the environment variable SLACK_TOKEN.')
- self.test_channel = self.config.get('Slack', 'test-channel')
+ self.test_channel = self.con... |
8d32970073c699e06663cae12861b58e7c365f2c | tests/test_rtnorm.py | tests/test_rtnorm.py |
# This should plot a histogram looking like a gaussian
# ... It does.
## CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 1.
maximum = 17.
center = 7.
stddev = 5.
## VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
from lib.rtnorm import rtnorm
variables = rtnorm(minimum, maximum, mu=c... |
import unittest
import matplotlib.pyplot as plot
import numpy as np
import sys
sys.path.append('.') # T_T
from lib.rtnorm import rtnorm
class RunTest(unittest.TestCase):
longMessage = True
def test_histogram(self):
"""
This should plot a histogram looking like a gaussian
... It d... | Fix the random truncated distribution tests | Fix the random truncated distribution tests
| Python | mit | irap-omp/deconv3d,irap-omp/deconv3d | ---
+++
@@ -1,28 +1,56 @@
-# This should plot a histogram looking like a gaussian
-# ... It does.
+import unittest
+import matplotlib.pyplot as plot
+import numpy as np
-## CONFIGURATION (play with different values)
-
-samples = int(1e6)
-
-minimum = 1.
-maximum = 17.
-center = 7.
-stddev = 5.
-
-
-## VARIABLES F... |
754707379a12058b4c66802c3f0545c0e634103d | bumblebee_status/modules/contrib/taskwarrior.py | bumblebee_status/modules/contrib/taskwarrior.py | """Displays the number of pending tasks in TaskWarrior.
Requires the following library:
* taskw
Parameters:
* taskwarrior.taskrc : path to the taskrc file (defaults to ~/.taskrc)
contributed by `chdorb <https://github.com/chdorb>`_ - many thanks!
"""
from taskw import TaskWarrior
import core.module
import... | """Displays the number of pending tasks in TaskWarrior.
Requires the following library:
* taskw
Parameters:
* taskwarrior.taskrc : path to the taskrc file (defaults to ~/.taskrc)
contributed by `chdorb <https://github.com/chdorb>`_ - many thanks!
"""
from taskw import TaskWarrior
import core.module
import... | Add active-task display and scrolling | Add active-task display and scrolling
This adds an option allowing you to specify
"taskwarrior.show_active=true" in your bar configuration and will
display the current, active task id and description on the status bar, but will show the
number of pending tasks if one isn't active.
This also adds the scrolling decorat... | Python | mit | tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status | ---
+++
@@ -27,12 +27,22 @@
"""Return a string with the number of pending tasks from TaskWarrior."""
try:
taskrc = self.parameter("taskrc", "~/.taskrc")
+ show_active = self.parameter("show_active", False)
w = TaskWarrior(config_filename=taskrc)
- pend... |
3421db3528a655768141b3615d04d84cf7100bb0 | ckanext/requestdata/plugin.py | ckanext/requestdata/plugin.py | import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.IConfigur... | import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
from ckanext.requestdata.logic import actions
from ckanext.requestdata.logic import auth
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
p... | Define actions and auth functions | Define actions and auth functions
| Python | agpl-3.0 | ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata | ---
+++
@@ -2,12 +2,16 @@
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
+from ckanext.requestdata.logic import actions
+from ckanext.requestdata.logic import auth
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)... |
109c46252a0b55f31c4b0b7471d9712764ade9a3 | pinry/urls.py | pinry/urls.py | from django.conf import settings
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from core.views import drf_router
admin.auto... | from django.conf import settings
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from core.views import drf_router
admin.auto... | Use api/v2 instead of drf_api/ | Feature: Use api/v2 instead of drf_api/
| Python | bsd-2-clause | pinry/pinry,lapo-luchini/pinry,pinry/pinry,lapo-luchini/pinry,pinry/pinry,pinry/pinry,lapo-luchini/pinry,lapo-luchini/pinry | ---
+++
@@ -13,9 +13,9 @@
urlpatterns = [
# drf api
- url(r'^drf_api/', include(drf_router.urls)),
+ url(r'^api/v2/', include(drf_router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
- url(r'^drf_api/docs/', include_docs_urls(title='PinryAPI', schema_url... |
89a232538c2ce7bc3ed406e6b9587cebbff2849e | amplpy/amplpython/__init__.py | amplpy/amplpython/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
os.environ['PATH'] += os.pathsep + lib32
os.environ['PATH'] += o... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
from glob import glob
from ctypes import sizeof
... | Add workaround for conda python | Add workaround for conda python
Python versions that come with conda for Windows
do not load .dlls in the same way as standard
python versions.
| Python | bsd-3-clause | ampl/amplpy,ampl/amplpy,ampl/amplpy | ---
+++
@@ -2,14 +2,22 @@
from __future__ import absolute_import
import os
+import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
- os.environ['PATH'] += os.pathsep + lib32... |
f97f4378e2d39e211bb4df195664c54e925dc867 | core/management/commands/delete_old_sessions.py | core/management/commands/delete_old_sessions.py | from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... p... | from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... p... | Add delete old sessions command | Add delete old sessions command
| Python | mit | QLGu/djangopackages,pydanny/djangopackages,nanuxbe/djangopackages,QLGu/djangopackages,pydanny/djangopackages,QLGu/djangopackages,nanuxbe/djangopackages,pydanny/djangopackages,nanuxbe/djangopackages | ---
+++
@@ -12,7 +12,7 @@
...
"""
-class Command(NoArgsCommand):
+class Command(BaseCommand):
args = '<count count ...>'
help = "Delete old sessions" |
7adcf50f27e805931e7bb4c39fa07fa346710acf | anserv/modules/mixpanel/generic_event_handlers.py | anserv/modules/mixpanel/generic_event_handlers.py | from modules.mixpanel.mixpanel import track_event_mixpanel
from modules.decorators import view, query, event_handler
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
REGEX_PAGES_TO_TRACK = ['/course', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in resp... | from modules.mixpanel.mixpanel import track_event_mixpanel
from modules.decorators import view, query, event_handler
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
COURSE_PAGES_TO_TRACK = ['/courses', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in re... | Fix up mixpanel course tracking | Fix up mixpanel course tracking
| Python | agpl-3.0 | edx/edxanalytics,edx/edxanalytics,edx/insights,edx/edxanalytics,edx/edxanalytics,edx/insights | ---
+++
@@ -3,7 +3,7 @@
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
-REGEX_PAGES_TO_TRACK = ['/course', '/about']
+COURSE_PAGES_TO_TRACK = ['/courses', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in response:
@@ -12,9 +12,13 @@
... |
aeef2c319ea5c7d59a0bdf69a5fbe5dc8a1ab1bc | wagtailnews/feeds.py | wagtailnews/feeds.py | from django.contrib.syndication.views import Feed
from django.utils import timezone
class LatestEnteriesFeed(Feed):
description = "Latest news"
def items(self):
now = timezone.now()
NewsItem = self.news_index.get_newsitem_model()
newsitem_list = NewsItem.objects.live().order_by('-date... | from django.contrib.syndication.views import Feed
from django.utils import timezone
class LatestEnteriesFeed(Feed):
def items(self):
now = timezone.now()
NewsItem = self.news_index.get_newsitem_model()
newsitem_list = NewsItem.objects.live().order_by('-date').filter(
newsindex... | Add some extra item methods / parameters to LatestEntriesFeed | Add some extra item methods / parameters to LatestEntriesFeed
| Python | bsd-2-clause | takeflight/wagtailnews,takeflight/wagtailnews,takeflight/wagtailnews,takeflight/wagtailnews | ---
+++
@@ -3,7 +3,6 @@
class LatestEnteriesFeed(Feed):
- description = "Latest news"
def items(self):
now = timezone.now()
@@ -13,13 +12,22 @@
return newsitem_list
def item_link(self, item):
- return item.url()
+ return item.full_url()
+
+ def item_guid(self, ... |
b3a8a187cb6e569229d7e6d2929377035790f7de | virtool/dev/api.py | virtool/dev/api.py | from logging import getLogger
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
from virtool.samples.fake import create_fake_samples
from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction
from virt... | from logging import getLogger
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
from virtool.samples.fake import create_fake_sample
from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction
from virto... | Fix handling of create_sample command on dev API endpoint | Fix handling of create_sample command on dev API endpoint
This was completely broken. | Python | mit | virtool/virtool,igboyes/virtool,virtool/virtool,igboyes/virtool | ---
+++
@@ -3,7 +3,7 @@
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
-from virtool.samples.fake import create_fake_samples
+from virtool.samples.fake import create_fake_sample
from virtool.subtractions.fake import create_fake_fast... |
c8bf23253aaacb880f438b7093c85c76767734e7 | duedil/resources/pro/company/accounts/__init__.py | duedil/resources/pro/company/accounts/__init__.py | 'Accounts'
from __future__ import unicode_literals
from .... import ProResource, RelatedResourceMixin
import six
import sys
class Account(RelatedResourceMixin, ProResource):
'Abstraction of Accounts resource in duedil v3 pro api'
attribute_names = [
'uri',
'date',
'type'
]
acc... | 'Accounts'
from __future__ import unicode_literals
from .... import ProResource, RelatedResourceMixin
import six
import sys
class Account(RelatedResourceMixin, ProResource):
'Abstraction of Accounts resource in duedil v3 pro api'
attribute_names = [
'uri',
'date',
'type'
]
acc... | Use dict comprehension instead of dict([...]) | Use dict comprehension instead of dict([...])
| Python | apache-2.0 | founders4schools/duedilv3 | ---
+++
@@ -23,7 +23,7 @@
full_endpoint = True
def __iter__(self):
- return iter(dict([(i,getattr(self, i)) for i in self.attribute_names]))
+ return iter({i: getattr(self, i) for i in self.attribute_names})
@property
def path(self): |
b0085ad5268da92181b043c56b64d690e5eb8679 | access/admin.py | access/admin.py | from django.contrib.auth.admin import UserAdmin
from .forms import UserCreationForm, UserChangeForm
class UserAdmin(UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
(None, {'fields': ('email', 'password',)}),
('Permissions', {'fields': ('is_active', 'is_staff',... | from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from .forms import UserCreationForm, UserChangeForm
class UserAdmin(UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
(None, {'fields': ('email', 'password', 'two_fa_... | Add 2FA field, use localized labels in UserAdmin | Add 2FA field, use localized labels in UserAdmin
| Python | agpl-3.0 | node13h/droll,node13h/droll | ---
+++
@@ -1,4 +1,5 @@
from django.contrib.auth.admin import UserAdmin
+from django.utils.translation import ugettext_lazy as _
from .forms import UserCreationForm, UserChangeForm
@@ -8,9 +9,10 @@
add_form = UserCreationForm
fieldsets = (
- (None, {'fields': ('email', 'password',)}),
- ... |
1bd0cd5ed8cc41a14363d9fedcb1799096e27221 | widgets/__init__.py | widgets/__init__.py | from os.path import dirname, basename, isfile
import glob
excepts = ['__init__', 'widget']
# Find all *.py files and add them to import
modules = [basename(f)[:-3] for f in glob.glob(dirname(__file__)+"/*.py") if
isfile(f)]
__all__ = [f for f in modules if f not in excepts]
| Load all widgets when 'widgets' module is loaded. | widgets: Load all widgets when 'widgets' module is loaded.
| Python | mit | alberand/lemonbar,alberand/lemonbar,alberand/lemonbar | ---
+++
@@ -0,0 +1,8 @@
+from os.path import dirname, basename, isfile
+import glob
+
+excepts = ['__init__', 'widget']
+# Find all *.py files and add them to import
+modules = [basename(f)[:-3] for f in glob.glob(dirname(__file__)+"/*.py") if
+ isfile(f)]
+__all__ = [f for f in modules if f not in excepts] | |
5c2ca9afac5fe29a86de8ff6774c62b7d3d33561 | tests/base.py | tests/base.py | from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
from twisted.trial import unittest
from twisted.enterprise import adbapi
from twisted.internet.defer import inlineCallbacks, returnValue
from twistar.registry import Registry
class TestBase(unittest.TestCase):
@i... | import logging
from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
from twisted.trial import unittest
from twisted.enterprise import adbapi
from twisted.internet.defer import inlineCallbacks, returnValue
from twistar.registry import Registry
class TestBase(unittest.T... | Write log file from unit tests | Write log file from unit tests
| Python | agpl-3.0 | sergey-dryabzhinsky/denyhosts_sync,sergey-dryabzhinsky/denyhosts_sync,janpascal/denyhosts_sync,sergey-dryabzhinsky/denyhosts_sync,janpascal/denyhosts_sync,janpascal/denyhosts_sync | ---
+++
@@ -1,3 +1,5 @@
+import logging
+
from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
@@ -17,4 +19,9 @@
config.dbtype = "sqlite3"
yield database.clean_database()
-
+ config.logfile = "unittest.log"
+ config.loglevel = 10
+ ... |
c7863c1efa1a030b04e4efcb97948925c84b7508 | acute/referrals.py | acute/referrals.py | """
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in'
progr... | """
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
page_title = 'Acute Admissions'
target_teams = ['take']
success_link = '/#/lis... | Rename referral portal -> Acute admissions | Rename referral portal -> Acute admissions
| Python | agpl-3.0 | openhealthcare/acute,openhealthcare/acute,openhealthcare/acute | ---
+++
@@ -9,6 +9,7 @@
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
+ page_title = 'Acute Admissions'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in' |
b37655199a42622dec88ba11f845cc78d2ed0e8c | mama_cas/services/__init__.py | mama_cas/services/__init__.py | from django.utils.module_loading import import_string
def _get_backends():
backends = []
for backend_path in ['mama_cas.services.backends.SettingsBackend']:
backend = import_string(backend_path)()
backends.append(backend)
return backends
def _is_allowed(attr, *args):
for backend in _... | from django.utils.module_loading import import_string
def _get_backends():
backends = []
for backend_path in ['mama_cas.services.backends.SettingsBackend']:
backend = import_string(backend_path)()
backends.append(backend)
return backends
def _is_allowed(attr, *args):
for backend in _... | Join callback lists returned from backends | Join callback lists returned from backends
| Python | bsd-3-clause | jbittel/django-mama-cas,orbitvu/django-mama-cas,jbittel/django-mama-cas,orbitvu/django-mama-cas | ---
+++
@@ -20,25 +20,21 @@
def get_callbacks(service):
+ callbacks = []
for backend in _get_backends():
try:
- callbacks = backend.get_callbacks(service)
+ callbacks = callbacks + backend.get_callbacks(service)
except AttributeError:
raise NotImplemen... |
e352ae0e0868cda1d76528379fc2454cd5c5edd2 | scripts/reactions.py | scripts/reactions.py | import argparse
from lenrmc.nubase import System
class App(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def run(self):
s = System.parse(self.kwargs['system'], **self.kwargs)
for reaction in s.terminal():
print(reaction)
def parse_arguments():
parser... | import argparse
from lenrmc.nubase import System
class App(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def run(self):
s = System.parse(self.kwargs['system'], **self.kwargs)
for reaction in s.terminal():
print(reaction)
def parse_arguments():
parser... | Change the default lower bound. | Change the default lower bound.
| Python | mit | emwalker/lenrmc | ---
+++
@@ -19,7 +19,7 @@
parser = argparse.ArgumentParser()
parser.add_argument('system', type=str)
parser.add_argument('--lb', dest='lower_bound', help='lower bound in keV')
- parser.set_defaults(lower_bound=-1000)
+ parser.set_defaults(lower_bound=0)
return parser.parse_args()
|
4be891f9d371e1c46211b0ed7920ae95df142a16 | seqcluster/create_report.py | seqcluster/create_report.py | import os
import shutil
import logging
#try:
# from bcbio.install import _set_matplotlib_default_backend
# _set_matplotlib_default_backend()
#except (ImportError, OSError, IOError):
# pass
#import matplotlib
#matplotlib.use('Agg', force=True)
from libs.read import load_data
from libs.report import make_profi... | import os
import shutil
import logging
#try:
# from bcbio.install import _set_matplotlib_default_backend
# _set_matplotlib_default_backend()
#except (ImportError, OSError, IOError):
# pass
#import matplotlib
#matplotlib.use('Agg', force=True)
from libs.read import load_data
from libs.report import make_profi... | Fix out dir in report | Fix out dir in report
| Python | mit | lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster | ---
+++
@@ -27,7 +27,7 @@
data = load_data(args.json)
logger.info("create profile")
- data = make_profile(data, out_dir, args)
+ data = make_profile(data, args.out, args)
logger.info("create database")
make_database(data, "seqcluster.db", args.out)
|
5253f7fbcea33e28af6348c3cc0f65334cad5623 | setuptools/launch.py | setuptools/launch.py | """
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been invoked ... | """
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been... | Swap out hard tabs for spaces | Swap out hard tabs for spaces | Python | mit | pypa/setuptools,pypa/setuptools,pypa/setuptools | ---
+++
@@ -11,25 +11,25 @@
def run():
- """
- Run the script in sys.argv[1] as if it had
- been invoked naturally.
- """
- __builtins__
- script_name = sys.argv[1]
- namespace = dict(
- __file__ = script_name,
- __name__ = '__main__',
- __doc__ = None,
- )
- sys.argv[:] = sys.argv[1:]
+ """
+ Run the s... |
5d78a0da7d24eb2dc4af648ece4e21cc2448b76e | app/admin/forms.py | app/admin/forms.py | from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField
from wtforms.validators import Required, Length, Email, Optional
class ProfileForm(Form):
name = StringField('Nafn', validators=[Optional(),
Length(1,64)])
location = Strin... | from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField, SelectField
from wtforms.fields.html5 import DateField
from wtforms.validators import Required, Length, Email, Optional
class ProfileForm(Form):
name = StringField('Nafn', validators=[Optional(),
... | Add a PostForm for posting a news story | Add a PostForm for posting a news story
| Python | mit | finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is | ---
+++
@@ -1,5 +1,6 @@
from flask.ext.wtf import Form
-from wtforms import StringField, TextAreaField, SubmitField
+from wtforms import StringField, TextAreaField, SubmitField, SelectField
+from wtforms.fields.html5 import DateField
from wtforms.validators import Required, Length, Email, Optional
class ProfileF... |
761b2675471dfee97943e4123e45fc058d8f8153 | qsdl/simulator/defaultCostCallbacks.py | qsdl/simulator/defaultCostCallbacks.py | # -*- coding: latin-1 -*-
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text()... | # -*- coding: latin-1 -*-
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_qu... | Change default query cost calculation interaction type to "basic" | Change default query cost calculation interaction type to "basic"
| Python | mit | fire-uta/ir-simulation,fire-uta/ir-simulation | ---
+++
@@ -9,7 +9,7 @@
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
- def get_current_query_cost( simulation, key_cost, interaction_type ):
+ def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_... |
03b40d180c7781a153c6f6be65d560db17fffd1e | zephyr/lib/logging_util.py | zephyr/lib/logging_util.py | import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
... | import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
... | Add logging filter for checking that the app is actually deployed | Add logging filter for checking that the app is actually deployed
(imported from commit 77bd7e008fdea4033e18a91d206999f9714e0f74)
| Python | apache-2.0 | dnmfarrell/zulip,arpith/zulip,thomasboyt/zulip,moria/zulip,peiwei/zulip,mahim97/zulip,mohsenSy/zulip,gigawhitlocks/zulip,praveenaki/zulip,tdr130/zulip,hengqujushi/zulip,kou/zulip,vikas-parashar/zulip,ApsOps/zulip,wavelets/zulip,MayB/zulip,jrowan/zulip,niftynei/zulip,shubhamdhama/zulip,xuanhan863/zulip,calvinleenyc/zuli... | ---
+++
@@ -45,3 +45,8 @@
class ReturnTrue(logging.Filter):
def filter(self, record):
return True
+
+class RequireReallyDeployed(logging.Filter):
+ def filter(self, record):
+ from django.conf import settings
+ return settings.DEPLOYED and not settings.TESTING_DEPLOYED |
0a78f0cc03124662871c27ae2ac8647ecac58457 | rasa_nlu/tokenizers/spacy_tokenizer.py | rasa_nlu/tokenizers/spacy_tokenizer.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Any, List
from rasa_nlu.components import Component
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers import Token... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Any, List
from rasa_nlu.components import Component
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers import Token... | Add missing "requires" to spacy tokenizer | Add missing "requires" to spacy tokenizer
| Python | apache-2.0 | RasaHQ/rasa_nlu,RasaHQ/rasa_nlu,RasaHQ/rasa_nlu | ---
+++
@@ -21,6 +21,8 @@
provides = ["tokens"]
+ requires = ["spacy_doc"]
+
def train(self, training_data, config, **kwargs):
# type: (TrainingData, RasaNLUModelConfig, **Any) -> None
|
4848dfc9e965f7f82eb1f7aa4d90e8b39489a6a0 | recipes/pyglet/display_import_tests.py | recipes/pyglet/display_import_tests.py | # The import tests in here should be only those that
# 1. Require an X11 display on linux
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound'... | # The import tests in here should be only those that
# 1. Require an X11 display on linux
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound'... | Add a tiny bit of output | Add a tiny bit of output
| Python | bsd-3-clause | data-exp-lab/staged-recipes,Savvysherpa/staged-recipes,hbredin/staged-recipes,tylere/staged-recipes,johannesring/staged-recipes,shadowwalkersb/staged-recipes,kwilcox/staged-recipes,mcernak/staged-recipes,rvalieris/staged-recipes,barkls/staged-recipes,johanneskoester/staged-recipes,birdsarah/staged-recipes,rmcgibbo/stag... | ---
+++
@@ -18,6 +18,7 @@
def expected_fail(module):
try:
+ print('Importing {}'.format(module))
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific |
b14d2827d3358ee2c5e1262d10f7b4e54cecdddb | setup.py | setup.py | import setuptools
from src.land_registry_elements.version import Version
setuptools.setup(name='land-registry-elements',
version=Version('1.0.4').number,
description='Land Registry Elements',
packages=['land_registry_elements'],
package_dir={'': 'src... | from json import loads
from os.path import join, dirname
from src.land_registry_elements.version import Version
import setuptools
def read(filename):
path = join(dirname(__file__), filename)
with open(path, 'rt') as file:
return file.read()
package = loads(read('package.json'))
setuptools.setup(nam... | Read python package version from node package.json | Read python package version from node package.json
| Python | mit | LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements | ---
+++
@@ -1,9 +1,19 @@
+from json import loads
+from os.path import join, dirname
+from src.land_registry_elements.version import Version
import setuptools
-from src.land_registry_elements.version import Version
+def read(filename):
+ path = join(dirname(__file__), filename)
+ with open(path, 'rt') as fi... |
52058f7ea882d9d62d1003796520387e2a092c6c | volt/hooks.py | volt/hooks.py | """Hooks for various events."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
import sys
import structlog
from typing import Any
from . import signals as s
__all__ = [
"log",
"post_site_load_engines",
"post_site_collect_targets",
"pre_si... | """Hooks for various events."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
import sys
import structlog
from typing import Any
from . import signals as s
__all__ = [
"log",
"post_site_load_engines",
"post_site_collect_targets",
"pre_si... | Add hook.name function for inferring hook names | feat: Add hook.name function for inferring hook names
| Python | bsd-3-clause | bow/volt | ---
+++
@@ -15,6 +15,18 @@
"post_site_collect_targets",
"pre_site_write",
]
+
+
+def name() -> str:
+ """Return the name of the current hook.
+
+ This function must be called inside the top-level hook function. That is, the
+ function that is decorated with the hook.
+
+ """
+ frame = sys._g... |
9e1eae8b5d63a046b0dbfdb738419abd2a8edd69 | setup.py | setup.py | # -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'tornado',
'pyserial'
]
setup_requires = [
'pytest-r... | # -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'tornado',
'pyserial'
]
setup_requires = [
'pytest-run... | Include non-py files in the final package too | Include non-py files in the final package too
| Python | mit | guolivar/dusty-acorn,guolivar/dusty-acorn,guolivar/dusty-acorn,guolivar/dusty-acorn | ---
+++
@@ -3,12 +3,10 @@
from setuptools import setup, find_packages
-
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
-
install_requires = [
'tornado',
@@ -38,6 +36,26 @@
long_description_content_type=... |
eb4eea9f76a50884743774a9723e14c1aa869eea | setup.py | setup.py | from setuptools import setup
setup(name='role2rdme',
version='0.1',
description='Script to generate md table from Ansible role',
url='https://github.com/RcRonco/role2md',
author='RcRonco',
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
install_... | from setuptools import setup
setup(name='role2rdme',
version='0.1',
description='Script to generate md table from Ansible role',
url='https://github.com/RcRonco/role2md',
author='RcRonco',
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
install_... | Change install_requires from yaml to pyYAML | Change install_requires from yaml to pyYAML | Python | bsd-3-clause | RcRonco/role2md,RcRonco/role2md | ---
+++
@@ -8,5 +8,5 @@
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
- install_requires=['yaml', 'jinja2'],
+ install_requires=['pyYAML', 'jinja2'],
zip_safe=False) |
0de11865966a2d05a33e6dc3b7ab198350227985 | setup.py | setup.py | #from distutils.core import setup
from setuptools import setup
setup(
name='django-auth_mac',
version='0.1.1',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com',
packages=['auth_mac', 'auth_mac.t... | #from distutils.core import setup
from setuptools import setup
setup(
name='django-auth_mac',
version='0.1.2',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com',
packages=['auth_mac', 'auth_mac.t... | Advance the minor version to reflect the bug fixes | Advance the minor version to reflect the bug fixes
| Python | mit | ndevenish/auth_mac | ---
+++
@@ -3,7 +3,7 @@
setup(
name='django-auth_mac',
- version='0.1.1',
+ version='0.1.2',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com', |
96a262dea7cf4a5559ae64088f0c8a072a3264aa | setup.py | setup.py | import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.7",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
... | import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.7",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
... | Use a placeholder string instead of a README. | Use a placeholder string instead of a README.
Until I work out why README.rst isn't being included, use this.
| Python | bsd-2-clause | sujaymansingh/dudebot | ---
+++
@@ -14,9 +14,6 @@
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
packages=setuptools.find_packages(),
- package_data={
- "dudebot": ["README.rst"]
- },
scripts=[],
url="https://github.com/sujaymansingh/dudebot",
... |
1b91e3ef7831a956b62a662a5084eee884b55331 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup, Command
class TestDiscovery(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys, subprocess
errno = subprocess.call([
sys.execut... | #!/usr/bin/env python
from distutils.core import setup, Command
class TestDiscovery(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys, subprocess
errno = subprocess.call([
sys.execut... | Use the right case for the package name | Use the right case for the package name
| Python | bsd-3-clause | gulopine/steel | ---
+++
@@ -24,7 +24,7 @@
raise SystemExit(errno)
-setup(name='Steel',
+setup(name='steel',
version='0.1',
description='A Python framework for describing binary file formats',
author='Marty Alchin', |
35ae3f1f9f77552af637cf9ba96cd02c81a21284 | setup.py | setup.py | """Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.4.0',
descript... | """Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.4.0',
descript... | Use nose to run the testsuite. | Use nose to run the testsuite.
| Python | mit | OpenBazaar/txrudp,Renelvon/txrudp | ---
+++
@@ -35,6 +35,6 @@
packages=('txrudp', 'tests'),
install_requires=('enum34', 'protobuf', 'pynacl', 'twisted'),
tests_require=('coverage', 'nose', 'mock'),
- test_suite='tests',
+ test_suite='nose.collector',
zip_safe=False
) |
68014f6e907df3711f14bae7e949a47081f5a0d0 | setup.py | setup.py | import os.path
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex',
version='0.... | import os.path
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex',
version='0.... | Move NumPy dependency to optional rastertoolz dependency | Move NumPy dependency to optional rastertoolz dependency
| Python | bsd-3-clause | SANDAG/spandex,UDST/spandex | ---
+++
@@ -27,13 +27,12 @@
packages=find_packages(exclude=['*.tests']),
install_requires=[
'gdal>=1.8.0',
- 'numpy>=1.8.0',
'pandas>=0.13.1',
'psycopg2>=2.5',
],
extras_require={
- 'rastertoolz': ['rasterio>=0.12', 'rasterstats>=0.4',
+ 'rastertoo... |
24bbd5dea392bc7206a939941f43a878baaf61dd | setup.py | setup.py | from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='housecanary',
version='0.6.2',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='Hou... | from setuptools import setup
def readme():
with open('README.rst', 'rb') as f:
return f.read().decode('UTF-8')
setup(name='housecanary',
version='0.6.2',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-pyth... | Fix encoding error happening on some Windows servers | Fix encoding error happening on some Windows servers
Fix error causing: “UnicodeDecodeError: 'charmap' codec can't decode
byte 0x9d”
| Python | mit | housecanary/hc-api-python | ---
+++
@@ -2,8 +2,8 @@
def readme():
- with open('README.rst') as f:
- return f.read()
+ with open('README.rst', 'rb') as f:
+ return f.read().decode('UTF-8')
setup(name='housecanary',
version='0.6.2', |
dcf766b0423e66927ab36f09716ad1736d54a7ab | setup.py | setup.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'manifestparser',
... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'manifestparser',
... | Add mozfile to the dependency list | Add mozfile to the dependency list
| Python | mpl-2.0 | mozilla/test-informant,ahal/test-informant,ahal/test-informant,mozilla/test-informant | ---
+++
@@ -9,6 +9,7 @@
deps = ['flask',
'manifestparser',
'mongoengine',
+ 'mozfile',
'mozillapulse']
setup(name='test-informant', |
ea66f16926b379cad3379440658a759e82256225 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(name='Robot Daemon',
version='1.0',
description='Daemon for vision code for Source Bots',
author='SourceBots',
author_email='',
packages=['robotd'],
setup_requires=["cffi>=1.0.0"],
ffi_modules=["robotd/vision/apriltag/... | #!/usr/bin/env python
from setuptools import setup
setup(name='Robot Daemon',
version='1.0',
description='Daemon for vision code for Source Bots',
author='SourceBots',
author_email='',
packages=['robotd'],
setup_requires=["cffi>=0.8.6"],
ffi_modules=["robotd/vision/apriltag/... | Decrease the bound on cffi | Decrease the bound on cffi
| Python | mit | sourcebots/robotd,sourcebots/robotd | ---
+++
@@ -9,7 +9,7 @@
author='SourceBots',
author_email='',
packages=['robotd'],
- setup_requires=["cffi>=1.0.0"],
+ setup_requires=["cffi>=0.8.6"],
ffi_modules=["robotd/vision/apriltag/apriltag_build.py:ffibuilder"],
install_requires=['pyudev', 'pyserial', 'pygame', 'Pi... |
c4266e2de376475974dd20c66da747d2e23182b9 | setup.py | setup.py | __doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.10.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate ... | __doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.11.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate ... | Increment version for new max_dBFS property | Increment version for new max_dBFS property | Python | mit | Geoion/pydub,jiaaro/pydub,cbelth/pyMusic,miguelgrinberg/pydub,joshrobo/pydub,sgml/pydub | ---
+++
@@ -8,7 +8,7 @@
setup(
name='pydub',
- version='0.10.0',
+ version='0.11.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate audio with an simple and easy high level interface', |
825b946ea1a10041c2cfc2e711e05d57d22ff349 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="openslides-gui",
version="1.0.0dev1",
description="GUI frontend for openslides",
long_description="", # TODO
url='http://openslides.org',
author='OpenSlides-Team, see AUTHORS',
author_email='support@openslides.org',
license='MIT',... | from setuptools import setup, find_packages
setup(
name="openslides-gui",
version="1.0.0dev1",
description="GUI frontend for openslides",
long_description="", # TODO
url='http://openslides.org',
author='OpenSlides-Team, see AUTHORS',
author_email='support@openslides.org',
license='MIT',... | Fix packaging of data files | Fix packaging of data files
| Python | mit | OpenSlides/openslides-gui,emanuelschuetze/openslides-gui | ---
+++
@@ -14,7 +14,6 @@
# TODO: fill those
],
packages=find_packages(),
- include_package_data=True,
install_requires=[
"openslides",
"wxPython-Phoenix", |
7cbb83b376924cb6ae6cdf317cd5ead1b658beef | setup.py | setup.py | from distutils.core import setup
import os.path
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ""
setup(name='diary',
packages=['diary'],
scripts=['dia... | from distutils.core import setup
import os.path
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ""
setup(name='diary',
packages=['diary'],
scripts=['dia... | Prepare for 0.1.1 small improvement release | Prepare for 0.1.1 small improvement release
| Python | mit | GreenVars/diary | ---
+++
@@ -11,7 +11,7 @@
setup(name='diary',
packages=['diary'],
scripts=['diary/bin/diary'],
- version='0.1.0',
+ version='0.1.1',
description='Async Logging',
long_description=long_description,
author='Sam Rosen', |
10d42226246e13886b01c0f1b11066439ff9644f | setup.py | setup.py | """Setup for to_words package."""
from setuptools import setup, find_packages
from wordsapp import AUTHOR, VERSION
name = 'words_app'
version = VERSION
setup(
name=name,
version=version,
packages=find_packages(exclude=['tests', 'tests.*']),
description="Numbers to words library",
author=AUTHOR,
... | """Setup for to_words package."""
from setuptools import setup, find_packages
from wordsapp import AUTHOR, VERSION
name = 'words_app'
def get_version(version_iter):
"""Get the version number."""
assert isinstance(version_iter, (tuple, list,))
version = ''
for number in version_iter:
version ... | Convert Version number into a decimal seperated string | Convert Version number into a decimal seperated string
| Python | mit | yoda-yoda/numbers-to-words | ---
+++
@@ -5,7 +5,16 @@
name = 'words_app'
-version = VERSION
+
+def get_version(version_iter):
+ """Get the version number."""
+ assert isinstance(version_iter, (tuple, list,))
+ version = ''
+ for number in version_iter:
+ version += str(number) + '.'
+ return version[:len(version) - 1]
... |
b76a6cafa7beabc3fc4bcb7357369b70e8d8b09a | setup.py | setup.py | from setuptools import setup
setup(
name='visioimg',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio image',
license='MIT',
packages=['visioimg'],
insta... | from setuptools import setup
setup(
name='visioemb_rst',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio image',
license='MIT',
packages=['visioemb_rst'],
... | Change name: visioimg -> visioemb_rst | Change name: visioimg -> visioemb_rst
| Python | apache-2.0 | visio2img/sphinxcontrib-visio | ---
+++
@@ -1,14 +1,14 @@
from setuptools import setup
setup(
- name='visioimg',
+ name='visioemb_rst',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio ... |
bffdd8ee32e20d7d6f39049514b76dcb5d4a2825 | setup.py | setup.py | #!/usr/bin/python
"""Install, build, or test the HXL Proxy.
For details, try
python setup.py -h
"""
import sys, setuptools
from hxl_proxy import __version__
if sys.version_info.major != 3:
raise SystemExit("The HXL Proxy requires Python 3.x")
setuptools.setup(
name = 'hxl-proxy',
packages = ['hxl_prox... | #!/usr/bin/python
"""Install, build, or test the HXL Proxy.
For details, try
python setup.py -h
"""
import sys, setuptools
from hxl_proxy import __version__
if sys.version_info.major != 3:
raise SystemExit("The HXL Proxy requires Python 3.x")
setuptools.setup(
name = 'hxl-proxy',
packages = ['hxl_prox... | Remove version for now, since it's messing up beta deployment. | Remove version for now, since it's messing up beta deployment.
| Python | unlicense | HXLStandard/hxl-proxy,HXLStandard/hxl-proxy,HXLStandard/hxl-proxy,HXLStandard/hxl-proxy | ---
+++
@@ -22,7 +22,7 @@
url='https://github.com/HXLStandard/hxl-proxy',
include_package_data = True,
zip_safe = False,
- install_requires=['flask-cache>=0.13', 'libhxl==4.8', 'ckanapi>=3.5', 'flask==0.12.4', 'requests_cache', 'mysql-connector-python'],
+ install_requires=['flask-cache>=0.13', '... |
ed202eef3e75b10e90c7fcd2ceac1feddc4acd95 | setup.py | setup.py | from __future__ import absolute_import
from setuptools import setup, find_packages
long_desc = """
Transform Excel spreadsheets
"""
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for classifiers
conf = dict(
name='databaker',
version='1.2.1',
description="DataBaker, part of QuickCode for ON... | from __future__ import absolute_import
from setuptools import setup, find_packages
long_desc = """
Transform Excel spreadsheets
"""
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for classifiers
conf = dict(
name='databaker',
version='1.2.1',
description="DataBaker, part of QuickCode for ON... | Remove bake.py console script entry point | Remove bake.py console script entry point
bake.py no longer exists.
| Python | agpl-3.0 | scraperwiki/databaker,scraperwiki/databaker | ---
+++
@@ -31,11 +31,8 @@
zip_safe=False,
install_requires=['docopt', 'xypath>=1.1.0', 'xlutils', 'pyhamcrest'],
tests_require=[],
- entry_points={
- 'console_scripts': [
- 'bake = databaker.bake:main',
- ]
- })
+ entry_points={},
+ )
if __name__ == '__main__':
... |
cc0ae53316705f4d432ca8a92b1dd8ba93facc7c | setup.py | setup.py | #!/usr/bin/env python3
from distutils.core import setup
version = "0.0.1"
setup(
name = 'homer',
packages = ['homer'],
license = 'MIT',
version = version,
description = 'Homer is a config handler tool.',
author = 'Manoel Carvalho',
author_email = 'manoelhc@gmail.com',
url = 'https://g... | #!/usr/bin/env python3
from distutils.core import setup
version = "0.0.1"
setup(
name = 'homer',
packages = ['homer'],
license = 'MIT',
version = version,
description = 'Homer is a config handler tool.',
author = 'Manoel Carvalho',
author_email = 'manoelhc@gmail.com',
url = 'https://g... | Fix the required package name | Fix the required package name
| Python | mit | manoelhc/homer | ---
+++
@@ -16,7 +16,7 @@
download_url = 'https://github.com/manoelhc/homer', # I'll explain this in a second
keywords = ['testing', 'configuration'], # arbitrary keywords
install_requires=[
- 'Crypto'
+ 'pycrypto'
],
classifiers = [
'Development Status :: 3 - Alpha', |
c858af26c6940cb514e845acede25b56b9274449 | setup.py | setup.py | from setuptools import setup, find_packages
setup (
name = 'hypnotoad',
version = '0.1.1',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad',
license = 'LICENSE.txt',
... | from setuptools import setup, find_packages
setup (
name = 'hypnotoad',
version = '0.1.2',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad',
license = 'LICENSE.txt',
... | Bump version number for future release. | Bump version number for future release.
| Python | bsd-3-clause | hpc/hypnotoad | ---
+++
@@ -2,7 +2,7 @@
setup (
name = 'hypnotoad',
- version = '0.1.1',
+ version = '0.1.2',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad', |
48a9701fc57679a3526f55e516710b7b787d479f | setup.py | setup.py | import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mdot',
version='0.1',
packages=['mdot'],
include_packa... | import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mdot',
version='0.1',
packages=['mdot'],
include_packa... | Revert "Try less than 2.0." | Revert "Try less than 2.0."
This reverts commit 1bffae34a767e56943bb83027719fbe6dffcdc3b.
| Python | apache-2.0 | uw-it-aca/mdot,uw-it-aca/mdot,charlon/mdot,uw-it-aca/mdot,charlon/mdot,uw-it-aca/mdot,charlon/mdot | ---
+++
@@ -16,7 +16,7 @@
'django<1.9rc1',
'django-compressor',
'django_mobileesp',
- 'uw-restclients<2.0',
+ 'uw-restclients==1.1',
'django-htmlmin',
],
license='Apache License, Version 2.0', |
23f328b1abb8e21942fb1c23a67ab18304674c4d | setup.py | setup.py | #!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
from version import VERSION
setup(name='asana',
version=VERSION,
description='Asana... | #!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
from version import VERSION
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
setup(
name='asana',
version=VERSION,
description='Asa... | Add PyPI classifiers and additional metadata. | Add PyPI classifiers and additional metadata.
| Python | mit | Asana/python-asana,asana/python-asana,asana/python-asana | ---
+++
@@ -4,24 +4,38 @@
import os
from setuptools import setup, find_packages
+from version import VERSION
+
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
-from version import VERSION
-setup(name='asana',
- versio... |
09e320c678016a4a12fdecbbe36a7e1c1905cf5c | setup.py | setup.py | from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='rhaptos.cnxmlutils',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# h... | from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='rhaptos.cnxmlutils',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# h... | Remove requirement for lxml (it's compiled/installed as a system package) | Remove requirement for lxml (it's compiled/installed as a system package)
| Python | agpl-3.0 | Connexions/rhaptos.cnxmlutils,Connexions/rhaptos.cnxmlutils,Connexions/rhaptos.cnxmlutils,Connexions/rhaptos.cnxmlutils,Connexions/rhaptos.cnxmlutils | ---
+++
@@ -24,7 +24,7 @@
zip_safe=False,
install_requires=[
'setuptools',
- 'lxml',
+ #'lxml',
#'argparse',
# -*- Extra requirements: -*-
], |
915e7a12e7e30aba93e9008c6daed32c38435f0c | setup.py | setup.py | from setuptools import setup, find_packages
version = open('VERSION').read().strip()
setup(
name="btw-backup",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'btw-backup = btw_backup.__main__:main'
],
},
author="Louis-Dominique Dubeau... | from setuptools import setup, find_packages
version = open('VERSION').read().strip()
setup(
name="btw-backup",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'btw-backup = btw_backup.__main__:main'
],
},
author="Louis-Dominique Dubeau... | Add s3cmd to the list of requirements. | Add s3cmd to the list of requirements.
| Python | mpl-2.0 | mangalam-research/btw-backup,mangalam-research/btw-backup | ---
+++
@@ -21,12 +21,13 @@
'pytimeparse>=1.1.4,<=2',
'pyhash>=0.6.2,<1',
'pyee>=1.0.2,<2',
- 'awscli>=1.10.21,<2'
+ 'awscli>=1.10.21,<2',
+ 's3cmd<3',
],
- tests_require = [
+ tests_require=[
'psycopg2>=2.5.2,<3'
],
- test_suite= 'nose.colle... |
349b0efb7a3714439f208c967cce2a0cd7344167 | setup.py | setup.py | import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='pykismet3',
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-dete... | import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='pykismet3',
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-dete... | Fix URL to renamed github repo. | Fix URL to renamed github repo.
| Python | mit | grundleborg/pykismet3 | ---
+++
@@ -12,7 +12,7 @@
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-detection web service.',
long_description=(read('README.md')),
- url='https://github.com/grundleborg/pykismet',
+ url='https://github.com/grundleborg/pykismet3',
license='MIT',
au... |
ddb70c43c0b63cb5af74fb059975cac17bf9f7b9 | mdot_rest/views.py | mdot_rest/views.py | from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
from rest_framework import generics
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
class ResourceDetail(generics.RetrieveUpdat... | from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
from rest_framework import generics, permissions
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
permission_classes = (permis... | Make the API read only unless authenticated. | Make the API read only unless authenticated.
| Python | apache-2.0 | uw-it-aca/mdot-rest,uw-it-aca/mdot-rest | ---
+++
@@ -1,14 +1,16 @@
from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
-from rest_framework import generics
+from rest_framework import generics, permissions
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
... |
e5ab635527281f9647f444e59ade4449d53aa979 | alexa/__init__.py | alexa/__init__.py | """
This script downloads the alexa top 1M sites, unzips it, and reads the CSV and
returns a list of the top N sites.
"""
import zipfile
import cStringIO
from urllib import urlopen
ALEXA_DATA_URL = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip'
def alexa_etl():
"""
Generator that:
Extracts by... | """
This script downloads the alexa top 1M sites, unzips it, and reads the CSV and
returns a list of the top N sites.
"""
import zipfile
import cStringIO
from urllib import urlopen
ALEXA_DATA_URL = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip'
def alexa_etl():
"""
Generator that:
Extracts by... | Fix error when run as script | Fix error when run as script
Change method call from alexa_list(), which is undefined, to top_list()
| Python | bsd-3-clause | davedash/Alexa-Top-Sites | ---
+++
@@ -33,4 +33,4 @@
if __name__ == "__main__":
- print alexa_list()
+ print top_list() |
925270e5dd8ffcc72b95bf431444bce480fa18bb | simphony/engine/__init__.py | simphony/engine/__init__.py | """ Simphony engine module
This module is dynamicaly populated at import with the
registered plugins modules. Plugins modules need to be
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
from ..extension import create_wrapper
__all__ = ['get_supported_engines', 'create_w... | """ Simphony engine module
This module is dynamicaly populated at import with the
registered plugins modules. Plugins modules need to be
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
__all__ = ['get_supported_engines',
'get_supported_engine_names']
def g... | Remove create_wrapper from the API | Remove create_wrapper from the API
| Python | bsd-2-clause | simphony/simphony-common | ---
+++
@@ -5,10 +5,9 @@
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
-from ..extension import create_wrapper
-__all__ = ['get_supported_engines', 'create_wrapper',
+__all__ = ['get_supported_engines',
'get_supported_engine_names']
|
a7ead6577d885475e82a1c18872eb55e9d39c8b0 | rwt/launch.py | rwt/launch.py | import os
import subprocess
import sys
import signal
def _build_env(target):
"""
Prepend target to PYTHONPATH
"""
env = dict(os.environ)
suffix = env.get('PYTHONPATH', '')
prefix = target
joined = os.pathsep.join([prefix, suffix]).rstrip(os.pathsep)
env['PYTHONPATH'] = joined
return env
def with_path(targe... | import os
import subprocess
import sys
import signal
import itertools
def _build_env(target):
"""
Prepend target and .pth references in target to PYTHONPATH
"""
env = dict(os.environ)
suffix = env.get('PYTHONPATH')
prefix = target,
items = itertools.chain(
prefix,
(suffix,) if suffix else (),
)
joined = ... | Refactor to better inject values into path items | Refactor to better inject values into path items
| Python | mit | jaraco/rwt | ---
+++
@@ -2,16 +2,21 @@
import subprocess
import sys
import signal
+import itertools
def _build_env(target):
"""
- Prepend target to PYTHONPATH
+ Prepend target and .pth references in target to PYTHONPATH
"""
env = dict(os.environ)
- suffix = env.get('PYTHONPATH', '')
- prefix = target
- joined = os.p... |
9489e8512df9e073ac019c75f827c03fe64242dd | sorts/bubble_sort.py | sorts/bubble_sort.py | """
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementa... | """
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementa... | Break if the collection is sorted | Break if the collection is sorted
| Python | mit | TheAlgorithms/Python | ---
+++
@@ -32,10 +32,12 @@
"""
length = len(collection)
for i in range(length):
+ swapped = False
for j in range(length-1):
if collection[j] > collection[j+1]:
+ swapped = True
collection[j], collection[j+1] = collection[j+1], collection[j]
... |
6182fd214580e517ffe8a59ed89037adf7fd2094 | traits/tests/test_dynamic_trait_definition.py | traits/tests/test_dynamic_trait_definition.py | from traits.testing.unittest_tools import unittest
from traits.api import Float, HasTraits, Int, List
class Foo(HasTraits):
x = Float
x_changes = List
y_changes = List
def _x_changed(self, new):
self.x_changes.append(new)
def _y_changed(self, new):
self.y_changes.append(new)
... | from traits.testing.unittest_tools import unittest
from traits.api import Float, HasTraits, Int, List
class Foo(HasTraits):
x = Float
y_changes = List
def _y_changed(self, new):
self.y_changes.append(new)
class TestDynamicTraitDefinition(unittest.TestCase):
""" Test demonstrating special ... | Remove unused trait definitions in test. | Remove unused trait definitions in test.
| Python | bsd-3-clause | burnpanck/traits,burnpanck/traits | ---
+++
@@ -6,11 +6,7 @@
class Foo(HasTraits):
x = Float
- x_changes = List
y_changes = List
-
- def _x_changed(self, new):
- self.x_changes.append(new)
def _y_changed(self, new):
self.y_changes.append(new) |
399ba60eb17744ea4c45891e29140f1a2b44a4c0 | netpyne/analysis/hnn.py | netpyne/analysis/hnn.py | """
analysis/rxd.py
Functions to plot and analyze RxD-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.inst... | """
analysis/rxd.py
Functions to plot and analyze RxD-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.inst... | Change plotDipole to return html instead of saving it as a file | Change plotDipole to return html instead of saving it as a file
| Python | mit | Neurosim-lab/netpyne,Neurosim-lab/netpyne | ---
+++
@@ -28,7 +28,10 @@
@exception
def plotDipole():
from .. import sim
- from bokeh.plotting import figure, show, output_file
+ from bokeh.plotting import figure
+ from bokeh.resources import CDN
+ from bokeh.embed import file_html
+ from bokeh.layouts import layout
TOOLS = "pan,wheel... |
cb7e8faad37719e7e2522bc203a29cdbc67a22aa | pollirio/reactors/__init__.py | pollirio/reactors/__init__.py | # -*- coding: utf-8 -*-
from functools import wraps
from pollirio import reactors
import re
def expose(text, args=None):
def decorator(fn):
reactors[text] = {"func":fn, "args":args}
return fn
return decorator
def reactor_run(line, *args):
for k in reactors.keys():
if re.findall(k... | # -*- coding: utf-8 -*-
from functools import wraps
from pollirio import reactors
import re
def expose(text, args=None):
def decorator(fn):
reactors[text] = {"func":fn, "args":args}
return fn
return decorator
def reactor_run(line, *args):
for k in reactors.keys():
if re.findall(k... | Disable markov until further optimization | Disable markov until further optimization
| Python | mit | dpaleino/pollirio,dpaleino/pollirio | ---
+++
@@ -16,6 +16,6 @@
if re.findall(k, line, re.IGNORECASE):
reactors.get(k)["func"](*args)
-from markov import *
+#from markov import *
from users import *
from misc import * |
e51a3f3af81ba0270b73baaf5df139c391b4004c | src/emulators/wit.py | src/emulators/wit.py |
class WitEmulator(object):
def __init__(self):
self.name='wit'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
print('plain response {0}'.format(data))
return [
{
... |
class WitEmulator(object):
def __init__(self):
self.name='wit'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
print('plain response {0}'.format(data))
return [
{
... | Revert "remove erroneous items() call" | Revert "remove erroneous items() call"
This reverts commit 8c6a79f668901dad2a0c47fa80a6ccbd1264066b.
| Python | apache-2.0 | verloop/rasa_nlu,PHLF/rasa_nlu,RasaHQ/rasa_nlu,beeva-fernandocerezal/rasa_nlu,RasaHQ/rasa_nlu,beeva-fernandocerezal/rasa_nlu,verloop/rasa_nlu,PHLF/rasa_nlu,RasaHQ/rasa_nlu | ---
+++
@@ -15,7 +15,7 @@
"_text": data["text"],
"confidence": None,
"intent": data["intent"],
- "entities" : {key:{"confidence":None,"type":"value","value":val} for key,val in data["entities"]}
+ "entities" : {key:{"confidence":None,"type":"value","value":... |
d8c8b5ffc1f79fc106dc9e41cc6f1ae4f40d0535 | src/mpi4py/futures/_core.py | src/mpi4py/futures/_core.py | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
# pylint: disable=missing-module-docstring
try:
from concurrent.futures import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
Tim... | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
# pylint: disable=missing-module-docstring
try:
from concurrent.futures import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
Tim... | Fix backward compatibility exception types | mpi4py.futures: Fix backward compatibility exception types
| Python | bsd-2-clause | mpi4py/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py | ---
+++
@@ -22,12 +22,16 @@
try: # Python 3.7
from concurrent.futures import BrokenExecutor
except ImportError: # pragma: no cover
- BrokenExecutor = RuntimeError
+ class BrokenExecutor(RuntimeError):
+ """The executor has become non-functional."""
try: # Python 3... |
65fcd98e65a5921dabf324e82a5e5925b1279a30 | alfred_db/migrations/versions/29a56dc34a2b_add_permissions.py | alfred_db/migrations/versions/29a56dc34a2b_add_permissions.py | """Add permissions
Revision ID: 29a56dc34a2b
Revises: 4fdf1059c4ba
Create Date: 2012-09-02 14:06:24.088307
"""
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
down_revision = '4fdf1059c4ba'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('permissions',
... | """Add permissions
Revision ID: 29a56dc34a2b
Revises: 4fdf1059c4ba
Create Date: 2012-09-02 14:06:24.088307
"""
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
down_revision = '5245d0b46f8'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('permissions',
s... | Fix permission table creation migration | Fix permission table creation migration
| Python | isc | alfredhq/alfred-db | ---
+++
@@ -7,7 +7,7 @@
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
-down_revision = '4fdf1059c4ba'
+down_revision = '5245d0b46f8'
from alembic import op
@@ -22,8 +22,12 @@
sa.Column('admin', sa.Boolean(), nullable=False),
sa.Column('push', sa.Boolean(), nullable=Fals... |
f85001b39f8f8097c20a197f8cbde70d7ec8e88b | tests/test_extension.py | tests/test_extension.py | import mock
from mopidy_spotify import Extension, backend as backend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert '[spotify]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_conf... | import mock
from mopidy_spotify import Extension, backend as backend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert '[spotify]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_conf... | Test existing config schema members | Test existing config schema members
| Python | apache-2.0 | jodal/mopidy-spotify,kingosticks/mopidy-spotify,mopidy/mopidy-spotify | ---
+++
@@ -22,6 +22,8 @@
assert 'bitrate' in schema
assert 'timeout' in schema
assert 'cache_dir' in schema
+ assert 'settings_dir' in schema
+ assert 'toplist_countries' in schema
def test_setup(): |
71ef5d2994dbbf4aa993ba1110eb5404de1f6ac3 | test_graph.py | test_graph.py | from __future__ import unicode_literals
import pytest
from graph import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_filled():
g = Graph()
g.graph = {
5: set([10]),
10: set([5, 20, 15]),
15: set(),
20: set([5]),
... | from __future__ import unicode_literals
import pytest
from graph import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_filled():
g = Graph()
g.graph = {
5: set([10]),
10: set([5, 20, 15]),
15: set(),
20: set([5]),
... | Add further tests for add_node | Add further tests for add_node
| Python | mit | jonathanstallings/data-structures,jay-tyler/data-structures | ---
+++
@@ -37,7 +37,24 @@
def test_add_node_to_empty(graph_empty):
- graph_empty.add_node(10)
- assert 10 in graph_empty
- assert isinstance(graph_empty[10], set) and len(graph_empty[10]) == 0
+ graph_empty.add_node(40)
+ assert 40 in graph_empty
+ assert isinstance(graph_empty[40], set) and l... |
e948fa0c24ebfe83d2df81f729b5bcc9b4b971b4 | mygpo/data/models.py | mygpo/data/models.py | from datetime import datetime
from django.db import models
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(models.Model):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.Foreig... | from datetime import datetime
from django.db import models
from mygpo.core.models import UUIDModel
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(UUIDModel):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that wa... | Use UUID as primary key of PodcastUpdateResult | Use UUID as primary key of PodcastUpdateResult
| Python | agpl-3.0 | gpodder/mygpo,gpodder/mygpo,gpodder/mygpo,gpodder/mygpo | ---
+++
@@ -2,10 +2,11 @@
from django.db import models
+from mygpo.core.models import UUIDModel
from mygpo.podcasts.models import Podcast
-class PodcastUpdateResult(models.Model):
+class PodcastUpdateResult(UUIDModel):
""" Results of a podcast update
Once an instance is stored, the update is ass... |
5b9bc280a4a5806dbf87ec555fcfdf87ad8bdfd9 | raven/contrib/django/utils.py | raven/contrib/django/utils.py | def linebreak_iter(template_source):
yield 0
p = template_source.find('\n')
while p >= 0:
yield p + 1
p = template_source.find('\n', p + 1)
yield len(template_source) + 1
def get_data_from_template(source):
origin, (start, end) = source
template_source = origin.reload()
li... | def linebreak_iter(template_source):
yield 0
p = template_source.find('\n')
while p >= 0:
yield p + 1
p = template_source.find('\n', p + 1)
yield len(template_source) + 1
def get_data_from_template(source):
origin, (start, end) = source
template_source = origin.reload()
li... | Implement relative path (use loadname) for Templates | Implement relative path (use loadname) for Templates
| Python | bsd-3-clause | lepture/raven-python,someonehan/raven-python,dbravender/raven-python,jmp0xf/raven-python,ticosax/opbeat_python,icereval/raven-python,patrys/opbeat_python,tarkatronic/opbeat_python,lepture/raven-python,danriti/raven-python,Photonomie/raven-python,beniwohli/apm-agent-python,dirtycoder/opbeat_python,percipient/raven-pytho... | ---
+++
@@ -29,7 +29,8 @@
return {
'sentry.interfaces.Template': {
- 'filename': origin.name,
+ 'filename': origin.loadname,
+ 'abs_path': origin.name,
'pre_context': pre_context,
'context_line': context_line,
'lineno': lineno, |
ca37ff8b08d5b0dd6db1bd48912807aa40872aba | erpnext/patches/v4_0/customer_discount_to_pricing_rule.py | erpnext/patches/v4_0/customer_discount_to_pricing_rule.py | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.au... | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.au... | Fix in pricing rule patch | Fix in pricing rule patch
| Python | agpl-3.0 | indictranstech/buyback-erp,Tejal011089/fbd_erpnext,Tejal011089/fbd_erpnext,indictranstech/phrerp,rohitwaghchaure/digitales_erpnext,indictranstech/biggift-erpnext,mbauskar/helpdesk-erpnext,njmube/erpnext,gangadharkadam/johnerp,gangadhar-kadam/verve_live_erp,fuhongliang/erpnext,rohitwaghchaure/GenieManager-erpnext,gangad... | ---
+++
@@ -24,7 +24,8 @@
"applicable_for": "Customer",
"customer": d.parent,
"price_or_discount": "Discount Percentage",
- "discount_percentage": d.discount
+ "discount_percentage": d.discount,
+ "selling": 1
}).insert()
frappe.db.auto_commit_on_many_writes = False |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.