commit
stringlengths
40
40
subject
stringlengths
1
3.25k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
old_contents
stringlengths
0
26.3k
lang
stringclasses
3 values
proba
float64
0
1
diff
stringlengths
0
7.82k
a4ee0125905f143a2642583baac17f7cfe5472ea
Raise ValueError if credentials are not from google-auth (#2828)
unit_tests/test_client.py
unit_tests/test_client.py
# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0
@@ -587,16 +587,154 @@ ittest%0A%0A +import mock%0A%0A%0Adef _make_credentials():%0A import google.auth.credentials%0A return mock.Mock(spec=google.auth.credentials.Credentials)%0A%0A %0Aclass T @@ -1328,38 +1328,49 @@ CREDENTIALS = -object +_make_credentials ()%0A targe @@ -1628,38 +1628,49 @@ C...
6138f19de99257246b24f35f2aa3f5f950a7bd7c
Add width and height to PhotoFactory
ditto/flickr/factories.py
ditto/flickr/factories.py
import datetime import pytz import factory from . import models from ..ditto.utils import datetime_now class UserFactory(factory.DjangoModelFactory): class Meta: model = models.User nsid = factory.Sequence(lambda n: (n * 10000)) username = factory.Sequence(lambda n: 'user%d' % n) realname = ...
Python
0
@@ -2227,12 +2227,44 @@ )%0A + width = 300%0A height = 200 %0A%0A%0A%0A
a508196c65b6d20df4efe3c973827e0579298245
Fix serializing message logs when publishing from stores.
ircb/models/logs.py
ircb/models/logs.py
# -*- coding: utf-8 -*- import datetime import sqlalchemy as sa from ircb.models.lib import Base class BaseLog(object): id = sa.Column(sa.Integer, primary_key=True) hostname = sa.Column(sa.String(100), nullable=False) roomname = sa.Column(sa.String(255), nullable=False) message = sa.Column(sa.Strin...
Python
0
@@ -800,37 +800,8 @@ t()%0A - if serializable:%0A @@ -856,20 +856,16 @@ - - d%5B'creat @@ -892,28 +892,24 @@ timestamp()%0A - d%5B'l @@ -954,16 +954,33 @@ stamp()%0A + return d%0A %0A%0Aclass @@ -990,33 +990,33 @@ sageLog(Base +Log , Base -Log ):%0A %22%22%...
e244227f41708084925d026ceb341953688ae31f
convert proxy object to string before passing to urllib
isso/utils/parse.py
isso/utils/parse.py
from __future__ import print_function import re import datetime from itertools import chain try: from urllib import unquote from urlparse import urlparse except ImportError: from urllib.parse import urlparse, unquote import html5lib from isso.compat import map, filter, PY2K if PY2K: # http://bugs.py...
Python
0.000001
@@ -285,16 +285,48 @@ er, PY2K +, string_types, text_type as str %0A%0Aif PY2 @@ -1895,24 +1895,95 @@ e)%0A %22%22%22%0A%0A + if not (isinstance(name, string_types)):%0A name = str(name)%0A%0A if not n
254d22dd96d2b7567743b0cc92916731ef9fb852
Prepare package to pip
vantiv/request/request.py
vantiv/request/request.py
from __future__ import absolute_import import ssl import urllib.request as urllib from .config import Config from .utils import remove_from_json class Request (object): def __getstate__(self): body = remove_from_json(self.__dict__.copy()) return body def __init__(self, category, proxy, endpoi...
Python
0
@@ -2234,10 +2234,8 @@ - # cod @@ -2284,32 +2284,103 @@ s = resp.read()%0A + if code != %22200%22:%0A error = contents%0A exce @@ -2520,17 +2520,16 @@ ntents)%0A -%0A
25a61363ba84a46422ef1a8cec317619d69b60a2
Fix typo
app/templatetags/extra_tags.py
app/templatetags/extra_tags.py
from django import template import urllib register = template.Library() @register.tag(name='make_query') def do_make_query(parser, token): try: tag_name, query = token.split_contents() except ValueError: raise template.TemplateSyntaxError( "%r tag requires a single argument" % token...
Python
0.999999
@@ -1536,21 +1536,16 @@ resolve( -self. context)
7a78525bb8cc6176dfbe348e5f95373c1d70628f
Add the checkRecaptcha( req, secret, simple=True ) function
functions.py
functions.py
#-*- coding: utf-8 -*- def getClientIP( req ): ''' Get the client ip address ''' xForwardedFor=req.META.get('HTTP_X_FORWARDED_FOR') if xForwardedFor: ip=xForwardedFor.split(',')[0] else: ip=req.META.get('REMOTE_ADDR') return ip def getBool( val, trueOpts=['YES', 'Y', '1', 'TRUE', 'T'] ): ''' Retrieve the...
Python
0.002676
@@ -72,16 +72,42 @@ address +%0A%0A%09@param req The request; %0A%09'''%0A%09x @@ -277,16 +277,30 @@ ol( val, + defVal=False, trueOpt @@ -384,70 +384,893 @@ ing%0A -%09'''%0A%09if val:%0A%09%09return str(val).upper() in trueOpts%0A%09return False +%0A%09@param val The value to be parse to bool%0A%09@param defVal...
72d73ccd01f405ce9b33715643d9a8f37ad853a5
add trailing comma
src/jinja2_webpack/__init__.py
src/jinja2_webpack/__init__.py
from os import path from . import renderer from .utils.load_json import load_json DEFAULT_SETTINGS = { 'errorOnInvalidReference': True, 'publicRoot': '/static/pack', 'manifest': 'webpack-manifest.json', 'defaultRenderer': renderer.url, 'useDefaultRenderByExt': False, 'renderByExt': { '...
Python
0.999523
@@ -500,16 +500,17 @@ ylesheet +, %0A %7D%0A%7D
7682bff9451a3a5f471ef8f28b905d3ae2b2c92a
Use layout.scalar in test
clifford/test/test_multivector_inverse.py
clifford/test/test_multivector_inverse.py
import numpy as np import pytest import clifford as cf class TestClosedForm: @pytest.mark.parametrize('p, q', [ (p, total_dims - p) for total_dims in [1, 2, 3, 4, 5] for p in range(total_dims + 1) ]) def test_hitzer_inverse(self, p, q): Ntests = 100 layout, blades...
Python
0
@@ -547,30 +547,21 @@ -(1.0 + 0*blades%5B%22e1%22%5D) +layout.scalar .val
3f07fb6a58870afbb36051bd5d54da4479561cc6
Fix regression in web_library_external
closure/webfiles/web_library_external.bzl
closure/webfiles/web_library_external.bzl
# Copyright 2016 The Closure Rules Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Python
0.002583
@@ -1130,21 +1130,24 @@ %22, %5C%22web -files +_library %5C%22)%22)%0A @@ -1182,21 +1182,24 @@ end(%22web -files +_library (%22)%0A li
a5b3def3485b696ecace36d3bd9000f203628593
fix tests
gem/admin.py
gem/admin.py
from django.contrib import admin from django.contrib.auth.models import User from gem.models import GemUserProfile, GemCommentReport from molo.commenting.admin import MoloCommentAdmin from molo.commenting.models import MoloComment from molo.profiles.admin import ProfileUserAdmin from molo.profiles.admin import Frontend...
Python
0.000001
@@ -596,16 +596,20 @@ sv%0Afrom +gem. tasks im
121bbec764a2a2c36641188c47a469fc7e28cf53
fix test
pusher_tests/test_request.py
pusher_tests/test_request.py
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import, division import unittest from pusher import Pusher from pusher.http import Request try: import unittest.mock as mock except ImportError: import mock class TestRequest(unittest.TestCase): def test_get_signature_generation(se...
Python
0.000002
@@ -1874,32 +1874,101 @@ y_header(self):%0A + conf = Pusher.from_url(u'http://key:secret@somehost/apps/4')%0A req = Re @@ -1973,35 +1973,34 @@ Request(conf, u' -POS +GE T', u'/some/obsc @@ -2050,31 +2050,179 @@ sert -Equal(req.headers(), %7B%7D +True('X-Pusher-Library' in req.headers)%0A push...
009505c5d97766b69fa479c145947c198eabfa24
Fix notifications on profile page
django/neverlate/views.py
django/neverlate/views.py
import json from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django.core.exceptions import SuspiciousOperation from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response, render from allaccess.views import OAuthRedir...
Python
0.000006
@@ -4599,24 +4599,67 @@ st.user.id,%0A + 'was_saved': was_saved,%0A
ac1a12bccfc5147b55fde2988a1563844e33e681
Stop redirects from /group to /event
ckanext/mapactionevent/plugin.py
ckanext/mapactionevent/plugin.py
from ckan import logic from ckan.lib.navl.validators import ignore_missing import pylons.config as config import ckan.plugins as plugins import ckan.plugins.toolkit as toolkit import ckanext.mapactionevent.logic.action.create import ckanext.mapactionevent.logic.action.get group_type = 'event' def event_descripti...
Python
0
@@ -2491,106 +2491,8 @@ ')%0A%0A - map.redirect('/group', '/event')%0A map.redirect('/group/%7Burl:.*%7D', '/event/%7Burl%7D')%0A%0A
7e609c777dba929717114e090de94af98ed2a854
Use contrib confirm rather than mine.
fabfile.py
fabfile.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from fabric.api import * # Globals env.project_name = 'editorsnotes' # Environments def dev(): "Use the development webserver." env.hosts = ['editorsnotes.local'] env.user = 'ryanshaw' env.path = '/Library/WebServer/Documents/%(project_name)s' % env ...
Python
0
@@ -64,16 +64,59 @@ import * +%0Afrom fabric.contrib.console import confirm %0A%0A# Glob @@ -2865,276 +2865,19 @@ -def yes_or_no(answer):%0A answer = answer.lower()%0A if (answer == 'y' or answer == 'yes'):%0A return True%0A if (answer == 'n' or answer == 'no'):%0A ret...
484e8db8351ab275cad295ba42083cecfb8fef66
Allow omitting everything except 'subdomain' and 'title'
estragon.py
estragon.py
import os from datetime import datetime, timedelta from flask import Flask, render_template, send_from_directory, request, url_for, abort, g import simplejson import random import warnings from collections import namedtuple import functools import pytz app = Flask(__name__) app.config.from_envvar('ESTRAGON_SETTINGS', ...
Python
0.008554
@@ -1043,33 +1043,37 @@ zone = site_dict -%5B +.get( 'arrival_zone'%5D%0A @@ -1070,17 +1070,17 @@ al_zone' -%5D +) %0A @@ -1111,17 +1111,21 @@ ite_dict -%5B +.get( 'arrival @@ -1125,17 +1125,17 @@ arrival' -%5D +) %0A%0A @@ -1599,17 +1599,21 @@ ite_dict -%5B +.get( 'no_imag @@ -1614,17 +1614,17 @...
02bcb1d8e3766b672688db6d8885fce9e198f526
Remove statsd code
cla_backend/apps/core/signals.py
cla_backend/apps/core/signals.py
import logging from django_statsd.clients import statsd logger = logging.getLogger(__name__) def log_user_created(sender, instance, created, **kwargs): if created: statsd.incr("user.created") logger.info( "User created", extra={ "USERNAME": instance.usern...
Python
0.000001
@@ -13,50 +13,8 @@ ng%0A%0A -from django_statsd.clients import statsd%0A%0A logg @@ -127,45 +127,8 @@ ed:%0A - statsd.incr(%22user.created%22)%0A%0A @@ -599,42 +599,8 @@ rn%0A%0A - statsd.incr(%22user.modified%22)%0A%0A
db0163e8af75ba22c6ec8d9f582027583e7c482f
use post_config_hook
py3status/modules/getjson.py
py3status/modules/getjson.py
# -*- coding: utf-8 -*- """ Display JSON data fetched from a URL. This module gets the given `url` configuration parameter and assumes the response is a JSON object. The keys of the JSON object are used as the format placeholders. The format placeholders are replaced by the value. Objects that are nested can be access...
Python
0.000011
@@ -1728,16 +1728,46 @@ '%7D%0A%22%22%22%0A%0A +STRING_ERROR = 'missing url'%0A%0A %0Aclass P @@ -1922,24 +1922,124 @@ url = None%0A%0A + def post_config_hook(self):%0A if not self.url:%0A raise Exception(STRING_ERROR)%0A%0A def getj
7d74e93ad25fe3ada5afa877ed09a0894e01252f
Remove unused import
cla_backend/apps/status/views.py
cla_backend/apps/status/views.py
import os from django.db import connection, DatabaseError from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from rest_framework.renderers import JSONRenderer from cla_common.smoketest import smoketest class JSONResponse(HttpResponse): def __init__(self, data, **kwargs): ...
Python
0.000001
@@ -1,15 +1,4 @@ -import os%0A%0A from
b5de27f7b2af0b1845c063210305cdffd36559df
Fix Django <1.11 support
django_auth_adfs/views.py
django_auth_adfs/views.py
import base64 import logging from django.conf import settings as django_settings from django.contrib.auth import authenticate, login, logout from django.shortcuts import redirect, render from django.utils.http import is_safe_url from django.views.generic import View from django_auth_adfs.config import provider_config...
Python
0
@@ -1027,16 +1027,24 @@ (request +=request , author
f2f74f53fe8f5b4ac4cd728c4181b3a66b4e873d
Change problem description so it actually makes sense
euler009.py
euler009.py
# euler 009 # A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, # a^2 + b^2 = c^2 # # For example, 32 + 42 = 9 + 16 = 25 = 52. # # There exists exactly one Pythagorean triplet for which a + b + c = 1000. # Find the product abc.
Python
0.000017
@@ -1,15 +1,53 @@ # -euler 009 +Project Euler%0A# 9 - Special Pythagorean triplet %0A%0A# @@ -165,13 +165,15 @@ e, 3 +%5E 2 + 4 +%5E 2 = @@ -191,13 +191,13 @@ = 5 +%5E 2.%0A# - %0A# T
a2ecfc7b22f94e0deebf56be47905bb400e09adb
Work around django-mysql-pool issues with autocommit state (bug 920081)
mkt/fireplace/management/commands/upload_new_marketplace_package.py
mkt/fireplace/management/commands/upload_new_marketplace_package.py
import os import os.path from datetime import datetime from django.core.management.base import BaseCommand, CommandError from django.db import transaction import commonware.log import amo from amo.decorators import use_master from files.models import FileUpload from mkt.webapps.models import Webapp from versions.mod...
Python
0
@@ -148,16 +148,29 @@ nsaction +, connections %0A%0Aimport @@ -3021,16 +3021,233 @@ ed back. + We force a connect() call%0A # first to work around django-mysql-pool problems (autocommit state is%0A # not properly reset, messing up transaction.atomic() blocks).%0A connections%5B'default'%5D.conne...
26b440a0289901207745b2300d3833e0028f047a
use for-loop instead of while-loop
py_solutions_1-10/Euler_8.py
py_solutions_1-10/Euler_8.py
# find the greatest product of 5 consecutive digits in this 1000 digit number import timeit start = timeit.default_timer() big_num = """73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 85861560789112949495459501737958331952853208805511 ...
Python
0.000131
@@ -1434,361 +1434,213 @@ n = -n.replace('%5Cn', '')%0A n = ''.join(%5Bi for i in n if i != ' '%5D)%0A position = 0%0A seq = ''%0A high = 0%0A while (position - 5) %3C= len(n):%0A total = 1%0A for i in n%5Bposition:position + 5%5D:%0A total = total * int(i)%0A if total %...
70592355c4977934291bcdfc54bc93d84b262b94
Add basic support.
fabfile.py
fabfile.py
"""Fabric file.""" from fabric.api import cd, local ############################################################################### # Constants ############################################################################### MOD = "cloud_browser" PROJ = "cloud_browser_project" PYLINT_INCLUDES = ( "fabfile.py", MOD...
Python
0
@@ -272,22 +272,21 @@ roject%22%0A -PYLINT +CHECK _INCLUDE @@ -793,22 +793,132 @@ %22.join( -PYLINT +CHECK_INCLUDES)), capture=False)%0A%0A%0Adef pep8():%0A %22%22%22Run pep8 style checker.%22%22%22%0A local(%22pep8 -r %25s%22 %25 %22 %22.join(CHECK _INCLUDE @@ -911,33 +911,32 @@ (CHECK_INCLUDES) -) , capture=...
96b92ca853f2d937b81cfb1522fe201fa5c593c3
Bump version to 0.2.3
django_skebby/__init__.py
django_skebby/__init__.py
__version__ = '0.2.2'
Python
0.000001
@@ -12,11 +12,11 @@ = '0.2. -2 +3 '%0A
d0be18d4ca82771082c442c5f419704806ebd412
Fix python3 incompatibility in table test
blaze/api/tests/test_table.py
blaze/api/tests/test_table.py
from blaze.api.table import Table, compute, table_repr from blaze.data.python import Python from blaze.compute.core import compute from blaze.compute.python import compute from datashape import dshape import pandas as pd data = (('Alice', 100), ('Bob', 200)) t = Table(data, columns=['name', 'amount']) def t...
Python
0.000136
@@ -1586,33 +1586,8 @@ ():%0A - mutable_data = %5B%5B0%5D%5D%0A @@ -1615,28 +1615,21 @@ = Table( -mutable_data +%5B%5B0%5D%5D , column @@ -1627,33 +1627,30 @@ %5D, columns=%5B -%22mutable%22 +'col1' %5D)%0A repr( @@ -1711,36 +1711,8 @@ ():%0A - mutable_data = range(2)%0A @@ -1738,20 +1738,11 ...
4acde16a501a98599ba553dad50cb4f6ae6b71d2
Make 'default' a kwarg in WhooshManager.__init__() because for compatibility with super.__init__()
django_whoosh/managers.py
django_whoosh/managers.py
import os from django.db import models from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.models.signals import post_save, post_delete, class_prepared from whoosh import store from whoosh.fields import Schema, STORED, ID, KEYWORD, TEXT from whoosh.index import Inde...
Python
0.000082
@@ -1438,17 +1438,8 @@ elf, - default, *ar @@ -1476,23 +1476,42 @@ fault = -default +kwargs.pop(%22default%22,None) %0A
08f5fbf3dac9ba76a90f6701b077cbaa60211ed8
fix numpy broadcasting error
pyannote/metrics/spotting.py
pyannote/metrics/spotting.py
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2017 CNRS # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation ...
Python
0.000024
@@ -3353,16 +3353,17 @@ axcum = +( np.maxim @@ -3375,32 +3375,50 @@ cumulate(scores) +).reshape((-1, 1)) %0A trigger
feaeba32c6e3ec1ac354984f55ae96107d5acbdf
Add default value to EnvironmentVariable substitution (#225)
launch/launch/substitutions/environment_variable.py
launch/launch/substitutions/environment_variable.py
# Copyright 2018 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Python
0
@@ -1072,21 +1072,38 @@ _init__( -self, +%0A self,%0A name: S @@ -1122,16 +1122,83 @@ ionsType +,%0A *,%0A default_value: SomeSubstitutionsType = ''%0A ) -%3E Non @@ -1413,16 +1413,97 @@ ns(name) +%0A self.__default_value = normalize_to_list_of_substitutions(default_value) ...
3f11d2e90da5c779bbe9283ef99688af4ade529c
debug fabfile
fabfile.py
fabfile.py
"""Fabric scripts. Require mkvirtualenv to be installed on all machines and to be run in, and WORKON_HOME defined in .bash_profile. """ from __future__ import with_statement import os from fabric.api import * env.project = "h1ds" env.git_url = "git@code.h1svr.anu.edu.au:h1ds/h1ds.git" env.moin_git_url = "git@code...
Python
0.000001
@@ -1978,84 +1978,29 @@ -env.virtual_env = os.environ%5B'VIRTUAL_ENV'%5D%0A with cd(%22%25(virtual_env)s +with cd(%22$VIRTUAL_ENV /%25(p
7c19002f341e69a966795336b8b4201a901f6ce7
Fix arguments for pushover module
lib/ansible/modules/extras/notification/pushover.py
lib/ansible/modules/extras/notification/pushover.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2012, Jim Richardson <weaselkeeper@gmail.com> # All rights reserved. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software F...
Python
0.000053
@@ -2858,32 +2858,45 @@ ct(required=True +, no_log=True ),%0A u @@ -2913,32 +2913,45 @@ ct(required=True +, no_log=True ),%0A p @@ -2982,17 +2982,52 @@ default= -0 +'0', choices=%5B'-2','-1','0','1','2'%5D ),%0A
cee5bb8eb1c0148d1219fad014bfe4d05becdf56
Update the server celery runs on.
fabfile.py
fabfile.py
from fabric.api import * env.runtime = 'production' env.hosts = ['chimera.ericholscher.com', 'kirin.ericholscher.com', 'ladon.ericholscher.com'] env.user = 'docs' env.code_dir = '/home/docs/sites/readthedocs.org/checkouts/readthedocs.org' env.virtualenv = '/home/docs/sites/readthedocs.org' env.rundir = '/home/docs/sit...
Python
0
@@ -992,16 +992,17 @@ corn%22)%0A%0A +# @hosts(%5B @@ -1026,24 +1026,59 @@ cher.com'%5D)%0A +@hosts(%5B'kirin.ericholscher.com'%5D)%0A def celery()
87f892731678049b5a706a36487982ebb9da3991
Add API client to global envar
pybossa_discourse/globals.py
pybossa_discourse/globals.py
# -*- coding: utf8 -*- """Jinja globals module for pybossa-discourse.""" from flask import Markup, request from . import discourse_client class DiscourseGlobals(object): """A class to implement Discourse Global variables.""" def __init__(self, app): self.url = app.config['DISCOURSE_URL'] app...
Python
0
@@ -302,16 +302,52 @@ E_URL'%5D%0A + self.api = discourse_client%0A
d97f94a55637c5a40e81facab66d132793988d1e
test for more spatial_scale in roi_max_pooling_2d
tests/chainer_tests/functions_tests/pooling_tests/test_roi_max_pooling_2d.py
tests/chainer_tests/functions_tests/pooling_tests/test_roi_max_pooling_2d.py
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr def _pair(x): if isinstance(x, chainer.utils.collections_abc.Iterable): return x return x, x @...
Python
0.000001
@@ -429,16 +429,54 @@ 5, 7)%5D,%0A + 'spatial_scale': %5B0.6, 1.0, 2.0%5D,%0A %7D))%0Aclas @@ -1131,41 +1131,8 @@ ze)%0A - self.spatial_scale = 0.6%0A
723cd31d57667e7ad1021e50df9d04dd367a17b9
Update loudness_zwicker_lowpass_intp.py
mosqito/functions/loudness_zwicker/loudness_zwicker_lowpass_intp.py
mosqito/functions/loudness_zwicker/loudness_zwicker_lowpass_intp.py
# -*- coding: utf-8 -*- """ @date Created on Fri May 22 2020 @author martin_g for Eomys """ # Standard library imports import math import numpy as np #Needed for the loudness_zwicker_lowpass_intp_ea function from scipy import signal def loudness_zwicker_lowpass_intp(loudness, tau, sample_rate): """1st order low-p...
Python
0.000002
@@ -2645,286 +2645,8 @@ s)%0A%0A - # Sustituir este bucle for por scipy.signal.lfilter https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.lfilter.html%0A # ui_delta_filt = scipy.signal.lfilter (b0 , a0, ui_delta )%0A #filt_loudness = ui_delta_filt.reshape(loudness.shape%5B0%5D,lp_iter).T%5B:,...
566c9088033158b4b707090a616a5952841c57aa
Correct an error in random_one_hot_topological_dense_design_matrix
pylearn2/testing/datasets.py
pylearn2/testing/datasets.py
""" Simple datasets to be used for unit tests. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "Ian Goodfellow" __email__ = "goodfeli@iro" import numpy as np from pylearn2.datasets.dense_desi...
Python
0.000064
@@ -1610,19 +1610,27 @@ dint(0, -dim +num_classes , (num_e
15621212e635792bd6e5f28a58052d6b881d42de
Call test func properly.
fabfile.py
fabfile.py
#!/usr/bin/env python import os from fabric.api import * from fabric.contrib.console import confirm from fab_shared import _nose_test, _test, _package_deploy as deploy env.unit = "django-comrade" env.root_dir = os.path.abspath(os.path.dirname(__file__)) env.scm = env.root_dir env.allow_no_tag = True env.upload_to_s3 ...
Python
0
@@ -373,10 +373,15 @@ ose_test +, dir )%0A
edb07b507aa93ead278cecd168da83a4be68b2ba
Disable front-end testing on Travis
bluebottle/settings/travis.py
bluebottle/settings/travis.py
# SECRET_KEY and DATABASES needs to be defined before the base settings is imported. SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } from .base import * # # Put the travis-ci e...
Python
0
@@ -353,16 +353,94 @@ low.%0A#%0A%0A +# Disable Selenium testing for now on Travis because it fails inconsistent.%0A# SELENIUM
a714e48ad09ce3c730cbd8b3ad04ffefba4b8661
Remove obsolete "babel compile" command
fabfile.py
fabfile.py
from fabric.api import env, task, local, cd, lcd, run, sudo, put from tempfile import NamedTemporaryFile env.use_ssh_config = True env.hosts = ['skylines@skylines'] APP_DIR = '/home/skylines' SRC_DIR = '%s/src' % APP_DIR @task def deploy(branch='master', force=False): deploy_ember() push(branch, force) ...
Python
0.000005
@@ -695,74 +695,8 @@ ')%0A%0A - # compile i18n .mo files%0A manage('babel compile')%0A%0A
1a29168aa2d621664bfc7e2491f1f18edc796501
Add a fab job for local tx pull and compile
fabfile.py
fabfile.py
# -*- coding: utf-8 -*- import os import sys from fabric.api import cd, run, sudo, lcd, local from fabric.api import task from fabric.api import env env.forward_agent = True PROJECT_DIR = os.environ.get('PROJECT_DIR', '') PROJECT_NAME = os.environ.get('PROJECT_NAME', '') DJANGO_DIR = PROJECT_DIR + '/' + PROJECT_NA...
Python
0
@@ -2125,16 +2125,22 @@ )%0A%0A%0A +@task%0A def pu -sh +ll _tra @@ -2157,64 +2157,129 @@ -%22%22%22Used on Travis to push translation on commit.%0A %22%22%22 +with lcd('src'):%0A local('tx pull')%0A local('python manage.py compilemessages')%0A%0A%0A@task%0Adef push_transifex(): %0A
d80b718c1bdebfd517816d8ec15765ceeb32db31
fix duplicate room routing
iembot/iemchatbot.py
iembot/iemchatbot.py
""" Chat bot implementation of IEMBot """ from __future__ import print_function import datetime import re from twisted.internet import reactor from twisted.web.client import HTTPClientFactory from twisted.mail.smtp import SMTPSenderFactory from twisted.words.protocols.jabber import jid from twisted.words.xish import x...
Python
0.000001
@@ -5885,16 +5885,42 @@ (elem)%0A%0A + alertedRooms = %5B%5D%0A @@ -5996,32 +5996,144 @@ t(channel, %5B%5D):%0A + if room in alertedRooms:%0A continue%0A alertedRooms.append(room)%0A
00d0df200f8b6e30e5a772107c35d9c39d634cf2
Clean up
fabfile.py
fabfile.py
#! /usr/bin/env python import json from os.path import dirname, abspath, join from config.settings import base from fabric.api import local from fabric.context_managers import lcd BASE_DIR = dirname(abspath(__file__)) def manage(command, args=''): """Dev only - a convenience""" local('{}/manage.py {} {}'.f...
Python
0.000002
@@ -1825,42 +1825,8 @@ a()%0A - manage(%22load_service_groups%22)%0A
b9f0bd5d63c5f5460a4259786fbb045196af1e38
Update at 2017-09-17 13-32-34
preprocess.py
preprocess.py
import json import argparse import subprocess import shutil from pathlib import Path from myutils import * from tqdm import tqdm parser = argparse.ArgumentParser() parser.add_argument('ds', help='dataset', type=str, default='~/ds/') args = parser.parse_args() dataset = Path(args.ds).expanduser() video_dirs = sorted(d...
Python
0
@@ -392,36 +392,35 @@ l_dir = Path('./ -data +tmp /hl/')%0A targe @@ -484,36 +484,35 @@ n_dir = Path('./ -data +tmp /non/')%0A targ
bc3c057a2cc775bcce690e0e9019c2907b638101
Bump version
pytablereader/__version__.py
pytablereader/__version__.py
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.25.4" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
Python
0
@@ -209,9 +209,9 @@ .25. -4 +5 %22%0A__
ebb3273d0d1702fe8b0f90145e4786c694178c9b
edit labels
importer/Uploader.py
importer/Uploader.py
from wikidataStuff.WikidataStuff import WikidataStuff as WDS import pywikibot import importer_utils as utils from os import path MAPPING_DIR = "mappings" PROPS = utils.load_json(path.join(MAPPING_DIR, "props_general.json")) class Uploader(object): TEST_ITEM = "Q4115189" def make_labels(self): label...
Python
0.000001
@@ -513,16 +513,29 @@ ls(self, + target_item, labels) @@ -548,20 +548,228 @@ -print(labels +for label in labels:%0A target_item.get()%0A name = labels%5Blabel%5D%5B'value'%5D%0A lang = labels%5Blabel%5D%5B'language'%5D%0A self.wdstuff.addLabelOrAlias(lang, name, targ...
da4900798c2b052f3d317cc419e829cebfb3701c
Remove unused lines of code
pytablereader/sqlite/core.py
pytablereader/sqlite/core.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import from __future__ import unicode_literals from .._constant import TableNameTemplate as tnt from .._validator import FileValidator from ..interface import TableLoader from .formatter import SqliteTab...
Python
0.000102
@@ -1811,146 +1811,25 @@ -from simplesqlite import SimpleSQLite%0A%0A self._validate()%0A%0A #formatter = SqliteTableFormatter(SimpleSQLite(self.source, %22r%22)) +self._validate()%0A %0A
8d02c7fc83722a8aaa1e676ec2175937aa3babe8
Switch to context manager wrapper for 'sdist' target.
fabfile.py
fabfile.py
"""Fabric file.""" from __future__ import with_statement import os from fabric.api import abort, local, settings ############################################################################### # Constants ############################################################################### MOD = "cloud_browser" PROJ = "cl...
Python
0
@@ -62,16 +62,54 @@ ort os%0A%0A +from contextlib import contextmanager%0A from fab @@ -147,16 +147,17 @@ ttings%0A%0A +%0A ######## @@ -1230,17 +1230,41 @@ )%0A%0A%0A +@contextmanager%0A def -s +_ dist +_wrapper ():%0A @@ -1274,33 +1274,66 @@ %22%22%22 -Package into distribution +Add temporary distribution ...
765de5ed9fd003e1d30edf44f427baa2347f8809
Move neighbours calculation to separated function
procedural.py
procedural.py
""" The Game of Life implemented in procedural style. https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life """ from copy import deepcopy from random import random from time import sleep import pygame WIDTH = 300 HEIGHT = 300 CELL_SIZE = 5 BG_COLOR = 255, 255, 255 CELL_COLOR = 0, 100, 0 INTERVAL = 0.01 INIT_DENSITY ...
Python
0.000001
@@ -1521,26 +1521,366 @@ # -Define neighbours. +Count alive neighbours.%0A neighbours = sum(1 for nx, ny in get_neighbours(x, y, x_len, y_len)%0A if grid%5Bny%5D%5Bnx%5D)%0A%0A # Choice new value.%0A if grid%5By%5D%5Bx%5D:%0A return 2 %3C= neighbours %3C= 3%0A else:%0A ...
f727ece7b3da04c79f52a1fb4b24e46ae41a543f
add regex fallback back to title parser
archivebox/extractors/title.py
archivebox/extractors/title.py
__package__ = 'archivebox.extractors' import re from html.parser import HTMLParser from pathlib import Path from typing import Optional from ..index.schema import Link, ArchiveResult, ArchiveOutput, ArchiveError from ..util import ( enforce_types, is_static_file, download_url, htmldecode, ) from ..con...
Python
0.000001
@@ -513,16 +513,266 @@ gress%0A%0A%0A +%0AHTML_TITLE_REGEX = re.compile(%0A r'%3Ctitle.*?%3E' # start matching text after %3Ctitle%3E tag%0A r'(.%5B%5E%3C%3E%5D+)', # get everything up to these symbols%0A re.IGNORECASE %7C re.MULTILINE %7C re.DOTALL %7C re.UNICODE,%0A...
fa18bbc7f795213f198c874a90ef03f12bd0016f
add wordnet to nltk init
fabfile.py
fabfile.py
""" Define common admin and maintenance tasks here. For more info: http://docs.fabfile.org/en/latest/ """ import sys from path import path from fabric.api import run, env, prefix, quiet, abort PROJECT_ROOT = path(__file__).abspath().realpath().dirname() sys.path.append(PROJECT_ROOT / 'setup') from fabutils import ...
Python
0.000094
@@ -616,16 +616,27 @@ %22punkt%22 +, %22wordnet%22 %5D%0A%0Apip_i
9a6dcfdd3c4b445089b74840d55f420f038833d4
Update MM_filter_ont_1_AM.py
python/MM_filter_ont_1_AM.py
python/MM_filter_ont_1_AM.py
from Bio import SeqIO import math from Tkinter import Tk name = '/$DataFolder/02_seqtk/unmapped_reads.fastq' qs = 9 output = '/$DataFolder/03_fastq9/unmapped_reads_q9' count = 0 for rec in SeqIO.parse(name, "fastq"): count += 1 print("%i reads in fastq file" % count) qual_sequences = [] # Setup an empty list c...
Python
0.000002
@@ -57,25 +57,24 @@ %0A%0A%0Aname = '/ -$ DataFolder/0 @@ -125,9 +125,8 @@ = '/ -$ Data
de6106c0f5156d8bbe72428bff2a015278fa90cc
Add secret key generation
project/settings.py
project/settings.py
# Django settings for project project. import os ROOT_PATH = os.getcwd() from secret_key import SECRET_KEY DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgre...
Python
0.000005
@@ -43,16 +43,31 @@ port os%0A +import random%0A%0A ROOT_PAT @@ -83,16 +83,335 @@ tcwd()%0A%0A +try:%0A from secret_key import SECRET_KEY%0Aexcept ImportError:%0A path = os.path.join(ROOT_PATH, %22project/secret_key.py%22)%0A key = ''.join(%5Brandom.choice(%22abcdefghijklmnopqrstuvwxyz0123456789!@#$%25%5E&*...
6499026980c76ebebd4c36a90760c0e0978b5312
Add Kruskal's complexity
python/graphs/mst_kruskal.py
python/graphs/mst_kruskal.py
# -*- coding: utf-8 -*- """ Kruskal MST Algorithm --------------------- Offers two functions that calculate the Minimum Spanning Tree of an undirected graph. - kruskal Parameters: Edges A list of the graph's edges. Each element is a tuple in the for...
Python
0.002423
@@ -731,16 +731,58 @@ om, To). +%0A%0A Complexity%0A %CE%98( %7CE%7C log(%7CE%7C) ) %0A%22%22%22%0A%0Afr
7aac72b0c0877f58d7a9f53a2e5349c229281e73
Fix Location header setting.
app/handlers/upload.py
app/handlers/upload.py
# 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 distributed in the hope that it will be usefu...
Python
0.001337
@@ -6481,24 +6481,81 @@ e_url(path)%0A + if location is not None:%0A
1ad51230f58070e9713d40bb611d823ce33a3ca2
fix particle validation (e.g., xbrli:context contents)
arelle/XmlValidateParticles.py
arelle/XmlValidateParticles.py
''' Created on Jan 20, 2012 @author: Mark V Systems Limited (c) Copyright 2012 Mark V Systems Limited, All rights reserved. ''' from lxml import etree from arelle.ModelDtsObject import (ModelConcept, ModelType, ModelGroupDefinition, ModelAll, ModelChoice, ModelSequence, ...
Python
0
@@ -4871,29 +4871,8 @@ elt -.children%5BiNextChild%5D %0A
615ef6097a4b43aba041d97b2c971329dcbcac0c
change smtp to ms to test mail function
config.py
config.py
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string' SQLALCHEMY_COMMIT_ON_TEARDOWN = True MAIL_SERVER = 'smtp.gmail.com' MAIL_PORT = 587 MAIL_USE_TLS = True MAIL_USERNAME = os.environ.get('MAIL_USERNAME...
Python
0
@@ -212,15 +212,22 @@ smtp -.g +- mail. +outlook. com' @@ -263,32 +263,57 @@ _USE_TLS = True%0A + MAIL_USE_SSL = False%0A MAIL_USERNAM
449c49901e4a8e202cb4cf08c7404747c7be54d9
Create models __init__.py file.
app/models/__init__.py
app/models/__init__.py
""" Initialisation file for models directory. """ # Create an _`_all__` list here, using values set in other application files. from .places import __all__ as placesModel from .trends import __all__ as trendsModel from .tweets import __all__ as tweetsModel from .cronJobs import __all__ as cronJobsModel __all__ = places...
Python
0
@@ -38,16 +38,260 @@ rectory. +%0A%0ANote that the model files cannot be be imported directly with%0A%60python -m models/%7Bmodel%7D.py%60, if they have been included here. Since%0Athis __init__ file will add the table names to the name space before the%0Afile is run, which causes a conflict. %0A%22%22%22%0A# C
1dcdda2297b9ecda97cccfd6034737f103bae171
use setup_limited_release
corehq/apps/cleanup/management/commands/populate_sql_model_from_couch_model.py
corehq/apps/cleanup/management/commands/populate_sql_model_from_couch_model.py
import logging import sys import traceback from django.core.management.base import BaseCommand, CommandError from django.core.management import call_command from django.db import transaction from corehq.dbaccessors.couchapps.all_docs import get_all_docs_with_doc_types, get_doc_count_by_type from corehq.util.couchdb_m...
Python
0.000001
@@ -4814,38 +4814,51 @@ nv%3E -deploy commcare --commcare-rev +fab setup_limited_release --set code_branch =%7Bcl @@ -4941,16 +4941,64 @@ o-manage + --release %3Crelease created by previous command%3E %7Bcomman
966a442eb0799b6e25d601d2f27affc1cc74aefd
fix grep socket error in lscpu command
python/paddle/v2/__init__.py
python/paddle/v2/__init__.py
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
Python
0.000002
@@ -2176,60 +2176,58 @@ en(%22 -lscpu %7Cgrep %5C%22Socket%5C%22 %7Cawk -F':' '%7Bprint $2%7D'%7Cxargs +grep 'physical id' /proc/cpuinfo %7C sort -u %7C wc -l %22)%0A @@ -2319,86 +2319,55 @@ pen( -%0A %22lscpu %7Cgrep %5C%22per socket%5C%22 %7Cawk -F':' '%7Bprint $2%7D'%7Cxargs +%22grep 'core id'...
9338814b45c7ee658955e9342ae5b87bf577e83b
Fix deprecated can_build warning
config.py
config.py
def can_build(platform): return True def configure(env): pass
Python
0.000001
@@ -7,16 +7,21 @@ n_build( +env, platform
3d6d89101d67219d51ad989143c5c0287556b725
Allow removal on preview and editing on staging
config.py
config.py
# coding=utf-8 import os import jinja2 from dmutils.status import enabled_since, get_version_label from dmutils.asset_fingerprint import AssetFingerprinter class Config(object): VERSION = get_version_label( os.path.abspath(os.path.dirname(__file__)) ) SESSION_COOKIE_NAME = 'dm_session' SESSI...
Python
0
@@ -3486,33 +3486,33 @@ since('2016-01-2 -0 +5 ')%0A%0A%0Aclass Live( @@ -3854,20 +3854,139 @@ n):%0A -pass +FEATURE_FLAGS_EDIT_SERVICE_PAGE = enabled_since('2015-06-03')%0A FEATURE_FLAGS_EDIT_SECTIONS = enabled_since('2016-01-25') %0A%0Aconfig
9a84296ead813a926b61f296020c55574df0e151
clean config
config.py
config.py
from module.lifegame.synergy.collection.LifeGameCollection import LifeGameCollection from module.lifegame.synergy.LifeGameSimulation import LifeGameSimulation from module.lifegame.synergy.collection.LifeGameCollectionConfiguration import LifeGameCollectionConfiguration from module.lifegame.display.curses_visualisation ...
Python
0.000001
@@ -1015,85 +1015,7 @@ ': %7B -%0A 'action_manager': %7B%0A 'max_recursions': 1000%0A %7D%0A %7D%0A%7D
f3f428480a8e61bf22532503680e718fd5f0d286
Write the first view - news feed.
fb/views.py
fb/views.py
from django.shortcuts import render # Create your views here.
Python
0
@@ -34,30 +34,240 @@ er%0A%0A -# Create your views here. +from fb.models import UserPost%0A%0A%0Adef index(request):%0A if request.method == 'GET':%0A posts = UserPost.objects.all()%0A context = %7B%0A 'posts': posts,%0A %7D%0A return render(request, 'index.html', context) %0...
72f429d74f04a700aa0240f1cb934dfcca979384
Remove comments
config.py
config.py
import os import yaml LAB_ENV = os.environ.get('LAB_ENV', 'development') env_config = yaml.load(open('labmanager/config/database.yml'))[LAB_ENV] # Have you run... "pip install git+https://github.com/lms4labs/rlms_weblabdeusto.git" first? RLMS = ['weblabdeusto','unr'] SQLALCHEMY_ENGINE_STR = os.environ.get('DATABASE_...
Python
0
@@ -1199,37 +1199,8 @@ %5D)%0A%0A -%0Aprint SQLALCHEMY_ENGINE_STR%0A #%0A# @@ -1294,584 +1294,4 @@ lse%0A -%0A# %0A# heroku = os.environ.get('HEROKU', None)%0A# testing = os.environ.get('TESTING_LABMANAGER', None)%0A# if heroku:%0A# SQLALCHEMY_ENGINE_STR = os.environ.get('DATABASE_URL')%0A# USE_PYMYSQL = Fa...
6b3a3d1ccf2f54d859b25904bf33edf917931529
fix url
incoming-webhooks.py
incoming-webhooks.py
# coding:utf-8 '''This program is class for incoming webhooks''' import requests import json class IncomingWebhooks: """Incoming webhooks""" def __init__(self, url, text, username=u'', icon_emoji=u'', link_names=0): """Set Property""" self.url = '' self.data = json.dumps({ ...
Python
0.000008
@@ -172,14 +172,21 @@ url +='' , text +=u'' , us @@ -274,18 +274,19 @@ f.url = -'' +url %0A
a0f12252a83d3a04cfc3b73be0fa7d39809bfd59
Bump version.
config.py
config.py
""" Configuration file for Atlas All variable settings should go here so values can be propagated to the various functions from a central location. """ import re import os # Set Atlas location atlas_location = os.path.dirname(os.path.realpath(__file__)) # Import config_servers.py. try: from config_servers impor...
Python
0
@@ -1598,7 +1598,7 @@ .0.2 -4 +5 '%0A
2c240b49276c008dbe6fda2d25861d1ee337fd27
Update pbimport.py (#10)
protofuzz/pbimport.py
protofuzz/pbimport.py
#!/usr/bin/env python3 ''' Collection of functions dealing with locating and using the protobuf compiler. ''' import sys import os import tempfile import subprocess import re import importlib import importlib.util __all__ = ['BadProtobuf', 'ProtocNotFound', 'from_string', 'from_file', 'type...
Python
0
@@ -707,19 +707,21 @@ name +s = +%5B 'protoc' %0D%0A%0D%0A @@ -716,16 +716,31 @@ 'protoc' +, 'protoc.exe'%5D %0D%0A%0D%0A @@ -773,11 +773,18 @@ lit( -':' +os.pathsep ) or @@ -830,16 +830,70 @@ paths:%0D%0A + for protoc_filename in protoc_filenames:%0D%0A @@ -943,24 +943,28 @@ _filen...
c8b04d46587aefc26bb16865bfc8946ee683d68c
Convert dictionary to dict literal
app/slot/controller.py
app/slot/controller.py
# 3rd Party Modules import datetime import os from flask import request, redirect, render_template, json from app import app import config from auth import requires_auth from app.slot import db_fieldbook, messaging import utils def index(): ops = db_fieldbook.get_all_opportunities() for op in ops: i...
Python
0.999999
@@ -2634,55 +2634,25 @@ -# TODO: Convert to dict literal%0A sms = dict( +sms = %7B%0A ' serv @@ -2661,17 +2661,19 @@ e_number -= +': str(requ @@ -2701,22 +2701,18 @@ - +' mobile -= +': str( @@ -2746,23 +2746,19 @@ - +' message -= +': str( @@ -2778,17 +2778,22 @@ 'Bod...
7e25321a6f6b0c6817eb14232f732cfccab8fdd8
Update utils.py
intelmq/lib/utils.py
intelmq/lib/utils.py
import logging import hashlib def decode(text, encodings=["utf-8"], force=False): for encoding in encodings: try: return text.decode(encoding) except ValueError as e: pass if force: for encoding in encodings: try: return text....
Python
0
@@ -51,32 +51,47 @@ codings=%5B%22utf-8%22 +, %22ISO-8859-15%22 %5D, force=False): @@ -1417,8 +1417,9 @@ digest() +%0A
a05e4e478a932d18350a83687ee80103c8398f0d
Change winrate threshold
config.py
config.py
# hearthpy global config db_filename = "hearthpy.db" auth_filename = "hearthpy.auth" port = 5000 match_limit = 20 front_match_limit = 21 card_limit = 22 winrate_tiers = [50, 60] # % min_games_deck = 20 deck_template = "^(Dd|Hr|Me|Pn|Pt|Re|Sn|Wk|Wr) .+ \d+\.\d+$" card_image_url = "http://wow.zamimg.com/images/hearthsto...
Python
0.000001
@@ -168,18 +168,18 @@ = %5B50, -60 +55 %5D # %25%0Ami
2dd68e018ad9e0bce16157fa8a748b5d075196b2
fix test
test.py
test.py
import os import clipmon import conf with open('test_cases.txt') as f: lines = f.read().splitlines() for i in range(0, len(lines), 3): test_line, expected = lines[i:i+2] if expected == 'None': expected = None actual = clipmon.clip_str_to_path_line(test_line) expected, actual = [ o...
Python
0.000002
@@ -101,16 +101,50 @@ ines()%0A%0A +proj_dir = conf.curr_proj_dirs%5B0%5D%0A for i in @@ -311,16 +311,26 @@ est_line +, proj_dir )%0A ex @@ -399,26 +399,16 @@ _dir%3E', -conf.curr_ proj_dir
8eb0600b686a232b651d4e9cd6ee0669fb764390
Update at 2017-07-21 01-03-28
test.py
test.py
import json import random import numpy as np import scipy.misc from moviepy.editor import VideoFileClip from tqdm import tqdm def sample_windows(video_dirs, n_samples, timesteps, fps): windows = [] for video_dir in video_dirs: video = VideoFileClip(str(video_dir / 'video.mp4')) n_frames = int(...
Python
0
@@ -3788,18 +3788,17 @@ rs%5B:3%5D, -10 +5 000, 10, @@ -3849,17 +3849,17 @@ s%5B-1:%5D, -2 +1 000, 10,
a8e2d43143e0e6aa04d8f4da28c142187fff4b07
Fix root.protocol
test.py
test.py
import os import select import threading import traceback import asyncio import aiotkinter import tkinter import tkinter.messagebox async def async_loop(): print("Thanks for calling") while True: await asyncio.sleep(1) print("Ping!") def async_cb(coro_fn, loop): async def wrapper(): ...
Python
0.001113
@@ -2739,16 +2739,25 @@ INDOW%22, +async_cb( quit_act @@ -2759,16 +2759,23 @@ t_action +, loop) )%0A qu
e978b8be7ccfd9206d618f5a3de855a306ceccfe
Test if rotor encodes with different offset properly
test.py
test.py
import unittest from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen class RotorTestCase(unittest.TestCase): def test_rotor_encoding(self): rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q') self.assertEqual('E', rotor.encode('A')) def test_rotor_reverse_encoding(self): ...
Python
0.000001
@@ -700,16 +700,272 @@ ('A'))%0A%0A + def test_rotor_different_offset(self):%0A rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q',%0A offset='B')%0A self.assertEqual('D', rotor.encode('A'))%0A self.assertEqual('W', rotor.encode_reverse('A'))%0A%0A %0Adef run
3d70e7705b6c151e8df19903a099cef8b907f204
seqence No. mamaner
test.py
test.py
# # class FuncTest(): def __init__(self, f): self.func = f def plus1(self, v): return v+1 def minus1(self, v): return v-1 def call(self, f, args): if f in FuncTest.__dict__: mth = FuncTest.__dict__[f] return mth(self, args) else: print "No such method" def callfunc(se...
Python
0.999994
@@ -668,274 +668,537 @@ )%0A%0A%0A -req=%5B1,2,3,4,0%5D%0Acurrent=0%0Alast=4%0A%0Adef getq():%0A global req, current, last%0A if req%5Bcurrent%5D == -1: return None%0A v=req%5Bcurrent%5D%0A req%5Bcurrent%5D=-1%0A current=v%0A return v%0A%0Adef retq(v):%0A glob +class adminId():%0A def __init__(se...
cb5a03571a827a1a8e8bf8c7525956b04173361c
Create test case for Enigma with default pieces
test.py
test.py
import unittest from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen class RotorTestCase(unittest.TestCase): def test_rotor_encoding(self): rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q') self.assertEqual('E', rotor.encode('A')) def test_rotor_reverse_encoding(self): ...
Python
0
@@ -2144,16 +2144,530 @@ 'PL')%0A%0A%0A +class EnigmaTestCase(unittest.TestCase):%0A def setUp(self):%0A self.rotors = (%0A Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q'),%0A Walzen(wiring='AJDKSIRUXBLHWTMCQGZNPYFVOE', notch='E'),%0A Walzen(wiring='BDFHJLCPRTXVZNYEIWG...
4b970e28f57fe0a91cf43f6fb870817c7607f1d6
Indent the courses when printed
course.py
course.py
from major import Major from ID import ID from helpers import get_readable_list from professor import process_professor all_courses = {} def getCourse(identifier, year=None, semester=None): try: courseID = ID(combined=identifier) except Exception: print("The course '" + str(identifier) + "' cannot exist.") re...
Python
0
@@ -4424,16 +4424,40 @@ output = + %22%22%0A%09%09output += %22 %22 + str(sel @@ -4711,16 +4711,17 @@ += %22 %5D%22%0A +%0A %09%09return
5173f9e37de4bddda59c76b6e48fe8ccfc9692f1
Make cython.py executable and add Unix shebang
cython.py
cython.py
# # Cython -- Main Program, generic # if __name__ == '__main__': import os import sys # Make sure we import the right Cython cythonpath, _ = os.path.split(os.path.realpath(__file__)) sys.path.insert(0, cythonpath) from Cython.Compiler.Main import main main(command_line = 1) else: ...
Python
0.000003
@@ -1,8 +1,31 @@ +#!/usr/bin/env python%0A%0A #%0A# Cy
94c647ac51a9547371bb7326964995904688abe3
Add django-import-export to admin
woodstock/voting/admin.py
woodstock/voting/admin.py
import csv from django.contrib import admin from django.http import HttpResponse from woodstock.voting.models import MozillianGroup, MozillianProfile, Vote def export_as_csv_action(description=None, fields=None, exclude=None, header=True): """ This function returns an export csv act...
Python
0.000006
@@ -1,16 +1,4 @@ -import csv%0A%0A from @@ -30,1580 +30,1234 @@ min%0A +%0A from -django.http import HttpResponse%0A%0Afrom woodstock.voting.models import MozillianGroup, MozillianProfile, Vote%0A%0A%0Adef export_as_csv_action(description=None, fields=None, exclude=None,%0A header=True):%0A ...
dfe813e55be813bd52ca566fff527149e9d1d87a
support use_cdn, http_cache
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/production.py
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/production.py
import os from .base import * # Do not set SECRET_KEY, Postgres or LDAP password or any other sensitive data here. # Instead, create a local.py file on the server. # Disable debug mode DEBUG = False TEMPLATE_DEBUG = False # Compress static files offline and minify CSS # http://django-compressor.readthedocs.org/en/l...
Python
0.999803
@@ -1204,16 +1204,544 @@ MAIL'%5D%0A%0A +if 'CACHE_PURGE_URL' in env:%0A INSTALLED_APPS += ( 'wagtail.contrib.wagtailfrontendcache', )%0A WAGTAILFRONTENDCACHE = %7B%0A 'default': %7B%0A 'BACKEND': 'wagtail.contrib.wagtailfrontendcache.backends.HTTPBackend',%0A 'LOCATION': env%5B'CACH...
0b88a39760f949e4eee80c8e4da6d057e2ea9d1d
Set random size between 2 and 30 if no size value is passed
app/tests/factories.py
app/tests/factories.py
import hashlib from datetime import timedelta from uuid import uuid4 import factory import factory.fuzzy from django.conf import settings from django.utils import timezone from grandchallenge.cases.models import Image, RawImageUploadSession, ImageFile from grandchallenge.challenges.models import ( Challenge, ...
Python
0.000003
@@ -6174,17 +6174,17 @@ randint( -1 +2 , 30)%0A
b97b68ae1c99820f32846ff40d8846ec2c53362d
Add validation to TestGrammar
app/tests/test_note.py
app/tests/test_note.py
import json import os import tempfile import unittest import pytz import requests from app import note_util class TestNote(unittest.TestCase): def setUp(self): self.note = note_util.Note() def test_parse_time(self): time = 1504334092 self.note.parse_time(time, pytz.timezone('America...
Python
0
@@ -1769,32 +1769,101 @@ test.TestCase):%0A + IGNORED = %5B'PUNCTUATION_PARAGRAPH_END', 'MORFOLOGIK_RULE_EN_US'%5D%0A def check_gr @@ -2226,14 +2226,219 @@ -# TODO +content = json.loads(response.content)%0A matches = content%5B'matches'%5D%0A matches = %5Bm for m in matches if m%5B'rule'%5D...
4b013c938c2c9b1ce885f6ad42c376903bb3f2f4
Update course_structure_to_mongod.py
course_structure_parsing/course_structure_to_mongod.py
course_structure_parsing/course_structure_to_mongod.py
''' Insert the edx course_structure-prod-analytics .json file into mongodb database for aggregation, see README.md The one JSON object will be split into sub objects, in which all the first level keys will become the _id of its object value ''' import pymongo import json import copy # SPECIFY .mongo filepath filena...
Python
0.000001
@@ -387,16 +387,239 @@ .json'%0A%0A +# If user wants to pass path to file via command line arguments. then user can do the following:%0A# filename = sys.argv%5B1%5D # On the command line, user can run the command: python course_structure_to_mongod.py path_to_file%0A%0A%0A # SPECIF
2b41703addd520af66a01618df6e7db35f0cb87d
fix indentation
temba/types.py
temba/types.py
from __future__ import unicode_literals import datetime import pytz import requests DATETIME_FORMATS = '%Y-%m-%dT%H:%M:%S.%fZ', '%Y-%m-%dT%H:%M:%SZ' class TembaException(Exception): """ Exception class for all errors from client methods """ def __init__(self, msg, caused_by=None): self.msg ...
Python
0.000358
@@ -1855,28 +1855,24 @@ - raise ValueE
d7157934c24d9e27db2a80a55288f09a188f66bd
Remove the libmesos.so mount
containerizer/commands/launch.py
containerizer/commands/launch.py
""" _ _ | | __ _ _ _ _ __ ___| |__ | |/ _` | | | | '_ \ / __| '_ \ | | (_| | |_| | | | | (__| | | | |_|\__,_|\__,_|_| |_|\___|_| |_| Containerizer subcommand to launch a new container. """ import os import logging from urlparse import urlparse from containerizer import app, recv_proto, co...
Python
0.000002
@@ -2469,118 +2469,8 @@ RY'%5D -%0A arguments.extend(%5B%22-v%22, %22%25s:/usr/local/lib/%25s%22 %25 (native_library, os.path.basename(native_library))%5D) %0A%0A
55ea9ef5da4fde09ec3b52a8e5fdbe0fc8a3ffdc
Clarify docstrings for ancestors, descendants.
refcycle/i_directed_graph.py
refcycle/i_directed_graph.py
# Copyright 2013 Mark Dickinson # # 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,...
Python
0
@@ -2631,16 +2631,39 @@ n start +vertex, including that vertex.%0A @@ -3465,16 +3465,39 @@ eachable +, including that vertex .%0A%0A
89c960bbe4154914f39391e4f0a4d47db33c01fb
Update test baseline
testing/test-cases/selenium-tests/glMultiPolygons/testGlMultiPolygons.py
testing/test-cases/selenium-tests/glMultiPolygons/testGlMultiPolygons.py
#!/usr/bin/env python from selenium_test import FirefoxTest, ChromeTest class glMultiPolygonsBase(object): testCase = ('glMultiPolygons',) testRevision = 3 def loadPage(self): self.resizeWindow(640, 480) self.loadURL('glMultiPolygons/index.html') self.wait() self.resizeWin...
Python
0
@@ -161,9 +161,9 @@ n = -3 +4 %0A%0A
e2a6347387e8ef96709105cc2ddd85ed0b7e74b5
Add a unittest asserting that max pooling is left inverse of unpooling
tests/chainer_tests/functions_tests/pooling_tests/test_max_pooling_2d.py
tests/chainer_tests/functions_tests/pooling_tests/test_max_pooling_2d.py
import unittest import mock import numpy import six import chainer from chainer import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition @testing.parameterize(*testing.product({ 'cover_all': [T...
Python
0.00002
@@ -4966,16 +4966,491 @@ udnn)%0A%0A%0A +class TestMaxPoolingUnpooling(unittest.TestCase):%0A%0A def setUp(self):%0A pass%0A%0A def test_identity(self):%0A h = w = 5%0A kh = kw = 3%0A sh = sw = 3%0A ph = pw = 0%0A x = numpy.random.uniform(0, 1, (1, 1, h, w)).astype(numpy...
674ed8a233dd2ea2d8e06ad302ce3615aaa03298
Use Python 3 octal syntax
pushbullet_cli/app.py
pushbullet_cli/app.py
#!/usr/bin/env python import argparse from functools import wraps import os import os.path from pushbullet import PushBullet import re import sys from contextlib import contextmanager KEY_PATH = os.path.expanduser("~/.pushbulletkey") URL_RE = re.compile(r"^[a-zA-Z]+://.+$") @contextmanager def private_files(): ...
Python
0.000429
@@ -334,16 +334,17 @@ .umask(0 +o 77)%0A
b380bfbfb15908c26fda5ad3600bf0b0c3186224
unicode-ize this
pwkit/ninja_syntax.py
pwkit/ninja_syntax.py
#!/usr/bin/python """Python module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that already use Python. """ import re import textwrap def escape_path(word): return word.replace('$ ', '$$ ').replace(' ', ...
Python
0.999982
@@ -1,21 +1,41 @@ # -!/usr/bin/python + -*- mode: python; coding: utf-8 -*- %0A%0A%22%22 @@ -233,16 +233,118 @@ n.%0A%22%22%22%0A%0A +# pwkit addition:%0Afrom __future__ import absolute_import, division, print_function, unicode_literals%0A%0A import r
6e9a91d902d543e1715675383162d133a8328741
Rename get_order_argument to get_sort_argument
table/views.py
table/views.py
#!/usr/bin/env python # coding: utf-8 from django.db.models import Q from django.http import HttpResponse from django.utils import simplejson as json from django.views.generic.list import BaseListView from table.forms import QueryDataForm from table.tables import TableDataMap class JSONResponseMixin(object): """...
Python
0.998726
@@ -1694,29 +1694,28 @@ def get_ +s or -der +t _arguments(s @@ -2309,21 +2309,20 @@ elf.get_ +s or -der +t _argumen
4514ddeac5bd2adc5228ecd4cd497059e7c82c88
delete unused code
pyblog/application.py
pyblog/application.py
# -*- coding:utf-8 -*- import os,time,asyncio,json import logging logging.basicConfig(level=logging.ERROR) try: from aiohttp import web except ImportError: logging.error("Can't import module aiohttp") from pyblog.log import Log from pyblog.httptools import Middleware,Route from pyblog.template import Template from...
Python
0.000002
@@ -1409,51 +1409,8 @@ op)%0A -%09%09#pool=yield from create_pool(self._loop)%0A %09%09se @@ -1515,67 +1515,8 @@ rt)%0A -%09%09logging.info(%22server start at http://%25s:%25s%22%25(addr,port))%0A %09%09Lo
4014553a3d7ddad5f86f53e212fd0b15a0535398
Fix template settings
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/deploy.py
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/deploy.py
from base import * DEBUG = False TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': '{{cookiecutter.project_name}}', 'HOST': '', 'USER': '', 'PASSWORD': '', 'CONN_MAX_AGE': 600, } } TEMPLATE_LOADERS = ( ( ...
Python
0.000001
@@ -32,33 +32,8 @@ se%0A%0A -TEMPLATE_DEBUG = DEBUG%0A%0A%0A DATA @@ -268,215 +268,40 @@ LATE -_LOADERS = (%0A (%0A 'django.template.loaders.cached.Loader', (%0A 'django.template.loaders.filesystem.Loader',%0A 'django.template.loaders.app_directories.Loader',%0A )%0A ),%0A) ...
2fbfe01a13a2cd1063cf3909a8e06aee2d751a8d
add docs to semigroup: Map
pymonet/semigroups.py
pymonet/semigroups.py
class Semigroup: """ In mathematics, a semigroup is an algebraic structure consisting of a set together with an associative binary operation. A semigroup generalizes a monoid in that there might not exist an identity element. It also (originally) generalized a group (a monoid with all inverses) ...
Python
0
@@ -2814,16 +2814,116 @@ igroup): +%0A %22%22%22%0A Map is a Semigroup that will always return contated all values inside Map value%0A %22%22%22 %0A%0A de @@ -3035,32 +3035,214 @@ lf, semigroup):%0A + %22%22%22%0A :param semigroup: other semigroup to concat%0A :type semigroup: Map%5B...
0c8ff55e88200e9e9511852e8fad73868833fc55
Improve response-time for quick parallel tasks.
pypeline/atomicset.py
pypeline/atomicset.py
#!/usr/bin/python # # Copyright (c) 2012 Mikkel Schubert <MSchubert@snm.ku.dk> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights #...
Python
0.000001
@@ -3185,32 +3185,58 @@ def join(self):%0A + sleep_time = 0.05%0A commands @@ -3560,16 +3560,54 @@ mmand))%0A + sleep_time = 0.05%0A @@ -3814,33 +3814,128 @@ d))%0A -%0A time.sleep(1 + sleep_time = 0.05%0A%0A time.sleep(sleep_time)...
aa32401c32ab41ec202ab8a440e22046e8c827c4
drop telemetry decorator
ceilometer/tests/tempest/scenario/test_object_storage_telemetry_middleware.py
ceilometer/tests/tempest/scenario/test_object_storage_telemetry_middleware.py
# Copyright 2014 Red Hat # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
Python
0.000259
@@ -5550,21 +5550,8 @@ age' -, 'telemetry' )%0A
2b6ac1f28b85b7726c6fc52eabaabed73acb2a98
add test_view
test.py
test.py
from time import sleep from mutations import Map from mutations import Body from mutations import EnergyBank import logging logging.basicConfig(filename='test.log', level=logging.INFO) def test(): map_ = Map(1000, 1000) for i in range(2): map_.add(EnergyBank(map_)) for i in range(5): map_.add(Body(map_)) f...
Python
0
@@ -1,12 +1,27 @@ +import logging%0A from time im @@ -30,16 +30,144 @@ rt sleep +%0A%0Afrom pyglet import app%0Afrom pyglet.window import Window%0Afrom pyglet.clock import schedule_interval%0A%0Afrom render import MapView %0Afrom mu @@ -245,31 +245,16 @@ rgyBank%0A -import logging%0A %0A%0Aloggin @@ -271,29 +271,8...
ececcee7814466c072948af0522113ee1746cc8f
Fix logging so it goes to stdout
task_runner.py
task_runner.py
import argparse import logging from scrapers import scrape_mps from scrapers import scrape_lords from scrapers import scrape_mps_interests from scrapers import scrape_lords_interests from scrapers import scrape_party_funding from parsers import master_entities from parsers import parse_mps from parsers import parse_l...
Python
0.000011
@@ -1,16 +1,27 @@ +import sys%0A import argparse%0A @@ -1673,16 +1673,26 @@ Handler( +sys.stdout ))%0Aif ar
251df5915b30b4fc9f05051663bcbf44bfd60b0e
Fix non-determininstic library-reindexing test.
cms/djangoapps/contentstore/management/commands/tests/test_reindex_library.py
cms/djangoapps/contentstore/management/commands/tests/test_reindex_library.py
""" Tests for library reindex command """ import sys import contextlib import ddt from django.core.management import call_command, CommandError import mock from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.django_utils import ModuleStoreTe...
Python
0.000001
@@ -6019,32 +6019,37 @@ self.assert +Items Equal(patched_in
1d8f5ec98b764306a63046d3d929d277878d0ad6
remove NL constant
pureyaml/encoder.py
pureyaml/encoder.py
#!/usr/bin/env python # coding=utf-8 from __future__ import absolute_import # noinspection PyCompatibility from future.utils import text_type, binary_type, iteritems, string_types from .nodes import * # noqa from .utils import ContextStack def node_encoder(obj): # noqa if isinstance(obj, dict): items...
Python
0.999999
@@ -1647,26 +1647,8 @@ T')%0A -NL = SYMBOL('NL')%0A %0A%0Acl @@ -2136,34 +2136,36 @@ if next_item is -NL +'%5Cn' :%0A @@ -2612,29 +2612,31 @@ urrent_item -is NL +== '%5Cn' :%0A @@ -2817,101 +2817,8 @@ on:%0A - if next_item is NL:%0A yield '%5Cn'%0A ...