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
d537ea32462c7ef46634d1527702c4c4a6d37e1e
tests/query_test/test_udfs.py
tests/query_test/test_udfs.py
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, Inc. All rights reserved. from tests.common.test_vector import * from tests.common.impala_test_suite import * class TestUdfs(ImpalaTestSuite): @classmethod def get_workload(cls): return 'functional-query' @classmethod def add_test_dimensions(cls): ...
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, Inc. All rights reserved. from tests.common.test_vector import * from tests.common.impala_test_suite import * class TestUdfs(ImpalaTestSuite): @classmethod def get_workload(cls): return 'functional-query' @classmethod def add_test_dimensions(cls): ...
Fix UDF test, take two
Fix UDF test, take two Change-Id: I817389d94dab665199d2c1b7365e8ce0d1495c41 Reviewed-on: http://gerrit.ent.cloudera.com:8080/504 Reviewed-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9dbf96abb2537f372f946@cloudera.com> Tested-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9dbf96abb2537f372f946@cloudera.com>
Python
apache-2.0
caseyching/Impala,theyaa/Impala,lirui-intel/Impala,ibmsoe/ImpalaPPC,gistic/PublicSpatialImpala,mapr/impala,cgvarela/Impala,rampage644/impala-cut,cchanning/Impala,cloudera/recordservice,caseyching/Impala,grundprinzip/Impala,placrosse/ImpalaToGo,kapilrastogi/Impala,brightchen/Impala,brightchen/Impala,tempbottle/Impala,ra...
--- +++ @@ -20,5 +20,9 @@ v.get_value('table_format').file_format == 'text' and\ v.get_value('table_format').compression_codec == 'none') + # This must run serially because other tests executing 'invalidate metadata' will nuke + # all loaded functions. + # TODO: This can be run in parallel once...
454740f2657efa88efa16abdba93dc427bcf4d70
run.py
run.py
from PdfProcessor import * import argparse from datetime import datetime import ConfigParser import ProcessLogger parser = argparse.ArgumentParser(description='Processes the pdf and extracts the text') parser.add_argument('-i','--infile', help='File path of the input pdf file.', required=True) parser.add_argument('-o'...
from PdfProcessor import * import argparse from datetime import datetime import ConfigParser import ProcessLogger import traceback parser = argparse.ArgumentParser(description='Processes the pdf and extracts the text') parser.add_argument('-i','--infile', help='File path of the input pdf file.', required=True) parser....
Add try catch to capture all the exceptions that might generate anywhere todo: need to capture exceptions in specific places and raise them to log from the main catch
Add try catch to capture all the exceptions that might generate anywhere todo: need to capture exceptions in specific places and raise them to log from the main catch
Python
mit
manishgs/pdf-processor,anjesh/pdf-processor,manishgs/pdf-processor,anjesh/pdf-processor
--- +++ @@ -3,27 +3,34 @@ from datetime import datetime import ConfigParser import ProcessLogger +import traceback parser = argparse.ArgumentParser(description='Processes the pdf and extracts the text') parser.add_argument('-i','--infile', help='File path of the input pdf file.', required=True) parser.add_arg...
70b4be757d671bc86876b4568632bb6fe6064001
admin_interface/templatetags/admin_interface_tags.py
admin_interface/templatetags/admin_interface_tags.py
# -*- coding: utf-8 -*- from django import template from admin_interface.models import Theme register = template.Library() @register.assignment_tag(takes_context = True) def get_admin_interface_theme(context): theme = None request = context.get('request', None) if request: theme = getattr(re...
# -*- coding: utf-8 -*- from django import template from admin_interface.models import Theme register = template.Library() @register.simple_tag(takes_context = True) def get_admin_interface_theme(context): theme = None request = context.get('request', None) if request: theme = getattr(reques...
Fix a Django deprecation warning
Fix a Django deprecation warning Replace deprecated assignment_tag: `python/lib/python3.5/site-packages/admin_interface/templatetags/admin_interface_tags.py:11: RemovedInDjango20Warning: assignment_tag() is deprecated. Use simple_tag() instead`
Python
mit
fabiocaccamo/django-admin-interface,fabiocaccamo/django-admin-interface,fabiocaccamo/django-admin-interface
--- +++ @@ -8,7 +8,7 @@ register = template.Library() -@register.assignment_tag(takes_context = True) +@register.simple_tag(takes_context = True) def get_admin_interface_theme(context): theme = None
b37814280dc06dbf8aefec4490f6b73a47f05c1a
custom_fixers/fix_alt_unicode.py
custom_fixers/fix_alt_unicode.py
# Taken from jinja2. Thanks, Armin Ronacher. # See also http://lucumr.pocoo.org/2010/2/11/porting-to-python-3-a-guide from lib2to3 import fixer_base from lib2to3.fixer_util import Name, BlankLine class FixAltUnicode(fixer_base.BaseFix): PATTERN = """ func=funcdef< 'def' name='__unicode__' ...
# Taken from jinja2. Thanks, Armin Ronacher. # See also http://lucumr.pocoo.org/2010/2/11/porting-to-python-3-a-guide from lib2to3 import fixer_base class FixAltUnicode(fixer_base.BaseFix): PATTERN = "'__unicode__'" def transform(self, node, results): new = node.clone() new.value = '__str__...
Simplify python3 unicode fixer and make it replace all occurrences of __unicode__ with __str__.
Simplify python3 unicode fixer and make it replace all occurrences of __unicode__ with __str__.
Python
mit
live-clones/pybtex
--- +++ @@ -3,15 +3,12 @@ from lib2to3 import fixer_base -from lib2to3.fixer_util import Name, BlankLine class FixAltUnicode(fixer_base.BaseFix): - PATTERN = """ - func=funcdef< 'def' name='__unicode__' - parameters< '(' NAME ')' > any+ > - """ + PATTERN = "'__unicode__'" ...
eb4cda636a0b0ceb5312b161e97ae5f8376c9f8e
indra/tests/test_biolookup_client.py
indra/tests/test_biolookup_client.py
from indra.databases import biolookup_client def test_lookup_curie(): curie = 'pubchem.compound:40976' res = biolookup_client.lookup_curie(curie) assert res['name'] == '(17R)-13-ethyl-17-ethynyl-17-hydroxy-11-' \ 'methylidene-2,6,7,8,9,10,12,14,15,16-decahydro-1H-' \ 'cyclopenta[a]phenanth...
from indra.databases import biolookup_client def test_lookup_curie(): curie = 'pubchem.compound:40976' res = biolookup_client.lookup_curie(curie) assert res['name'] == '(17R)-13-ethyl-17-ethynyl-17-hydroxy-11-' \ 'methylidene-2,6,7,8,9,10,12,14,15,16-decahydro-1H-' \ 'cyclopenta[a]phenanth...
Change biolookup test to work around service bug
Change biolookup test to work around service bug
Python
bsd-2-clause
johnbachman/indra,bgyori/indra,johnbachman/indra,bgyori/indra,bgyori/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/indra,sorgerlab/indra
--- +++ @@ -10,8 +10,8 @@ def test_lookup(): - res = biolookup_client.lookup('FPLX', 'ERK') - assert res['name'] == 'ERK', res + res = biolookup_client.lookup('HGNC', '1097') + assert res['name'] == 'BRAF', res def test_get_name():
c535c22884dbb0df227d4ad142e4d4515415ca29
tests/backends/gstreamer_test.py
tests/backends/gstreamer_test.py
import unittest import os from mopidy.models import Playlist, Track from mopidy.backends.gstreamer import GStreamerBackend from tests.backends.base import (BasePlaybackControllerTest, BaseCurrentPlaylistControllerTest) folder = os.path.dirname(__file__) folder = os.path.join(folder, ...
import unittest import os from mopidy.models import Playlist, Track from mopidy.backends.gstreamer import GStreamerBackend from tests.backends.base import (BasePlaybackControllerTest, BaseCurrentPlaylistControllerTest) folder = os.path.dirname(__file__) folder = os.path.join(folder, ...
Switch to wav test files for gstreamer tests
Switch to wav test files for gstreamer tests
Python
apache-2.0
dbrgn/mopidy,jcass77/mopidy,woutervanwijk/mopidy,jcass77/mopidy,tkem/mopidy,kingosticks/mopidy,ali/mopidy,diandiankan/mopidy,hkariti/mopidy,bacontext/mopidy,rawdlite/mopidy,jcass77/mopidy,bacontext/mopidy,pacificIT/mopidy,ZenithDK/mopidy,adamcik/mopidy,mopidy/mopidy,dbrgn/mopidy,mokieyue/mopidy,hkariti/mopidy,woutervan...
--- +++ @@ -10,7 +10,7 @@ folder = os.path.dirname(__file__) folder = os.path.join(folder, '..', 'data') folder = os.path.abspath(folder) -song = os.path.join(folder, 'song%s.mp3') +song = os.path.join(folder, 'song%s.wav') song = 'file://' + song # FIXME can be switched to generic test
eac2f296e855f92d040321edee943ad5f8a8fb39
nodeconductor/events/views.py
nodeconductor/events/views.py
from rest_framework import generics, response from nodeconductor.events import elasticsearch_client class EventListView(generics.GenericAPIView): def list(self, request, *args, **kwargs): order_by = request.GET.get('o', '-@timestamp') elasticsearch_list = elasticsearch_client.ElasticsearchResult...
from rest_framework import generics, response from nodeconductor.events import elasticsearch_client class EventListView(generics.GenericAPIView): def list(self, request, *args, **kwargs): order_by = request.GET.get('o', '-@timestamp') event_types = request.GET.getlist('event_type') searc...
Add filtering to view (nc-463)
Add filtering to view (nc-463)
Python
mit
opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor
--- +++ @@ -7,7 +7,10 @@ def list(self, request, *args, **kwargs): order_by = request.GET.get('o', '-@timestamp') - elasticsearch_list = elasticsearch_client.ElasticsearchResultList(user=request.user, sort=order_by) + event_types = request.GET.getlist('event_type') + search_text =...
72e948719145579eb7dfb9385b921f8eb6ea1384
tests/v4/conftest.py
tests/v4/conftest.py
from .context import tohu from tohu.v4.primitive_generators import * from tohu.v4.derived_generators import * __all__ = ['EXEMPLAR_GENERATORS', 'EXEMPLAR_PRIMITIVE_GENERATORS', 'EXEMPLAR_DERIVED_GENERATORS'] def add(x, y): return x + y EXEMPLAR_PRIMITIVE_GENERATORS = [ Constant("quux"), Integer(100, 200...
from .context import tohu from tohu.v4.primitive_generators import * from tohu.v4.derived_generators import * __all__ = ['EXEMPLAR_GENERATORS', 'EXEMPLAR_PRIMITIVE_GENERATORS', 'EXEMPLAR_DERIVED_GENERATORS'] def add(x, y): return x + y EXEMPLAR_PRIMITIVE_GENERATORS = [ Boolean(p=0.3), Constant("quux"), ...
Add more exemplar primitive generators
Add more exemplar primitive generators
Python
mit
maxalbert/tohu
--- +++ @@ -9,10 +9,12 @@ EXEMPLAR_PRIMITIVE_GENERATORS = [ + Boolean(p=0.3), Constant("quux"), + FakerGenerator(method="name"), + Float(12.34, 56.78), + HashDigest(length=6), Integer(100, 200), - HashDigest(length=6), - FakerGenerator(method="name"), IterateOver('abcdefghijklmno...
12d22221df5786caee510cc167c9ef29f9155488
var/www/cgi-bin/abundanceConf.py
var/www/cgi-bin/abundanceConf.py
#!/home/daniel/Software/anaconda3/bin/python # Import modules for CGI handling import cgi, cgitb from abundanceDriver import abundancedriver from emailSender import sendEmail def cgi2dict(form): """Convert the form from cgi.FieldStorage to a python dictionary""" params = {} for key in form.keys(): ...
#!/home/daniel/Software/anaconda3/bin/python # Import modules for CGI handling import cgi, cgitb from abundanceDriver import abundancedriver from emailSender import sendEmail def cgi2dict(form): """Convert the form from cgi.FieldStorage to a python dictionary""" params = {} for key in form.keys(): ...
Correct name of output file
Correct name of output file
Python
mit
DanielAndreasen/FASMA-web,DanielAndreasen/FASMA-web,DanielAndreasen/FASMA-web,DanielAndreasen/FASMA-web
--- +++ @@ -27,8 +27,6 @@ if __name__ == '__main__': # Enable debugging - import os - os.system('touch /tmp/test1') cgitb.enable() form = cgi.FieldStorage() @@ -36,7 +34,7 @@ # Run ARES for one or several line lists formDict = cgi2dict(form) abundance(formDict) - sendEmail(...
24b8e2f7440926d6d1c384a7289dfb5d1124e82f
opps/core/admin/__init__.py
opps/core/admin/__init__.py
# -*- coding: utf-8 -*- from opps.core.admin.channel import * from opps.core.admin.profile import * from opps.core.admin.source import *
# -*- coding: utf-8 -*- from opps.core.admin.article import * from opps.core.admin.channel import * from opps.core.admin.profile import * from opps.core.admin.source import *
Add article on core admin
Add article on core admin
Python
mit
YACOWS/opps,opps/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,opps/opps,williamroot/opps
--- +++ @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +from opps.core.admin.article import * from opps.core.admin.channel import * from opps.core.admin.profile import * from opps.core.admin.source import *
ea416504c287bc5a3716289b57ebfd15bb770b9d
sql/branch.py
sql/branch.py
from gratipay import wireup env = wireup.env() db = wireup.db(env) participants = [] with open('./sql/emails.txt') as f: emails = [line.rstrip() for line in f] participants = db.all(""" SELECT p.*::participants FROM participants p WHERE email_address IN %s """, (tuple(emails), ...
import sys from gratipay import wireup env = wireup.env() db = wireup.db(env) # Temporary, will fill with actual values when running script email_txt = """ rohitpaulk@live.com abcd@gmail.com """ emails = [email.strip() for email in email_txt.split()] assert len(emails) == 176 participants = [] participan...
Use a string instead of a file
Use a string instead of a file (so that I can redirect input to heroku from a local file)
Python
mit
eXcomm/gratipay.com,studio666/gratipay.com,eXcomm/gratipay.com,gratipay/gratipay.com,eXcomm/gratipay.com,mccolgst/www.gittip.com,mccolgst/www.gittip.com,studio666/gratipay.com,mccolgst/www.gittip.com,gratipay/gratipay.com,eXcomm/gratipay.com,mccolgst/www.gittip.com,gratipay/gratipay.com,studio666/gratipay.com,studio666...
--- +++ @@ -1,17 +1,30 @@ +import sys + from gratipay import wireup env = wireup.env() db = wireup.db(env) +# Temporary, will fill with actual values when running script +email_txt = """ + rohitpaulk@live.com + abcd@gmail.com +""" + +emails = [email.strip() for email in email_txt.split()] + +assert len(e...
34035c4b272e9271834c531990c404940eee8633
apps/votes/models.py
apps/votes/models.py
from django.db import models from meps.models import MEP class Proposal(models.Model): id = models.CharField(max_length=63, primary_key=True) title = models.CharField(max_length=255, unique=True) class SubProposal(models.Model): datetime = models.DateTimeField() subject = models.CharField(max_length=2...
from django.db import models from meps.models import MEP class Proposal(models.Model): id = models.CharField(max_length=63, primary_key=True) title = models.CharField(max_length=255, unique=True) class SubProposal(models.Model): datetime = models.DateTimeField() subject = models.CharField(max_length=2...
Add a link between vote and subproposal
[enh] Add a link between vote and subproposal
Python
agpl-3.0
yohanboniface/memopol-core,yohanboniface/memopol-core,yohanboniface/memopol-core
--- +++ @@ -17,4 +17,5 @@ class Vote(models.Model): choice = models.CharField(max_length=15, choices=((u'for', u'for'), (u'against', u'against'), (u'abstention', u'abstention'))) name = models.CharField(max_length=127) + sub_proposal = models.ForeignKey(SubProposal) mep = models.ForeignKey(MEP)
496481e3bd6392a44788fadc7cf517fc36143e96
contrib/plugins/w3cdate.py
contrib/plugins/w3cdate.py
""" Add a 'w3cdate' key to every entry -- this contains the date in ISO8601 format WARNING: you must have PyXML installed as part of your python installation in order for this plugin to work Place this plugin early in your load_plugins list, so that the w3cdate will be available to subsequent plugins """ __author__ ...
""" Add a 'w3cdate' key to every entry -- this contains the date in ISO8601 format WARNING: you must have PyXML installed as part of your python installation in order for this plugin to work Place this plugin early in your load_plugins list, so that the w3cdate will be available to subsequent plugins """ __author__ ...
Change to cb_story, clean up TZ handling some more
Change to cb_story, clean up TZ handling some more
Python
mit
willkg/douglas,daitangio/pyblosxom,willkg/douglas,daitangio/pyblosxom
--- +++ @@ -14,11 +14,10 @@ import xml.utils.iso8601 import time +from Pyblosxom import tools -def cb_prepare(args): - request = args["request"] - form = request.getHttp()['form'] - config = request.getConfiguration() +def cb_story(args): + request = tools.get_registry()["request"] data = reque...
e5e83b75e250ee3c6d8084e23ee777d519293cb6
swprobe/__init__.py
swprobe/__init__.py
# Copyright (c) 2012 Spil Games # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
# Copyright (c) 2012 Spil Games # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
Fix for keystone / swift 1.8.0
Fix for keystone / swift 1.8.0
Python
apache-2.0
spilgames/swprobe,spilgames/swprobe
--- +++ @@ -14,5 +14,5 @@ # limitations under the License. # -version_info = (0 , 3, 0) +version_info = (0 , 3, 1) version = __version__ = ".".join(map(str, version_info))
9fa55bc43a3f83a57318799ba8b9f2769676bd44
test/test_flvlib.py
test/test_flvlib.py
import unittest import test_primitives, test_astypes, test_helpers def get_suite(): modules = (test_primitives, test_astypes, test_helpers) suites = [unittest.TestLoader().loadTestsFromModule(module) for module in modules] return unittest.TestSuite(suites) def main(): unittest.TextTestRu...
import unittest import test_primitives, test_astypes, test_helpers, test_tags def get_suite(): modules = (test_primitives, test_astypes, test_helpers, test_tags) suites = [unittest.TestLoader().loadTestsFromModule(module) for module in modules] return unittest.TestSuite(suites) def main(): ...
Include the tags module tests in the full library testsuite.
Include the tags module tests in the full library testsuite.
Python
mit
wulczer/flvlib
--- +++ @@ -1,8 +1,8 @@ import unittest -import test_primitives, test_astypes, test_helpers +import test_primitives, test_astypes, test_helpers, test_tags def get_suite(): - modules = (test_primitives, test_astypes, test_helpers) + modules = (test_primitives, test_astypes, test_helpers, test_tags) suit...
47c2936e65d00a08896b4e60060ff737b7a2f675
app/tests/workstations_tests/test_migrations.py
app/tests/workstations_tests/test_migrations.py
import pytest from django.db import connection from django.db.migrations.executor import MigrationExecutor @pytest.mark.django_db(transaction=True) def test_workstation_group_migration(): executor = MigrationExecutor(connection) app = "workstations" migrate_from = [(app, "0001_initial")] migrate_to = ...
import pytest from django.db import connection from django.db.migrations.executor import MigrationExecutor from guardian.shortcuts import get_perms from grandchallenge.workstations.models import Workstation from tests.factories import UserFactory @pytest.mark.django_db(transaction=True) def test_workstation_group_mi...
Check that the permission migrations work
Check that the permission migrations work
Python
apache-2.0
comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django
--- +++ @@ -1,6 +1,10 @@ import pytest from django.db import connection from django.db.migrations.executor import MigrationExecutor +from guardian.shortcuts import get_perms + +from grandchallenge.workstations.models import Workstation +from tests.factories import UserFactory @pytest.mark.django_db(transactio...
2e18e05659e9ba88f2fcce77259792f84b25e5fa
_pydevd_frame_eval/pydevd_frame_eval_main.py
_pydevd_frame_eval/pydevd_frame_eval_main.py
import os import sys IS_PY36_OR_OLDER = False if (sys.version_info[0] == 3 and sys.version_info[1] >= 6) or sys.version_info[0] > 3: IS_PY36_OR_OLDER = True set_frame_eval = None stop_frame_eval = None if IS_PY36_OR_OLDER: try: from _pydevd_frame_eval.pydevd_frame_evaluator import frame_eval_func, s...
import os import sys IS_PY36_OR_OLDER = False if (sys.version_info[0] == 3 and sys.version_info[1] >= 6) or sys.version_info[0] > 3: IS_PY36_OR_OLDER = True set_frame_eval = None stop_frame_eval = None use_frame_eval = os.environ.get('PYDEVD_USE_FRAME_EVAL', None) if use_frame_eval == 'NO': frame_eval_func,...
Add ability to disable frame evaluation
Add ability to disable frame evaluation (cherry picked from commit 6cd89d0)
Python
epl-1.0
Elizaveta239/PyDev.Debugger,Elizaveta239/PyDev.Debugger,fabioz/PyDev.Debugger,fabioz/PyDev.Debugger,fabioz/PyDev.Debugger,Elizaveta239/PyDev.Debugger,Elizaveta239/PyDev.Debugger,fabioz/PyDev.Debugger,Elizaveta239/PyDev.Debugger,fabioz/PyDev.Debugger
--- +++ @@ -8,13 +8,18 @@ set_frame_eval = None stop_frame_eval = None +use_frame_eval = os.environ.get('PYDEVD_USE_FRAME_EVAL', None) -if IS_PY36_OR_OLDER: - try: - from _pydevd_frame_eval.pydevd_frame_evaluator import frame_eval_func, stop_frame_eval - except ImportError: - from _pydev_bun...
bda88dfe6e0a2f16f0c3be74a42cf8783aae1d9e
django_enum_js/views.py
django_enum_js/views.py
from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.safestring import mark_safe from django_enum_js import enum_wrapper def enums_js(request): enums = enum_wrapper.get_json_formatted_enums() return render_to_response('django_enum_js/enums_js.tpl', { 'en...
from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.safestring import mark_safe from django_enum_js import enum_wrapper def enums_js(request): enums = enum_wrapper.get_json_formatted_enums() return render_to_response('django_enum_js/enums_js.tpl', { 'en...
Fix to support django v1.7
Fix to support django v1.7
Python
mit
leifdenby/django_enum_js
--- +++ @@ -6,4 +6,4 @@ def enums_js(request): enums = enum_wrapper.get_json_formatted_enums() - return render_to_response('django_enum_js/enums_js.tpl', { 'enums': mark_safe(enums), }, context_instance=RequestContext(request), mimetype='application/javascript') + return render_to_response('django_enum_...
54296c607b735ce06b3420efecb312f52876e012
django_react_templatetags/context_processors.py
django_react_templatetags/context_processors.py
#!/usr/bin/env python # -*- coding: utf-8 -*- def react_context_processor(request): """Expose a global list of react components to be processed""" print("react_context_processor is no longer required.") return { 'REACT_COMPONENTS': [], }
#!/usr/bin/env python # -*- coding: utf-8 -*- import warnings def react_context_processor(request): """Expose a global list of react components to be processed""" warnings.warn( "react_context_processor is no longer required.", DeprecationWarning ) return { 'REACT_COMPONENTS': [], ...
Replace warning message with deprecation warning
Replace warning message with deprecation warning
Python
mit
Frojd/django-react-templatetags,Frojd/django-react-templatetags,Frojd/django-react-templatetags
--- +++ @@ -1,10 +1,14 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- + +import warnings def react_context_processor(request): """Expose a global list of react components to be processed""" - print("react_context_processor is no longer required.") + warnings.warn( + "react_context_processor...
1fed9f26010f24af14abff9444862ed0861adb63
thinglang/runner.py
thinglang/runner.py
from thinglang.execution.execution import ExecutionEngine from thinglang.lexer.lexer import lexer from thinglang.parser.parser import parse def run(source): if not source: raise ValueError('Got empty source') source = source.strip().replace(' ' * 4, '\t') lexical_groups = list(lexer(source)) ...
from thinglang.execution.execution import ExecutionEngine from thinglang.lexer.lexer import lexer from thinglang.parser.parser import parse from thinglang.parser.simplifier import simplify def run(source): if not source: raise ValueError('Source cannot be empty') source = source.strip().replace(' ' *...
Add simplification between parsing and execution
Add simplification between parsing and execution
Python
mit
ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang
--- +++ @@ -1,16 +1,18 @@ from thinglang.execution.execution import ExecutionEngine from thinglang.lexer.lexer import lexer from thinglang.parser.parser import parse +from thinglang.parser.simplifier import simplify def run(source): if not source: - raise ValueError('Got empty source') + ra...
6138f02896bc865a98480be36300bf670a6defa8
plugin/complete_database.py
plugin/complete_database.py
import vim import re import json from os import path current = vim.eval("expand('%:p')") ccd = vim.eval("l:ccd") opts = [] with open(ccd) as database: data = json.load(database) for d in data: # hax for headers fmatch = re.search(r'(.*)\.(\w+)$', current) dmatch = re.search(r'(.*)\.(\...
import vim import re import json from os import path curr_file = vim.eval("expand('%:p')") curr_file_noext = path.splitext(curr_file)[0] ccd = vim.eval("l:ccd") opts = [] with open(ccd) as database: # Search for the right entry in the database matching file names for d in json.load(database): # This ...
Replace re by os.path utils
compdb: Replace re by os.path utils Instead of using regular expressions to drop file name ending use os.path.splitext().
Python
isc
justmao945/vim-clang,justmao945/vim-clang
--- +++ @@ -3,25 +3,32 @@ import json from os import path -current = vim.eval("expand('%:p')") +curr_file = vim.eval("expand('%:p')") +curr_file_noext = path.splitext(curr_file)[0] + ccd = vim.eval("l:ccd") opts = [] with open(ccd) as database: - data = json.load(database) + # Search for the right entr...
0fe7cd8cf316dc6d4ef547d733b634de64fc768c
dbaas/dbaas_services/analyzing/admin/analyze.py
dbaas/dbaas_services/analyzing/admin/analyze.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django_services import admin from dbaas_services.analyzing.service import AnalyzeRepositoryService from dbaas_services.analyzing.forms import AnalyzeRepositoryForm class AnalyzeRepositoryAdmin(admin.DjangoServicesAdmin): form = ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django_services import admin from dbaas_services.analyzing.service import AnalyzeRepositoryService from dbaas_services.analyzing.forms import AnalyzeRepositoryForm class AnalyzeRepositoryAdmin(admin.DjangoServicesAdmin): form = ...
Add more options on filters
Add more options on filters
Python
bsd-3-clause
globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service
--- +++ @@ -10,7 +10,8 @@ service_class = AnalyzeRepositoryService search_fields = ("database_name", "engine_name", "environment_name", "instance_name", "databaseinfra_name") - list_filter = ("analyzed_at", "memory_alarm", "cpu_alarm", "volume_alarm") + list_filter = ("analyzed_a...
ecf71bd004d99b679936e07453f5a938e19f71dc
megalist_dataflow/setup.py
megalist_dataflow/setup.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Add aiohttp as a execution requirement
Add aiohttp as a execution requirement
Python
apache-2.0
google/megalista,google/megalista
--- +++ @@ -1,4 +1,4 @@ -# Copyright 2019 Google LLC +# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,6 +22,6 @@ url='https://cse.googlesource.com/solutions/megalist', install_require...
2d09314ab58bb766372dc6e263fb17428b1fd3cd
doc/pool_scripts/cats.py
doc/pool_scripts/cats.py
import os import photomosaic.flickr import photomosaic as pm if not os.path.isfile('~/pools/cats/pool.json'): FLICKR_API_KEY = os.environ['FLICKR_API_KEY'] pm.set_options(flickr_api_key=FLICKR_API_KEY) photomosaic.flickr.from_search('cats', '~/pools/cats/') pool = pm.make_pool('~/pools/cats/*.jpg') ...
import os import photomosaic.flickr import photomosaic as pm if not os.path.isfile(os.path.expanduser('~/pools/cats/pool.json')): FLICKR_API_KEY = os.environ['FLICKR_API_KEY'] pm.set_options(flickr_api_key=FLICKR_API_KEY) photomosaic.flickr.from_search('cats', '~/pools/cats/') pool = pm.make_pool('~/...
Fix check for existing pools.
BLD: Fix check for existing pools.
Python
bsd-3-clause
danielballan/photomosaic
--- +++ @@ -3,7 +3,7 @@ import photomosaic as pm -if not os.path.isfile('~/pools/cats/pool.json'): +if not os.path.isfile(os.path.expanduser('~/pools/cats/pool.json')): FLICKR_API_KEY = os.environ['FLICKR_API_KEY'] pm.set_options(flickr_api_key=FLICKR_API_KEY)
4b545d2e72080537672bb4ebb990708cad678344
entrypoint.py
entrypoint.py
#!/usr/bin/python3 # # Define containerized environment for running Diosix on Qemu # # On Google Cloud Run: Creates HTTP server on port 8080 # or whatever was specified using the PORT system variable. # Outputs via the HTTP port. This requires K_SERVICE to be set. # # On all other environments: Log to stdout # # syntax...
#!/usr/bin/python3 # # Define containerized environment for running Diosix on Qemu # # On Google Cloud Run: Creates HTTP server on port 8080 # or whatever was specified using the PORT system variable. # Outputs via the HTTP port. This requires K_SERVICE to be set. # # On all other environments: Log to stdout # # syntax...
Debug Google Cloud Run support
Debug Google Cloud Run support
Python
mit
diodesign/diosix
--- +++ @@ -23,9 +23,7 @@ if __name__ == "__main__": if not os.environ.get('K_SERVICE'): print('Running locally') - stream = os.popen('. $HOME/.cargo/env && cd /build/diosix && {}'.format(' '.join(sys.argv[1:]))) - output = stream.read() - output + os.system('. $HOME/.cargo/...
4a25286506cc8e50b5e1225b12015f4d0da3ccfc
smbackend/urls.py
smbackend/urls.py
from django.conf.urls import patterns, include, url from services.api import all_views as services_views from services.api import AccessibilityRuleView from observations.api import views as observations_views from rest_framework import routers from observations.views import obtain_auth_token from munigeo.api import all...
from django.conf.urls import patterns, include, url from services.api import all_views as services_views from services.api import AccessibilityRuleView from observations.api import views as observations_views from rest_framework import routers from observations.views import obtain_auth_token from munigeo.api import all...
Put api token auth endpoint under v1.
Put api token auth endpoint under v1.
Python
agpl-3.0
City-of-Helsinki/smbackend,City-of-Helsinki/smbackend
--- +++ @@ -33,5 +33,5 @@ # url(r'^admin/', include(admin.site.urls)), url(r'^open311/', 'services.views.post_service_request', name='services'), url(r'^v1/', include(router.urls)), - url(r'^api-token-auth/', obtain_auth_token) + url(r'^v1/api-token-auth/', obtain_auth_token) )
7d69bcc6474d954b311251bf077750e0418170cb
button.py
button.py
import RPi.GPIO as GPIO import time import os from optparse import OptionParser # Parse input arguments parser = OptionParser() parser.add_option("-t", "--testGPIO", action="store_true", help="Test GPIO connection, does not call the JS script.") # The option --pin sets the Input Pin for your Button # It default to G...
import RPi.GPIO as GPIO import time import os from optparse import OptionParser # Parse input arguments parser = OptionParser() parser.add_option("-t", "--testGPIO", action="store_true", help="Test GPIO connection, does not call the JS script.") # The option --pin sets the Input Pin for your Button # It default to G...
Fix typo and execute JS script found in local folder.
Fix typo and execute JS script found in local folder.
Python
mit
henne-/guest-password-printer,henne-/guest-password-printer
--- +++ @@ -29,7 +29,7 @@ #waits for Pin Input and then exectures the script below if (GPIO.input(buttonPin)): if (testingGPIO): - print "PIN " + buttonPing + " works correctly." + print "PIN " + buttonPin + " works correctly." continue #the script that will be executed (as root) - o...
6c095c0e14c084666b9417b4bd269f396804bfab
src/ensign/_interfaces.py
src/ensign/_interfaces.py
# pylint: skip-file from zope.interface import Attribute, Interface class IFlag(Interface): """ Flag Interface. Any kind of flag must implement this interface. """ TYPE = Attribute("""Flag type""") store = Attribute("""Flag storage backend""") name = Attribute("""Flag name""") value...
# pylint: skip-file from zope.interface import Attribute, Interface class IFlag(Interface): """ Flag Interface. Any kind of flag must implement this interface. """ TYPE = Attribute("""Flag type""") store = Attribute("""Flag storage backend""") name = Attribute("""Flag name""") value...
Update interface with the latest changes in functionality.
Update interface with the latest changes in functionality.
Python
isc
bolsote/py-cd-talk,bolsote/py-cd-talk
--- +++ @@ -21,6 +21,11 @@ """ Create a new flag with the given name and, optionally, extra data, persisted in the given store. + """ + + def all(store): + """ + Retrieve all flags in the store. """ def _check(): @@ -53,3 +58,6 @@ def info(name...
f535228e38f33263289f28d46e910ccb0a98a381
tournamentcontrol/competition/constants.py
tournamentcontrol/competition/constants.py
import pytz from dateutil.rrule import DAILY, WEEKLY from django.utils.translation import ugettext_lazy as _ GENDER_CHOICES = ( ('M', _('Male')), ('F', _('Female')), ('X', _('Unspecified')), ) SEASON_MODE_CHOICES = ( (WEEKLY, _("Season")), (DAILY, _("Tournament")), ) WIN_LOSE = { 'W': _("Winn...
import pytz from dateutil.rrule import DAILY, WEEKLY from django.utils.translation import ugettext_lazy as _ GENDER_CHOICES = ( ('M', _('Male')), ('F', _('Female')), ('X', _('Unspecified')), ) SEASON_MODE_CHOICES = ( (WEEKLY, _("Season")), (DAILY, _("Tournament")), ) WIN_LOSE = { 'W': _("Winn...
Use list comprehension to evaluate PYTZ_TIME_ZONE_CHOICES
Use list comprehension to evaluate PYTZ_TIME_ZONE_CHOICES During Python 3 conversion this must have been missed.
Python
bsd-3-clause
goodtune/vitriolic,goodtune/vitriolic,goodtune/vitriolic,goodtune/vitriolic
--- +++ @@ -38,5 +38,5 @@ for iso, name in pytz.country_names.items(): values = sorted(pytz.country_timezones.get(iso, [])) names = [s.rsplit("/", 1)[1].replace("_", " ") for s in values] - PYTZ_TIME_ZONE_CHOICES.append((name, zip(values, names))) + PYTZ_TIME_ZONE_CHOICES.append((name, [each for each...
c0787c468e1b71d7e9db93b5f5990ae9bb506d82
pystruct/datasets/dataset_loaders.py
pystruct/datasets/dataset_loaders.py
import cPickle from os.path import dirname from os.path import join import numpy as np def load_letters(): """Load the OCR letters dataset. This is a chain classification task. Each example consists of a word, segmented into letters. The first letter of each word is ommited from the data, as it ...
import cPickle from os.path import dirname from os.path import join import numpy as np def load_letters(): """Load the OCR letters dataset. This is a chain classification task. Each example consists of a word, segmented into letters. The first letter of each word is ommited from the data, as it ...
FIX other two sample data load for Windows
FIX other two sample data load for Windows
Python
bsd-2-clause
massmutual/pystruct,pystruct/pystruct,amueller/pystruct,d-mittal/pystruct,wattlebird/pystruct,pystruct/pystruct,d-mittal/pystruct,wattlebird/pystruct,massmutual/pystruct,amueller/pystruct
--- +++ @@ -24,11 +24,11 @@ def load_scene(): module_path = dirname(__file__) - data_file = open(join(module_path, 'scene.pickle')) + data_file = open(join(module_path, 'scene.pickle'),'rb') return cPickle.load(data_file) def load_snakes(): module_path = dirname(__file__) - data_file =...
f0ef4f5e269d7f2d7fd347e8f458c1c9ce1ffb34
mqueue/hooks/redis/__init__.py
mqueue/hooks/redis/__init__.py
import redis import time from mqueue.conf import DOMAIN from mqueue.hooks.redis import serializer from mqueue.conf import HOOKS conf = HOOKS["redis"] R = redis.StrictRedis(host=conf["host"], port=conf["port"], db=conf["db"]) event_num = int(time.time()) def save(event, conf): name = DOMAIN+"_event"+str(event_num...
import redis import time from mqueue.conf import DOMAIN from mqueue.hooks.redis import serializer from mqueue.conf import HOOKS conf = HOOKS["redis"] R = redis.StrictRedis(host=conf["host"], port=conf["port"], db=conf["db"]) event_num = int(time.time()) def save(event, conf): global event_num global R na...
Fix bug in redis hook
Fix bug in redis hook
Python
mit
synw/django-mqueue,synw/django-mqueue,synw/django-mqueue
--- +++ @@ -6,10 +6,14 @@ conf = HOOKS["redis"] R = redis.StrictRedis(host=conf["host"], port=conf["port"], db=conf["db"]) -event_num = int(time.time()) +event_num = int(time.time()) + def save(event, conf): - name = DOMAIN+"_event"+str(event_num) + global event_num + global R + name = DOMAIN + "_...
d5167d8ba1b3107e5ce121eca76b5496bf8d6448
qipipe/registration/ants/template.py
qipipe/registration/ants/template.py
import os import logging import envoy from .ants_error import ANTSError def create_template(metric, files): """ Builds a template from the given image files. :param metric: the similarity metric :param files: the image files :return: the template file name """ CMD = "buildtemplateparal...
import os import logging import envoy from .ants_error import ANTSError def create_template(metric, files): """ Builds a template from the given image files. :param metric: the similarity metric :param files: the image files :return: the template file name """ CMD = "buildtemplateparal...
Truncate a long log message.
Truncate a long log message.
Python
bsd-2-clause
ohsu-qin/qipipe
--- +++ @@ -21,7 +21,7 @@ return tmpl cmd = CMD.format(metric=metric.name, output=PREFIX, files=' '.join(files)) logging.info("Building the %s registration template with the following command:" % tmpl) - logging.info(cmd) + logging.info(cmd[:80]) r = envoy.run(cmd) if r.status_code:...
7ee29cfee740d6096fca8379253073077890a54c
examples/util/wordcount_redis.py
examples/util/wordcount_redis.py
from disco.schemes.scheme_redis import redis_output_stream from disco.worker.task_io import task_output_stream from disco.core import Job, result_iterator class WordCount(Job): reduce_output_stream = (task_output_stream, redis_output_stream) @staticmethod def map(line, params): k, v = line ...
""" Usage: python wordcount_redis.py redis://redis_server:6379:0 redis://redis_server:6379:1 The input is read from db 0 and the output is written to db 1. The inputs should be of the form (key, list_of_values) (they are read from the server with the lrange command. See the redis documentation for more info). The ou...
Add more info to the redis example.
examples: Add more info to the redis example.
Python
bsd-3-clause
seabirdzh/disco,discoproject/disco,oldmantaiter/disco,pooya/disco,oldmantaiter/disco,simudream/disco,pombredanne/disco,seabirdzh/disco,discoproject/disco,simudream/disco,discoproject/disco,ErikDubbelboer/disco,mozilla/disco,mozilla/disco,pombredanne/disco,ErikDubbelboer/disco,mwilliams3/disco,pooya/disco,mwilliams3/dis...
--- +++ @@ -1,3 +1,15 @@ +""" +Usage: +python wordcount_redis.py redis://redis_server:6379:0 redis://redis_server:6379:1 + +The input is read from db 0 and the output is written to db 1. The inputs +should be of the form (key, list_of_values) (they are read from the server with the +lrange command. See the redis do...
1c939a99e377ff1dfe037c47dd99f635d3cb0a1f
polling_stations/apps/data_collection/management/commands/import_cotswold.py
polling_stations/apps/data_collection/management/commands/import_cotswold.py
from data_collection.management.commands import BaseXpressWebLookupCsvImporter class Command(BaseXpressWebLookupCsvImporter): council_id = 'E07000079' addresses_name = 'CotswoldPropertyPostCodePollingStationWebLookup-2017-03-27.TSV' stations_name = 'CotswoldPropertyPostCodePollingStationWebLookup-2017-03-2...
from data_collection.management.commands import BaseXpressWebLookupCsvImporter class Command(BaseXpressWebLookupCsvImporter): council_id = 'E07000079' addresses_name = 'CotswoldPropertyPostCodePollingStationWebLookup-2017-03-27.TSV' stations_name = 'CotswoldPropertyPostCodePollingStationWebLookup-2017-03-2...
Remove Cotswold election id (update expected)
Remove Cotswold election id (update expected)
Python
bsd-3-clause
chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations
--- +++ @@ -6,6 +6,6 @@ stations_name = 'CotswoldPropertyPostCodePollingStationWebLookup-2017-03-27.TSV' elections = [ 'local.gloucestershire.2017-05-04', - 'parl.2017-06-08' + #'parl.2017-06-08' ] csv_delimiter = '\t'
ad3554ae58f65a295ac94c131d8193e0b2e7e6f8
termsuggester/word2vec.py
termsuggester/word2vec.py
from gensim.models import Word2Vec import logging logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) logger.addHandler(logging.StreamHandler()) class Word2VecSuggester(): def __init__(self, modelfile): try: self.model = Word2Vec.load(modelfile) logger.info('Load Wo...
from gensim.models import Word2Vec import logging logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) logger.addHandler(logging.StreamHandler()) class Word2VecSuggester(): def __init__(self, modelfile): try: self.model = Word2Vec.load(modelfile) logger.info('Load Wo...
Add reminder to look at the number of terms returned
Add reminder to look at the number of terms returned
Python
apache-2.0
nlesc-sherlock/concept-search,nlesc-sherlock/concept-search,nlesc-sherlock/concept-search,nlesc-sherlock/concept-search
--- +++ @@ -17,9 +17,10 @@ self.model = None def suggest_terms(self, query_word): + # TODO: make the number of terms returned a parameter of the function if self.model is not None: results = self.model.most_similar(positive=[query_word], - ...
73a375a3adb140c270444e886b3df842e0b28a86
numpy/core/tests/test_print.py
numpy/core/tests/test_print.py
import numpy as np from numpy.testing import * def check_float_type(tp): for x in [0, 1,-1, 1e10, 1e20] : assert_equal(str(tp(x)), str(float(x))) def test_float_types(): """ Check formatting. This is only for the str function, and only for simple types. The precision of np.float and n...
import numpy as np from numpy.testing import * def check_float_type(tp): for x in [0, 1,-1, 1e10, 1e20] : assert_equal(str(tp(x)), str(float(x))) def test_float_types(): """ Check formatting. This is only for the str function, and only for simple types. The precision of np.float and n...
Fix formatting tests: cfloat and cdouble as well as np.float and np.double are the same; make sure we test 4 bytes float.
Fix formatting tests: cfloat and cdouble as well as np.float and np.double are the same; make sure we test 4 bytes float.
Python
bsd-3-clause
chiffa/numpy,gfyoung/numpy,ekalosak/numpy,hainm/numpy,sigma-random/numpy,GrimDerp/numpy,sonnyhu/numpy,embray/numpy,GaZ3ll3/numpy,nbeaver/numpy,dimasad/numpy,gmcastil/numpy,musically-ut/numpy,kirillzhuravlev/numpy,simongibbons/numpy,ContinuumIO/numpy,simongibbons/numpy,mindw/numpy,ogrisel/numpy,rgommers/numpy,pelson/num...
--- +++ @@ -13,7 +13,7 @@ python float precision. """ - for t in [np.float, np.double, np.longdouble] : + for t in [np.float32, np.double, np.longdouble] : yield check_float_type, t def check_complex_type(tp): @@ -30,7 +30,7 @@ python float precision. """ - for t i...
9c7660fd63bc1c48a0533e867c7d18faf9d90c03
main.py
main.py
#!/usr/bin/env python from morss import main if __name__ == '__main__': main()
#!/usr/bin/env python from morss import main, cgi_wrapper as application if __name__ == '__main__': main()
Make use thru uwsgi easier
Make use thru uwsgi easier Import the main cgi_wrapper as "application" in main.py
Python
agpl-3.0
pictuga/morss,pictuga/morss,pictuga/morss
--- +++ @@ -1,5 +1,5 @@ #!/usr/bin/env python -from morss import main +from morss import main, cgi_wrapper as application if __name__ == '__main__': main()
3cff942af436f16aab2078e6aeedd3073f4a5522
flask_roots/extension.py
flask_roots/extension.py
from __future__ import absolute_import import os from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.images import Images # from flask.ext.mail import Mail from flask.ext.login import LoginManager from flask.ext.acl import AuthManager class Roots(object): def __init__(self, app): self.extensions...
from __future__ import absolute_import import os from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.images import Images from flask.ext.mail import Mail from flask.ext.login import LoginManager from flask.ext.acl import AuthManager class Roots(object): def __init__(self, app): self.extensions =...
Add Flask-Mail, and null user loader
Add Flask-Mail, and null user loader
Python
bsd-3-clause
mikeboers/Flask-Roots,mikeboers/Flask-Roots
--- +++ @@ -4,7 +4,7 @@ from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.images import Images -# from flask.ext.mail import Mail +from flask.ext.mail import Mail from flask.ext.login import LoginManager from flask.ext.acl import AuthManager @@ -32,7 +32,9 @@ from .session import setup_sessi...
054dc32d30ca9175a6c8b40af52491b8e3a98978
heufybot/modules/util/webutils.py
heufybot/modules/util/webutils.py
from twisted.plugin import IPlugin from heufybot.moduleinterface import BotModule, IBotModule from heufybot.utils.logutils import logExceptionTrace from zope.interface import implements import re, requests class WebUtils(BotModule): implements(IPlugin, IBotModule) name = "WebUtils" canDisable = False ...
from twisted.plugin import IPlugin from twisted.python import log from heufybot.moduleinterface import BotModule, IBotModule from heufybot.utils.logutils import logExceptionTrace from zope.interface import implements import logging, re, requests class WebUtils(BotModule): implements(IPlugin, IBotModule) name...
Debug the URL that's being requested
Debug the URL that's being requested
Python
mit
Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot
--- +++ @@ -1,8 +1,9 @@ from twisted.plugin import IPlugin +from twisted.python import log from heufybot.moduleinterface import BotModule, IBotModule from heufybot.utils.logutils import logExceptionTrace from zope.interface import implements -import re, requests +import logging, re, requests class WebUtils(B...
1c9f12f808ffa0f1d4f16ea9f35021a83126243f
get-solr-download-url.py
get-solr-download-url.py
#!/usr/bin/env python # encoding: utf-8 from __future__ import absolute_import, print_function, unicode_literals import sys import requests # Try to import urljoin from the Python 3 reorganized stdlib first: try: from urlparse.parse import urljoin except ImportError: from urlparse import urljoin if len(sy...
#!/usr/bin/env python # encoding: utf-8 from __future__ import absolute_import, print_function, unicode_literals import sys import requests # Try to import urljoin from the Python 3 reorganized stdlib first: try: from urllib.parse import urljoin except ImportError: from urlparse import urljoin if len(sys....
Update test Solr download script to work with default Python 3
Update test Solr download script to work with default Python 3
Python
bsd-3-clause
upayavira/pysolr,mylanium/pysolr,mbeacom/pysolr,shasha79/pysolr,django-searchstack/skisolr,toastdriven/pysolr,CANTUS-Project/pysolr-tornado,toastdriven/pysolr,mylanium/pysolr,mbeacom/pysolr,upayavira/pysolr,django-haystack/pysolr,swistakm/pysolr,CANTUS-Project/pysolr-tornado,swistakm/pysolr,django-haystack/pysolr,rokak...
--- +++ @@ -9,7 +9,7 @@ # Try to import urljoin from the Python 3 reorganized stdlib first: try: - from urlparse.parse import urljoin + from urllib.parse import urljoin except ImportError: from urlparse import urljoin
0c0a1d0ec480c7df9dd8821d40af7791e46db453
tests/lib/test_finance.py
tests/lib/test_finance.py
# Copyright (c) 2013 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. from tests import OldPythonTestCase __author__ = 'felix_kluge' from pycroft.lib.finance import create_semester...
# Copyright (c) 2013 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. from tests import OldPythonTestCase __author__ = 'felix_kluge' from pycroft.lib.finance import create_semester...
Fix for wrong test: create_semester_accounts
Fix for wrong test: create_semester_accounts refs #448
Python
apache-2.0
agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft
--- +++ @@ -5,13 +5,13 @@ __author__ = 'felix_kluge' -from pycroft.lib.finance import create_semester -from pycroft.lib.config import get,config -from pycroft.model.finance import FinanceAccount +from pycroft.lib.finance import create_semester, import_csv +from pycroft.lib.config import get, config +from pycroft...
169a8612eb06410a5ae7e110227f7bea010d2ba9
tests/test_ghostscript.py
tests/test_ghostscript.py
import subprocess import unittest class GhostscriptTest(unittest.TestCase): def test_installed(self): process = subprocess.Popen( ['gs', '--version'], stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) stdout, stderr = process.com...
import subprocess import unittest class GhostscriptTest(unittest.TestCase): def test_installed(self): process = subprocess.Popen( ['gs', '--version'], stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) stdout, stderr = process.com...
Make stdout and stderr into strings.
Make stdout and stderr into strings.
Python
mit
YPlan/treepoem
--- +++ @@ -14,5 +14,5 @@ stdout, stderr = process.communicate() self.assertEqual(process.returncode, 0) - self.assertEqual(stderr, "") - self.assertRegexpMatches(stdout, r'9\.\d\d') + self.assertEqual(str(stderr), "") + self.assertRegexpMatches(str(stdout), r'9\.\d\d')
ba37080645153d66a8ae1c8df10312806999f8ec
tests/test_observation.py
tests/test_observation.py
import unittest from datetime import datetime from dateutil.tz import tzutc from fmi import FMI class TestObservations(unittest.TestCase): def test_lappeenranta(self): now = datetime.now(tz=tzutc()) f = FMI(place='Lappeenranta') for point in f.observations(): assert point.time...
import unittest from datetime import datetime from dateutil.tz import tzutc from fmi import FMI class TestObservations(unittest.TestCase): def test_lappeenranta(self): now = datetime.now(tz=tzutc()) f = FMI(place='Lappeenranta') for point in f.observations(): assert point.time...
Add use of fmisid to tests.
Add use of fmisid to tests.
Python
mit
kipe/fmi
--- +++ @@ -12,3 +12,7 @@ for point in f.observations(): assert point.time < now assert isinstance(point.temperature, float) + + for point in f.observations(fmisid=101237): + assert point.time < now + assert isinstance(point.temperature, float)
9369f72c4fe9a544e24f10a1db976589dc013424
plinth/modules/sso/__init__.py
plinth/modules/sso/__init__.py
# # This file is part of Plinth. # # 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 option) any later version. # # This program is distribute...
# # This file is part of Plinth. # # 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 option) any later version. # # This program is distribute...
Add dependency on apache module
sso: Add dependency on apache module This ensures that Apache is fully setup before setting up mod-auth-pubtkt. Signed-off-by: Sunil Mohan Adapa <3eaa7035e78e5eca849aa1e8ea4aaf97b4588601@medhas.org> Reviewed-by: James Valleroy <46e3063862880873c8617774e45d63de6172aab0@mailbox.org>
Python
agpl-3.0
kkampardi/Plinth,harry-7/Plinth,kkampardi/Plinth,harry-7/Plinth,harry-7/Plinth,kkampardi/Plinth,kkampardi/Plinth,harry-7/Plinth,kkampardi/Plinth,harry-7/Plinth
--- +++ @@ -25,7 +25,7 @@ is_essential = True -depends = ['security'] +depends = ['security', 'apache'] name = _('Single Sign On')
ee98b5a5c6b82671738bc60e68ea87d838c5400f
migrations/0020_change_ds_name_to_non_uniqe.py
migrations/0020_change_ds_name_to_non_uniqe.py
from redash.models import db import peewee from playhouse.migrate import PostgresqlMigrator, migrate if __name__ == '__main__': migrator = PostgresqlMigrator(db.database) with db.database.transaction(): # Change the uniqueness constraint on data source name to be (org, name): success = False ...
from redash.models import db import peewee from playhouse.migrate import PostgresqlMigrator, migrate if __name__ == '__main__': migrator = PostgresqlMigrator(db.database) with db.database.transaction(): # Change the uniqueness constraint on data source name to be (org, name): # In some cases i...
Improve the migration for unique data source name
Improve the migration for unique data source name
Python
bsd-2-clause
ninneko/redash,EverlyWell/redash,hudl/redash,useabode/redash,pubnative/redash,chriszs/redash,akariv/redash,alexanderlz/redash,easytaxibr/redash,pubnative/redash,amino-data/redash,rockwotj/redash,ninneko/redash,guaguadev/redash,rockwotj/redash,denisov-vlad/redash,imsally/redash,ninneko/redash,useabode/redash,crowdworks/...
--- +++ @@ -7,26 +7,13 @@ with db.database.transaction(): # Change the uniqueness constraint on data source name to be (org, name): - success = False - for index_name in ['unique_name', 'data_sources_name']: - try: - print "Trying to remove data source name uniq...
ca15e6523bd34e551528dce6c6ee3dcb70cf7806
pyinfra/modules/util/files.py
pyinfra/modules/util/files.py
# pyinfra # File: pyinfra/modules/util/files.py # Desc: common functions for handling the filesystem from types import NoneType def ensure_mode_int(mode): # Already an int (/None)? if isinstance(mode, (int, NoneType)): return mode try: # Try making an int ('700' -> 700) return in...
# pyinfra # File: pyinfra/modules/util/files.py # Desc: common functions for handling the filesystem from types import NoneType def ensure_mode_int(mode): # Already an int (/None)? if isinstance(mode, (int, NoneType)): return mode try: # Try making an int ('700' -> 700) return in...
Use sed inline (unsure why mv was used originally).
Use sed inline (unsure why mv was used originally).
Python
mit
Fizzadar/pyinfra,Fizzadar/pyinfra
--- +++ @@ -27,10 +27,8 @@ line = line.replace('/', '\/') replace = replace.replace('/', '\/') - temp_filename = state.get_temp_filename() - - return 'sed "s/{0}/{1}/{2}" {3} > {4} && mv {4} {3}'.format( - line, replace, flags, filename, temp_filename + return 'sed -i "s/{0}/{1}/{2}" {3}'....
5a4d9255c59be0d5dda8272e0e7ced71822f4d40
prime-factors/prime_factors.py
prime-factors/prime_factors.py
import sieve def prime_factors(n): primes = sieve.sieve(n) factors = [] for p in primes: while n % p == 0: factors += [p] n //= p return factors
def prime_factors(n): factors = [] factor = 2 while n != 1: while n % factor == 0: factors += [factor] n //= factor factor += 1 return factors
Fix memory issues by just trying every number
Fix memory issues by just trying every number
Python
agpl-3.0
CubicComet/exercism-python-solutions
--- +++ @@ -1,11 +1,9 @@ -import sieve - - def prime_factors(n): - primes = sieve.sieve(n) factors = [] - for p in primes: - while n % p == 0: - factors += [p] - n //= p + factor = 2 + while n != 1: + while n % factor == 0: + factors += [factor] + ...
8ea3350c6944946b60732308c912dc240952237c
project/settings_production.py
project/settings_production.py
from .settings import * # Update SITE infos to use the common port 80 to publish the webapp SITE_FIXED = { 'name': "Recalbox Manager", 'ip': None, # If 'None' find the ip automatically. Use a string to define another ip/hostname 'port': None, # If 'None' no port is added to hostname, so the server have to ...
from .settings import * # Update SITE infos to use the common port 80 to publish the webapp SITE_FIXED = { 'name': "Recalbox Manager", 'ip': None, # If 'None' find the ip automatically. Use a string to define another ip/hostname 'port': None, # If 'None' no port is added to hostname, so the server have to ...
Revert "Set the right recalbox.log path"
Revert "Set the right recalbox.log path"
Python
mit
recalbox/recalbox-manager,recalbox/recalbox-manager,recalbox/recalbox-manager,sveetch/recalbox-manager,sveetch/recalbox-manager,sveetch/recalbox-manager,sveetch/recalbox-manager,recalbox/recalbox-manager,sveetch/recalbox-manager,recalbox/recalbox-manager
--- +++ @@ -8,7 +8,7 @@ } # Production path to the Recalbox logs file -RECALBOX_LOGFILE_PATH = "/recalbox/share/system/logs" +RECALBOX_LOGFILE_PATH = "/root/recalbox.log" # Use packaged assets ASSETS_PACKAGED = True
fd4688cc899b08253cc50b345bb7e836081783d8
bayespy/inference/vmp/nodes/__init__.py
bayespy/inference/vmp/nodes/__init__.py
###################################################################### # Copyright (C) 2011,2012 Jaakko Luttinen # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. ###################################################################### ###############...
###################################################################### # Copyright (C) 2011,2012 Jaakko Luttinen # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. ###################################################################### ###############...
Add Beta and Binomial to automatically imported nodes
ENH: Add Beta and Binomial to automatically imported nodes
Python
mit
jluttine/bayespy,SalemAmeen/bayespy,fivejjs/bayespy,bayespy/bayespy
--- +++ @@ -25,14 +25,23 @@ from . import * +from .binomial import Binomial +from .categorical import Categorical + +from .beta import Beta +from .dirichlet import Dirichlet + from .gaussian import Gaussian, GaussianARD from .wishart import Wishart from .gamma import Gamma -from .dirichlet import Dirichlet -f...
ed21e865f346b700c48458f22e3d3f1841f63451
api/swd6/api/app.py
api/swd6/api/app.py
import flask import flask_cors from sqlalchemy_jsonapi import flaskext as flask_jsonapi import logging from swd6.config import CONF from swd6.db.models import db logging.basicConfig(level=logging.DEBUG) app = flask.Flask(__name__) app.config['DEBUG'] = True app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True app.con...
import flask import flask_cors from sqlalchemy_jsonapi import flaskext as flask_jsonapi import logging from swd6.config import CONF from swd6.db.models import db logging.basicConfig(level=logging.DEBUG) app = flask.Flask(__name__) app.config['DEBUG'] = True app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True app.con...
Fix JSON encoder to work with Decimal fields
Fix JSON encoder to work with Decimal fields Need to get a patch upstream, but this is a suitable temporary workaround.
Python
apache-2.0
jimbobhickville/swd6,jimbobhickville/swd6,jimbobhickville/swd6
--- +++ @@ -22,4 +22,31 @@ db.init_app(app) +import json +import uuid +import datetime +import decimal + +class JSONAPIEncoder(json.JSONEncoder): + """ JSONEncoder Implementation that allows for UUID and datetime """ + + def default(self, value): + """ + Handle UUID, datetime, decimal, and ca...
e2330caffae04bc31376a2e0f66f0e86ebf92532
kNearestNeighbors/howItWorksKNearestNeighbors.py
kNearestNeighbors/howItWorksKNearestNeighbors.py
# -*- coding: utf-8 -*- """K Nearest Neighbors classification for machine learning. This file demonstrate knowledge of K Nearest Neighbors classification. By building the algorithm from scratch. The idea of K Nearest Neighbors classification is to best divide and separate the data based on clustering the data and clas...
Add my own K-nearest-neighbor algorithm
Add my own K-nearest-neighbor algorithm
Python
mit
a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms
--- +++ @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +"""K Nearest Neighbors classification for machine learning. + +This file demonstrate knowledge of K Nearest Neighbors classification. By +building the algorithm from scratch. +The idea of K Nearest Neighbors classification is to best divide and separate +the data bas...
06d0287a8fef0679b281296e6ed76e0b6c803acb
sorl/thumbnail/management/commands/thumbnail.py
sorl/thumbnail/management/commands/thumbnail.py
from django.core.management.base import BaseCommand, CommandError from sorl.thumbnail.conf import settings from sorl.thumbnail import default class Command(BaseCommand): help = ( u'Handles thumbnails and key value store' ) args = '[cleanup, clear]' option_list = BaseCommand.option_list de...
import sys from django.core.management.base import BaseCommand, CommandError from sorl.thumbnail import default class Command(BaseCommand): help = ( u'Handles thumbnails and key value store' ) args = '[cleanup, clear]' option_list = BaseCommand.option_list def handle(self, *labels, **opti...
Improve management command to clear or clean kvstore
Improve management command to clear or clean kvstore
Python
bsd-3-clause
mariocesar/sorl-thumbnail,perdona/sorl-thumbnail,fdgogogo/sorl-thumbnail,Knotis/sorl-thumbnail,jcupitt/sorl-thumbnail,einvalentin/sorl-thumbnail,fladi/sorl-thumbnail,lampslave/sorl-thumbnail,seedinvest/sorl-thumbnail,guilouro/sorl-thumbnail,TriplePoint-Software/sorl-thumbnail,jazzband/sorl-thumbnail,jcupitt/sorl-thumbn...
--- +++ @@ -1,5 +1,5 @@ +import sys from django.core.management.base import BaseCommand, CommandError -from sorl.thumbnail.conf import settings from sorl.thumbnail import default @@ -12,6 +12,11 @@ def handle(self, *labels, **options): verbosity = int(options.get('verbosity')) + + if not ...
5c97b9911a2dafde5fd1e4c40cda4e84974eb855
assembla/lib.py
assembla/lib.py
from functools import wraps class AssemblaObject(object): """ Proxies getitem calls (eg: `instance['id']`) to a dictionary `instance.data['id']`. """ def __init__(self, data): self.data = data def __getitem__(self, key): return self.data[key] def keys(self): return se...
from functools import wraps class AssemblaObject(object): """ Proxies getitem calls (eg: `instance['id']`) to a dictionary `instance.data['id']`. """ def __init__(self, data): self.data = data def __getitem__(self, key): return self.data[key] def __setitem__(self, key, value)...
Allow keys to be set (in anticipation of write commands). Better object __repr__() for spaces and tickets.
Allow keys to be set (in anticipation of write commands). Better object __repr__() for spaces and tickets.
Python
mit
markfinger/assembla
--- +++ @@ -11,6 +11,9 @@ def __getitem__(self, key): return self.data[key] + def __setitem__(self, key, value): + self.data[key] = value + def keys(self): return self.data.keys() @@ -19,6 +22,15 @@ def get(self, *args, **kwargs): return self.data.get(*args, *...
cee2368dac250ef9655a3df9af3188b8abd095dc
spec/puzzle/examples/gph/a_basic_puzzle_spec.py
spec/puzzle/examples/gph/a_basic_puzzle_spec.py
from data import warehouse from puzzle.examples.gph import a_basic_puzzle from puzzle.problems import number_problem from puzzle.puzzlepedia import prod_config from spec.mamba import * with description('a_basic_puzzle'): with before.all: warehouse.save() prod_config.init() self.subject = a_basic_puzzle.g...
from data import warehouse from puzzle.examples.gph import a_basic_puzzle from puzzle.problems import number_problem from puzzle.puzzlepedia import prod_config from spec.mamba import * with _description('a_basic_puzzle'): with before.all: warehouse.save() prod_config.init() self.subject = a_basic_puzzle....
Disable slow test. Not intended to run.
Disable slow test. Not intended to run.
Python
mit
PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge
--- +++ @@ -4,7 +4,7 @@ from puzzle.puzzlepedia import prod_config from spec.mamba import * -with description('a_basic_puzzle'): +with _description('a_basic_puzzle'): with before.all: warehouse.save() prod_config.init()
07f86c47c58d6266bd4b42c81521001aca072ff1
jsonconfigparser/test/__init__.py
jsonconfigparser/test/__init__.py
import unittest from jsonconfigparser import JSONConfigParser class JSONConfigTestCase(unittest.TestCase): def test_init(self): JSONConfigParser() def test_read_string(self): string = '[section]\n' + \ 'foo = "bar"\n' cf = JSONConfigParser() cf.read_string(s...
import unittest from jsonconfigparser import JSONConfigParser class JSONConfigTestCase(unittest.TestCase): def test_init(self): JSONConfigParser() def test_read_string(self): string = '[section]\n' + \ '# comment comment\n' + \ 'foo = "bar"\n' + \ ...
Add some more rubbish to example string
Add some more rubbish to example string
Python
bsd-3-clause
bwhmather/json-config-parser
--- +++ @@ -9,7 +9,12 @@ def test_read_string(self): string = '[section]\n' + \ - 'foo = "bar"\n' + '# comment comment\n' + \ + 'foo = "bar"\n' + \ + '\n' + \ + '[section2]\n' + \ + 'bar = "baz"\n' + ...
e0dac0a621cbeed615553e5c3544f9c49de96eb2
metadata/FrostNumberModel/hooks/pre-stage.py
metadata/FrostNumberModel/hooks/pre-stage.py
"""A hook for modifying parameter values read from the WMT client.""" import os import shutil from wmt.utils.hook import find_simulation_input_file from topoflow_utils.hook import assign_parameters file_list = [] def execute(env): """Perform pre-stage tasks for running a component. Parameters -------...
"""A hook for modifying parameter values read from the WMT client.""" import os import shutil from wmt.utils.hook import find_simulation_input_file, yaml_dump from topoflow_utils.hook import assign_parameters file_list = [] def execute(env): """Perform pre-stage tasks for running a component. Parameters ...
Subtract 1 from model end_year
Subtract 1 from model end_year This matches the behavior of the FrostNumberModel BMI.
Python
mit
csdms/wmt-metadata
--- +++ @@ -3,7 +3,7 @@ import os import shutil -from wmt.utils.hook import find_simulation_input_file +from wmt.utils.hook import find_simulation_input_file, yaml_dump from topoflow_utils.hook import assign_parameters @@ -19,10 +19,13 @@ A dict of component parameter values from WMT. """ - ...
9d29061f8520506d798ad75aa296be8dc838aaf7
resolwe/elastic/pagination.py
resolwe/elastic/pagination.py
""".. Ignore pydocstyle D400. ================== Elastic Paginators ================== Paginator classes used in Elastic app. .. autoclass:: resolwe.elastic.pagination.LimitOffsetPostPagination """ from __future__ import absolute_import, division, print_function, unicode_literals from rest_framework.pagination im...
""".. Ignore pydocstyle D400. ================== Elastic Paginators ================== Paginator classes used in Elastic app. .. autoclass:: resolwe.elastic.pagination.LimitOffsetPostPagination """ from __future__ import absolute_import, division, print_function, unicode_literals from rest_framework.pagination im...
Remove leftover print call in paginator
Remove leftover print call in paginator
Python
apache-2.0
genialis/resolwe,jberci/resolwe,genialis/resolwe,jberci/resolwe
--- +++ @@ -36,7 +36,6 @@ """Return limit parameter.""" if self.limit_query_param: try: - print(get_query_param(request, self.limit_query_param)) return _positive_int( get_query_param(request, self.limit_query_param), ...
61e4693988c5b89b4a82457181813e7a6e73403b
utils/text.py
utils/text.py
import codecs from django.core import exceptions from django.utils import text import translitcodec def slugify(model, field, value, validator): orig_slug = slug = text.slugify(codecs.encode(value, 'translit/long'))[:45] i = 0 while True: try: try: validator(slug) ...
import codecs from django.core import exceptions from django.utils import text import translitcodec def no_validator(arg): pass def slugify(model, field, value, validator=no_validator): orig_slug = slug = text.slugify(codecs.encode(value, 'translit/long'))[:45] i = 0 while True: try: ...
Fix slugify for use without validator
Fix slugify for use without validator
Python
agpl-3.0
stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten
--- +++ @@ -3,7 +3,10 @@ from django.utils import text import translitcodec -def slugify(model, field, value, validator): +def no_validator(arg): + pass + +def slugify(model, field, value, validator=no_validator): orig_slug = slug = text.slugify(codecs.encode(value, 'translit/long'))[:45] i = 0 ...
7c74017bc0d76ecb34e3fab44767290f51d98a09
humbug/test_settings.py
humbug/test_settings.py
from settings import * DATABASES["default"] = {"NAME": "zephyr/tests/zephyrdb.test", "ENGINE": "django.db.backends.sqlite3", "OPTIONS": { "timeout": 20, },} TORNADO_SERVER = 'http://localhost:9983'
from settings import * DATABASES["default"] = {"NAME": "zephyr/tests/zephyrdb.test", "ENGINE": "django.db.backends.sqlite3", "OPTIONS": { "timeout": 20, },} TORNADO_SERVER = 'http://localhost:9983' # Decrease the get_updates timeout to 1 second. # This allows CasperJS ...
Decrease get_updates timeout for client test suite
Decrease get_updates timeout for client test suite Fixes #475. (imported from commit d8f908c55f2e519541e5383a742edbf23183539c)
Python
apache-2.0
ryanbackman/zulip,christi3k/zulip,dnmfarrell/zulip,littledogboy/zulip,LAndreas/zulip,timabbott/zulip,hayderimran7/zulip,xuxiao/zulip,deer-hope/zulip,zhaoweigg/zulip,m1ssou/zulip,wdaher/zulip,punchagan/zulip,lfranchi/zulip,kokoar/zulip,voidException/zulip,brainwane/zulip,blaze225/zulip,akuseru/zulip,JPJPJPOPOP/zulip,hay...
--- +++ @@ -5,3 +5,7 @@ "OPTIONS": { "timeout": 20, },} TORNADO_SERVER = 'http://localhost:9983' + +# Decrease the get_updates timeout to 1 second. +# This allows CasperJS to proceed quickly to the next test step. +POLL_TIMEOUT = 1000
6486a888cbcec7285df92020f76e3f1c5fbba0e2
bluebottle/test/test_runner.py
bluebottle/test/test_runner.py
from django.test.runner import DiscoverRunner from django.db import connection from tenant_schemas.utils import get_tenant_model from bluebottle.test.utils import InitProjectDataMixin class MultiTenantRunner(DiscoverRunner, InitProjectDataMixin): def setup_databases(self, *args, **kwargs): result = supe...
from django.test.runner import DiscoverRunner from django.db import connection from django.core import management from tenant_schemas.utils import get_tenant_model from bluebottle.test.utils import InitProjectDataMixin class MultiTenantRunner(DiscoverRunner, InitProjectDataMixin): def setup_databases(self, *arg...
Load exchange rates in test setup. Make it posible to use --keepdb
Load exchange rates in test setup. Make it posible to use --keepdb
Python
bsd-3-clause
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
--- +++ @@ -1,5 +1,6 @@ from django.test.runner import DiscoverRunner from django.db import connection +from django.core import management from tenant_schemas.utils import get_tenant_model @@ -13,7 +14,7 @@ # Create secondary tenant connection.set_schema_to_public() tenant_domain = '...
873c5e8bf85a8be5a08852134967d29353ed3009
examples/simple.py
examples/simple.py
from lobster import cmssw from lobster.core import * storage = StorageConfiguration( output=[ "hdfs:///store/user/matze/test_shuffle_take29", "file:///hadoop/store/user/matze/test_shuffle_take29", "root://ndcms.crc.nd.edu//store/user/matze/test_shuffle_take29", "...
from lobster import cmssw from lobster.core import * storage = StorageConfiguration( output=[ "hdfs:///store/user/matze/test_shuffle_take29", "file:///hadoop/store/user/matze/test_shuffle_take29", "root://T3_US_NotreDame/store/user/matze/test_shuffle_take29", "sr...
Swap ndcms for generic T3 string.
Swap ndcms for generic T3 string.
Python
mit
matz-e/lobster,matz-e/lobster,matz-e/lobster
--- +++ @@ -5,7 +5,7 @@ output=[ "hdfs:///store/user/matze/test_shuffle_take29", "file:///hadoop/store/user/matze/test_shuffle_take29", - "root://ndcms.crc.nd.edu//store/user/matze/test_shuffle_take29", + "root://T3_US_NotreDame/store/user/matze/test_shuffle_ta...
587abec7ff5b90c03885e164d9b6b62a1fb41f76
grip/github_renderer.py
grip/github_renderer.py
from flask import abort, json import requests def render_content(text, gfm=False, context=None, username=None, password=None): """Renders the specified markup using the GitHub API.""" if gfm: url = 'https://api.github.com/markdown' data = {'text': text, 'mode': 'gfm'} ...
from flask import abort, json import requests def render_content(text, gfm=False, context=None, username=None, password=None): """Renders the specified markup using the GitHub API.""" if gfm: url = 'https://api.github.com/markdown' data = {'text': text, 'mode': 'gfm'} ...
Fix the headers sent by the GitHub renderer.
Fix the headers sent by the GitHub renderer.
Python
mit
ssundarraj/grip,mgoddard-pivotal/grip,mgoddard-pivotal/grip,joeyespo/grip,joeyespo/grip,jbarreras/grip,jbarreras/grip,ssundarraj/grip
--- +++ @@ -11,12 +11,13 @@ if context: data['context'] = context data = json.dumps(data) + headers = {'content-type': 'application/json'} else: url = 'https://api.github.com/markdown/raw' data = text - headers = {'content-type': 'text/plain'} + h...
71a84ecb772aa5560e35409219c11001ac168c6a
chmvh_website/contact/forms.py
chmvh_website/contact/forms.py
from django import forms from django.conf import settings from django.core import mail from django.template import loader class ContactForm(forms.Form): name = forms.CharField() email = forms.EmailField() message = forms.CharField(widget=forms.Textarea( attrs={'rows': 5})) template = loader.g...
import logging from smtplib import SMTPException from django import forms from django.conf import settings from django.core import mail from django.template import loader logger = logging.getLogger('chmvh_website.{0}'.format(__name__)) class ContactForm(forms.Form): name = forms.CharField() email = forms....
Add logging for contact form email.
Add logging for contact form email.
Python
mit
cdriehuys/chmvh-website,cdriehuys/chmvh-website,cdriehuys/chmvh-website
--- +++ @@ -1,7 +1,14 @@ +import logging + +from smtplib import SMTPException + from django import forms from django.conf import settings from django.core import mail from django.template import loader + + +logger = logging.getLogger('chmvh_website.{0}'.format(__name__)) class ContactForm(forms.Form): @@ -22...
d7cfdbd2bde0cc876db8c1bce020d8a1cf0ea77b
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, permissions class ResourceList(generics.ListCreateAPIView): queryset = Resource.objects.all() serializer_class = ResourceSerializer permission_classes = (permis...
from django.shortcuts import render from .models import Resource from .serializers import ResourceSerializer from rest_framework import generics, permissions import django_filters class ResourceFilter(django_filters.FilterSet): class Meta: model = Resource fields = ('name', 'featured', 'accessible...
Add search filtering for name and booleans in resource API.
Add search filtering for name and booleans in resource API.
Python
apache-2.0
uw-it-aca/mdot-rest,uw-it-aca/mdot-rest
--- +++ @@ -2,12 +2,20 @@ from .models import Resource from .serializers import ResourceSerializer from rest_framework import generics, permissions +import django_filters + + +class ResourceFilter(django_filters.FilterSet): + class Meta: + model = Resource + fields = ('name', 'featured', 'accessib...
3555b002aae386220bc02d662a9b188426afc08f
cmsplugin_facebook/cms_plugins.py
cmsplugin_facebook/cms_plugins.py
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cmsplugin_facebook import models class BasePlugin(CMSPluginBase): name = None def render(self, context, instance, placeholder): context.update({'instance': instance, 'name': self.name, ...
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cmsplugin_facebook import models class BasePlugin(CMSPluginBase): name = None def render(self, context, instance, placeholder): context.update({'instance': instance, 'name': self.name, ...
Create a specific group for the Facebook plugins - makes it a bit neater in the list of plugins.
Create a specific group for the Facebook plugins - makes it a bit neater in the list of plugins.
Python
bsd-3-clause
chrisglass/cmsplugin_facebook
--- +++ @@ -15,12 +15,14 @@ class FacebookLikeBoxPlugin(BasePlugin): model = models.FacebookLikeBox name = 'Facebook Like Box' + module = 'Facebook' render_template = 'cmsplugin_facebook/likebox.html' change_form_template = 'cmsplugin_facebook/likebox_change_form.html' class FacebookLikeBut...
c2798702a1f2b1dc40c10b481b9989f9a86c71b2
helpers/fix_fathatan.py
helpers/fix_fathatan.py
# -*- coding: utf-8 -*- import os import re import argparse def fix_fathatan(file_path): with open(file_path, 'r') as file: lines = file.readlines() new_lines = [] for line in lines: new_lines.append(re.sub(r'اً', 'ًا', line)) file_path = file_path.split(os.sep) file_path[-1] = 'fixed_' + file_pat...
# -*- coding: utf-8 -*- import os import re import argparse def fix_fathatan(file_path): with open(file_path, 'r') as file: lines = file.readlines() new_lines = [] for line in lines: new_lines.append(re.sub(r'اً', 'ًا', line)) file_path = file_path.split(os.sep) file_path[-1] = 'fixed_' + file_pat...
Fix indentation error in some helpers
Fix indentation error in some helpers
Python
mit
AliOsm/arabic-text-diacritization
--- +++ @@ -22,7 +22,7 @@ print(file_path) if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Changes after-Alif fathatan to before-Alit fathatan') + parser = argparse.ArgumentParser(description='Changes after-Alif fathatan to before-Alit fathatan') parser.add_argument('-in', '--file...
97a490db75f0a4976199365c3f654ba8cdb9a781
01_Built-in_Types/tuple.py
01_Built-in_Types/tuple.py
#!/usr/bin/env python import sys import pickle # Check argument if len(sys.argv) != 2: print("%s filename" % sys.argv[0]) raise SystemExit(1) # Write tuples file = open(sys.argv[1], "wb"); line = [] while True: print("Enter name, age, score (ex: zzz, 16, 90) or quit"); line = sys.stdin.readline() ...
#!/usr/bin/env python import sys import pickle # Test zip, and format in print names = ["xxx", "yyy", "zzz"] ages = [18, 19, 20] persons = zip(names, ages) for name, age in persons: print "{0}'s age is {1}".format(name, age) # Check argument if len(sys.argv) != 2: print("%s filename" % sys.argv[0]) rai...
Test zip, and print format
Test zip, and print format
Python
bsd-2-clause
zzz0072/Python_Exercises,zzz0072/Python_Exercises
--- +++ @@ -1,6 +1,15 @@ #!/usr/bin/env python import sys import pickle + +# Test zip, and format in print +names = ["xxx", "yyy", "zzz"] +ages = [18, 19, 20] + +persons = zip(names, ages) + +for name, age in persons: + print "{0}'s age is {1}".format(name, age) # Check argument if len(sys.argv) != 2:
e5963987e678926ad8cdde93e2551d0516a7686b
slave/skia_slave_scripts/android_bench_pictures.py
slave/skia_slave_scripts/android_bench_pictures.py
#!/usr/bin/env python # Copyright (c) 2012 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. """ Run the Skia bench_pictures executable. """ from android_render_pictures import AndroidRenderPictures from android_run_bench i...
#!/usr/bin/env python # Copyright (c) 2012 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. """ Run the Skia bench_pictures executable. """ from android_render_pictures import AndroidRenderPictures from android_run_bench i...
Increase timeout for bench_pictures on Android
Increase timeout for bench_pictures on Android Unreviewed. git-svn-id: 32fc27f4dcfb6c0385cd9719852b95fe6680452d@6290 2bbb7eff-a529-9590-31e7-b0007b416f81
Python
bsd-3-clause
Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Ti...
--- +++ @@ -12,6 +12,10 @@ import sys class AndroidBenchPictures(BenchPictures, AndroidRenderPictures): + def __init__(self, args, attempts=1, timeout=4800): + super(AndroidBenchPictures, self).__init__(args, attempts=attempts, + timeout=timeout) + def _DoBench...
b219823af7188f968d7c52c5273148c510bd7454
blaze/compute/air/frontend/ckernel_impls.py
blaze/compute/air/frontend/ckernel_impls.py
""" Lift ckernels to their appropriate rank so they always consume the full array arguments. """ from __future__ import absolute_import, division, print_function import datashape from pykit.ir import transform, Op #------------------------------------------------------------------------ # Run #----------------------...
""" Convert 'kernel' Op to 'ckernel'. """ from __future__ import absolute_import, division, print_function from pykit.ir import transform, Op def run(func, env): strategies = env['strategies'] transform(CKernelImplementations(strategies), func) class CKernelImplementations(object): """ For kernels...
Simplify the ckernel pass a bit more
Simplify the ckernel pass a bit more
Python
bsd-3-clause
ChinaQuants/blaze,jdmcbr/blaze,xlhtc007/blaze,aterrel/blaze,FrancescAlted/blaze,mrocklin/blaze,maxalbert/blaze,alexmojaki/blaze,dwillmer/blaze,cowlicks/blaze,LiaoPan/blaze,jcrist/blaze,maxalbert/blaze,mrocklin/blaze,cowlicks/blaze,ChinaQuants/blaze,aterrel/blaze,scls19fr/blaze,mwiebe/blaze,FrancescAlted/blaze,nkhuyu/bl...
--- +++ @@ -1,24 +1,16 @@ """ -Lift ckernels to their appropriate rank so they always consume the full array -arguments. +Convert 'kernel' Op to 'ckernel'. """ from __future__ import absolute_import, division, print_function -import datashape from pykit.ir import transform, Op -#----------------------------...
970978b5355259fe943d5efed1b8b4ce945fdfa7
weather.py
weather.py
#! /usr/bin/python2 from os.path import expanduser,isfile from sys import argv from urllib import urlopen location_path="~/.location" def location_from_homedir(): if isfile(expanduser(location_path)): with open(expanduser(location_path)) as f: return "&".join(f.read().split("\n")) else: ...
#! /usr/bin/python2 from os.path import expanduser,isfile import sys from urllib import urlopen location_path="~/.location" def location_from_homedir(): if isfile(expanduser(location_path)): with open(expanduser(location_path)) as f: return "&".join(f.read().split("\n")) else: pri...
Debug control flow and exit on errors
Debug control flow and exit on errors
Python
mit
robbystk/weather
--- +++ @@ -1,7 +1,7 @@ #! /usr/bin/python2 from os.path import expanduser,isfile -from sys import argv +import sys from urllib import urlopen location_path="~/.location" @@ -12,24 +12,25 @@ return "&".join(f.read().split("\n")) else: print("no location file at ", location_path) + ...
1caace2631f8e9c38cf0adfb1179a5260dcd3c33
tools/management/commands/output_all_uniprot.py
tools/management/commands/output_all_uniprot.py
from django.core.management.base import BaseCommand, CommandError from django.core.management import call_command from django.conf import settings from django.db import connection from django.db.models import Q from django.template.loader import render_to_string from protein.models import Protein from residue.models im...
from django.core.management.base import BaseCommand, CommandError from django.core.management import call_command from django.conf import settings from django.db import connection from django.db.models import Q from django.template.loader import render_to_string from protein.models import Protein from residue.models im...
Change output_all_unitprot to allow multi ids for some proteins.
Change output_all_unitprot to allow multi ids for some proteins.
Python
apache-2.0
cmunk/protwis,fosfataza/protwis,fosfataza/protwis,fosfataza/protwis,cmunk/protwis,protwis/protwis,cmunk/protwis,cmunk/protwis,fosfataza/protwis,protwis/protwis,protwis/protwis
--- +++ @@ -31,8 +31,9 @@ print('total:',len(ps)) mapping = {} for p in ps: - uniprot = p.web_links.get(web_resource__slug='uniprot') - mapping[p.entry_name] = uniprot.index + uniprot = p.web_links.filter(web_resource__slug='uniprot').values_list('index', fl...
1b06091101c119f30eb5eabb2d2638fab0e8f658
test_debug.py
test_debug.py
from bullsandcows import isdebugmode def test_isdebugmode(): assert isdebugmode() == 0, "program is in debug mode, this should not be commited"
from bullsandcows import isdebug def test_isdebug(): assert isdebug() == 0, "program is in debug mode, this should not be commited"
Test modified to work with renamed debug function
Test modified to work with renamed debug function
Python
mit
petrgabrlik/BullsAndCows
--- +++ @@ -1,4 +1,4 @@ -from bullsandcows import isdebugmode +from bullsandcows import isdebug -def test_isdebugmode(): - assert isdebugmode() == 0, "program is in debug mode, this should not be commited" +def test_isdebug(): + assert isdebug() == 0, "program is in debug mode, this should not be commited"
1305af162dd05591cc0e5328eb192843b63dabb1
kk/urls_v1.py
kk/urls_v1.py
from django.conf.urls import include, url from kk.views import ( HearingCommentViewSet, HearingImageViewSet, HearingViewSet, SectionCommentViewSet, SectionViewSet, UserDataViewSet ) from rest_framework_nested import routers router = routers.SimpleRouter() router.register(r'hearing', HearingViewSet) router.regi...
from django.conf.urls import include, url from kk.views import ( HearingCommentViewSet, HearingImageViewSet, HearingViewSet, SectionCommentViewSet, SectionViewSet, UserDataViewSet ) from rest_framework_nested import routers router = routers.DefaultRouter() router.register(r'hearing', HearingViewSet) router.reg...
Use DefaultRouter instead of SimpleRouter
Use DefaultRouter instead of SimpleRouter
Python
mit
City-of-Helsinki/kerrokantasi,vikoivun/kerrokantasi,stephawe/kerrokantasi,stephawe/kerrokantasi,stephawe/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,vikoivun/kerrokantasi,City-of-Helsinki/kerrokantasi,vikoivun/kerrokantasi
--- +++ @@ -5,7 +5,7 @@ ) from rest_framework_nested import routers -router = routers.SimpleRouter() +router = routers.DefaultRouter() router.register(r'hearing', HearingViewSet) router.register(r'users', UserDataViewSet, base_name='users')
abd3daed5cd0c70d76bf8fa1cfdda93efcda3e70
knights/compat/django.py
knights/compat/django.py
from django.core.urlresolvers import reverse from django.utils.encoding import iri_to_uri import datetime from knights.library import Library register = Library() @register.helper def now(fmt): return datetime.datetime.now().strftime(fmt) @register.helper def url(name, *args, **kwargs): try: ret...
from django.core.urlresolvers import reverse from django.utils import timezone from django.utils.encoding import iri_to_uri import datetime from knights.library import Library register = Library() @register.helper def now(fmt): return timezone.now().strftime(fmt) @register.helper def url(name, *args, **kwar...
Make the `now` helper timezone aware
Make the `now` helper timezone aware Thanks @tysonclugg
Python
mit
funkybob/knights-templater,funkybob/knights-templater
--- +++ @@ -1,5 +1,6 @@ from django.core.urlresolvers import reverse +from django.utils import timezone from django.utils.encoding import iri_to_uri import datetime @@ -11,7 +12,7 @@ @register.helper def now(fmt): - return datetime.datetime.now().strftime(fmt) + return timezone.now().strftime(fmt) ...
4e9a530403dce47f322df471255a0fc40fd1071f
examples/tic_ql_tabular_selfplay_all.py
examples/tic_ql_tabular_selfplay_all.py
''' The Q-learning algorithm is used to learn the state-action values for all Tic-Tac-Toe positions by playing games against itself (self-play). ''' from capstone.game.games import TicTacToe from capstone.game.players import RandPlayer from capstone.rl import Environment, GameMDP from capstone.rl.learners import QLearn...
''' The Q-learning algorithm is used to learn the state-action values for all Tic-Tac-Toe positions by playing games against itself (self-play). ''' from capstone.game.games import TicTacToe from capstone.game.players import RandPlayer from capstone.rl import Environment, GameMDP from capstone.rl.learners import QLearn...
Change number of episodes to 60000
Change number of episodes to 60000
Python
mit
davidrobles/mlnd-capstone-code
--- +++ @@ -21,7 +21,7 @@ policy=rand_policy, learning_rate=0.1, discount_factor=0.99, - n_episodes=3000, + n_episodes=60000, verbose=0, callbacks=[ EpisodicWLDPlotter(
52a6ea1e7dd4333b9db6a0bbd53b8ae0b39a1f6d
Designs/redundant.py
Designs/redundant.py
'''Due to the needs arising from completing the project on time, I have defined redundant.py which will hold replacement modules as I migrate from file based application to lists only web application. This modules so far will offer the capabilities of registration, creating a shopping list and adding items into a shopp...
'''Due to the needs arising from completing the project on time, I have defined redundant.py which will hold replacement modules as I migrate from file based application to lists only web application. This modules so far will offer the capabilities of registration, creating a shopping list and adding items into a shopp...
Add __doc__ to module functions
[Fix] Add __doc__ to module functions
Python
mit
AndersonMasese/Myshop,AndersonMasese/Myshop,AndersonMasese/Myshop
--- +++ @@ -6,6 +6,7 @@ global account account=[] def register(username,email,password): + '''registration list''' account.append(username) account.append(email) account.append(password) @@ -15,10 +16,12 @@ shopping_list_container=[]#contain shopping lists only def create(list_name): + '''...
22428bcdbb095b407a0845c35e06c8ace0653a44
urls.py
urls.py
from django.conf.urls.defaults import * from django.contrib import admin from django.conf import settings admin.autodiscover() urlpatterns = patterns('', (r'^admin/(.*)', admin.site.root), (r'^', include('blangoblog.blango.urls')), ) handler500 = 'blango.views.server_error' handler404 = 'blango.views.page_not...
from django.conf.urls.defaults import * from django.contrib import admin from django.conf import settings admin.autodiscover() urlpatterns = patterns('', (r'^admin/(.*)', admin.site.root), (r'^', include('blangoblog.blango.urls')), ) handler500 = 'blango.views.server_error' handler404 = 'blango.views.page_not...
Use MEDIA_URL instead of a hardcoded path
Use MEDIA_URL instead of a hardcoded path
Python
bsd-3-clause
fiam/blangoblog,fiam/blangoblog,fiam/blangoblog
--- +++ @@ -15,5 +15,5 @@ from os.path import abspath, dirname, join PROJECT_DIR = dirname(abspath(__file__)) urlpatterns += patterns('', - (r'^site-media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': join(PROJECT_DIR, 'media')}), + (r'^%s(?P<path>.*)$' % settings.MEDIA_U...
224700aada7e7d80b4389b123ee00b5f14e88c99
fluent_contents/plugins/text/content_plugins.py
fluent_contents/plugins/text/content_plugins.py
""" Definition of the plugin. """ from django.utils.html import format_html from fluent_contents.extensions import ContentPlugin, plugin_pool, ContentItemForm from fluent_contents.plugins.text.models import TextItem class TextItemForm(ContentItemForm): """ Perform extra processing for the text item """ ...
""" Definition of the plugin. """ from django.utils.safestring import mark_safe from fluent_contents.extensions import ContentPlugin, plugin_pool, ContentItemForm from fluent_contents.plugins.text.models import TextItem class TextItemForm(ContentItemForm): """ Perform extra processing for the text item ""...
Fix HTML escaping of TextPlugin, by feature/text-filters branch
Fix HTML escaping of TextPlugin, by feature/text-filters branch
Python
apache-2.0
django-fluent/django-fluent-contents,django-fluent/django-fluent-contents,edoburu/django-fluent-contents,edoburu/django-fluent-contents,django-fluent/django-fluent-contents,edoburu/django-fluent-contents
--- +++ @@ -1,7 +1,7 @@ """ Definition of the plugin. """ -from django.utils.html import format_html +from django.utils.safestring import mark_safe from fluent_contents.extensions import ContentPlugin, plugin_pool, ContentItemForm from fluent_contents.plugins.text.models import TextItem @@ -33,4 +33,4 @@ ...
5fbb4ff5d3427c8f4050fc5b75d4a6a2c15351c6
pelicanconf.py
pelicanconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = 'Donne Martin' SITENAME = 'Donne Martin' SITEURL = '' PATH = 'content' TIMEZONE = 'America/New_York' DEFAULT_LANG = 'en' # Feed generation is usually not desired when developing FEED_ALL_ATOM = None CATEGORY_FEED_ATOM ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = 'Donne Martin' SITENAME = 'Donne Martin' SITEURL = '' PATH = 'content' TIMEZONE = 'America/New_York' DEFAULT_LANG = 'en' # Feed generation is usually not desired when developing FEED_ALL_ATOM = None CATEGORY_FEED_ATOM ...
Set pygments style to monokai.
Set pygments style to monokai.
Python
mit
donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io
--- +++ @@ -18,7 +18,9 @@ TRANSLATION_FEED_ATOM = None AUTHOR_FEED_ATOM = None AUTHOR_FEED_RSS = None + HIDE_SIDEBAR = True +PYGMENTS_STYLE = 'monokai' # Blogroll LINKS = (('Pelican', 'http://getpelican.com/'),
5dc4641a40ff25b439541f6c3c02639a53346985
comics/crawlers/betty.py
comics/crawlers/betty.py
from comics.crawler.base import BaseComicsComComicCrawler from comics.crawler.meta import BaseComicMeta class ComicMeta(BaseComicMeta): name = 'Get Fuzzy' language = 'en' url = 'http://comics.com/betty/' start_date = '1991-01-01' history_capable_date = '2008-10-13' schedule = 'Mo,Tu,We,Th,Fr,Sa...
from comics.crawler.base import BaseComicsComComicCrawler from comics.crawler.meta import BaseComicMeta class ComicMeta(BaseComicMeta): name = 'Betty' language = 'en' url = 'http://comics.com/betty/' start_date = '1991-01-01' history_capable_date = '2008-10-13' schedule = 'Mo,Tu,We,Th,Fr,Sa,Su'...
Fix name of 'Betty' comic
Fix name of 'Betty' comic
Python
agpl-3.0
klette/comics,jodal/comics,jodal/comics,datagutten/comics,datagutten/comics,klette/comics,datagutten/comics,datagutten/comics,klette/comics,jodal/comics,jodal/comics
--- +++ @@ -2,7 +2,7 @@ from comics.crawler.meta import BaseComicMeta class ComicMeta(BaseComicMeta): - name = 'Get Fuzzy' + name = 'Betty' language = 'en' url = 'http://comics.com/betty/' start_date = '1991-01-01'
fbdaeff6f01ffaf0ac4f9a0d0d962a19c2865b32
jupyterlab/labhubapp.py
jupyterlab/labhubapp.py
import os import warnings from traitlets import default from .labapp import LabApp try: from jupyterhub.singleuser import SingleUserNotebookApp except ImportError: SingleUserLabApp = None raise ImportError('You must have jupyterhub installed for this to work.') else: class SingleUserLabApp(SingleUser...
import os from traitlets import default from .labapp import LabApp try: from jupyterhub.singleuser import SingleUserNotebookApp except ImportError: SingleUserLabApp = None raise ImportError('You must have jupyterhub installed for this to work.') else: class SingleUserLabApp(SingleUserNotebookApp, Lab...
Add docstring documenting the intended use of LabHubApp.
Add docstring documenting the intended use of LabHubApp.
Python
bsd-3-clause
jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab
--- +++ @@ -1,5 +1,4 @@ import os -import warnings from traitlets import default @@ -12,17 +11,25 @@ raise ImportError('You must have jupyterhub installed for this to work.') else: class SingleUserLabApp(SingleUserNotebookApp, LabApp): + """ + A sublcass of JupyterHub's SingleUserNotebo...
de9f9c07c6f1dde8d7ad314b6a6fb58a963e1558
geodj/youtube.py
geodj/youtube.py
from gdata.youtube.service import YouTubeService, YouTubeVideoQuery from django.utils.encoding import smart_str import re class YoutubeMusic: def __init__(self): self.service = YouTubeService() def search(self, artist): query = YouTubeVideoQuery() query.vq = artist query.orderb...
from gdata.youtube.service import YouTubeService, YouTubeVideoQuery from django.utils.encoding import smart_str import re class YoutubeMusic: def __init__(self): self.service = YouTubeService() def search(self, artist): query = YouTubeVideoQuery() query.vq = artist query.orderb...
Return as many results as possible
Return as many results as possible
Python
mit
6/GeoDJ,6/GeoDJ
--- +++ @@ -12,6 +12,7 @@ query.orderby = 'relevance' query.racy = 'exclude' query.format = '5' + query.max_results = 50 query.categories.append("/Music") feed = self.service.YouTubeQuery(query) results = []
db1653c551f71092a7eca96e6a4d1c96ef17e06a
lib/rapidsms/message.py
lib/rapidsms/message.py
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import copy class Message(object): def __init__(self, backend, caller=None, text=None): self._backend = backend self.caller = caller self.text = text # initialize some empty attributes self.received = None ...
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import copy class Message(object): def __init__(self, backend, caller=None, text=None): self._backend = backend self.caller = caller self.text = text self.responses = [] def __unicode__(self): return self.text ...
Remove unused attributes; also, empty responses after it's flushed.
Remove unused attributes; also, empty responses after it's flushed.
Python
bsd-3-clause
rapidsms/rapidsms-legacy,rapidsms/rapidsms-legacy,rapidsms/rapidsms-legacy
--- +++ @@ -8,10 +8,6 @@ self._backend = backend self.caller = caller self.text = text - - # initialize some empty attributes - self.received = None - self.sent = None self.responses = [] def __unicode__(self): @@ -31,6 +27,7 @@ def flus...
388653366ee4db58ed8ce8a9c8ab071593b9fc53
lancet/contrib/dploi.py
lancet/contrib/dploi.py
from shlex import quote import click @click.command() @click.option('-p', '--print/--exec', 'print_cmd', default=False, help='Print the command instead of executing it.') @click.argument('environment') @click.pass_obj def ssh(lancet, print_cmd, environment): """ SSH into the given environment, ...
from shlex import quote import click @click.command() @click.option('-p', '--print/--exec', 'print_cmd', default=False, help='Print the command instead of executing it.') @click.argument('environment') @click.pass_obj def ssh(lancet, print_cmd, environment): """ SSH into the given environment, ...
Use correct default SSH port
Use correct default SSH port
Python
mit
GaretJax/lancet,GaretJax/lancet
--- +++ @@ -20,7 +20,7 @@ config = namespace['settings'][environment] host = '{}@{}'.format(config['user'], config['hosts'][0]) - cmd = ['ssh', '-p', str(config.get('port', 20)), host] + cmd = ['ssh', '-p', str(config.get('port', 22)), host] if print_cmd: click.echo(' '.join(quote(s)...
7d34b407a35fe917e919fc01b3a6c736a7bdc372
helpdesk/urls.py
helpdesk/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'helpdesk.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), )
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'helpdesk.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'', include(admin.site.urls)), )
Remove admin prefix from url
Remove admin prefix from url
Python
mit
rosti-cz/django-emailsupport
--- +++ @@ -6,5 +6,5 @@ # url(r'^$', 'helpdesk.views.home', name='home'), # url(r'^blog/', include('blog.urls')), - url(r'^admin/', include(admin.site.urls)), + url(r'', include(admin.site.urls)), )
52d76647b1fa50a2649335b65f22f88d7877e9d3
spotpy/unittests/test_fast.py
spotpy/unittests/test_fast.py
import unittest try: import spotpy except ImportError: import sys sys.path.append(".") import spotpy from spotpy.examples.spot_setup_hymod_python import spot_setup class TestFast(unittest.TestCase): def setUp(self): self.spot_setup = spot_setup() self.rep = 200 # REP must be a...
import unittest try: import spotpy except ImportError: import sys sys.path.append(".") import spotpy from spotpy.examples.spot_setup_hymod_python import spot_setup class TestFast(unittest.TestCase): def setUp(self): self.spot_setup = spot_setup() self.rep = 200 # REP must be a...
Return to old setting of repetitions for fast testing
Return to old setting of repetitions for fast testing
Python
mit
bees4ever/spotpy,bees4ever/spotpy,thouska/spotpy,thouska/spotpy,bees4ever/spotpy,thouska/spotpy
--- +++ @@ -28,7 +28,7 @@ sampler.sample(self.rep) results = sampler.getdata() - self.assertEqual(200,len(results)) + self.assertEqual(203,len(results))
4b54d1472a57ad4d45293ec7bdce9a0ed9746bde
ideasbox/mixins.py
ideasbox/mixins.py
from django.views.generic import ListView class ByTagListView(ListView): def get_queryset(self): qs = super(ByTagListView, self).get_queryset() if 'tag' in self.kwargs: qs = qs.filter(tags__slug__in=[self.kwargs['tag']]) return qs def get_context_data(self, **kwargs): ...
from django.views.generic import ListView from taggit.models import Tag class ByTagListView(ListView): def get_queryset(self): qs = super(ByTagListView, self).get_queryset() if 'tag' in self.kwargs: qs = qs.filter(tags__slug__in=[self.kwargs['tag']]) return qs def get_co...
Use tag name not slug in tag page title
Use tag name not slug in tag page title
Python
agpl-3.0
ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,Lcaracol/ideasbox.lan,Lcaracol/ideasbox.lan,Lcaracol/ideasbox.lan,ideascube/ideascube
--- +++ @@ -1,4 +1,6 @@ from django.views.generic import ListView + +from taggit.models import Tag class ByTagListView(ListView): @@ -11,5 +13,5 @@ def get_context_data(self, **kwargs): context = super(ByTagListView, self).get_context_data(**kwargs) - context['tag'] = self.kwargs.get('tag...
72539e1a83eba8db9adfdeef6099081475ef8d86
objectset/forms.py
objectset/forms.py
from django import forms from .models import ObjectSet def objectset_form_factory(Model, queryset=None): """Takes an ObjectSet subclass and defines a base form class. In addition, an optional queryset can be supplied to limit the choices for the objects. This uses the generic `objects` field rather ...
from django import forms from .models import ObjectSet def objectset_form_factory(Model, queryset=None): """Takes an ObjectSet subclass and defines a base form class. In addition, an optional queryset can be supplied to limit the choices for the objects. This uses the generic `objects` field rather ...
Handle Django 1.4 nuance for the empty ModelMultipleChoiceField values
Handle Django 1.4 nuance for the empty ModelMultipleChoiceField values
Python
bsd-2-clause
chop-dbhi/django-objectset,chop-dbhi/django-objectset
--- +++ @@ -31,7 +31,13 @@ required=False) def save(self, *args, **kwargs): - self.instance._pending = self.cleaned_data.get('objects') + objects = self.cleaned_data.get('objects') + # Django 1.4 nuance when working with an ...
6694a9e8d554c9450cdf6cd076bb56a324048b44
social/apps/django_app/urls.py
social/apps/django_app/urls.py
"""URLs module""" from django.conf import settings try: from django.conf.urls import patterns, url except ImportError: # Django < 1.4 from django.conf.urls.defaults import patterns, url from social.utils import setting_name extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or '' ...
"""URLs module""" from django import VERSION from django.conf import settings from django.conf.urls import url from social.apps.django_app import views from social.utils import setting_name extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or '' urlpatterns = ( # authentication / associati...
Update the url patterns to be compliant with Django 1.9 new formatting
Update the url patterns to be compliant with Django 1.9 new formatting so need to support Django < 1.8 because it is now deprecated for security reasons
Python
bsd-3-clause
cmichal/python-social-auth,cmichal/python-social-auth,cmichal/python-social-auth
--- +++ @@ -1,27 +1,28 @@ """URLs module""" +from django import VERSION from django.conf import settings -try: - from django.conf.urls import patterns, url -except ImportError: - # Django < 1.4 - from django.conf.urls.defaults import patterns, url - +from django.conf.urls import url +from social.apps.djang...
9fe1c66b70bd396d9a698cc001ccb89644383f3b
logs.py
logs.py
# Copyright 2013 Russell Heilling import logging import sys import args args.add_argument('--verbose', '-v', action='count', help='Enable verbose logging.') ARGS = args.ARGS LEVEL_SETTERS = set([logging.getLogger().setLevel]) def register_logger(level_setter): LEVEL_SETTERS.add(level_setter) de...
# Copyright 2013 Russell Heilling import logging import sys import args args.add_argument('--verbose', '-v', action='count', help='Enable verbose logging.') ARGS = args.ARGS LEVEL_SETTERS = set([logging.getLogger().setLevel]) def register_logger(level_setter): LEVEL_SETTERS.add(level_setter) de...
Include timestamp in log format
Include timestamp in log format
Python
mit
xchewtoyx/comicmgt,xchewtoyx/comicmgt
--- +++ @@ -14,6 +14,10 @@ LEVEL_SETTERS.add(level_setter) def set_logging(): + handler = logging.StreamHandler() + handler.setFormatter(logging.Formatter( + '%(asctime)s %(levelname)s:%(name)s %(message)s')) + logging.getLogger().addHandler(handler) level = logging.WARN if ARGS.verbose > 1: ...
f7fc79ac56b94e2e54d14360b0f9a5ab97d28a3b
tests/conftest.py
tests/conftest.py
""" Configuration, plugins and fixtures for `pytest`. """ from typing import Iterator import pytest from mock_vws import MockVWS from mock_vws.database import VuforiaDatabase from vws import VWS pytest_plugins = [ # pylint: disable=invalid-name 'tests.fixtures.images', ] @pytest.fixture() def _mock_database(...
""" Configuration, plugins and fixtures for `pytest`. """ from typing import Iterator import pytest from mock_vws import MockVWS from mock_vws.database import VuforiaDatabase from vws import VWS pytest_plugins = [ # pylint: disable=invalid-name 'tests.fixtures.images', ] @pytest.fixture() def _mock_database(...
Update for new mock database
Update for new mock database
Python
mit
adamtheturtle/vws-python,adamtheturtle/vws-python
--- +++ @@ -31,8 +31,8 @@ Yield a VWS client which connects to a mock. """ vws_client = VWS( - server_access_key=_mock_database.server_access_key.decode(), - server_secret_key=_mock_database.server_secret_key.decode(), + server_access_key=_mock_database.server_access_key, + ...
5c0282810f298762bdd00c260f40e2ceb7914eb0
tests/test_dna.py
tests/test_dna.py
#!/usr/bin/env python2 import pytest from kbkdna.dna import * def test_reverse_complement(): assert reverse_complement('ATGC') == 'GCAT' def test_gc_content(): assert gc_content('ATGC') == 0.5
#!/usr/bin/env python2 import pytest import kbkdna def test_reverse_complement(): assert kbkdna.reverse_complement('ATGC') == 'GCAT' def test_gc_content(): assert kbkdna.gc_content('ATGC') == 0.5
Simplify the imports in the tests.
Simplify the imports in the tests.
Python
mit
kalekundert/kbkdna
--- +++ @@ -1,11 +1,11 @@ #!/usr/bin/env python2 import pytest -from kbkdna.dna import * +import kbkdna def test_reverse_complement(): - assert reverse_complement('ATGC') == 'GCAT' + assert kbkdna.reverse_complement('ATGC') == 'GCAT' def test_gc_content(): - assert gc_content('ATGC') == 0.5 + as...
1e62c328bb42ec123e75b5c66fb29f002cd57db2
tests/test_nap.py
tests/test_nap.py
from nap.api import Api from . import HttpServerTestBase class TestNap(HttpServerTestBase): def test_unallowed_method(self): """Tries to use non-existent HTTP method""" api = Api('http://localhost:8888') with self.assertRaises(AttributeError): api.resource.nonexisting()
""" Tests for nap module. These tests only focus that requests is called properly. Everything related to HTTP requests should be tested in requests' own tests. """ import unittest import requests from nap.api import Api class TestNap(unittest.TestCase): def test_unallowed_method(self): """Tries to use...
Document module and add couple of tests
Document module and add couple of tests
Python
mit
kimmobrunfeldt/nap
--- +++ @@ -1,13 +1,40 @@ +""" +Tests for nap module. + +These tests only focus that requests is called properly. +Everything related to HTTP requests should be tested in requests' own tests. +""" + +import unittest +import requests from nap.api import Api -from . import HttpServerTestBase - -class TestNap(Htt...
5f2ffbbbf145653b853a4f67308bc28da6839dba
main.py
main.py
"""Usage: chronicler [-c CHRONICLE] The Chronicler remembers… Options: -c, --chronicle CHRONICLE chronicle file to use [default: chronicle.txt] """ import docopt import hjson import jsonschema import chronicle def main(): options = docopt.docopt(__doc__) try: c = open(options['--chronicle'])...
"""Usage: chronicler [-c CHRONICLE] The Chronicler remembers… Options: -c, --chronicle CHRONICLE chronicle file to use [default: chronicle.hjson] """ import docopt import hjson import jsonschema import chronicle def main(): options = docopt.docopt(__doc__) try: c = open(options['--chronicle'...
Change the default value for the chronicle option
Change the default value for the chronicle option
Python
unlicense
elwinar/chronicler
--- +++ @@ -3,7 +3,7 @@ The Chronicler remembers… Options: - -c, --chronicle CHRONICLE chronicle file to use [default: chronicle.txt] + -c, --chronicle CHRONICLE chronicle file to use [default: chronicle.hjson] """ import docopt
5f72b6edc28caa7bf03720ed27a9f3aa32c8323e
go/billing/management/commands/go_gen_statements.py
go/billing/management/commands/go_gen_statements.py
from datetime import datetime from optparse import make_option from go.billing.models import Account from go.billing.tasks import month_range, generate_monthly_statement from go.base.command_utils import BaseGoCommand, get_user_by_email class Command(BaseGoCommand): help = "Generate monthly billing statements fo...
from datetime import datetime from optparse import make_option from go.billing.models import Account from go.billing.tasks import month_range, generate_monthly_statement from go.base.command_utils import BaseGoCommand, get_user_by_email class Command(BaseGoCommand): help = "Generate monthly billing statements fo...
Fix broken billing statement command tests
Fix broken billing statement command tests
Python
bsd-3-clause
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
--- +++ @@ -27,9 +27,12 @@ "Generating statements for account %s..." % (opts['email_address'],)) - months = [datetime.strptime(m, '%Y-%m') for m in opts['months']] + months = [datetime.strptime(m, '%Y-%m') for m in opts['month']] for month in months: f...
1e8f9a95badc1e2b558bae7570ef9bc23f26a0df
pyhaystack/info.py
pyhaystack/info.py
# -*- coding: utf-8 -*- """ File : pyhaystackTest.py (2.x) This module allow a connection to a haystack server Feautures provided allow user to fetch data from the server and eventually, to post to it. See http://www.project-haystack.org for more details Project Haystack is an open source initiative to streamline wor...
# -*- coding: utf-8 -*- """ File : pyhaystackTest.py (2.x) This module allow a connection to a haystack server Feautures provided allow user to fetch data from the server and eventually, to post to it. See http://www.project-haystack.org for more details Project Haystack is an open source initiative to streamline wor...
Modify version to 0.72 to mark change
Modify version to 0.72 to mark change Signed-off-by: Christian Tremblay <31ac1ca2e4859489ad6997067c1b3a4264642859@servisys.com>
Python
apache-2.0
ChristianTremblay/pyhaystack,vrtsystems/pyhaystack,ChristianTremblay/pyhaystack
--- +++ @@ -10,7 +10,7 @@ """ -__author__ = 'Christian Tremblay, @sjlongland, @sudo-Whateverman, Igor' +__author__ = 'Christian Tremblay, Stuart J. Longland, @sudo-Whateverman, Igor' __author_email__ = 'christian.tremblay@servisys.com' -__version__ = '0.71.1.8.2' +__version__ = '0.72' __license__ = 'LGPL'
36ea751618287a75fc82db500d953d4fa40b373b
tests/containers/entrypoint/renew-demo-token.py
tests/containers/entrypoint/renew-demo-token.py
#!/usr/bin/python3 import os import json import time from urllib import request # Create the requested json demo_json = { "payload": { "aud": "ANY", "ver": "scitokens:2.0", "scope": "condor:/READ condor:/WRITE", "exp": int(time.time() + 3600*8), "sub": "abh3" } } # Co...
#!/usr/bin/python3 import os import json import time from urllib import request # Request payload payload = {"aud": "ANY", "ver": "scitokens:2.0", "scope": "condor:/READ condor:/WRITE", "exp": int(time.time() + 3600*8), "sub": "abh3" } # Convert the format from...
Update token renewal due to demo.scitokens.org API update
Update token renewal due to demo.scitokens.org API update
Python
apache-2.0
matyasselmeci/htcondor-ce,brianhlin/htcondor-ce,matyasselmeci/htcondor-ce,brianhlin/htcondor-ce,matyasselmeci/htcondor-ce,brianhlin/htcondor-ce
--- +++ @@ -6,20 +6,17 @@ from urllib import request -# Create the requested json -demo_json = { - "payload": { - "aud": "ANY", - "ver": "scitokens:2.0", - "scope": "condor:/READ condor:/WRITE", - "exp": int(time.time() + 3600*8), - "sub": "abh3" - } -} +# Request payload...
1eacbac722ca949518e1a8e9d6a0a957e193ba9e
tests/functional/staging_and_prod/test_admin.py
tests/functional/staging_and_prod/test_admin.py
from retry.api import retry_call from config import config from tests.pages import UploadCsvPage from tests.postman import ( send_notification_via_csv, get_notification_by_id_via_api, ) from tests.test_utils import assert_notification_body, recordtime, NotificationStatuses @recordtime def test_admin(driver...
import pytest from retry.api import retry_call from config import config from tests.pages import UploadCsvPage from tests.postman import ( send_notification_via_csv, get_notification_by_id_via_api, ) from tests.test_utils import assert_notification_body, recordtime, NotificationStatuses @pytest.mark.skip(...
Disable CSV upload tests temporarily
Disable CSV upload tests temporarily When the database tasks queue builds up we get false pager duty alerts due to the time it takes for the test csv to get through to the front of the queue.
Python
mit
alphagov/notifications-functional-tests,alphagov/notifications-functional-tests
--- +++ @@ -1,3 +1,5 @@ +import pytest + from retry.api import retry_call from config import config @@ -11,7 +13,7 @@ from tests.test_utils import assert_notification_body, recordtime, NotificationStatuses -@recordtime +@pytest.mark.skip(reason="intermittent pager duty alerts due to queue backlog") def test...
d28c0e25ba9d3779a77d285e0dc82a799643e1e6
tests/test_webapps/filestotest/rest_routing.py
tests/test_webapps/filestotest/rest_routing.py
"""Routes configuration The more specific and detailed routes should be defined first so they may take precedent over the more generic routes. For more information refer to the routes manual at http://routes.groovie.org/docs/ """ from pylons import config from routes import Mapper def make_map(): """Create, confi...
"""Routes configuration The more specific and detailed routes should be defined first so they may take precedent over the more generic routes. For more information refer to the routes manual at http://routes.groovie.org/docs/ """ from pylons import config from routes import Mapper def make_map(): """Create, confi...
Update to reflect not having trailing slashes
Update to reflect not having trailing slashes --HG-- branch : trunk
Python
bsd-3-clause
Pylons/pylons,moreati/pylons,moreati/pylons,Pylons/pylons,moreati/pylons,Pylons/pylons
--- +++ @@ -20,8 +20,7 @@ # CUSTOM ROUTES HERE map.resource('restsample', 'restsamples') - map.connect('/:controller/index', action='index') - map.connect('/:controller/:action/') + map.connect('/:controller/:action') map.connect('/:controller/:action/:id') return map
428889029541bb5c8f8998eb1f4cbc057a80fb87
s2v2.py
s2v2.py
from s2v1 import * def number_of_records(data_sample): return len(data_sample) number_of_ties = number_of_records(data_from_csv) print(number_of_ties, "ties in our data sample")
from s2v1 import * def number_of_records(data_sample): return len(data_sample) number_of_ties = number_of_records(data_from_csv) - 1 # minus header row print(number_of_ties, "ties in our data sample")
Subtract header row for acurate counting
Subtract header row for acurate counting
Python
mit
alexmilesyounger/ds_basics
--- +++ @@ -3,6 +3,6 @@ def number_of_records(data_sample): return len(data_sample) -number_of_ties = number_of_records(data_from_csv) +number_of_ties = number_of_records(data_from_csv) - 1 # minus header row print(number_of_ties, "ties in our data sample")