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
ea027e70f94d351fade02a3110135e031b9f52c5
Update botcmd import.
dieHardBot.py
dieHardBot.py
#!/usr/bin/env python """A bot which will respond to various Die Hard character name commands and mentions and respond with a random line spoken by that character in the film. """ from errbot.botplugin import BotPlugin from errbot.jabberbot import botcmd from dieHard import DieHard def generate(character): f...
Python
0
@@ -231,18 +231,8 @@ rbot -.jabberbot imp
ca90b06be21728f83a04cd9425e11e9fa0f4d684
Remove reference to strong, since its not used
dirty_bits.py
dirty_bits.py
from django.db.models import get_models, ManyToManyField from django.db.models.signals import post_init, post_save from threading import Lock hash_fnc = hash REGISTRY_LOCK = Lock() REGISTRY = set() NEW_MODEL_HASH = None def register_all(strict=False): models = get_models() for model in models: regi...
Python
0.000003
@@ -1173,22 +1173,8 @@ ance -, strong=False ):%0A
7b7ff6e8cea6c0811310efb5407eeffe49044992
clean up last_in_suite jobs
teuthology/queue.py
teuthology/queue.py
import argparse import logging import os import subprocess import sys import tempfile import yaml import beanstalkc from teuthology import safepath log = logging.getLogger(__name__) def connect(ctx): host = ctx.teuthology_config['queue_host'] port = ctx.teuthology_config['queue_port'] return beanstalkc....
Python
0
@@ -3094,28 +3094,24 @@ th)%0A - job.delete()
74286f4d631b09d46a0c9df995aa21e608b99dc2
Update regex_utils
text/regex_utils.py
text/regex_utils.py
# coding=utf-8 import re def parse_line(regex , line): if line == None: return None if regex == None: return line items = [] pattern = re.compile(regex) match = pattern.match(line) if match: items = match.groups() return items def check_line(r...
Python
0.000002
@@ -539,16 +539,140 @@ rn False +%0A %0Adef match(regex, line):%0A return check_line(regex, line)%0A%0Adef group(regex, line):%0A return parse_line(regex, line) %0A%0Adef su
c679fcce6e48a445c6af5545977c0a286b4204c4
Fix web.py line reading with empty page id
web.py
web.py
import socket import threading import re import json from collections import defaultdict from html import escape as escape_html from urllib.parse import quote_plus class _Html(object): def __init__(self, template, values): self.value = template.format(*map(escape_html, values)) def __repr__(self): ...
Python
0
@@ -2163,17 +2163,17 @@ %5CS+) (%5CS -+ +* ) (.*)',
462171f13341f7987c84a148d05d44d43f4c7436
Use spawn_id in marker key
web.py
web.py
# -*- coding: utf-8 -*- from datetime import datetime import argparse import json import requests from flask import Flask, render_template from flask_googlemaps import GoogleMaps from flask_googlemaps import Map from flask_googlemaps import icons from requests.packages.urllib3.exceptions import InsecureRequestWarning ...
Python
0.000001
@@ -3583,16 +3583,31 @@ 'key': +'%7B%7D-%7B%7D'.format( pokemon. @@ -3609,32 +3609,51 @@ emon.pokemon_id, + pokemon.spawn_id), %0A 'di
e5fb37ad00eff773640c2c71b2c8b15dda5a8015
Refactor web.py
web.py
web.py
import json import os import logging from flask import Flask, render_template, request, jsonify, redirect, url_for, session from flask_sslify import SSLify from flask_oauth import OAuth from urllib2 import Request, urlopen, URLError from mongo_agent import MongoAgent # Initialize logging and setting to INFO level log...
Python
0
@@ -76,17 +76,8 @@ ate, - request, jso @@ -399,31 +399,27 @@ %0A%0A# -Google Console API valu +Environment variabl es%0AG @@ -529,36 +529,8 @@ T'%5D%0A -REDIRECT_URI = '/gCallback'%0A SECR @@ -567,66 +567,177 @@ Y'%5D%0A -DEBUG = False%0A%0Aapp = Flask(__name__)%0A%0A#sslify = SSLify(app +ENVIRONMENT_TYPE = os...
f900f24320d3e5c715bd7e72b60deb8c5cc2f00a
Move selection of compressed or indented into modifiable section
wf3.py
wf3.py
### Do not edit the lines at the top and bottom of this file. ### Edit the workflow description between START and FINISH comments from balcaza.t2types import * from balcaza.t2activity import * from balcaza.t2flow import * ### START editing your workflow below here # # This example creates a simple nested workflow. Fir...
Python
0
@@ -4257,16 +4257,165 @@ ow 34'%0A%0A +# Set compressed = True to create a smaller workflow file%0A# Set compressed = False to create a workflow indented for readability%0A%0Acompressed = True%0A%0A # FINISH @@ -4478,52 +4478,8 @@ elow -, except to select%0A# one of the export lines %0A%0Aim @@ -4530,89 +4530,24 @@...
c98783bad0d249a203fcf1479b839182d967d3cc
Make python test_main behave as list-query
Trie.py
Trie.py
#! /usr/bin/env python # vim: set encoding=utf-8 """ This module provides access to libtrie shared object. Using it should be faster than spawning a process and communicating with it. This Python interface only allows for querying the trie. It is not possible to create new tries via Python. """ from ctypes import cd...
Python
0.000634
@@ -2165,33 +2165,148 @@ -t = T +if len(sys.argv) != 2:%0A sys.stderr.w ri +t e(' -prijmeni6.trie' +Need one command line argument - trie file%5Cn')%0A sys.exit(1)%0A t = Trie(sys.argv%5B1%5D )%0A%0A @@ -2374,16 +2374,65 @@ 'utf8')%0A + res = t.lookup(name)%0A if res:%0A ...
f49fc187bc397a56f03217c88fa06b7ef1704b41
Add docstring for `is_landscape()`
Util.py
Util.py
"""Collection of Helper Functions""" import os from fnmatch import fnmatch from PyPDF2 import PdfFileReader def pdf_file(filename): """Test whether or the the filename ends with '.pdf'.""" return fnmatch(filename, '*.pdf') def all_pdf_files_in_directory(path): """Return a list of of PDF files in a dire...
Python
0.000001
@@ -1652,24 +1652,91 @@ cape(page):%0A + %22%22%22Check whether or not a page is in landscape orientation.%22%22%22%0A box = pa
041ff0805acde88fe6cb797227df9abc4c6b8d96
Use cache for rendering posts in /blog.
blog.py
blog.py
import webapp2 import os import jinja2 import json import helper from google.appengine.ext import db JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), autoescape=True, extensions=['jinja2.ext.autoescape']) def render_str(template, **kw): t = JINJA_ENV...
Python
0
@@ -2821,57 +2821,79 @@ )%0A%0A%0A -class BlogHandler(BaseHandler):%0A def get(self) +CACHE = %7B%7D%0A%0A%0Adef update_blog():%0A key = %22top%22%0A if key not in CACHE :%0A @@ -2994,16 +2994,16 @@ DESC %22%0A - @@ -3034,16 +3034,176 @@ IT 10%22)%0A + posts = list(posts)%0A CACH...
92a57e512e4437b781d7db76587d27092033a49a
remove dead code
chart-02-ols-median-of-root-median-squared-errors.py
chart-02-ols-median-of-root-median-squared-errors.py
# create files for chart-02-ols-median-of-root-mdian-squared-errors # with these choices # metric in median-root-median-squared-errors # model in ols # ndays in 30 60 ... 360 # predictors in act actlog ct ctlog # responses in price logprice # usetax in yes no # year in 2008 # invocations...
Python
0.999454
@@ -671,65 +671,8 @@ ():%0A - def median_value(x):%0A cvresult = CvResult(x)%0A%0A @@ -1101,48 +1101,8 @@ '%5D,%0A - usetax=%5B'yes', 'no'%5D,%0A
4c425af1be1d4a4d4b424db5edf27f24b768f396
Save the IP address in a file, if the IP address hasn't
slackip.py
slackip.py
#!/usr/bin/env python """ ## slackip.py ## ## I am behind a NAT get my global IPv4 address and write it to a slack channel ## ## https://github.com/nerby/slackIP ## ## Atanu Ghosh ## <atanu@acm.org> ## 2017-03-05 """ from __future__ import print_function import getopt import httplib import os import sys IPHOST = "ipi...
Python
0
@@ -690,16 +690,21 @@ e.read() +%5B:-1%5D %0A%0Adef wr @@ -1380,18 +1380,514 @@ -return Tru +print(%22Sucessfully wrote to slack channel%22)%0A%0A return True%0A%0Adef save_ip_address_to_file(filename, ipaddress):%0A %22%22%22%0A Save my IP address to a file%0A %22%22%22%0A%0A save = open(filenam...
3809d9a277412ef7c53905ecdcae55d537e08c95
Fix whitespace in tests file
travis_solo_tests.py
travis_solo_tests.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from nose.tools import eq_, ok_ from travis_solo import Configuration, Loader, Step class TestLoader(object): def setup(self): self.loader = Loader() def test_loading_steps(self): setti...
Python
0.001412
@@ -213,20 +213,17 @@ bject):%0A - +%09 def setu @@ -231,24 +231,18 @@ (self):%0A - +%09%09 self.loa @@ -257,20 +257,17 @@ ader()%0A%0A - +%09 def test @@ -284,32 +284,26 @@ teps(self):%0A - +%09%09 settings = d @@ -307,28 +307,19 @@ = dict(%0A - +%09%09%09 before_i @@ -349...
27aff0f597d16ed73a976397a14b9cd1f7cf2c4a
Add support for sendback paths
troposphere/views.py
troposphere/views.py
import logging from datetime import datetime from django.http import HttpResponse from django.shortcuts import render, redirect from django.conf import settings from django.core.urlresolvers import reverse from troposphere.cas import CASClient, InvalidTicket from troposphere.oauth import OAuthClient, Unauthorized imp...
Python
0
@@ -1494,16 +1494,81 @@ sponse%0A%0A + flash = %7B'gatewayed': True, 'path': request.get_full_path()%7D%0A mess @@ -1593,27 +1593,21 @@ equest, -'gatewayed' +flash )%0A re @@ -2374,16 +2374,54 @@ Returns +a tuple of the form (a, b) where a is true iff @@ -2435,16 +2435,20 @@ eceeding +%0A reque...
aa632e5956abc516cee119d5ee413d7e8d9e0dc0
Fix execution from non-Git directories.
appengine/components/tools/calculate_version.py
appengine/components/tools/calculate_version.py
#!/usr/bin/env python # Copyright 2013 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. """Given current git checkout state return version string to use for an app.""" import getpass import logging import optparse impo...
Python
0.000027
@@ -263,16 +263,34 @@ pp.%22%22%22%0A%0A +import contextlib%0A import g @@ -655,24 +655,157 @@ cwd=cwd)%0A%0A%0A +@contextlib.contextmanager%0Adef chdir(path):%0A orig = os.getcwd()%0A try:%0A os.chdir(path)%0A yield%0A finally:%0A os.chdir(orig)%0A%0A%0A def get_pseu @@ -1685,16 +1685,38 @@ strip()%0...
c1a5b9fcb3316ec5d8ff550be68197c583a21b7b
extract is_act_as_username method
djactasauth/backends.py
djactasauth/backends.py
# -*- coding: utf-8 -*- from django.contrib.auth.backends import ModelBackend from django.contrib.auth import get_user_model class FilteredModelBackend(ModelBackend): def get_user(self, user_id): user = super(FilteredModelBackend, self).get_user(user_id) return self.filter_user(user) def auth...
Python
0.999427
@@ -936,16 +936,116 @@ = '/'%0A%0A + @classmethod%0A def is_act_as_username(cls, username):%0A return cls.sepchar in username%0A%0A def @@ -1120,35 +1120,43 @@ if self. -sepchar in +is_act_as_username( username :%0A @@ -1139,32 +1139,33 @@ sername(username +) :%0A au
1e222b72e632e5649d26dc71ab44ef31af7459fe
Fix rendering of groups in sidebar that didn't get all the template context passed into it.
django_backend/group.py
django_backend/group.py
from django.forms.forms import pretty_name from django.template import Context from django.template.loader import render_to_string from .compat import context_flatten class Group(list): """ A simplistic representation of backends that are related and should be displayed as one "group" in the backend (e.g...
Python
0
@@ -1179,24 +1179,19 @@ ext_data -.update( + = self.get @@ -1203,33 +1203,48 @@ ext_data(context -) +, **context_data )%0A return @@ -1261,29 +1261,16 @@ _string( -%0A self.get @@ -1290,30 +1290,9 @@ e(), -%0A self.get_ + cont @@ -1299,19 +1299,10 @@ ext_data -(context) )%0A
bda88dfe6e0a2f16f0c3be74a42cf8783aae1d9e
Fix to support django v1.7
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...
Python
0.000001
@@ -386,12 +386,16 @@ t), -mime +content_ type
6a9ed8867ccaab1284ae999d752de92174de399e
fix error message rendering failing due to message being a dict
djcelery_email/tasks.py
djcelery_email/tasks.py
from django.conf import settings from django.core.mail import get_connection, EmailMessage from celery.task import task CONFIG = getattr(settings, 'CELERY_EMAIL_TASK_CONFIG', {}) BACKEND = getattr(settings, 'CELERY_EMAIL_BACKEND', 'django.core.mail.backends.smtp.EmailBackend') TASK_CONFIG = { '...
Python
0.000001
@@ -1080,11 +1080,14 @@ sage -.to +%5B'to'%5D )%0A
81ff4ede4ea6397e6d54020c56cdf8dddcda1485
add dg sub-package to sfepy/discrete/setup.py
sfepy/discrete/setup.py
sfepy/discrete/setup.py
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration import os.path as op auto_name = op.split(op.dirname(__file__))[-1] config = Configuration(auto_name, parent_package, top_path) subdirs = [ 'common', 'fem', 'iga', ...
Python
0
@@ -277,16 +277,30 @@ ommon',%0A + 'dg',%0A
152c77db3e06201d28300ea0c6112c3bb93d150f
Change f-string to .format()
desktop/core/src/desktop/lib/botserver/views.py
desktop/core/src/desktop/lib/botserver/views.py
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
Python
0.005025
@@ -2745,23 +2745,15 @@ e = -f 'Hi %3C@%7B -user_id %7D%3E : @@ -2758,16 +2758,32 @@ :wave:' +.format(user_id) %0A respo
a57273553db9dc5528acfcaf89f7baf637552d72
Fix some mock patch paths
ditto/twitter/tests/test_management_commands.py
ditto/twitter/tests/test_management_commands.py
# coding: utf-8 from mock import patch from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase from django.utils.six import StringIO from .. import factories class FetchTwitterTweetsArgs(TestCase): def test_fail_with_no_args(self): ...
Python
0.000001
@@ -2282,37 +2282,72 @@ ('ditto.twitter. -fetch +management.commands.fetch_twitter_tweets .RecentTweetsFet @@ -2839,21 +2839,56 @@ twitter. -fetch +management.commands.fetch_twitter_tweets .RecentT
ddb560c398b0a9ba85faec6ba1e15f98bb94f1ad
update comments
pyWipeRemix.py
pyWipeRemix.py
#!/usr/bin/env python #!/usr/bin/env python3 from __future__ import print_function from builtins import input """ Python 2.7 & 3.4 disk wiping utility for use on Linux operating systems. RUN AS ROOT. """ import sys # For interpreter variables & associated functions import os # For ope...
Python
0
@@ -4144,26 +4144,38 @@ nd r -eturn convers +un function based on select ion -s. %22%22%22
54296c607b735ce06b3420efecb312f52876e012
Replace warning message with deprecation warning
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': [], }
Python
0.999999
@@ -40,16 +40,33 @@ -8 -*-%0A%0A +import warnings%0A%0A %0Adef rea @@ -171,14 +171,31 @@ -print( +warnings.warn(%0A %22rea @@ -238,16 +238,41 @@ quired.%22 +, DeprecationWarning%0A )%0A%0A r
1a301f19a754e8bb3dfb1d7697193ccc90d82c33
Fix unit tests
django_tenants/tests/test_filesystem_storage.py
django_tenants/tests/test_filesystem_storage.py
import warnings from django.db import connection from django.core.files.base import ContentFile from django.test import override_settings from django_tenants import utils from django_tenants.files.storage import TenantFileSystemStorage from django_tenants.files.storages import TenantFileSystemStorage as OldTenantFile...
Python
0.000005
@@ -351,17 +351,22 @@ nts.test -. +s.test cases im @@ -370,22 +370,20 @@ import -Tenant +Base TestCase @@ -384,17 +384,16 @@ stCase%0A%0A -%0A class Te @@ -422,22 +422,20 @@ estCase( -Tenant +Base TestCase
2b7e0d52a8a8764b66d8698800bf18e8adc9dae7
fix crash when running fix_loop_duplicates.py
dojo/management/commands/fix_loop_duplicates.py
dojo/management/commands/fix_loop_duplicates.py
from django.core.management.base import BaseCommand from pytz import timezone from dojo.utils import fix_loop_duplicates locale = timezone(get_system_setting('time_zone')) """ Author: Marian Gawron This script will identify loop dependencies in findings """ class Command(BaseCommand): help = 'No input commands ...
Python
0.000003
@@ -49,34 +49,8 @@ and%0A -from pytz import timezone%0A from @@ -93,60 +93,8 @@ es%0A%0A -locale = timezone(get_system_setting('time_zone'))%0A%0A %22%22%22%0A
e776ac5b08fa2a7ce299ec68697d330fb8a02fd5
upgrade __version__ in __init__.py to 1.4.0
django_nose/__init__.py
django_nose/__init__.py
VERSION = (1, 3, 0) __version__ = '.'.join(map(str, VERSION)) from django_nose.runner import * from django_nose.testcases import * # Django < 1.2 compatibility. run_tests = run_gis_tests = NoseTestSuiteRunner
Python
0.00002
@@ -11,9 +11,9 @@ (1, -3 +4 , 0)
eec67d43d208b490c9d219b3c38e586597b1fa73
Refactor generate_module_objects
pytest_wish.py
pytest_wish.py
# -*- coding: utf-8 -*- import importlib import inspect import re import sys import pytest def pytest_addoption(parser): group = parser.getgroup('wish') group.addoption('--wish-modules', default=(), nargs='+', help="Space separated list of module names.") group.addoption('--wish-incl...
Python
0.000002
@@ -784,20 +784,10 @@ -obj_module = +if ins @@ -813,37 +813,11 @@ ct_) -%0A if obj_module is not + is mod @@ -829,25 +829,8 @@ - - continue%0A
ee38beca5c4f561b246af8e2affe9f8552b9eb50
Change the default DEBUG value to 'False' and update the default database name.
django_olcc/settings.py
django_olcc/settings.py
# Django settings for django_olcc project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
Python
0
@@ -45,19 +45,20 @@ DEBUG = -Tru +Fals e%0ATEMPLA @@ -326,22 +326,20 @@ NAME': ' -sqlite +olcc .db',
93e12746d19161b30e2dade0d71f22242603b0bd
Address fix
python/test.py
python/test.py
import math from roboclaw import Roboclaw address = 0x80 rc = Roboclaw("/dev/roboclaw",115200) rc.Open() version = rc.ReadVersion(address) if version[0]==False: print "GETVERSION Failed" else: print repr(version[1]) rc.SetM1VelocityPID(rc_address,3000,300,0,708) rc.SetM2VelocityPID(rc_address,3000,300,0,720) rc.Write...
Python
0.000001
@@ -223,35 +223,32 @@ etM1VelocityPID( -rc_ address,3000,300 @@ -279,11 +279,8 @@ PID( -rc_ addr
b860606c2ce654044131228ddfb741c517ab282e
make QLibraryInfo.location works
qtpy/QtCore.py
qtpy/QtCore.py
# # Copyright © 2014-2015 Colin Duquesnoy # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """ Provides QtCore classes and functions. """ from . import PYQT6, PYQT5, PYSIDE2, PYSIDE6, PythonQtError if PYQT6: from PyQt6 import QtCore ...
Python
0
@@ -873,16 +873,68 @@ ead.exec +%0A %0A QLibraryInfo.location = QLibraryInfo.path %0A%0A #
304bfbe4a77358c766f6fe190a77f863d6915f46
Use constants for the log options
rccn/config.py
rccn/config.py
import sys, os, logging, time, re, glob, importlib import psycopg2 import psycopg2.extras import sqlite3 import json import riak from riak.transports.pbc.transport import RiakPbcTransport from logging import handlers as loghandlers from decimal import Decimal from datetime import date from config_values import * class...
Python
0.000001
@@ -561,16 +561,64 @@ Loggers%0A +mode = 'a'%0AmaxBytes = 104857600%0AbackupCount = 5%0A smlog = @@ -687,33 +687,43 @@ n.log', -'a', 104857600, 5 +mode, maxBytes, backupCount )%0Aformat @@ -915,33 +915,43 @@ g.log', -'a', 104857600, 5 +mode, maxBytes, backupCount )%0Ablog.s @@ -1051,33 +1051,43 @@ i.log', -'...
34b6d5c04e51e95874141d746dbfc6e16fcca967
Use capital letters in all view name words
reddit/urls.py
reddit/urls.py
"""django_reddit URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cla...
Python
0.00001
@@ -1175,17 +1175,17 @@ e=%22Edit -p +P rofile%22)
4394515cd5632a7f110993ff75033d407d10861d
Fix stray '.' in import statement.
doc/cdoc/numpyfilter.py
doc/cdoc/numpyfilter.py
#!/usr/bin/env python """ numpyfilter.py INPUTFILE Interpret C comments as ReStructuredText, and replace them by the HTML output. Also, add Doxygen /** and /**< syntax automatically where appropriate. """ from __future__ import division, absolute_import import sys import re import os import textwrap import optparse ...
Python
0
@@ -395,17 +395,16 @@ s pickle -. %0A%0ACACHE_ @@ -1094,20 +1094,16 @@ ml(text) - %0A ret
21102267231fbdc171b670d62f5ee8baf7d4d4c4
Add multiplication operation
calc.py
calc.py
import sys def add_all(nums): return sum(nums) if __name__ == '__main__': command = sys.argv[1] nums = map(float, sys.argv[2:]) if command == 'add': print(add_all(nums))
Python
0.999777
@@ -46,16 +46,85 @@ (nums)%0A%0A +def multiply_all(nums):%0A return reduce(lambda a, b: a * b, nums)%0A%0A if __nam @@ -257,8 +257,74 @@ l(nums)) +%0A elif command == 'multiply':%0A print(multiply_all(nums))
f6fdbdc1176cffa0a145170cab583387f26f8649
Add module docstring
calc.py
calc.py
import sys if __name__ == '__main__': print(sum(map(int, sys.argv[1:])))
Python
0.000001
@@ -1,8 +1,52 @@ +%22%22%22calc.py: A simple python calculator.%22%22%22%0A%0A import s
5223518b1bacdbeaa5f2ac11fede45b30ec15b0e
clean up strips
cite.py
cite.py
#!/usr/bin/python3 import sys from bs4 import BeautifulSoup import re from tld import get_tld import datetime def soup2dict(soup, dictionary): """ Extract info from BeautifulSoup soup into a dictionary. Return a modified dictionary. """ meta = soup.find_all("meta") for tag in meta: if...
Python
0.000001
@@ -397,32 +397,24 @@ t(%22content%22) -.strip() %0A eli @@ -491,32 +491,24 @@ t(%22content%22) -.strip() %0A eli @@ -587,32 +587,24 @@ t(%22content%22) -.strip() %0A eli @@ -678,32 +678,24 @@ t(%22content%22) -.strip() %0A eli @@ -774,32 +774,24 @@ t(%22content%22) -.strip() %0A ...
72e9bb3ea002f9a86835ef26667de4f0147ba0b3
Update at 2017-07-18 23-51-46
data.py
data.py
import json import random from pathlib import Path import numpy as np from tqdm import tqdm from utils import * DATASET = Path('~/dataset/').expanduser() DIRS = [x for x in DATASET.iterdir() if x.is_dir()] TRAIN_DIRS = DIRS[:-1] VAL_DIRS = DIRS[-1:] IMAGE_TRAIN = Path('npy/image_train') IMAGE_VAL = Path('npy/image_...
Python
0
@@ -43,16 +43,42 @@ ort Path +%0Afrom pprint import pprint %0A%0Aimport @@ -4217,16 +4217,116 @@ =True)%0A%0A + print('Train data:')%0A pprint(TRAIN_DIRS)%0A print('Validation data:')%0A pprint(VAL_DIRS)%0A%0A gen_
5fd51adbbc136adc28725688c7bf1ecf56e978c1
Develop (#105)
auth/auth_backend.py
auth/auth_backend.py
""" auth_backend.py Peter Zujko (@zujko) Defines Django authentication backend for shibboleth. 04/05/17 """ from django.contrib.auth.models import User class Attributes(): EDU_AFFILIATION = 'urn:oid:1.3.6.1.4.1.4447.1.41' FIRST_NAME = 'urn:oid:2.5.4.42' LAST_NAME = 'urn:oid:2.5.4.4' USERNAME = 'urn:...
Python
0
@@ -1645,17 +1645,17 @@ ccess = -1 +0 %0A @@ -1667,66 +1667,15 @@ if ' -Employee' in affiliation or 'Alumni' in affiliation or '-1 +Student ' in @@ -1730,17 +1730,17 @@ ccess = -0 +1 %0A%0A
b8f63a7517d6c6189bda0d213ae797c8905868b4
add visualization method to see tissue outline in DSA
histomicstk/saliency/tests/tissue_detection_test.py
histomicstk/saliency/tests/tissue_detection_test.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Sep 18 00:06:28 2019. @author: mtageld """ import unittest import os import tempfile import shutil from imageio import imread, imwrite import girder_client import numpy as np # from matplotlib import pylab as plt # from matplotlib.colors import Listed...
Python
0
@@ -946,16 +946,17 @@ Tests%0A%0A +%0A class Ti @@ -1324,17 +1324,17 @@ eps= -2 +1 , sigma= 0., @@ -1329,18 +1329,19 @@ , sigma= -0. +1.5 , min_si @@ -1815,17 +1815,17 @@ led)), 1 -4 +0 )%0A%0A
95ead630018870f293613febc599a50e8c69c792
Change in field length
hs_core/migrations/0030_resourcefile_file_folder.py
hs_core/migrations/0030_resourcefile_file_folder.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hs_core', '0029_auto_20161123_1858'), ] operations = [ migrations.AddField( model_name='resourcefile', ...
Python
0.000001
@@ -386,11 +386,12 @@ gth= -255 +4096 , nu
1f74e958193b5bf94dc7d7129e08834265d9f82b
Remove unused --check
pdftables/scripts/render.py
pdftables/scripts/render.py
#!/usr/bin/env python """pdftables-render: obtain pdftables debugging information from pdfs Usage: pdftables-render [options] <pdfpath>... pdftables-render (-h | --help) pdftables-render --version pdftables-render --check <pdfpath> Example page number lists: <pdfpath> may contain a [:page-number...
Python
0
@@ -207,47 +207,8 @@ sion -%0A pdftables-render --check %3Cpdfpath%3E %0A%0AEx @@ -1451,86 +1451,8 @@ s)%0A%0A - if arguments%5B%22--check%22%5D:%0A return check(arguments%5B%22%3Cpdfpath%3E%22%5D%5B0%5D)%0A%0A @@ -3834,158 +3834,4 @@ )%0A%0A%0A -def check(path):%0A fileobj = open(path, 'rb')%...
8e845851f5630cf56562e0b8f9b1241f643052a3
Remove resolved TODO (to self)
pebble/PblProjectCreator.py
pebble/PblProjectCreator.py
import os import string import uuid from PblCommand import PblCommand class PblProjectCreator(PblCommand): name = 'new-project' help = 'Create a new Pebble project' def configure_subparser(self, parser): parser.add_argument("name", help = "Name of the project you want to create") parser.a...
Python
0
@@ -4261,47 +4261,8 @@ %22%22%0A%0A -# @ROBERT TODO: how I make subst here?%0A DICT
57c2fbd6843d7a86d02983378926696cfd519f34
remove unnecessary log, and make a save-log more informative
jsk_apc2016_common/node_scripts/collect_sib_data.py
jsk_apc2016_common/node_scripts/collect_sib_data.py
#!/usr/bin/env python from jsk_apc2016_common.msg import BinInfoArray, SegmentationInBinSync import rospy from cv_bridge import CvBridge import cv2 import numpy as np import pickle from time import gmtime, strftime from sensor_msgs.msg import Image import os import threading class CollectSIBData(object): """ ...
Python
0
@@ -1096,46 +1096,8 @@ g):%0A - rospy.loginfo('get bin_info')%0A @@ -1155,16 +1155,16 @@ /json')%0A + @@ -1587,43 +1587,8 @@ msg%0A - rospy.loginfo('get depth')%0A @@ -1868,65 +1868,8 @@ rn%0A%0A - rospy.loginfo(rospy.get_param('~ready_to_save'))%0A @@ -2967,54 +2967...
0fc84d4cefde2446f3fbb2ab77d48c0f557d2496
Complete pyinstaller hooks.
kivy/tools/packaging/pyinstaller_hooks/hook-kivy.py
kivy/tools/packaging/pyinstaller_hooks/hook-kivy.py
''' Kivy hook for PyInstaller ========================= Kivy load itself in a complete dynamic way. PyImported don't see most of the import cause of the Factory and Core. In addition, the data and missing module are not copied automatically. With this hook, everything needed for running kivy is correctly copied. Che...
Python
0
@@ -2045,24 +2045,29 @@ ore. -image.img_pygame +audio.audio_gstplayer ',%0A @@ -2084,21 +2084,25 @@ ore. -image.img_pil +audio.audio_pygst ',%0A @@ -2123,33 +2123,27 @@ audio.audio_ -gstplayer +sdl ',%0A 'kivy @@ -2351,65 +2351,253 @@ ore. -video.video_gstplayer',%0A 'kivy.core.video.video +clipboard.cli...
9b9d6db9d99bec69e61070a743d0b2194c35e375
Mark as dead
module/plugins/hoster/FreevideoCz.py
module/plugins/hoster/FreevideoCz.py
# -*- coding: utf-8 -*- """ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in...
Python
0.00004
@@ -22,1113 +22,166 @@ *-%0A%0A -%22%22%22%0A This program is free software; you can redistribute it and/or modify%0A it under the terms of the GNU General Public License as published by%0A the Free Software Foundation; either version 3 of the License,%0A or (at your option) any later version.%0A%0A Thi...
1fed9f26010f24af14abff9444862ed0861adb63
Add simplification between parsing and execution
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)) ...
Python
0.000066
@@ -133,16 +133,65 @@ t parse%0A +from thinglang.parser.simplifier import simplify%0A %0A%0Adef ru @@ -250,24 +250,30 @@ or(' -Got empty source +Source cannot be empty ')%0A%0A @@ -369,24 +369,19 @@ e))%0A -root_nod +tre e = pars @@ -397,16 +397,47 @@ _groups) +%0A root_node = simplify(tree) %0A%0A wi...
7167b03d3f2b4100b4d7f229e78e74b98f104def
version update
tibanna/_version.py
tibanna/_version.py
"""Version information.""" # The following line *must* be the last in the module, exactly as formatted: __version__ = "1.2.0"
Python
0.000001
@@ -121,7 +121,7 @@ 1.2. -0 +1 %22%0A
e57e003b85f0a88ac6e3c19d5765144f95ac9959
Increase version to 0.3.2rc
tmserver/version.py
tmserver/version.py
# TmServer - TissueMAPS server application. # Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen # # 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...
Python
0.000002
@@ -792,12 +792,14 @@ = '0.3. -1 +2rc '%0A%0A
c09bfe422d6dd705e5e38402dd8754f461fabe59
Support filtering by list of jobNo
tools/accounting.py
tools/accounting.py
#!/usr/bin/env python3 """ collection: gisds.accountinglogs """ #--- standard library imports # from argparse import ArgumentParser from datetime import datetime import os from pprint import PrettyPrinter import sys from time import gmtime, strftime #--- project specific imports # # add lib dir for this pipeline ins...
Python
0.000001
@@ -843,88 +843,16 @@ o%22, -help=%22filter records by jobNo of jobs%22)%0A instance.add_argument(%22-o%22, %22--owner +nargs=%22* %22, h @@ -874,21 +874,21 @@ ords by -owner +jobNo of jobs @@ -928,27 +928,8 @@ ()%0A%0A - selection = %7B%7D%0A @@ -955,64 +955,92 @@ -selection%5B%22jobs.jobNo%2...
35830058d50e2e5cb8a54cbf166c28b5720b0b81
Add tests for empty edges and duplicate edges
networkx/testing/tests/test_utils.py
networkx/testing/tests/test_utils.py
from nose.tools import * import networkx as nx from networkx.testing import * # thanks to numpy for this GenericTest class (numpy/testing/test_utils.py) class _GenericTest(object): def _test_equal(self, a, b): self._assert_func(a, b) def _test_not_equal(self, a, b): try: self._asse...
Python
0
@@ -2243,16 +2243,345 @@ True))%0A%0A + def test_no_edges(self):%0A G = nx.MultiGraph()%0A H = nx.MultiGraph()%0A self._test_equal(G.edges(data=True, keys=True),%0A H.edges(data=True, keys=True))%0A%0A%0A def test_duplicate_edges(self):%0A a = %5B(1,2),(5,4),(1...
35268b43a315b2d44d9912159f189e2b80c610cf
Remove leftover imports (NC-1469)
nodeconductor/cost_tracking/admin.py
nodeconductor/cost_tracking/admin.py
from django.conf.urls import patterns, url from django.contrib import admin from django.contrib.admin import SimpleListFilter from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.db import transaction from django.shortcuts import redirect from django.utils....
Python
0
@@ -1,47 +1,4 @@ -from django.conf.urls import patterns, url%0A from
5ac6c93073c98ea17a0786e6e1a1de3837e460d9
Handle RSS feeds for blogs that don't have dates
observatory/dashboard/models/Blog.py
observatory/dashboard/models/Blog.py
# Copyright (c) 2010, Nate Stedman <natesm@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUT...
Python
0
@@ -768,16 +768,32 @@ TWARE.%0A%0A +import datetime%0A from das @@ -1485,33 +1485,15 @@ -# time manipation is fun%0A +try:%0A @@ -1537,60 +1537,8 @@ ate) -%0A try:%0A date = (date - date.utcoffset()) .rep @@ -1581,12 +1581,41 @@ -pass +date = datetime.datetime.utcnow() %0A
ff30fbd3adef0de27c7b3f690fff1c47c6d42b6a
set tree self.depth to minDepth
DecisionTree.py
DecisionTree.py
class Node: def __init__(self, data=None): self.data = data self.left = None self.right = None class Tree: # passing (object ) into class is no longer needed in python3 def __init__(self, dataset, minDepth, depth = 3): self.root = None self.left = None self.rig...
Python
0
@@ -133,70 +133,8 @@ ree: - # passing (object ) into class is no longer needed in python3 %0A%0A @@ -175,19 +175,8 @@ epth -, depth = 3 ):%0A @@ -299,17 +299,20 @@ depth = -d +minD epth%0A%0A
3976ad2e9d1ded6d36bced785b88ea186af5b01f
add urlencode
ItasaFlexGet.py
ItasaFlexGet.py
import urllib, urllib2, cookielib,urlparse import os from contextlib import closing from flexget.plugin import register_plugin from BeautifulSoup import BeautifulSoup BASE_PATH = 'http://www.italiansubs.net/index.php' class Itasa(object): """ rss: http://www.italiansubs.net/index.php?option=com_rsssub... #...
Python
0.000042
@@ -3107,21 +3107,45 @@ eturl(), +urllib.parse.urlencode( data) +) %0A%0Aregist
6ea2a6cf6af7dfdb7767c7961a3fd192d4739f2f
Add rudimentary encryption
seedbox/models.py
seedbox/models.py
import os import pickle import click import paramiko class SeedBox(): """Simple interface to view recently available files.""" def __init__(self): self.home_dir = os.path.expanduser('~') self.config_file = os.path.join(self.home_dir, '.sbconfig') if not self._has_creds(): ...
Python
0.999993
@@ -1,12 +1,23 @@ +import bz2%0A import os%0Aim @@ -598,21 +598,17 @@ -self. +_ creds = @@ -638,45 +638,116 @@ -self.hostname = self.creds%5B'hostname' +_creds = bz2.decompress(_creds)%0A _creds = _creds.split(';;')%0A self.hostname = _creds%5B0 %5D%0A @@ -776,25 +776,16 @@ ...
2fd677035118b80e4dfb04e380b526b3264492eb
Remove debugger (oops)
holmes/material.py
holmes/material.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from uuid import uuid4 from functools import partial from collections import defaultdict from holmes.cli import BaseCLI from holmes.models.domain import Domain from holmes.models.page import Page from holmes.models.violation import Violation from holmes.utils i...
Python
0
@@ -388,56 +388,8 @@ g):%0A - import ipdb; ipdb.set_trace() # BREAKPOINT%0A
01b12e4a9994dbbb70fd2b8faea6aa7b9e2c1900
fix path in make.py
DesktopEditor/xmlsec/src/wasm/module/make.py
DesktopEditor/xmlsec/src/wasm/module/make.py
#!/usr/bin/env python import sys sys.path.append('../../build_tools/scripts') import base import os import codecs def run_as_bash(file, commands): if base.is_file(file): base.delete_file(file) file_bash = codecs.open(file, "w", "utf-8") file_bash.write("#!/bin/bash\n") file_bash.write("\n".join(commands))...
Python
0.000005
@@ -50,16 +50,28 @@ ('../../ +../../../../ build_to
2fb944f5f069be47ed4560c813daf1fa6e99da81
fix some bugs and limit sites for now
htdocs/cscap/dl.py
htdocs/cscap/dl.py
#!/usr/bin/python """ """ import sys import psycopg2 import psycopg2.extras import ConfigParser import cgi config = ConfigParser.ConfigParser() config.read('/mesonet/www/apps/iemwebsite/scripts/cscap/mytokens.cfg') def clean( val ): ''' Clean the value we get ''' if val is None: return val if val...
Python
0
@@ -887,16 +887,21 @@ ,plotid, +year, depth,so @@ -922,16 +922,16 @@ il23%5Cn%22%0A - curs @@ -1043,16 +1043,218 @@ not null +%0A and value ~* '%5B0-9%5C.%5D' and value != '.' and value !~* '%3C'%0A and site in ('MASON', 'KELLOGG', 'GILMORE', 'ISUAG', 'WOOSTER.COV',%0A 'SEPAC', 'BRADFORD.A', 'BRADFORD...
b1d83fc13ec2d71e78fea406f76c48d5cc528f46
Fix imports
spacy/ml/models/parser.py
spacy/ml/models/parser.py
from typing import Optional from thinc.api import Model, chain, list2array, Linear, zero_init, use_ops from ...util import registry from .._precomputable_affine import PrecomputableAffine from ..tb_framework import TransitionModel @registry.architectures.register("spacy.TransitionBasedParser.v1") def build_tb_parser...
Python
0.000002
@@ -20,16 +20,22 @@ Optional +, List %0Afrom th @@ -101,16 +101,49 @@ use_ops +%0Afrom thinc.types import Floats2d %0A%0Afrom .
a5bef7ac44a688b9d4493c28210a1a3fbcb64ffe
Fix channel comparison with # prefix
slackclient/_channel.py
slackclient/_channel.py
class Channel(object): def __init__(self, server, name, channel_id, members=None): self.server = server self.name = name self.id = channel_id self.members = [] if members is None else members def __eq__(self, compare_str): if self.name == compare_str or self.name == "#" ...
Python
0
@@ -291,24 +291,30 @@ mpare_str or + %22#%22 + self.name = @@ -314,22 +314,16 @@ .name == - %22#%22 + compare
a2a652620fa4d7504baa42f08fc80bd2a7db1341
Make frozendict peristently-hasheable
edgedb/lang/common/datastructures/immutables.py
edgedb/lang/common/datastructures/immutables.py
## # Copyright (c) 2008-2010 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## import abc import collections class ImmutableMeta(type): def __new__(mcls, name, bases, dct): if '_shadowed_methods_' in dct: shadowed = dct['_shadowed_methods_'] del dct['_shadowed_m...
Python
0.000004
@@ -21,16 +21,22 @@ 008-2010 +, 2014 Sprymix @@ -129,16 +129,83 @@ ctions%0A%0A +from metamagic.utils.algos.persistent_hash import persistent_hash%0A%0A %0Aclass I @@ -1345,8 +1345,96 @@ ems()))%0A +%0A def persistent_hash(self):%0A return persistent_hash(frozenset(self.items()))%0A
4cda993213fce2b4567ba31f2dc6a116445ce664
rollback on dummy database now has no effect (previously raised an error). This means that custom 500 error pages (and e-mailed exceptions) now work even if a database has not been configured. Fixes #4429.
django/db/backends/dummy/base.py
django/db/backends/dummy/base.py
""" Dummy database backend for Django. Django uses this if the DATABASE_ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured def complain(*args, **kwargs): raise Improperly...
Python
0.000004
@@ -377,16 +377,55 @@ yet.%22%0A%0A +def ignore(*args, **kwargs):%0A pass%0A%0A class Da @@ -589,24 +589,22 @@ lback = -complain +ignore %0A%0A de
1ec9d3b5d7a2fdfd6e7d0e763c95e1a3117cd96d
Update middleware to be django1.10-compatible
django_user_agents/middleware.py
django_user_agents/middleware.py
from django.utils.functional import SimpleLazyObject from .utils import get_user_agent class UserAgentMiddleware(object): # A middleware that adds a "user_agent" object to request def process_request(self, request): request.user_agent = SimpleLazyObject(lambda: get_user_agent(request))
Python
0.000603
@@ -45,16 +45,69 @@ zyObject +%0Afrom django.utils.deprecation import MiddlewareMixin %0A%0Afrom . @@ -162,22 +162,31 @@ dleware( -object +MiddlewareMixin ):%0A #
27ebfe1f8b5b258dfb9db6fe8148bf22fe3a9c91
fix start parameter
djangosolr/documents/queryset.py
djangosolr/documents/queryset.py
from djangosolr.documents.query import Query from djangosolr import solr class QuerySet(object): def __init__(self, model, query=None): self._model = model self._query = query or Query() self._responses = [] self._responses_more = True self._result_cache = None ...
Python
0.000002
@@ -547,24 +547,78 @@ nses) * rows + if self._query._start is None else self._query._start %0A whi
9fe4b5fee790b7e21eb5810176a2cfa49abde7b2
Create author obj only for active users
doc/deployer/create_auth_objs.py
doc/deployer/create_auth_objs.py
from gnowsys_ndf.ndf.models import * from django.contrib.auth.models import User all_users = User.objects.all() auth_gst = node_collection.one({'_type': u'GSystemType', 'name': u'Author'}) new_auth_instances = 0 for each_user in all_users: auth = node_collection.one({'_type': u"Author", 'created_by': int(each_user.id)...
Python
0
@@ -414,16 +414,40 @@ is None + and each_user.is_active :%0A%09%09prin
69f28c471935d5e8136a4b32f51310f1f46046f0
set lower for envvar keys
docku/build/__init__.py
docku/build/__init__.py
import json import os class BuildConfig(dict): def __init__(self, path): cc = {} with open(path) as fh: cc = json.load(fh) super().__init__(cc) self.populate_envvars() def populate_envvars(self): keys = ['BINTRAY_TOKEN', 'BINTRAY_USER', 'BINTRAY_REPO'] ...
Python
0.000002
@@ -414,16 +414,24 @@ self%5Bkey +.lower() %5D = valu
b289569a228ff574f2c469d0d2a7fbb019c19c9e
Update version
snipsskills/__init__.py
snipsskills/__init__.py
# -*-: coding utf-8 -*- """ snipsskills module """ __version__ = '0.1.4.934'
Python
0
@@ -67,11 +67,11 @@ 0.1.4.93 -4 +5 '%0A
5ad52608a470796ac09d3d675c54aee234a9d8ef
修改python 空格和tab混用的问题;
bsp/stm32/stm32f767-fire-challenger/rtconfig.py
bsp/stm32/stm32f767-fire-challenger/rtconfig.py
import os # toolchains options ARCH='arm' CPU='cortex-m7' CROSS_TOOL='gcc' # bsp lib config BSP_LIBRARY_TYPE = None if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if os.getenv('RTT_ROOT'): RTT_ROOT = os.getenv('RTT_ROOT') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute...
Python
0
@@ -552,17 +552,20 @@ 'iar':%0A -%09 + PLATFORM @@ -574,17 +574,20 @@ = 'iar'%0A -%09 + EXEC_PAT @@ -2511,17 +2511,16 @@ = CFLAGS - %0A CFL @@ -3733,20 +3733,16 @@ CFLAGS%0A - %0A EXE
6092e01013d233d77d9d1350d7e3923a5e68f85c
Fix to get shape.
chainer/functions/pooling/average_pooling_nd.py
chainer/functions/pooling/average_pooling_nd.py
import numpy import functools import operator import six from chainer import cuda from chainer.functions.pooling import average_pooling_nd_kernel from chainer.functions.pooling import pooling_nd from chainer import utils from chainer.utils import conv_nd if cuda.cudnn_enabled: cudnn = cuda.cudnn libcudnn = ...
Python
0
@@ -5026,13 +5026,8 @@ n(x. -data. shap
5e7dbbcc47ec12e07e4acd5c41cd31d88dd0ca21
Exclude the archs that are not supported in the webapp too
autocloud/web/app.py
autocloud/web/app.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import flask import flask.ext.restless from flask import request, url_for, render_template from sqlalchemy import desc from werkzeug.exceptions import abort import autocloud from autocloud.models import init_model from autocloud.models import JobDetail...
Python
0
@@ -3757,24 +3757,97 @@ eJobDetails) +%0A supported_archs = %5Barch for arch, _ in ComposeJobDetails.ARCH_TYPES%5D %0A%0A if com @@ -4096,16 +4096,85 @@ pose_id) +.filter(%0A ComposeJobDetails.arch.in_(supported_archs)) %0A%0A #
45e515efbe7242f3f8871242cd1ddb7ceb29ae32
fix file perms
src/main/python/netkraken/__init__.py
src/main/python/netkraken/__init__.py
from datetime import datetime, timedelta import os settings = { "stagedir": "/tmp/netconns/__stage__", "finaldir": "/tmp/netconns/final"} formats = { "day": "%Y-%m-%d", "hour": "%Y-%m-%dT%H", "minute": "%Y-%m-%dT%H:%M"} thresholds = { "day": timedelta(days=14), "hour": timedelta(hours=4*...
Python
0.000001
bc7c3322e027578f79119e6836111244ba1445cc
revert out
autonetkit/config.py
autonetkit/config.py
import pkg_resources import ConfigParser from configobj import ConfigObj, flatten_errors import os import validate validator = validate.Validator() import os.path #TODO: check this works on Windows ank_user_dir = os.path.join(os.environ['HOME'], ".autonetkit") def load_config(): settings = ConfigParser.RawConfi...
Python
0.000001
@@ -163,41 +163,56 @@ th%0A# -TODO: check this works on Windows + from http://stackoverflow.com/questions/4028904 %0Aank @@ -243,23 +243,28 @@ (os. -environ%5B'HOME'%5D +path.expanduser(%22~%22) , %22
d6a229deb0db1b8ef050e2271b25da73d1117cc8
add element properties
library/pyjamas/ui/__init__.py
library/pyjamas/ui/__init__.py
# Copyright 2006 James Tauber and contributors # Copyright 2009 Luke Kenneth Casson Leighton # # 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...
Python
0.000001
@@ -1083,16 +1083,97 @@ PE = 3%0A%0A +ELPROP_NAME = 0%0AELPROP_DESC = 1%0AELPROP_FNAM = 2%0AELPROP_TYPE = 3%0AELPROP_DFLT = 4%0A%0A def get_ @@ -1484,16 +1484,37 @@ ops = %5B%5D +%0A _elem_props = %5B%5D %0A%0A de @@ -2869,16 +2869,17 @@ rn self. +_ props%0A%0A @@ -3436,9 +3436,413 @@ args) %0A%0A + de...
cba6caf0eed1efce421926abaa14742893dd1bbd
remove trailing empty line (PEP8 conformance)
debsources/tests/test_filetype.py
debsources/tests/test_filetype.py
# Copyright (C) 2013-2015 The Debsources developers <info@sources.debian.net>. # See the AUTHORS file at the top-level directory of this distribution and at # https://anonscm.debian.org/gitweb/?p=qa/debsources.git;a=blob;f=AUTHORS;hb=HEAD # # This file is part of Debsources. Debsources is free software: you can # redi...
Python
0
@@ -3542,29 +3542,28 @@ %22makefile%22)%0A -%0A
080b967c0854d416532449dba96bbbd8f0318d8a
remove time_per_record since it does not make real sense
pikos/benchmark/monitors.py
pikos/benchmark/monitors.py
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # Package: Pikos toolkit # File: benchmark/monitors.py # License: LICENSE.TXT # # Copyright (c) 2012, Enthought, Inc. # All rights reserved. #---------------------------------------------------------------------...
Python
0.000181
@@ -776,116 +776,23 @@ r': -lambda recorder, record_type: FunctionMonitor(%0A recorder, None if record_type is None else tuple) +FunctionMonitor ,%0A @@ -1603,23 +1603,8 @@ 0%7D %7C - Per record %7C %7B:%5E @@ -1772,47 +1772,8 @@ %3E10%7D - '%0A '%7C %7Btime_per_record:.6e%7D %7C %7B ...
50f06cbc588cfc099105b6a0b62abff027f3ad21
Comment out potentially conflicting packages in results
piptools/scripts/compile.py
piptools/scripts/compile.py
# coding: utf-8 from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import pip # Make sure we're using a reasonably modern version of pip # isort:skip if not tuple(int(digit) for digit in pip.__version__.split('.')[:2]) >= (6, 1): print('pip-com...
Python
0
@@ -5476,16 +5476,76 @@ results) +%0A%0A EXCLUDE_PACKAGES = %7B'setuptools', 'distribute', 'pip'%7D %0A for @@ -5780,24 +5780,22 @@ l -og.info( +ine = format_r @@ -5835,16 +5835,123 @@ otation) +%0A%0A if result.name in EXCLUDE_PACKAGES:%0A line = '# %7B%7D'.format(line)%0A%0A ...
9b52967bd0b4fcf411ce4303170fa77d1d417669
fix repr exception when using raven
dpark/task.py
dpark/task.py
import os,os.path import socket import marshal import cPickle import logging import struct from dpark.util import compress, decompress, atomic_file from dpark.serialize import marshalable, load_func, dump_func, dumps, loads from dpark.shuffle import LocalFileShuffle logger = logging.getLogger(__name__) class Task: ...
Python
0.000001
@@ -2138,32 +2138,179 @@ __repr__(self):%0A + shuffleId = getattr(self, 'shuffleId', None)%0A partition = getattr(self, 'partition', None)%0A rdd = getattr(self, 'rdd', None)%0A return ' @@ -2327,13 +2327,13 @@ sk(%25 -d, %25d +s, %25s ) of @@ -2341,21 +2341,16 @@ %25s%3E' %25 ( -self....
cc17153f777a275065be9a08d7ecbcb480cd8759
add within_frame function to __init__.py
plantcv/plantcv/__init__.py
plantcv/plantcv/__init__.py
import os import matplotlib # If there is no display or a matplotlib backend already defined, use the non-GUI backend if "DISPLAY" not in os.environ and "MPLBACKEND" not in os.environ: matplotlib.use("Agg") class Params: """PlantCV parameters class Keyword arguments/parameters: device = device n...
Python
0.000088
@@ -4772,24 +4772,78 @@ ort closing%0A +from plantcv.plantcv.within_frame import within_frame%0A from plantcv @@ -6271,16 +6271,31 @@ closing' +,'within_frame' %5D%0A%0A%0Afrom
a477de34625f9fc4076eaa093b606463063e33b3
add check if TwitterAPI was installed and installed it if not
gimp_be/network/twitter.py
gimp_be/network/twitter.py
from gimp_be.settings.settings import * from gimp_be.utils.string_tools import * def tweetImage(message,image_file): """ Tweet image with message :param message: :param image_file: :return: """ from TwitterAPI import TwitterAPI global settings_data CONSUMER_KEY = settings_data['twi...
Python
0
@@ -74,16 +74,111 @@ mport *%0A +from gimp_be.utils.pip import *%0Atry:%0A import TwitterAPI%0Aexcept:%0A pipInstall(%22TwitterAPI%22) %0A%0Adef tw
6138f02896bc865a98480be36300bf670a6defa8
Replace re by os.path utils
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'(.*)\.(\...
Python
0
@@ -51,19 +51,21 @@ th%0A%0Acurr -ent +_file = vim.e @@ -85,16 +85,63 @@ %25:p')%22)%0A +curr_file_noext = path.splitext(curr_file)%5B0%5D%0A%0A ccd = vi @@ -203,178 +203,422 @@ -data = json.load(database)%0A%0A for d in data:%0A # hax for headers%0A fmatch = re.search(r'(.*)%5C.(%5Cw+)$', c...
cf056c8840e224a1f15478832434c7df33fa97f8
Limit Urban Dictionary definition to 300 characters
plugins/urbandict/plugin.py
plugins/urbandict/plugin.py
import logging from cardinal.decorators import command, help import requests from twisted.internet import defer from twisted.internet.threads import deferToThread URBANDICT_API_PREFIX = 'http://api.urbandictionary.com/v0/define' class UrbanDictPlugin: def __init__(self): self.logger = logging.getLogger...
Python
0.998394
@@ -949,16 +949,119 @@ nition'%5D +%5B0:300%5D%0A if definition != entry%5B'definition'%5D:%0A definition = definition + %22%E2%80%A6%22 %0A
7903c7604a54a8786a5d4b658c224b6d28ed43af
Add iterator for lists
popeui/widgets/structure.py
popeui/widgets/structure.py
from .base import BaseContainer from .abstract import HeadLink class Document(BaseContainer): """ A document. Analogous to the HTML ``<html>`` element. """ html_tag = "html" def __init__(self, id, view, classname=None, parent=None, **kwargs): """ :param view: :class:`~.application.View` in which t...
Python
0.000002
@@ -2300,16 +2300,90 @@ ist.%22)%0A%0A + def __iter__(self):%0A return iter(list(%5Bx%5B0%5D for x in self._items%5D))%0A%0A def __
19b6aecd0cc2a1447c0f659d3aa5565e66c4a7e7
Handle uniqueness in generators
populous/generators/base.py
populous/generators/base.py
import random from cached_property import cached_property from faker import Factory from populous.exceptions import ValidationError from populous.generators.vars import Expression fake = Factory.create() class BaseGenerator(object): def __init__(self, item, field_name, **kwargs): self.item = item ...
Python
0.000001
@@ -1996,24 +1996,671 @@ eld value%0A%0A%0A +class UniquenessMixin(object):%0A%0A def get_arguments(self, unique=False, **kwargs):%0A super(UniquenessMixin, self).get_arguments(**kwargs)%0A%0A self.unique = unique%0A%0A def get_generator(self):%0A if self.unique:%0A return self.ge...
e43d0190c00e9b0b0f2cc72900ac288d33fae435
add missing names to easy:consume_args, PavementError
trunk/paver/easy.py
trunk/paver/easy.py
import subprocess import sys from paver import tasks from paver.options import Bunch def dry(message, func, *args, **kw): """Wraps a function that performs a destructive operation, so that nothing will happen when a dry run is requested. Runs func with the given arguments and keyword arguments. If this ...
Python
0.99623
@@ -2924,41 +2924,111 @@ pts%0A -BuildFailure = tasks.BuildFailure +consume_args = tasks.consume_args%0ABuildFailure = tasks.BuildFailure%0APavementError = tasks.PavementError %0A%0A#
a0e8acde31c32b23a453f73ec2996ce71d647dab
Add hard coded list_locations for VPS.net
libcloud/drivers/vpsnet.py
libcloud/drivers/vpsnet.py
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # libcloud.org licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not...
Python
0.000001
@@ -974,16 +974,30 @@ odeImage +, NodeLocation %0A%0Aimport @@ -5918,8 +5918,106 @@ images%0A +%0A def list_locations(self):%0A return %5BNodeLocation(0, %22VPS.net Western US%22, 'us', self)%5D%0A
3dc0b7baee5640d12dc8a910810db4cd3931ac09
Update various docstrings.
colour/models/rgb/transfer_functions/red_log.py
colour/models/rgb/transfer_functions/red_log.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ RED Log Encodings ================= Defines the *RED* log encodings: - :func:`log_encoding_REDLog` - :func:`log_decoding_REDLog` See Also -------- `RGB Colourspaces Jupyter Notebook <http://nbviewer.jupyter.org/github/colour-science/colour-notebooks/\ blob/maste...
Python
0
@@ -178,16 +178,88 @@ _REDLog%60 +%0A- :func:%60log_encoding_REDLogFilm%60%0A- :func:%60log_decoding_REDLogFilm%60 %0A%0ASee Al
c4b408bdf84333a5e41d10ee3d46f926069b5548
Delete deprecated with_coverage task
lutrisweb/settings/test.py
lutrisweb/settings/test.py
from base import * # noqa DEBUG = False DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS += ( 'django_jenkins', ) JENKINS_TASKS = ( 'django_jenkins.tasks.with_coverage', 'django_jenkins.tasks.run_pylint', 'django_jenkin...
Python
0.000012
@@ -218,50 +218,8 @@ = (%0A - 'django_jenkins.tasks.with_coverage',%0A
421ace15d779cc686aa83489c0e965bbeabe49b9
Update script to repeat test set experiment 10 times
cptm/experiment_testset_without_perspectives.py
cptm/experiment_testset_without_perspectives.py
"""Script to extract a document/topic matrix for a set of text documents. The corpus is not divided in perspectives. Used to calculate theta for the CAP vragenuurtje data. """ import logging import argparse import pandas as pd import os from CPTCorpus import CPTCorpus from cptm.utils.experiment import get_sampler, t...
Python
0
@@ -1423,17 +1423,73 @@ out_dir%0A -%0A +nTopics = params.get('nTopics')%0A%0Afor i in range(10):%0A sampler @@ -1530,31 +1530,21 @@ ics= -params.get(' nTopics -') ,%0A + @@ -1579,16 +1579,20 @@ =False)%0A + sampler. @@ -1624,16 +1624,20 @@ _topic)%0A + sampler. @@ -1642,16 +1642,20 @@ ...
e9064d4dda3cbf2abb7f2a16ebceee62d5b9d004
Remove last real reference to locations/by_name
custom/ilsgateway/tanzania/handlers/register.py
custom/ilsgateway/tanzania/handlers/register.py
import re from django.contrib.auth.models import User from corehq.apps.locations.models import Location from corehq.apps.sms.mixin import PhoneNumberInUseException, VerifiedNumber from corehq.apps.users.models import CommCareUser from custom.ilsgateway.tanzania.handlers import get_location from custom.ilsgateway.tan...
Python
0.000008
@@ -90,16 +90,19 @@ import +SQL Location @@ -1025,404 +1025,102 @@ -locs = Location.view('locations/by_name',%0A startkey=%5Bdomain, %22DISTRICT%22, sp%5D,%0A endkey=%5Bdomain, %22DISTRICT%22, sp + %22z%22%5D,%0A reduce=False,...
0fe7cd8cf316dc6d4ef547d733b634de64fc768c
Add more options on filters
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 = ...
Python
0
@@ -590,16 +590,92 @@ e_alarm%22 +, %22engine_name%22,%0A %22environment_name%22, %22databaseinfra_name%22 )%0A li
4605dfb434d7a934e2fce39f96d73e66f17a682b
Handle missing settings file
i2vbot/settings.py
i2vbot/settings.py
#!/usr/bin/env python2 # Ampuni aku... :( import pickle SETTINGS_FILE = "data/settings.pickle" def loadSettings(settingsFile = SETTINGS_FILE): with open(settingsFile, 'r') as f: try: return pickle.load(f) except: return {} def saveSettings(settings, settingsFile = SETTING...
Python
0.000001
@@ -131,32 +131,45 @@ SETTINGS_FILE):%0A + try:%0A with open(se @@ -195,21 +195,8 @@ f:%0A - try:%0A @@ -225,20 +225,16 @@ load(f)%0A - exce @@ -237,20 +237,16 @@ except:%0A -
8bc3e371690ef28609f1999a4a3dabc0dd453850
Correct serve() to call serve_one() not listen_one()
uhttpsrv/uhttpsrv.py
uhttpsrv/uhttpsrv.py
import socket class uHTTPsrv: PROTECTED = [b'__init__', b'listen_once', b'listen', b'response_header', b'__qualname__', b'__module__', b'address', b'port', b'backlog', b'in_buffer_len', b'debug'] def __init__(self, address='', port=80, backlog=1, in_buffer_len=1024, debug=False): self.address = address self.po...
Python
0.000169
@@ -1217,26 +1217,24 @@ %09%09%09self. -listen +serve _on -c e(self)%0A
d69aa85c74482354ff8788fb7b9692f0aee6d311
Fix it.
iepy/preprocess.py
iepy/preprocess.py
import logging logger = logging.getLogger(__name__) class PreProcessPipeline(object): """Coordinates the pre-processing tasks on a set of documents""" def __init__(self, step_runners, documents_manager): """Takes a list of callables and a documents-manager. Step Runners may be any calla...
Python
0.999982
@@ -971,16 +971,40 @@ 'step') + and not runner.override :%0A
e5f7f120a6574c0bf7d09c5188931a914ab6849b
Use the correct implementation of as_symbol
devito/dse/inspection.py
devito/dse/inspection.py
from collections import OrderedDict from sympy import Function, Indexed, Number, Symbol, cos, preorder_traversal, sin from devito.dimension import Dimension from devito.dse.search import retrieve_indexed, retrieve_ops, search from devito.dse.queries import q_timedimension from devito.logger import warning from devito...
Python
0.006325
@@ -4176,19 +4176,20 @@ _symbol( -obj +expr ):%0A %22 @@ -4199,129 +4199,53 @@ -Turn %60%60obj%60%60 into a :class:%60sympy.Symbol%60. Raise %60%60TypeError%60%60 if no%0A conversion rule for the type of %60%60obj%60%60 is known +Extract the %22main%22 symbol from a SymPy object .%0A @@ -4281,19 +4281,...
f076e4d1fc13c1aea3000b19cd4b51f404378d0e
Update docs and bucket subdirectory path for each build.
.buildkite/upload_artifacts.py
.buildkite/upload_artifacts.py
""" # Requirements: * Generate access token in your Github account, then create environment variable GITHUB_ACCESS_TOKEN. - e.g export GITHUB_ACCESS_TOKEN=1ns3rt-my-t0k3n-h3re. * Generate a service account key for your Google API credentials, then create environment variable GOOGLE_APPLICATION_CREDENTI...
Python
0
@@ -770,17 +770,75 @@ .%0A * +GOOGLE_APPLICATION_CREDENTIALS = Your service account key. %0A - %22%22%22%0Aimpo @@ -1142,16 +1142,64 @@ QUEST%22)%0A +BUILD_ID = os.getenv(%22BUILDKITE_BUILD_NUMBER%22)%0A%0A %0ARELEASE @@ -1473,16 +1473,21 @@ %0A %22%22%22 +%0A Create a @@ -1531,16 +1531,21 @@ en dict...
42743ac90ede1d9d78c892f1cee033c5e5a66c9b
fix typo in docker update script
.travis/docker/update_image.py
.travis/docker/update_image.py
#!/usr/bin/env python3 import os import subprocess import sys cc_mapping = {'gcc': 'g++', 'clang': 'clang++'} thisdir = os.path.dirname(os.path.abspath(__file__)) def update(commit, cc): gdt_super_dir = os.path.join(thisdir, '..', '..',) dockerfile = os.path.join(thisdir, 'dune-gdt-testing', 'Dockerfile') ...
Python
0.000005
@@ -160,16 +160,17 @@ le__))%0A%0A +%0A def upda @@ -852,16 +852,17 @@ repo%5D)%0A%0A +%0A if __nam @@ -946,17 +946,16 @@ comm -m its = %5Bs
4bddcadd7b177b764d2ee12370b635ec31f12288
change jumping
server/server1.py
server/server1.py
import socket, sys, commands, re import random, time, math import xlrd #controller default PORT and IP UDP_IP = 'controller-host' UDP_PORT_HELLO = 7777 UDP_PORT_INFO = 7778 UDP_OUT_PORT=5005 def getGreenEnergyValue(location_id, worksheet, row): energyValue = worksheet.cell(row,location_id).value return float(en...
Python
0.000003
@@ -2422,17 +2422,17 @@ row += -2 +1 #jumpin
45ee385204d4a38ea904228d2648d266309332ab
fix shutdown command
server/sockets.py
server/sockets.py
import asyncio from aiohttp import web import socketio import hexdump from log import logname import frame from hardware import Hardware from version import version_info import os logger = logname("sockets") class WSnamespace(socketio.AsyncNamespace): def __init__(self, namespace='/sockets'): super().__in...
Python
0.000005
@@ -172,16 +172,34 @@ mport os +%0Aimport subprocess %0A%0Alogger @@ -1779,15 +1779,8 @@ on_ -system_ shut @@ -1808,18 +1808,24 @@ -os.system( +subprocess.run(%5B 'pow @@ -1834,10 +1834,10 @@ off' +%5D ) - %0A%0A%0Ac