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
b12b4f47d3cd701506380c914e45b9958490392c
Add FT specs and use unittest.
functional_tests.py
functional_tests.py
from selenium import webdriver browser = webdriver.Firefox() browser.get('http://localhost:8000') assert 'Django' in browser.title
Python
0
@@ -28,106 +28,1706 @@ ver%0A -%0Abrowser = webdriver.Firefox()%0Abrowser.get('http://localhost:8000')%0A%0Aassert 'Django' in browser.title +import unittest%0A%0Aclass NewVisitorTest(unittest.TestCase):%0A%0A def setUp(self):%0A self.browser = webdriver.Firefox()%0A%0A def tearDown(self):%0A self....
0f19fb03a9976beb410f52b4e53a6da31665ab15
Fix identation errors.
editor_backend/editor_backend/views.py
editor_backend/editor_backend/views.py
from django.http import HttpResponse from django.template.loader import get_template from django.template import Context from django.shortcuts import render import json import requests NODE_ADDR = "http://127.0.0.1:9001" publish_base_url = "http://despina.128.no/publish" def get_publisher_url(): r = requests.get(NOD...
Python
0.000041
@@ -1172,24 +1172,17 @@ r_url()%0A - +%09 if publi @@ -1191,28 +1191,18 @@ er_url:%0A - +%09%09 r = requ @@ -1272,34 +1272,17 @@ le)%0A - else:%0A +%09else:%0A%09%09 # Do @@ -1312,26 +1312,15 @@ re.%0A - +%09%09 pass%0A -%09 %0A%09#j
891e80db6cc3795dd3af19f942e813eaa5107fb3
check for job ids
vent/core/file-drop/file_drop.py
vent/core/file-drop/file_drop.py
import os import sys import time import uuid from redis import Redis from rq import Queue from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler class GZHandler(PatternMatchingEventHandler): """ Handles when an event on the directory being watched happens that matches ...
Python
0.000001
@@ -1268,32 +1268,103 @@ event.src_path%0A + print uid, len(q)%0A print uid, q.job_ids%0A
463d4f48287dd085ff4d4de0845ad5cdfea62c0a
add info to bash failure exception
parsl/app/bash.py
parsl/app/bash.py
import logging from inspect import signature, Parameter from parsl.app.futures import DataFuture from parsl.app.app import AppBase from parsl.dataflow.dflow import DataFlowKernelLoader logger = logging.getLogger(__name__) def remote_side_bash_executor(func, *args, **kwargs): """Execute the bash app type functio...
Python
0
@@ -1289,52 +1289,75 @@ %7B%7D' -returned NoneType, must return string object +did not return a value, or returned none - with this exeception: %7B%7D %22.fo @@ -1370,16 +1370,19 @@ unc_name +, e ), None)
345fb3f60b5df1d45b44a5b2b7f162900669f1e9
Fix typo in command
Probe/Application/RawApplication.py
Probe/Application/RawApplication.py
# Copyright (c) 2015-2018 Agalmic Ventures LLC (www.agalmicventures.com) # # 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 # to u...
Python
0.988863
@@ -2654,17 +2654,17 @@ umactl - -h +H ') if no
95fed1638ca13414711c792addb5f84ce41307c4
Update main.py
gateway/src/main.py
gateway/src/main.py
#!/usr/bin/env python #Communicate with end devices via LoRa. #Communicate with server via MQTT(hbmqtt) and HTTP POST. #Save data in the sqlite database. #Parse JSON from MQTT and LoRa protocol. #Communication module: LoRa. #Communication method with device via LoRa. #Uart port drive LoRa module. #Parse JSON between d...
Python
0.000001
@@ -1042,18 +1042,16 @@ g()%0A - if count @@ -1057,18 +1057,16 @@ t != 0:%0A - re @@ -1144,26 +1144,24 @@ block%0A - ser.flushInp @@ -1167,26 +1167,24 @@ put()%0A - print(recv)%0A @@ -1179,26 +1179,24 @@ print(recv)%0A - sleep(0.
f3e1fcd12b41a642b40db2f3fd03409644a35fa2
Update main.py
gateway/src/main.py
gateway/src/main.py
#!/usr/bin/env python #### /usr/bin/python3.4 #Communicate with end devices via LoRa. #Communicate with server via MQTT(hbmqtt) and HTTP POST. #Save data in the sqlite database. #Parse JSON from MQTT and LoRa protocol. #Communication module: LoRa. #Communication method with device via LoRa. #Uart port drive LoRa modul...
Python
0.000001
@@ -1001,16 +1001,98 @@ cv = ''%0A +#Function of Thread Lora, waiting for the data(json) from device via LoRa-module.%0A def Lora
698d6bd59f810f3527c663a9f51362c018f6f394
add french formatting for numbers
calebasse/settings/formats/fr/formats.py
calebasse/settings/formats/fr/formats.py
DATE_FORMAT = 'l d F Y' SHORT_DATE_FORMAT = 'j/n/Y' DATE_INPUT_FORMATS = ('%d/%m/%Y', '%d/%m/%Y', '%Y-%m-d') TIME_INPUT_FORMATS = ( '%Hh%M', '%H:%M', '%H%M', '%Hh' )
Python
0.000002
@@ -159,8 +159,77 @@ '%25Hh' )%0A +DECIMAL_SEPARATOR = ','%0ANUMBER_GROUPING = 3%0ATHOUSAND_SEPARATOR = ' '%0A
b2f6ec1db1c6831b923cb89907bbfedea79012f0
handle yaml in post - WIP
genmodel/manager.py
genmodel/manager.py
from flask import Flask, request, render_template, jsonify from tabulate import tabulate import os import psycopg2 # Connect to Database try: DB_NAME=os.environ['DB_NAME'] DB_USER=os.environ['DB_USER'] DB_PASS=os.environ['DB_PASS'] except KeyError as e: raise Exception('environment variables for databa...
Python
0
@@ -52,16 +52,28 @@ jsonify%0A +import yaml%0A from tab @@ -939,24 +939,72 @@ == %22POST%22:%0A + resp = yaml.loads(request.files%5B'job'%5D)%0A # Ta @@ -1135,26 +1135,26 @@ urn -'Not implemented' +jsonify(resp), 201 %0A
13624f71910b38a74f496b54d47b3fd1cc79a633
fix test
api_tests/logs/views/test_log_detail.py
api_tests/logs/views/test_log_detail.py
# -*- coding: utf-8 -*- from nose.tools import * # noqa from tests.base import ApiTestCase from osf_tests.factories import ( ProjectFactory, AuthUserFactory, NodeFactory, ) from framework.auth.core import Auth from website.models import NodeLog from website.util import permissions as osf_permissions fr...
Python
0.000002
@@ -5756,24 +5756,28 @@ assert_ +not_ equal(%0A @@ -5898,33 +5898,28 @@ format(self. -component +node ._id, self.f
1239d7a881f7ad88c736aac526a821658cea0f96
check platform with correct python
certbot-nginx/certbot_nginx/constants.py
certbot-nginx/certbot_nginx/constants.py
"""nginx plugin constants.""" import pkg_resources import platform if(platform.system() == ('FreeBSD' or 'Darwin')): server_root_tmp = "/usr/local/etc/nginx" else: server_root_tmp = "/etc/nginx" CLI_DEFAULTS = dict( server_root=server_root_tmp, ctl="nginx", ) """CLI defaults.""" MOD_SSL_CONF_DES...
Python
0
@@ -63,17 +63,17 @@ form%0A%0Aif -( + platform @@ -86,10 +86,10 @@ m() -== +in ('F @@ -95,19 +95,17 @@ FreeBSD' - or +, 'Darwin @@ -106,17 +106,16 @@ Darwin') -) :%0A se @@ -194,20 +194,16 @@ /nginx%22%0A - %0ACLI_DEF
e889cd87e1260d209775a98fb7779146f92c9333
handle non integer issue numbers better
ooo.py
ooo.py
#!/usr/bin/python import os import sys import re from collections import defaultdict COMIC_RE = re.compile(r'^\d+ +([^#]+)#(\d+)') def lines(todofile): with open(todofile) as todolines: for line in todolines: title_match = COMIC_RE.match(line) if title_match: # (title, issue) yield ...
Python
0.000027
@@ -506,16 +506,19 @@ and +abs( issue -!= +- see @@ -525,17 +525,20 @@ n%5Btitle%5D -+ +) %3E 1:%0A
3256800e9f88a0778099215047f195e0cfed4db4
fix code for use with newer pybtex version
pelican_bibtex.py
pelican_bibtex.py
""" Pelican BibTeX ============== A Pelican plugin that populates the context with a list of formatted citations, loaded from a BibTeX file at a configurable path. The use case for now is to generate a ``Publications'' page for academic websites. """ # Author: Vlad Niculae <vlad@vene.ro> # Unlicense (see UNLICENSE fo...
Python
0
@@ -428,17 +428,16 @@ '0.2'%0A%0A -%0A def add_ @@ -2058,19 +2058,19 @@ .fields. -pop +get ('pdf', @@ -2105,19 +2105,19 @@ .fields. -pop +get ('slides @@ -2155,19 +2155,19 @@ .fields. -pop +get ('poster
7bb675270b7a10f66a2e3436fcfc377d89999be6
Set `connected` indicator variable.
PyOpenWorm/__init__.py
PyOpenWorm/__init__.py
# -*- coding: utf-8 -*- """ PyOpenWorm ========== OpenWorm Unified Data Abstract Layer. Most statements correspond to some action on the database. Some of these actions may be complex, but intuitively ``a.B()``, the Query form, will query against the database for the value or values that are related to ``a`` through...
Python
0.999988
@@ -3728,16 +3728,38 @@ return%0A + m.connected = True %0A if
04d1494cfcbc4508519f559d9a2093f4491c3451
Update get_access_token.py
get_access_token.py
get_access_token.py
#!/usr/bin/env python # # Copyright 2007-2013 The Python-Twitter Developers # # 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 ...
Python
0.000001
@@ -1056,16 +1056,36 @@ r_secret +, callback_uri='oob' )%0A%0A p
777dc0b199f34677f999a06b2c453b8cb28a10cc
fix a silly bug with variable aliasing
p2o.py
p2o.py
"""Get latest posts from Pinboard and create a new blog post.""" import collections import cStringIO import datetime import os import re import sys import gflags import requests FLAGS = gflags.FLAGS gflags.DEFINE_string( 'octopress', '.', 'location of octopress directory') gflags.DEFINE_integer( 'days', 7, ...
Python
0.000003
@@ -3786,27 +3786,24 @@ for p -ost in grouped%5B @@ -3883,35 +3883,32 @@ p -ost %5B'description'%5D. @@ -3917,19 +3917,16 @@ rip(), p -ost %5B'href'%5D @@ -3953,19 +3953,16 @@ if p -ost %5B'extend @@ -4018,19 +4018,16 @@ %25s' %25 p -ost %5B'extend @@ -4045,27 +4045,24 @@ ...
ebb2b2381662dcaa9a16083cae3b7e0ae9bc1065
Reword 51
p51.py
p51.py
# 51 # Find the smallest prime which, by replacing part of the number with the same digit, from prime import Prime class Solve(object): def __init__(self): self.p = Prime() self.ps = self.p.prime_stream() def get_replaced(self, p_str, r_str): return [int(p_str.replace(r_str, str(i))) ...
Python
0
@@ -84,16 +84,57 @@ digit,%0A +# is part of an eight prime value family%0A from pri
80e6c4d499b6c126dc0032a8175d9a6ba3bab1a8
Add os import
pca.py
pca.py
# pca <master> <inputFile> <outputFile> <slices> <k> <dim> # # performs pca on a data matrix # input is a local text file or a file in hdfs # format should be rows of ' ' separated values # - example: space (rows) x time (cols) # - rows should be whichever dim is larger # 'dim' is dimension to subtract mean along # '...
Python
0.000001
@@ -407,16 +407,25 @@ ort sys%0A +import os %0Afrom nu
2cf25d10bb81f53fa415523650558b9ea10032f0
Add rounding to nearest for the number of SQL queries per call.
speedinfo/models.py
speedinfo/models.py
# coding: utf-8 from django.db import models class ViewProfiler(models.Model): """ Holds profiler stats grouped by view. """ view_name = models.CharField('View name', max_length=255) method = models.CharField('HTTP method', max_length=8) anon_calls = models.PositiveIntegerField('Anonymous cal...
Python
0
@@ -1910,16 +1910,22 @@ urn int( +round( self.sql @@ -1939,16 +1939,22 @@ count / +float( self.tot @@ -1954,32 +1954,34 @@ elf.total_calls) +)) %0A else:%0A
041ead70032adf241d40b37fc3d7de859b8a71de
Add Dynamic Programming solution for maximum subarray
src/maximum_subarray.py
src/maximum_subarray.py
# brute force solution O(n^3) # it works, but Time Limit Exceeded in leetcode class Solution1: # @param {integer[]} nums # @return {integer} def maxSubArray(self, nums): if not nums: return None maxSum = nums[0] for size in range(1, len(nums)+1): for i in rang...
Python
0.000002
@@ -1292,16 +1292,621 @@ maxSum%0A%0A +# Dynamic Programming with state transaction. O(n)%0A# cur_sum = max(a%5Bi%5D, cur_sum + a%5Bi%5D) ?? think about this.%0A# max_sum = max(cur_sum, max_sum)%0Aclass Solution3:%0A # @param %7Binteger%5B%5D%7D nums%0A # @return %7Binteger%7D%0A def maxSubArray(self, nums):%...
50357907c5578f226b629e8a0dda29f87298fb7e
Fix issue with AddRecordForm editing the omit_fields of the EditableForm if __sprox__.omit_fields is specified
sprox/configbase.py
sprox/configbase.py
from formencode.validators import Validator from sprox.providerselector import ProviderTypeSelector class ConfigBaseError(Exception):pass class ConfigBase(object): """ Base class for all configurable classes in Sprox. :Modifiers: +-----------------------------------+---------------------------------...
Python
0.000001
@@ -92,16 +92,28 @@ Selector +%0Aimport copy %0A%0Aclass @@ -7595,10 +7595,26 @@ _', +copy.deepcopy( value) +)%0A
77b2d1bb65a80ad4ade4237e2855e90f7c25347a
Fix Trip.clean() method
planner/models.py
planner/models.py
import datetime from cities_light.models import City from cities_light.models import City from django.core import validators as valids from django.db import models from django.utils.translation import ugettext_lazy as _ from users.models import User from getaride import settings from planner.validators import validat...
Python
0.000005
@@ -1601,23 +1601,16 @@ me.now() -.date() + datet
1c738439e8d3d30d5c2f7586e6ca796e64e28873
add service debug log.
src/webhooks2irc/core/ircbot.py
src/webhooks2irc/core/ircbot.py
#!/usr/bin/env python # coding: UTF-8 import time import threading from irc import client as irc_client from webhooks2irc import settings class IrcBotService(threading.Thread): def __init__(self): self.client = irc_client.Reactor() server = self.client.server() server.connect(settings.I...
Python
0
@@ -60,16 +60,31 @@ hreading +%0Aimport logging %0A%0Afrom i @@ -149,16 +149,53 @@ ettings%0A +logger = logging.getLogger(__name__)%0A %0A%0Aclass @@ -328,24 +328,90 @@ nt.server()%0A + logger.debug('connect to %7B0%7D.'.format(settings.IRC_HOST))%0A serv @@ -765,24 +765,74 @@ onnected():%0A + ...
c2ff1198a53d13ea325ac293650a6f61246e89cf
improve error recovery for malformed lines.
pls.py
pls.py
# -*- coding: utf-8 -*- # # Copyright (C) 2009, 2010 Amit Saha # # This file is part of Zeya. # # Zeya 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...
Python
0
@@ -1802,41 +1802,77 @@ -#read the filename into filename%0A +try:%0A # Parse the filename from the line.%0A @@ -1927,30 +1927,216 @@ ine. -f ind +ex (%22=%22) -+1:len(line)%5D + + 1:%5D%0A except ValueError:%0A print %22WARNING: malfor...
f34773f4ae5e8ab3ad067e5e9fd57bb4996a2186
Bump version to 0.1.2
pontoon/__init__.py
pontoon/__init__.py
# -*- coding: utf-8 -*- __name__ = 'pontoon' __description__ = 'A Python CLI for Digital Ocean' __version__ = '0.1.1' __author__ = 'Ross Duggan' __author_email__ = 'ross.duggan@acm.org' __url__ = 'https://github.com/duggan/pontoon' __copyright__ = 'Copyright Ross Duggan 2013' from .cache import cache from .log import...
Python
0
@@ -109,17 +109,17 @@ = '0.1. -1 +2 '%0A__auth
8a520b1824e4f7d24c3aa05c22f374baafb3f629
Add a copyright and license comment to re2.py
re2.py
re2.py
#!/usr/bin/env python # Define this first, since it is referenced by _re2. class error(Exception): pass import _re2 compile = _re2._compile
Python
0
@@ -16,16 +16,1558 @@ python%0A%0A +# Copyright (c) 2010, David Reiss and Facebook, Inc. All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions%0A# are met:%0A# * Redistributions of source code must retain t...
64b1b00c9b00c9cf9b368fdc58b6705013c5cc69
Fix HTML injection attack in change subject lines
webapp/codereview/changetable.py
webapp/codereview/changetable.py
# Copyright 2008 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
@@ -3459,16 +3459,28 @@ bject': +html.escape( defaultf @@ -3514,16 +3514,17 @@ ect, 11) +) ,%0A @@ -4289,24 +4289,36 @@ , lambda c: +html.escape( c.dest_proje @@ -4325,16 +4325,17 @@ ct.name) +) %0AFIELD_M @@ -4577,16 +4577,28 @@ mbda c: +html.escape( c.dest_b @@ -4603,21 +4603,28 @@ _branch. +short...
bb1247fff33973d0edd82ceaa7a79f1ce73f6cde
Update regular expression to correctly return 404 instead of 500 in some invalid paths.
st2common/st2common/util/api.py
st2common/st2common/util/api.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Python
0
@@ -3748,16 +3748,17 @@ rguments +? %5C(%5Cd+ g
aa57ee789731f129646dc6641087a17486353251
Fix filtering bug in run.py
run.py
run.py
#!/usr/bin/env python import logging import logconfig # silence these loggers logging.getLogger().setLevel("CRITICAL") logging.getLogger("driller.fuzz").setLevel("INFO") l = logging.getLogger("driller") l.setLevel("INFO") import os import sys import redis import fuzzer.tasks import driller.config as config ''' Lar...
Python
0.000002
@@ -1375,21 +1375,24 @@ not in -pwned +filter_t , jobs)%0A
655a2d3311a8f679f3e241173c4907515c274d6d
Exclude __main__ part from testing
run.py
run.py
# -*- coding: utf-8 -*- # # This file is part of the VecNet OpenMalaria Portal. # For copyright and licensing information about this package, see the # NOTICE.txt and LICENSE.txt files in its top-level directory; they are # available at https://github.com/vecnet/om # # This Source Code Form is subject to the terms of t...
Python
0.000223
@@ -577,24 +577,44 @@ %22__main__%22: + # pragma: no cover %0A # This @@ -4586,16 +4586,36 @@ main__%22: + # pragma: no cover %0A sim
bb407804ee238474bfa814b635c021820dcf8b37
Make indipendent on matlib. It is for faster computation and less memory usage.
scw.py
scw.py
import math import numpy as np from numpy import matlib from scipy.stats import norm __all__ = ['SCW1', 'SCW2'] class BaseSCW(object): def __init__(self, C=1.0, ETA=1.0): self.weights = None self.covariance = None self.C = np.float64(C) self.cdf_values = self.calc_cdf_values(ETA)...
Python
0
@@ -29,33 +29,8 @@ np%0A -from numpy import matlib%0A from @@ -368,56 +368,35 @@ t = -label * self.weights.T*x%0A if t %3E= 1:%0A +self.calc_margin(x, label)%0A @@ -407,31 +407,31 @@ return 0 -%0A return + if t %3E= 1 else 1-t%0A%0A @@ -634,16 +634,34 @@ -c = x.T* +return np.dot(...
b59a57c395546ac0acd32867ee0a53105b8ae4eb
Make source file executable
tellbot.py
tellbot.py
#!/usr/bin/env python3 # -*- coding: ascii -*- import sys, os import basebot class TellBot(basebot.Bot): pass class TellBotManager(basebot.BotManager): pass if __name__ == '__main__': basebot.run_main(TellBot, mgrcls=TellBotManager)
Python
0.000011
b9237a009e57463275970312d8e3f676755d8a7b
set display order
src/otest/conf_setup.py
src/otest/conf_setup.py
import importlib import json import logging import sys from mako.lookup import TemplateLookup from oic.utils.keyio import build_keyjar from otest.parse_cnf import parse_yaml_conf from otest.prof_util import ProfileHandler from otest.rp.setup import read_path2port_map from otest.utils import SERVER_LOG_FOLDER from ote...
Python
0.000001
@@ -1669,16 +1669,36 @@ nst_conf +, display_order=None ):%0A %22 @@ -2421,16 +2421,80 @@ ofiles%0A%0A + if display_order is None:%0A display_order = OP_ORDER%0A%0A flow @@ -2685,24 +2685,29 @@ y_order= -OP_ORDER +display_order )%0A%0A #
b8cde3c191f645d83ba9215c921c77cb81c13ee3
allow TestRun editing
squad/core/admin.py
squad/core/admin.py
from django.contrib import admin from . import models from .tasks import notify_project_status from squad.plugins import PluginLoader class TokenAdmin(admin.ModelAdmin): """ Handles global tokens, i.e. tokens that are not projec-specific. """ model = models.Token fields = ['description', 'key'] ...
Python
0
@@ -3401,16 +3401,719 @@ ame'%5D%0A%0A%0A +class TestRunProjectFilter(admin.SimpleListFilter):%0A title = %22Project%22%0A parameter_name = %22project%22%0A%0A def lookups(self, request, model_admin):%0A ret_list = ()%0A for project in models.Project.objects.all():%0A ret_list = ret_l...
aa2d675354566fa4cef801b2a553e076ad8d8c94
remove attempt to grab terminal size (breaks when there is no terminal)
ThreeDFSC/programs/utility_functions.py
ThreeDFSC/programs/utility_functions.py
import os import sys def print_progress(iteration, total, prefix='', suffix='', decimals=1): """ Call in a loop to create terminal progress bar @params: iteration - Required : current iteration (Int) total - Required : total iterations (Int) prefix - Optional...
Python
0
@@ -568,16 +568,17 @@ %22%22%0A%0A +# rows, co @@ -627,16 +627,33 @@ split()%0A + columns = 40%0A bar_
811fc1b869aaacf3319836993ae6bbbc51b7b8a3
Update appro
cogs/pubgcog.py
cogs/pubgcog.py
from pubg_python import PUBG, Shard import common import asyncio import datetime class Puby: """ Pubg Fetchers""" def __init__(self, bot): self.bot = bot async def check_pubg_matches(bot): """ Checks for new matches :return: None """ c_to_send = None await bot.wait_until_re...
Python
0.000001
@@ -1163,16 +1163,21 @@ if p +.name not in @@ -1243,16 +1243,21 @@ info%22%5D%5Bp +.name %5D != p.m @@ -1867,25 +1867,20 @@ %22 -killing %7B%7D people +for %7B%7D kills . %22%5C @@ -2483,16 +2483,21 @@ info%22%5D%5Bp +.name %5D = mp_i @@ -2498,16 +2498,71 @@ = mp_id%0A + com...
d5b13e06c3ed31691c23de765fcb60d5972ef7d9
Fix embedding images from tweets in threads
cogs/twitter.py
cogs/twitter.py
import re from lxml import etree from discord.ext import commands class Twitter: url_expr = re.compile(r'https?:\/\/twitter\.com\/\S+\/status\/\d+') tweet_selector = ".//div[@class='AdaptiveMediaOuterContainer']" img_selector = './/img[@data-aria-label-part]' def __init__(self, bot): self.b...
Python
0.002054
@@ -183,44 +183,49 @@ div%5B -@class='AdaptiveMediaOuterContainer' +contains(@class, 'tweet permalink-tweet') %5D%22%0A @@ -1230,24 +1230,41 @@ MLParser())%0A + try:%0A twee @@ -1272,20 +1272,21 @@ = root. -find +xpath (self.tw @@ -1298,16 +1298,19 @@ elector) +%5B0%5D %0A @@ -1314,2...
3299e9a73e484df73a0b2ce3e947a980ac64d862
Update PedidoEditar.py
backend/Models/Campus/PedidoEditar.py
backend/Models/Campus/PedidoEditar.py
from Framework.Pedido import Pedido from Framework.ErroNoHTTP import ErroNoHTTP class PedidoEditar(Pedido): def __init__(self,variaveis_do_ambiente): super(PedidoEditar, self).__init__(variaveis_do_ambiente) try: self.id = self.corpo['id'] self.nome = self.corpo['nome'] except: raise ErroNoHTTP(400) ...
Python
0
@@ -217,38 +217,8 @@ ry:%0A -%09%09%09self.id = self.corpo%5B'id'%5D%0A %09%09%09s @@ -286,47 +286,11 @@ 00)%0A +%0A %09%09 -%0A%09def getId(self):%0A%09%09return self.id%0A%0A %09%0A%09d @@ -317,16 +317,17 @@ return self.nome +%0A
82f9abbb7689bea6b8961274a169568e0ff2bbeb
Add conversion for out of date processes
backend/scripts/conversion/convert.py
backend/scripts/conversion/convert.py
#!/usr/bin/env python import rethinkdb as r from optparse import OptionParser import sys def msg(s): print s sys.stdout.flush() def fix_mcpub_missing_property_types(conn): processes = list(r.db('mcpub').table('processes').filter(~r.row.has_fields('process_type')).run(conn)) for process in processes...
Python
0
@@ -151,37 +151,36 @@ cpub_missing_pro -perty +cess _types(conn):%0A @@ -177,16 +177,67 @@ (conn):%0A + print %22Fixing missing process_type entries...%22%0A proc @@ -564,16 +564,1346 @@ n(conn)%0A + print %22Done.%22%0A%0A%0Adef fix_bad_mcpub_process_types(conn):%0A print %22Fixing bad process_type...
0eff0eb9e544e9071a49226545d227371bc4843f
Add person admin
bazango/contrib/organization/admin.py
bazango/contrib/organization/admin.py
from django.contrib import admin from .models import Organization, OrganizationProfile, Category from django.utils.translation import ugettext_lazy as _ @admin.register(Organization) class OrganizationAdmin(admin.ModelAdmin): list_display = ['short_name', 'krs', 'register_at', 'tag_list', 'category_list', 'is_act...
Python
0.000001
@@ -89,16 +89,24 @@ Category +, Person %0Afrom dj @@ -1724,8 +1724,79 @@ %0A %5D%0A%0A +%0A@admin.register(Person)%0Aclass PersonAdmin(admin.ModelAdmin):%0A pass%0A
c17bd83a2536a5f67ecb07dafb256a625eab3991
should compare against basestring, not str
enthought/pyface/ui/wx/python_shell.py
enthought/pyface/ui/wx/python_shell.py
#------------------------------------------------------------------------------ # Copyright (c) 2005, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions describ...
Python
0.999999
@@ -3710,11 +3710,17 @@ and -typ +isinstanc e(ob @@ -3729,16 +3729,21 @@ name -) is str +, basestring) and
8936f1a0098f5987eaea6e7feca70143ce522561
Add try-catch on queue closure (#9955)
ibm_mq/datadog_checks/ibm_mq/collectors/stats_collector.py
ibm_mq/datadog_checks/ibm_mq/collectors/stats_collector.py
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from pymqi.CMQCFC import MQCMD_STATISTICS_CHANNEL, MQCMD_STATISTICS_Q from datadog_checks.ibm_mq.stats.base_stats import BaseStats from datadog_checks.ibm_mq.stats.queue_stats import QueueStats from ..m...
Python
0
@@ -3081,20 +3081,150 @@ -queue.close( +try:%0A queue.close()%0A except pymqi.PYIFError as e:%0A self.log.debug(%22Could not close queue: %25s%22, str(e) )%0A%0A
282ce26a3200dc5c5c94781dc2fc4af27a75df7f
Update version [skip ci]
previous_version.py
previous_version.py
PREVIOUS_VERSION = '0.20.4' def main(): print PREVIOUS_VERSION if __name__ == "__main__": main()
Python
0
@@ -1,24 +1,63 @@ +from __future__ import print_function%0A%0A PREVIOUS_VERSION = '0.20 @@ -59,11 +59,11 @@ '0.2 -0.4 +1.0 '%0A%0A%0A @@ -83,17 +83,17 @@ print - +( PREVIOUS @@ -100,16 +100,17 @@ _VERSION +) %0A%0A%0Aif __
9e00287611f254ec3599eb69c2b6ef8a2220ecef
Store previous version [skip ci]
previous_version.py
previous_version.py
PREVIOUS_VERSION = '0.20.3' def main(): print PREVIOUS_VERSION if __name__ == "__main__": main()
Python
0
@@ -22,9 +22,9 @@ .20. -3 +4 '%0A%0A%0A
86b87ba2975a0eef39887568c7af57801594fc9e
Set correct number of nodes in JSON.
src/api/readings.py
src/api/readings.py
# Copyright (c)Shaun Crampton 2012-2012. All rights reserved. import time import tornado import cjson from data import Session, Reading import datetime class ReadingsHandler(tornado.web.RequestHandler): def get(self): sess = Session() self.set_header("Content-Type", "application/json") ...
Python
0.000001
@@ -339,17 +339,17 @@ _nodes%22: -2 +3 ,%22readin
1d63a28492163a63d710a950004bf67e6e46ae41
remove spaces
TrackCat/templatetags/navigation.py
TrackCat/templatetags/navigation.py
from django import template from django.core import urlresolvers register = template.Library() @register.simple_tag(takes_context=True) def current(context, url_name, return_value=' active', **kwargs): matches = current_url_equals(context, url_name, **kwargs) return return_value if matches else '' d...
Python
0.999999
@@ -60,18 +60,16 @@ lvers%0A %0A - %0A register @@ -92,18 +92,16 @@ ary()%0A %0A - %0A @registe @@ -306,18 +306,16 @@ se ''%0A %0A - %0A def curr
eeedced52404b6fcb7e2b97d1fdbf35369d25c84
Add check for -d argument
wonderful_bing/wonderful_bing.py
wonderful_bing/wonderful_bing.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ wonderful_bing ~~~~~~~~~~~~~~ Wonderful_bing is a small and simple program that helps you download pictures from Bing and set as wallpaper. My first python program :) :copyright: (c) 2014 by lord63. :license: MIT, see LICENSE for more details. ...
Python
0
@@ -484,16 +484,27 @@ port os%0A +import sys%0A import a @@ -3410,16 +3410,168 @@ _args()) +%0A if not config%5B'directory'%5D:%0A sys.exit(%22Set the directory to save Bing's imgs first.%5Cn%22%0A %22For more information, use --help.%22) %0A%0A bi
d98e33d28105c8180b591e3097af83e42599bfc5
Remove the usage of nargs to avoid different behaviors between chronograph and command line.
django_local_apps/management/commands/docker_exec.py
django_local_apps/management/commands/docker_exec.py
import logging import docker from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase log = logging.getLogger() class DockerExecutor(DjangoCmdBase): def add_arguments(self, parser): # Positional arguments """ :param: in the args it could be: /usr/local/bin/python /...
Python
0
@@ -493,32 +493,216 @@ rn:%0A %22%22%22%0A + # for using with chronograph, do not use nargs param, because chronograph seems do not support passing%0A # array, but using nargs will generate a list for the parameters%0A parser.a @@ -713,16 +713,22 @@ rgument( +'-c', '--conta @@ -739,17 ...
b86158f63cdb31ac326bf8c02f6bdc67d20872a0
Handle the case when tab index is None
graphysio/mainui.py
graphysio/mainui.py
import sys, csv, os from functools import partial import pandas as pd import numpy as np from pyqtgraph.Qt import QtGui, QtCore from graphysio import dialogs, utils, csvio from graphysio.plotwidgets import TSWidget class MainUi(*utils.loadUiFile('mainwindow.ui')): hasdata = QtCore.pyqtSignal(object) haserr...
Python
0.999999
@@ -1834,16 +1834,53 @@ kwargs)%0A + if tabindex is not None:%0A
52ec83af00ae6c3355a4f118373e90804e7535a1
Fix moderator permission migration
c2corg_api/scripts/migration/users.py
c2corg_api/scripts/migration/users.py
from sqlalchemy.sql import text import transaction import zope from c2corg_api.models.user import User from c2corg_api.scripts.migration.migrate_base import MigrateBase from c2corg_api.scripts.migration.batch import SimpleBatch class MigrateUsers(MigrateBase): """Migrate user data. Roles are stored directly ...
Python
0
@@ -1076,12 +1076,15 @@ re -turn +sults = sel @@ -1221,16 +1221,70 @@ r(gid))) +.fetchall()%0A return %5Br%5B0%5D for r in results%5D %0A%0A
899371a92184519744df832965a71c181a46da26
Use has_focus and fix varnames
plugins/notify.py
plugins/notify.py
# coding: UTF-8 """ Copyright (c) 2009 Michael Kuhn All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions a...
Python
0.000001
@@ -3420,243 +3420,8 @@ %22)%0A%0A -%09def is_current_tab(self, server, target):%0A%09%09%22%22%22 return True if the server / target is activated in the UI %22%22%22%0A%09%09cs,ct = gui.tabs.get_current_tabs()%0A%09%09return (cs != None and cs.name == server and ct != None%0A%09%09%09%09and ct.name == target)%0A%0A ...
82fca7d325ebe1e2459195139bac8fdcbd17eb0d
Make the display_window.py example quit after a few loops
docs/python_api/examples/renderdoc/display_window.py
docs/python_api/examples/renderdoc/display_window.py
import sys # Import renderdoc if not already imported (e.g. in the UI) if 'renderdoc' not in sys.modules and '_renderdoc' not in sys.modules: import renderdoc # Alias renderdoc for legibility rd = renderdoc def loadCapture(filename): # Open a capture file handle cap = rd.OpenCaptureFile() # Open a particular fi...
Python
0.00001
@@ -2433,16 +2433,38 @@ urdraw = + draws%5B0%5D%0A%0Aloopcount = 0%0A%0A# Th @@ -2503,17 +2503,16 @@ d every -1 50ms, to @@ -2577,16 +2577,34 @@ curdraw +, draws, loopcount %0A%0A%09# Mov @@ -2655,30 +2655,23 @@ meEvent( -draws%5B curdraw -%5D .eventId @@ -2835,22 +2835,15 @@ d = -draws%5B curdraw -%5D ...
9c353b0684a9a3a1bc2640974e44fdc71f5417c3
Fix Keystore comment to point at correct class (#697)
plyer/__init__.py
plyer/__init__.py
''' Plyer ===== ''' __all__ = ( 'accelerometer', 'audio', 'barometer', 'battery', 'bluetooth', 'brightness', 'call', 'camera', 'compass', 'cpu', 'email', 'filechooser', 'flash', 'gps', 'gravity', 'gyroscope', 'humidity', 'irblaster', 'keystore', 'light', 'notification', 'orientation', 'processors', ...
Python
0
@@ -725,20 +725,21 @@ ades.Key -ring +store %60%0Akeysto
f09880dc0b51108ed6d915ac6f8d2e443d358619
Fix int conversion
project/settings.py
project/settings.py
""" Django settings for project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os ...
Python
0.000011
@@ -2076,10 +2076,12 @@ T', +' 25 +' ))%0AS @@ -3072,12 +3072,13 @@ SSING = True +%0A
36e7af17c8d7c4bdb9cfd20387c470697e1bac96
Simplify f-string to remove cast
po/build-babel.py
po/build-babel.py
import subprocess from pathlib import Path po_path: Path = Path(__file__).resolve().parent def run_babel(command: str, input: Path, output_file: Path, locale: str): subprocess.run( [ "pybabel", command, f"--input={str(input)}", f"--output-file={str(output_f...
Python
0.000056
@@ -262,18 +262,13 @@ ut=%7B -str( input -) %7D%22,%0A @@ -296,20 +296,16 @@ t-file=%7B -str( output_f @@ -307,17 +307,16 @@ put_file -) %7D%22,%0A @@ -339,19 +339,14 @@ le=%7B -str( locale -) %7D%22,%0A
33b89927b7bcba35927ba2a855780682a56ffdf0
Remove unneeded import to fix tests
ckanext/glasgow/tests/logic/test_auth.py
ckanext/glasgow/tests/logic/test_auth.py
import mock import nose import ckan.plugins as p import ckan.new_tests.helpers as helpers import ckan.new_tests.factories as factories eq_ = nose.tools.eq_ class TestCreate(object): @classmethod def setup_class(cls): helpers.reset_db() # Create test users and other objects cls.sy...
Python
0
@@ -87,53 +87,8 @@ pers -%0Aimport ckan.new_tests.factories as factories %0A%0Aeq
9400c0a1818b8853f23cfb564d2f4f09807fca1c
Fix an issue importing stages from entrypoints.
streamcorpus_pipeline/config.py
streamcorpus_pipeline/config.py
"""yakonfig declarations for streamcorpus_pipeline. .. This software is released under an MIT/X11 open source license. Copyright 2014-2015 Diffeo, Inc. If your program will use :mod:`streamcorpus_pipeline`, then include the top-level module in your initial :mod:`yakonfig` setup, e.g. .. code-block:: python wi...
Python
0.000001
@@ -1614,28 +1614,52 @@ ath',%0A%7D%0A +# We can't find out our sub -_ +- modules = set(st @@ -1654,320 +1654,515 @@ les -= set(stage%0A for stage in PipelineStages().itervalues()%0A if hasattr(stage, 'config_name'))%0A%0A%0Adef replace_config(config, name):%0A # Do we have ...
74d1dfabe7ccab9d75b53d596c47768220bfced2
Rewrite solution
string/first-str-substr-occr.py
string/first-str-substr-occr.py
# Implement a function that takes two strings, s and x, as arguments and finds the first occurrence of the string x in s. The function should return an integer indicating the index in s of the first occurrence of x. If there are no occurrences of x in s, return -1 def find_substring(string, substr): string_len = len(...
Python
0.00001
@@ -300,81 +300,22 @@ ):%0A%09 -string_len = len(string)%0A%09substr_len = len(substr)%0A%09j = 0%0A%0A%09if substr_len +if len(substr) %3E= @@ -341,18 +341,19 @@ (0, +len( string -_len +) ):%0A%09 @@ -369,32 +369,23 @@ ng%5Bi -%5D == substr%5Bj%5D:%0A%09%09%09%09if j +:i+len(substr)%5D == @@ -394,19 +394,1...
990dd6dab442671affb69c0dd16b08aeaf45ddbc
use radio selects in cryptokeys admin as well
powerdns/admin.py
powerdns/admin.py
# -*- coding: utf-8 -*- from django.contrib import admin from django.contrib.admin.widgets import AdminRadioSelect from django.db import models from django.forms import NullBooleanSelect from django.utils.translation import ugettext_lazy as _ from powerdns.models import (CryptoKey, Domain, DomainMetadata, Record, ...
Python
0
@@ -3212,16 +3212,209 @@ tent',)%0A + formfield_overrides = %7B%0A models.NullBooleanField: %7B%0A 'widget': NullBooleanRadioSelect(%0A attrs=%7B'class': 'radiolist inline'%7D%0A ),%0A %7D,%0A %7D%0A %0A%0Aadmin.
2494e769cd93bb934ef723be3bdfc6a0891461d0
fix reference to db_exp, how many of these can i make in 10 LoCs?
pprof/utils/db.py
pprof/utils/db.py
"""Database support module for the pprof study.""" import logging from pprof.settings import CFG logger = logging.getLogger(__name__) def create_run(cmd, prj, exp, grp): """ Create a new 'run' in the database. This creates a new transaction in the database and creates a new run in this transaction. A...
Python
0.999998
@@ -2827,16 +2827,22 @@ newp +_value = %7B%0A @@ -3030,24 +3030,30 @@ .update(newp +_value )%0A lo @@ -3089,16 +3089,22 @@ s%22, newp +_value )%0A%0A s @@ -3748,24 +3748,43 @@ n.add(newe)%0A + ret = newe%0A logg @@ -3940,16 +3940,43 @@ , exps)%0A + ret = exps.first()%0A ...
aa4cf0dbdbf55727a23b5166b965ad5fd31caf73
add missing run_id for config instances
pprof/utils/db.py
pprof/utils/db.py
"""Database support module for the pprof study.""" from pprof.settings import config def create_run(cmd, prj, exp, grp): """ Create a new 'run' in the database. This creates a new transaction in the database and creates a new run in this transaction. Afterwards we return both the transaction as w...
Python
0.000017
@@ -3383,16 +3383,31 @@ nfig%5Bc%5D) +, run_id=run.id )%0A se
d60341cbba0f1ddd1315dcd86f9ddad12191512a
include category (and for compatibility briefly, info.category) in mixpanel list_cubes; include info.category in full cube.
cubes/backends/mixpanel/store.py
cubes/backends/mixpanel/store.py
# -*- coding=utf -*- from ...model import * from ...browser import * from ...stores import Store from ...errors import * from .mixpanel import * from string import capwords DIMENSION_COUNT_LIMIT = 100 time_dimension_md = { "name": "time", "levels": ["year", "month", "day", "hour"], "hierarchies": [ ...
Python
0
@@ -2647,16 +2647,70 @@ label,%0A + %22category%22: self.store.category,%0A
d2bcce6f945fba33b271b983420f57a9865c9186
Update validation.py
cea/optimization/master/validation.py
cea/optimization/master/validation.py
""" Validation """ from __future__ import division import random from cea.optimization.constants import DH_CONVERSION_TECHNOLOGIES_WITH_SPACE_RESTRICTIONS, \ DH_CONVERSION_TECHNOLOGIES_SHARE, DC_CONVERSION_TECHNOLOGIES_SHARE, DC_CONVERSION_TECHNOLOGIES_WITH_SPACE_RESTRICTIONS def validation_main(individual_wit...
Python
0.000001
@@ -1093,75 +1093,8 @@ te = - ''%0A while candidate.count('1') %3C 2:%0A candidate = ''. @@ -1156,32 +1156,60 @@ building_name in +%0A column_names_bu @@ -1225,38 +1225,37 @@ eating)%0A - if +while candidate.count @@ -1268,58 +1268,9 @@ %3C 2: - #there ...
03aa67ff670789b8b31a6391bf10d75fa3dba990
Allow filtering by tag slug
projectsheet/api.py
projectsheet/api.py
from tastypie.resources import ModelResource from tastypie.authorization import Authorization from tastypie import fields from .models import ProjectSheet, ProjectSheetTemplate, ProjectSheetSuggestedItem, ProjectSheetQuestion from projects.api import ProjectResource from projects.models import Project from django.core...
Python
0
@@ -538,32 +538,24 @@ _methods = %5B -'post', 'get'%5D%0A @@ -706,18 +706,20 @@ ' -id +slug ' : ('ex
2a588df23755bd94924e42dae517705aca3938d8
Use Pseudo-Normalized verbiage
proof_of_concept.py
proof_of_concept.py
import time import csv tables = [ { 'test_table': { 'file_name': 'raw_data.tsv', 'column_structure': ( {'id': int}, {'first_name': str} ) } } ] field_lookups = { 'first_name': { 'type': str, 'values': { 1: 'John', 2: 'Bob', 3: 'Robert', 4: 'Michael', 5: 'Erin', 6: 'Vict...
Python
0.000162
@@ -1128,19 +1128,23 @@ nt(%22 -Memory Mapp +Pseudo-Normaliz ed:
b6ed218dfe5f50a645056b2556724700dfc0d1ab
Use string argument for legend's loc parameter
examples/linear_model/plot_theilsen.py
examples/linear_model/plot_theilsen.py
""" ==================== Theil-Sen Regression ==================== Computes a Theil-Sen Regression on a synthetic dataset. See :ref:`theil_sen_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the Theil-Sen estimator is robust against outliers. It has a breakd...
Python
0.000001
@@ -2796,17 +2796,28 @@ end(loc= -2 +'upper left' )%0A%0A%0A#### @@ -3505,17 +3505,28 @@ end(loc= -2 +'upper left' )%0Apl.sho
225c362122a0074056e2057acf56b8e2963fc6fb
Fix sqlalchemy->sqlite port error
gutenberg/corpus.py
gutenberg/corpus.py
from . import api import gzip import sqlite3 import os class SqliteCorpus(api.Corpus): def __init__(self, *args, **kwargs): api.Corpus.__init__(self, *args, **kwargs) self._index = 'file:%s?' % os.path.join(self.basedir, 'index.sqlite3') def _build_index(self): with sqlite3.connect(se...
Python
0.000001
@@ -199,21 +199,8 @@ ex = - 'file:%25s?' %25 os. @@ -313,31 +313,8 @@ ndex - + 'mode=rwc', uri=True ) as @@ -1057,38 +1057,16 @@ f._index - + 'mode=ro', uri=True ) as dbc @@ -1769,30 +1769,8 @@ ndex - + 'mode=ro', uri=True ) as
a2ac7b84f9578ba8414c00769a0ab4e87ef87c6e
Clean up client
xierpa3/sites/typo2014/client.py
xierpa3/sites/typo2014/client.py
# -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # xierpa server # Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com # # X I E R P A 3 # Distribution by the MIT License. # # -----------------------------------------------------------...
Python
0
@@ -407,76 +407,8 @@ ent%0A -from xierpa3.sites.documentation.documentation import Documentation%0A from @@ -433,16 +433,16 @@ ypo2014%0A + %0Aclass C @@ -493,44 +493,8 @@ 14() -%0A documentation = Documentation() %0A%0A @@ -597,32 +597,32 @@ HEME: typo2014,%0A + 'typo': @@ -635,38 +635,8 @@ 14,%...
f94fb405213343cd616a5dde2e794454419e2d0b
add **kwargs to swallow any superfluous parameters
extras/calvinsys/web/mqtt/Subscribe.py
extras/calvinsys/web/mqtt/Subscribe.py
# -*- coding: utf-8 -*- # Copyright (c) 2018 Ericsson AB # # 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 ...
Python
0.000001
@@ -4706,16 +4706,26 @@ ly=False +, **kwargs ):%0A
541ee58cb0798d163f71a3ab6aea92555454fcfc
Add login_required to remove_file
projects/views.py
projects/views.py
# coding: utf-8 import calendar import reversion import base64 from django.contrib.auth.decorators import login_required, permission_required from django.contrib.sites.models import Site from django.shortcuts import render, get_object_or_404, redirect from django.utils.translation import ugettext as _ from django.core...
Python
0.000001
@@ -4460,24 +4460,40 @@ locals())%0A%0A%0A +@login_required%0A def remove_f @@ -4577,24 +4577,43 @@ d=project_id +, user=request.user )%0A projec
dc399405d43c9c7f12a5580fc761af7fd68b5a60
Remove orig_size kwarg in build_*_thumbnail
src/thumbnailers.py
src/thumbnailers.py
# Copyright 2016, 2017 Matteo Franchin # # 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 ...
Python
0
@@ -1163,32 +1163,16 @@ th, size -, orig_size=None ):%0A t @@ -1353,35 +1353,9 @@ d %7B%7D -, %7B%7D'%0A +' .for @@ -1370,27 +1370,16 @@ e.size, -size, orig_ size))%0A%0A @@ -1673,24 +1673,8 @@ ize, - orig_size=None, **k
2b192dc076b38ff9a3eaef3415b92647f4b64bd6
fix warning msg again
core/ali/oss.py
core/ali/oss.py
import oss2 import os import time from . import ALI_CONF from oss2.exceptions import NoSuchKey from ..colorMessage import dyeWARNING, dyeFAIL def oss2key(destination): prefix = os.path.join('oss://', BUCKET.bucket_name) key = destination.replace(prefix, '').strip('/') return key class OSSkeys(object): ...
Python
0
@@ -2222,24 +2222,66 @@ t_meta(key)%0A + source_size = os.path.getsize(source)%0A msg = 'W @@ -2360,16 +2360,139 @@ _size%7D)' +.format(%0A source=source, source_size=source_size, destination=destination, destination_size=meta.content_length) %0A pri
8ab7ecbee7e656b17bde8102c3a70b7318cc719b
Update test_code_style.py
_unittests/ut_module/test_code_style.py
_unittests/ut_module/test_code_style.py
""" @brief test log(time=10s) """ import os import unittest from pyquickhelper.loghelper import fLOG from pyquickhelper.pycode import check_pep8, ExtTestCase class TestCodeStyle(ExtTestCase): def test_style_src(self): thi = os.path.abspath(os.path.dirname(__file__)) src_ = os.path.normpath(o...
Python
0.000004
@@ -2688,16 +2688,72 @@ y:164%22,%0A + %22ipython_helper.py:21: E1101%22,%0A
907398f23253f7c2347579f223331b76d7f59d67
Remove e in testfinder.py
ptest/testfinder.py
ptest/testfinder.py
import copy import importlib import os from .enumeration import PDecoratorType from .testfilter import TestClassNameFilter, TestCaseNameFilter __author__ = 'karl.gong' class TestFinder: def __init__(self, test_target, test_class_filter_group, test_case_filter_group, target_test_suite): self.test_target =...
Python
0.000002
@@ -1095,18 +1095,16 @@ raise - e %0A%0A
9d84b469b3f05b111c08ea83d8f465a4d4fbcca4
FIX : obob in mpl_helpers
xray_vision/utils/mpl_helpers.py
xray_vision/utils/mpl_helpers.py
import matplotlib import matplotlib.pyplot as plt from functools import wraps def ensure_ax(func): @wraps(func) def inner(*args, **kwargs): if 'ax' in kwargs: ax = kwargs.pop('ax', None) elif len(args) > 0 and isinstance(args[0], matplotlib.axes.Axes): ax = args[0] ...
Python
0
@@ -672,17 +672,17 @@ ce(args%5B -1 +0 %5D, matpl @@ -721,17 +721,17 @@ = args%5B -1 +0 %5D%0A
718071622d8bae486dd8bc250daf1e1626d59d97
use float comparisons
account_invoice_zero/account_invoice.py
account_invoice_zero/account_invoice.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
Python
0
@@ -940,30 +940,113 @@ rom -openerp.osv import orm +functools import partial%0A%0Afrom openerp.osv import orm%0Afrom openerp.tools.float_utils import float_is_zero %0A%0A%0Ac @@ -1271,32 +1271,210 @@ ontext=context)%0A + dp_obj = self.pool%5B'decimal.precision'%5D%0A precision = dp_obj.precision_get(c...
4258ffab62236c9648f15ecd32f238c56f06550b
fix argument name
jsmapper/examples/product.py
jsmapper/examples/product.py
# -*- coding: utf-8 -*- from jsmapper import ( JSONSchema, Array, Mapping, Number, Object, String, ) from jsmapper.defines import JSONSchemaDraftV4 class Product(Mapping): id = JSONSchema(type=Number(), description="The unique identifier for a product") name = JSO...
Python
0.998638
@@ -193,16 +193,176 @@ ping):%0A%0A + class Dimensions(Mapping):%0A length = JSONSchema(type=Number())%0A width = JSONSchema(type=Number())%0A height = JSONSchema(type=Number())%0A%0A id = @@ -388,16 +388,16 @@ mber(),%0A - @@ -551,17 +551,18 @@ xclusive -M +_m inimum=T @@ -66...
66364fdddb1f61817c9858af1b58c89798f653f3
use a regular string for the password
heltour/settings.py
heltour/settings.py
""" Django settings for heltour project. Generated by 'django-admin startproject' using Django 1.9.7. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os fr...
Python
0.000786
@@ -5596,16 +5596,20 @@ SWORD = +str( override @@ -5673,16 +5673,17 @@ SWORD')) +) %0A SER
f5edd7ae5105c5e7c58f220f326f5d18ca2c035b
Update test
youtube_dl/extractor/clipfish.py
youtube_dl/extractor/clipfish.py
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, unified_strdate, ) class ClipfishIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?clipfish\.de/(?:[^/]+/)+video/(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.clipfis...
Python
0
@@ -420,40 +420,40 @@ ': ' -720563e467b86374c194bdead08d207d +b9a5dc46294154c1193e2d10e0c95693 ',%0A
fc42a1dae7f3b545c292ce555e5fe7a0dce80e36
Set --sandbox_tmpfs_path=/tmp to avoid SIGBUS (#1117)
docgen/docgen.py
docgen/docgen.py
#!/usr/bin/env python3 # # Copyright 2021 The Bazel 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 ...
Python
0
@@ -761,16 +761,45 @@ in:/bin%22 +, %22--sandbox_tmpfs_path=/tmp%22 %5D%0A%0ASetti
cfe2962e0a6b62ac097e82b0624edbf3a63fdeff
reorganize code to unblock setup.py
ziggurat_foundations/__init__.py
ziggurat_foundations/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals __version__ = {'major': 0, 'minor': 7, 'patch': 3} from ziggurat_foundations.utils import ModelProxy, noop from ziggurat_foundations.models.services.user import UserService from ziggurat_foundations.models.services.group import GroupService from ziggurat...
Python
0.000001
@@ -56,16 +56,72 @@ literals +%0Afrom ziggurat_foundations.utils import ModelProxy, noop %0A%0A__vers @@ -154,9 +154,9 @@ r': -7 +8 , 'p @@ -166,68 +166,54 @@ h': -3%7D%0A%0Afrom ziggurat_foundations.utils +0%7D%0A%0A%0Adef import - M +_m odel -Proxy, noop%0A +_service_mappings():%0A from @@ -266,32 +266...
3c4b7786c1efd65837bbfcabefc1c6341b05569b
Update send_frame to ignore not connected error
hookbox/protocol.py
hookbox/protocol.py
import logging import uuid import eventlet from errors import ExpectedException import rtjp_eventlet class HookboxConn(object): logger = logging.getLogger('HookboxConn') def __init__(self, server, rtjp_conn, config, remote_addr): self._rtjp_conn = rtjp_conn self.server = server sel...
Python
0
@@ -997,24 +997,97 @@ pass%0A + elif 'not connected' in str(e).lower():%0A pass%0A
b2edcf2caaa41ffcc098ddd2c6837af2352cec74
Remove unused import.
demos/bartlett1932/experiment.py
demos/bartlett1932/experiment.py
"""Bartlett's transmission chain experiment from Remembering (1932).""" import logging import time from selenium.webdriver.common.by import By from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as E...
Python
0
@@ -84,20 +84,8 @@ ging -%0Aimport time %0A%0Afr
6d2678d9b5ac70c8b3b30c7fc053f6daf63cf428
add ability to differentiate between postcommit queues with celery kwarg
framework/postcommit_tasks/handlers.py
framework/postcommit_tasks/handlers.py
# -*- coding: utf-8 -*- import functools import hashlib import logging import threading import binascii from collections import OrderedDict import os from celery.canvas import Signature from celery.local import PromiseProxy from gevent.pool import Pool from website import settings _local = threading.local() logger ...
Python
0
@@ -1983,18 +1983,103 @@ redicate +, celery=True):%0A queue = postcommit_celery_queue() if celery else postcommit_queue( ) -: %0A mat @@ -2112,33 +2112,13 @@ in -postcommit_celery_ queue -() .ite
6a6034d46c2a7e8a62ab8bbd9ca42abf6ecfc12f
Remove commented out maps
docs/xref_map.py
docs/xref_map.py
xref_map = { 'as_vector': ('function', 'menpo.base.Vectorizable.as_vector'), 'Affine': ('class', 'menpo.transform.Affine'), 'Alignment': ('class', 'menpo.transform.Alignment'), 'AlignmentAffine': ('class', 'menpo.transform.AlignmentAffine'), 'AlignmentSimilarity': ('class', 'menpo.transform.AlignmentSimilarity'), 'Bool...
Python
0
@@ -3370,1104 +3370,4 @@ )%0A%7D%0A -#%0A# 'GradientDescent': ('class', 'menpo.fit.gradientdescent.base.GradientDescent'),%0A# 'AAM': ('class', 'menpo.fitmultilevel.aam.builder.AAM'),%0A# 'AAMFitter': ('class', 'menpo.fitmultilevel.aam.base.AAMFitter'),%0A# 'AAMMultilevelFittingResult': ('class', 'menpo.fitmultilevel....
06613d72429c1f68230e21206fc60240546c4c91
Update test_linux-daemon-cmake.py
ci_scripts/test_linux-daemon-cmake.py
ci_scripts/test_linux-daemon-cmake.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import multiprocessing as mp import neblio_ci_libs as nci nci.setup_travis_or_gh_actions_env_vars() working_dir = os.getcwd() build_dir = "wallet" deploy_dir = os.path.join(os.environ['BUILD_DIR'],'deploy', '') packages_to_install = \ [ "ccache", "qt5-default"...
Python
0.000002
@@ -687,16 +687,42 @@ %22,%0A%22gdb%22 +,%0A%22python3%22,%0A%22python3-pip%22 %0A%5D%0A%0Anci. @@ -1764,16 +1764,51 @@ /test')%0A +os.chdir('pwd')%0Aos.chdir('ls -al')%0A nci.call @@ -1827,12 +1827,8 @@ de(' -gdb ./ne
2bc8f9a633a6c433a9a5c9564a2f161adefc381e
Enable username hack by default (it's up to 255 characters now).
kobo/django/auth/__init__.py
kobo/django/auth/__init__.py
Python
0
@@ -0,0 +1,151 @@ +# -*- coding: utf-8 -*-%0A%0A%0A# enable the username hack%0A# make sure that 'kobo.django.auth' precedes 'django.contrib.auth' in INSTALLED_APPS%0Aimport hacks%0A
9a3a9992a8a83ca9bd3472f22d2b4d821d62817e
Generate paragraphs.
publisher/writer.py
publisher/writer.py
__all__ = ['writer'] import docutils.core as dc import docutils.writers from docutils import nodes from docutils.writers.latex2e import (Writer, LaTeXTranslator, PreambleCmds) from options import options PreambleCmds.float_settings = ''' \\usepackage[font={small,it},labelfont=b...
Python
0.999999
@@ -3147,32 +3147,34 @@ act%7D')%0A%0A +el if 'keywords' in @@ -3237,32 +3237,83 @@ EEEkeywords%7D')%0A%0A + else:%0A self.out.append('%5Cn%5Cn')%0A%0A def depart_p
32e00dadc8eb3fd036afd9064b22cacee5291560
add hasColumn
src/pubsubsql/client.py
src/pubsubsql/client.py
#! /usr/bin/env python """ Copyright (C) 2014 CompleteDB LLC. This program is free software: you can redistribute it and/or modify it under the terms of the Apache License Version 2.0 http://www.apache.org/licenses. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; with...
Python
0.000008
@@ -8602,24 +8602,270 @@ geBytes)%0D%0A%0D%0A + def hasColumn(self, column):%0D%0A %22%22%22Determines if the column name exists in the columns collection of the result set.%22%22%22%0D%0A if self.__getColumnIndex(column) %3C 0:%0D%0A return False%0D%0A else:%0D%0A return ...
281997bf43f4e91fe48de97e7c09716b1c63b6aa
Enable the gallery plugin
cmsplugin_cascade/bootstrap3/settings.py
cmsplugin_cascade/bootstrap3/settings.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.utils.translation import ugettext_lazy as _ from cmsplugin_cascade.settings import CMSPLUGIN_CASCADE, orig_config CASCADE_PLUGINS = ('buttons', 'carousel', 'accordion', 'container', 'image', 'picture', 'panel',...
Python
0
@@ -322,13 +322,39 @@ -'tabs + 'tabs', 'gallery ',)%0A
c854e0604a95b3bfa3446934f635ffdc3b64d861
Fix the reset() function of the Python view server.
couchdb/view.py
couchdb/view.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2007 Christopher Lenz # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. import simplejson as json import sys import traceback from types import FunctionTyp...
Python
0.999999
@@ -1130,32 +1130,36 @@ eset():%0A +del functions = %5B%5D%0A @@ -1151,20 +1151,18 @@ unctions - = %5B +: %5D%0A
8f01e3fc09c28a02abf58ae2d86bd44dbc9f1e01
fix for non-integer in pow_to_mul
devito/symbolics/manipulation.py
devito/symbolics/manipulation.py
from collections import Iterable, OrderedDict import sympy from sympy import Number, Indexed, Function, Symbol from devito.symbolics.extended_sympy import Add, Mul, Eq from devito.symbolics.search import retrieve_indexed, retrieve_functions from devito.dimension import Dimension from devito.tools import as_tuple, fla...
Python
0.001544
@@ -6546,16 +6546,38 @@ exp %3C= 0 + or not exp.is_integer :%0A
7cee7edabad08b01ceda0ed8f2798ebf47c87e95
Fix catch-all URLs with prefix
src/pycontw2016/urls.py
src/pycontw2016/urls.py
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from core.views import flat_page from users.views import user_dashboard urlpatterns = [ url(r'^$', TemplateView.as_v...
Python
0.999999
@@ -915,16 +915,44 @@ t last.%0A +if settings.URL_PREFIX:%0A urlpatte @@ -956,24 +956,28 @@ tterns += %5B%0A + url(r'%5E( @@ -975,16 +975,24 @@ url(r'%5E +%7Bprefix%7D (?P%3Cpath @@ -998,16 +998,144 @@ h%3E.+)/$' +.format(prefix=settings.URL_PREFIX),%0A flat_page, name='page'),%0A %5D%...
c35be6d48a462d668c9a57f381682da905725329
Update the version number.
pydfm/__init__.py
pydfm/__init__.py
# PyDuplicateFileManager # The MIT License # # Copyright (c) 2010,2011,2012,2013,2015 Jeremie DECOCK (http://www.jdhp.org) # # 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 restricti...
Python
0
@@ -1626,17 +1626,17 @@ '3.0.dev -1 +2 '%0A%0A__all @@ -1647,10 +1647,58 @@ %5B'core' +, %0A 'database',%0A 'file_hash' %5D%0A
30471ac300005a9c272a68237953161951ea35f4
Add import matplotlib back
analysis/data_process/uk_2017/config.py
analysis/data_process/uk_2017/config.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Config file for the cleaning - plotting and notebook process""" class CleaningConfig: # Unprocessed dataset raw_data = './dataset/raw_results-survey245554.csv' # load the different answers to questions to classify questions based on that question_fil...
Python
0
@@ -1074,16 +1074,54 @@ as np',%0A + 'import matplotlib',%0A
44131b55cac2dadee7cb76b82bad455152a92139
include \. in attachments file slugs
lakaxita/attachments/urls.py
lakaxita/attachments/urls.py
from django.conf.urls.defaults import patterns, url from lakaxita.attachments.views import AttachmentDetail, FileRedirect urlpatterns = patterns('', url('^(?P<slug>(\w|\d|-)+)/$', AttachmentDetail.as_view(), name='detail'), url('^file/(?P<slug>(\w|\d|-)+)/$', FileRedirect.as_view(), name='file'), )
Python
0.000127
@@ -256,32 +256,35 @@ ?P%3Cslug%3E(%5Cw%7C%5Cd%7C- +%7C%5C. )+)/$', FileRedi
f5363167bc9c7ce611e4a72cb518f0100ab28cec
use assertIsInstance
lakaxita/lost_found/tests.py
lakaxita/lost_found/tests.py
from datetime import date from django.utils import unittest from django.test import Client from milkman.dairy import milkman from lakaxita.lost_found.models import Item, Notification from lakaxita.lost_found.forms import NotificationForm class ItemTestCase(unittest.TestCase): def setUp(self): self.jacke...
Python
0.000002
@@ -3175,17 +3175,17 @@ sert -Equal(typ +IsInstanc e(se @@ -3211,17 +3211,16 @@ %5B'form'%5D -) , Notifi
8ce19d44bce3d6325e4883739a16431e45b01792
Add command-line parsing and control of the listening address to crossdomaind.py.
crossdomaind.py
crossdomaind.py
#!/usr/bin/env python # A simple daemon to serve a cross-domain policy. import socket ADDRESS = ("0.0.0.0", 843) POLICY = """\ <cross-domain-policy> <allow-access-from domain="*" to-ports="*"/> </cross-domain-policy> \0""" s = socket.socket() s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind(ADDRESS) ...
Python
0
@@ -20,74 +20,56 @@ on%0A%0A -# A simple daemon to serve a cross-domain policy.%0A%0Aimport socket%0A%0A +import getopt%0Aimport socket%0Aimport sys%0A%0ADEFAULT_ ADDR @@ -74,17 +74,16 @@ DRESS = -( %220.0.0.0 @@ -87,14 +87,27 @@ 0.0%22 -, +%0ADEFAULT_PORT = 843 -) %0A%0APO @@ -219,26 +219,999 @@ %22%22%0A%0A...
63f3b0ab6e735093ff0548610f9b515d42a23e34
Fix examples/hdf5.py to work properly with --test
examples/hdf5.py
examples/hdf5.py
# -*- coding: utf-8 -*- """ In this example we create a subclass of PlotCurveItem for displaying a very large data set from an HDF5 file that does not fit in memory. The basic approach is to override PlotCurveItem.viewRangeChanged such that it reads only the portion of the HDF5 data that is necessary to display the ...
Python
0
@@ -894,13 +894,23 @@ -print +raise Exception (%22No @@ -987,28 +987,8 @@ e.%22) -%0A os._exit(1) %0A%0Apl
e89dcf867a67fe1f9009186594981ed80770b0fa
Remove unused import of UserDict.
src/utils/python.py
src/utils/python.py
### # Copyright (c) 2005-2009, Jeremiah Fincher # Copyright (c) 2009-2010, James Vega # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above c...
Python
0
@@ -1663,24 +1663,8 @@ tch%0A -import UserDict%0A impo