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
6ab7c268d21ada1c30414551bdbb03190560ae55
Fix typo in runserver.py breaking debug mode.
runserver.py
runserver.py
#!/usr/bin/env python import argparse from wake import app parser = argparse.ArgumentParser() parser.add_argument( '--host', default='127.0.0.1', help='hostname to listen on', ) parser.add_argument( '--port', type=int, default=5000, help='port to listen on', ) parser.add_argument( '--...
Python
0
@@ -474,18 +474,19 @@ debug=a -pp +rgs .debug)%0A
c929ea6b201a5cfed6b53a81ba6dbe8dc6c3241f
rename password keyword to passwd
tests.py
tests.py
from __future__ import (absolute_import, division, print_function, unicode_literals) from datetime import date from tornado.ioloop import IOLoop from tornado.testing import AsyncTestCase, gen_test import tornado.platform.twisted import mysql.connector import MySQLdb tornado.platform.twisted.in...
Python
0.000157
@@ -468,18 +468,16 @@ ', passw -or d='', ho
e69deed27176406c499cb332c76d3c9ffcecd786
Add test for get_dates().
tests.py
tests.py
#!/usr/bin/env python # encoding: utf-8 import datetime import unittest import mock import pandas as pd import pandas_finance from pandas.util.testing import assert_frame_equal from nose.tools import assert_equal class GetStockTestCase(unittest.TestCase): @mock.patch('pandas_finance.web.DataReader') def tes...
Python
0
@@ -208,16 +208,50 @@ t_equal%0A +from freezegun import freeze_time%0A %0A%0Aclass @@ -2872,8 +2872,289 @@ pass%0A +%0A%0Aclass GetDatesTestCase(unittest.TestCase):%0A @freeze_time('2014-04-10 15:05:05')%0A def test_get_dates(self):%0A start, end = pandas_finance.get_dates()%0A assert_equal(d...
64605573382f1c9fb2170d0cdbcd007f5ddae8d6
Fix to pass all test
tests/players/sample/console_player_test.py
tests/players/sample/console_player_test.py
from tests.base_unittest import BaseUnitTest from pypokerengine.players.sample.console_player import PokerPlayer as ConsolePlayer class ConsolePlayerTest(BaseUnitTest): def setUp(self): self.valid_actions = [\ {'action': 'fold', 'amount': 0},\ {'action': 'call', 'amount': 10},\ {'action'...
Python
0.000002
@@ -365,16 +365,685 @@ %7D%5C%0A %5D +%0A self.round_state = %7B%0A 'dealer_btn': 1,%0A 'street': 'preflop',%0A 'seats': %5B%0A %7B'stack': 85, 'state': 'participating', 'name': u'player1', 'uuid': 'ciglbcevkvoqzguqvnyhcb'%7D,%0A %7B'stack': 100, 'state': 'participating', '...
c9cd0ed7b8d9d43c4143074489fcd5e14137b45a
implement list method main loop and quit action
queue.py
queue.py
#!/usr/bin/python3.4 # -*-coding:Utf-8 -* '''module that contain queue class''' from renderingTask import renderingTask class queue: '''class who contain the list of all the rendering task to manage''' def __init__(self,xml=False): '''initialize queue object with empty queue who is filled with values extract f...
Python
0
@@ -112,16 +112,26 @@ ringTask +%0Aimport os %0A%0Aclass @@ -1151,16 +1151,354 @@ ns'''%0A%09%09 +os.system('clear')%0A%09%09log.menuIn('Rendering Queue')%0A%09%09%0A%09%09while True:%0A%09%09%09choice = input(%22action?('q' to quit)%22).strip().lower()%0A%09%09%09%0A%09%09%09try:%0A%09%09%09%09if choice in %5B'q',...
e37ef9a477c081d1dca11e99ab8d831dd4f9102a
fix some bug
radio.py
radio.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import getopt import sys from core import * from player import Player class radio(): def __init__(self, _player): self.player = _player def play(self): pass def forward(self): self.player.forward() def backward(self): sel...
Python
0.000004
@@ -65,16 +65,26 @@ ort sys%0A +import os%0A from cor @@ -514,16 +514,55 @@ ause()%0A%0A + def next_list(self):%0A pass%0A%0A class on @@ -2442,34 +2442,9 @@ fail -, list_id=%25d%22%25self.list_id +%22 )%0A%0A @@ -3605,16 +3605,172 @@ xit(1)%0A%0A + if not os.path.isfile(channel_file) or not os.pat...
33ed99891ba95b1299000b90d03868d5652459b7
The RHS of epsilon rules can now be empty
purplex/grammar.py
purplex/grammar.py
import collections EPSILON = '<empty>' END_OF_INPUT = '<$>' class Production(object): """Represents a grammar production rule.""" def __init__(self, rule, func): items = rule.split(':', 1) self.lhs = items[0].strip() self.rhs = items[1].strip().split() self.func = func d...
Python
0.999251
@@ -281,16 +281,29 @@ .split() + or %5BEPSILON%5D %0A
1bafd352110d186d1371d14714abd8de7e6e590f
Update prompt
pwndbg/__init__.py
pwndbg/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import gdb import pwndbg.arch import pwndbg.arguments import pwndbg.disasm import pwndbg.disasm.arm import pwndbg.disasm.jump import pwndbg.disasm.mips import pwndbg.disasm.ppc import pwndbg.disasm.sparc import pwndbg.disasm.x86 import pwndbg.vmmap import pwndbg.dt import ...
Python
0.000001
@@ -1464,16 +1464,19 @@ t = %22pwn +dbg %3E %22%0Aprom
ea2faeb88d2b6ddc98a9a10c760574dca993673c
change func1 to accept args
py/decorator_ex.py
py/decorator_ex.py
def entryExitFunc(f): def newFunc(): print "inside decorator function" print "entering", f.__name__ f() print "exited", f.__name__ return newFunc class entryExit(object): def __init__(self, f): ''' If there are no decorator arguments, the function to be decorated ...
Python
0.000001
@@ -212,35 +212,8 @@ ):%0A%0A - def __init__(self, f):%0A @@ -336,22 +336,84 @@ - self.f = f +def __init__(self, f):%0A self.f = f%0A print %22entryExit.__init__%22 %0A%0A @@ -417,24 +417,30 @@ %0A '''%0A + Note: The major c @@ -669,18 +669,60 @@ l__(self -): +, *args):%0A ...
e40205bb8a3267396bc8d40a7e83779344866d15
Add support for Pages.
pybossa/hateoas.py
pybossa/hateoas.py
# -*- coding: utf8 -*- # This file is part of PYBOSSA. # # Copyright (C) 2015 Scifabric LTD. # # PYBOSSA 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 op...
Python
0
@@ -4003,32 +4003,296 @@ rel='parent')%5D%0A + elif cls == 'page':%0A link = self.create_link(item.id, title='page')%0A if item.project_id is not None:%0A links = %5Bself.create_link(item.project_id,%0A title='project', rel='parent')...
90e87e8d06393e8049b26299d3295a2ff46da521
switch homepage to dashboard
seqr/urls.py
seqr/urls.py
"""seqr URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ """ from seqr.views.apis.dataset_api import add_dataset_handler from settings import ENABLE_DJANGO_DEBUG_TOOLBAR from django.conf.urls import url, include ...
Python
0.000001
@@ -2118,26 +2118,20 @@ = %7B%0A -'dashboard +r'%5E$ ': %7B%0A
b553029859b55db2963b15694f5f17714ac8c079
Update Futures_demo.py
examples/Futures_demo.py
examples/Futures_demo.py
import matplotlib.pyplot as plt import OnePy as op ####### Strategy Demo class MyStrategy(op.StrategyBase): # 可用参数: # list格式: self.cash, self.position, self.margin, # self.total, self.unre_profit def __init__(self,marketevent): super(MyStrategy,self).__init__(mar...
Python
0.000001
@@ -793,46 +793,8 @@ -20' -,%0A timeframe=1 )%0A%0A%0A @@ -1154,16 +1154,18 @@ h(100000 +00 )
a49c58450316fd87676da9ca8b58acc71b1062b9
Removed import of __future__ print
pydy/viz/server.py
pydy/viz/server.py
#!/usr/bin/env python from __future__ import print_function import os import signal import socket import webbrowser import BaseHTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler __all__ = ['Server'] class StoppableHTTPServer(BaseHTTPServer.HTTPServer): """ Overrides BaseHTTPServer.HTTPServer...
Python
0.998496
@@ -20,47 +20,8 @@ on%0A%0A -from __future__ import print_function%0A%0A impo
0ed07211d62044a42e1b0ff024f8feb20435270d
Use strings for IDs in Committee Popolo
pombola/south_africa/views/api.py
pombola/south_africa/views/api.py
from django.http import JsonResponse from django.views.generic import ListView from pombola.core.models import Organisation # Output Popolo JSON suitable for WriteInPublic for any committees that have an # email address. class CommitteesPopoloJson(ListView): queryset = Organisation.objects.filter( kind__...
Python
0.000001
@@ -580,16 +580,20 @@ 'id': +str( committe @@ -596,16 +596,17 @@ ittee.id +) ,%0A
1cff212270e0ac0f23df5f788e0bf10426b83529
Fix email admin: HTML body is not being displayed (#418)
post_office/sanitizer.py
post_office/sanitizer.py
from django.utils.html import mark_safe, format_html from django.utils.translation import gettext_lazy try: import bleach except ImportError: # if bleach is not installed, render HTML as escaped text to prevent XSS attacks heading = gettext_lazy("Install 'bleach' to render HTML properly.") clean_html =...
Python
0
@@ -4655,17 +4655,16 @@ %5D,%0A %7D -, %0A try
c606e5d1481ae82072cccd4b9edb6b7d73933277
update version in preparation for release
pyface/__init__.py
pyface/__init__.py
#------------------------------------------------------------------------------ # Copyright (c) 2005-2011, 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 des...
Python
0
@@ -792,11 +792,11 @@ '4. -0.1 +1.0 '%0A%0A_
3429e18dd112f4c5058d0e27662379c2860baded
Fix indentation on string_methods.py
exercises/concept/little-sisters-essay/string_methods.py
exercises/concept/little-sisters-essay/string_methods.py
def capitalize_title(title): """ :param title: str title string that needs title casing :return: str title string in title case (first letters capitalized) """ pass def check_sentence_ending(sentence): """ :param sentence: str a sentence to check. :return: bool True if punctuated ...
Python
0.998856
@@ -676,24 +676,25 @@ %22%22%22%0A%0A + :param sente @@ -733,24 +733,25 @@ ords in.%0A + :param new_w @@ -776,16 +776,17 @@ nt word%0A + :para @@ -820,16 +820,17 @@ lace%0A + :return: @@ -887,16 +887,17 @@ d words%0A + %22%22%22%0A%0A
d779c126e922b6b9907100ac4fc75de9d085b98a
Revert "Update runc4.py"
MR-OCP/MROCPdjango/ocpipeline/procs/runc4.py
MR-OCP/MROCPdjango/ocpipeline/procs/runc4.py
#!/usr/bin/env python # Copyright 2014 Open Connectome Project (http://openconnecto.me) # # 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
@@ -805,186 +805,4 @@ GK%0A - # parse inputs%0A #forge list files%0A #call m2g using qsub and list files as commandline args%0A%0Adef main():%0A %0A #runc4(niftis, bs, opts, email)%0A%0Aif __name__ == '__main__':%0A main()%0A
217d1f94f03b5cda709798dda98380362b937bd3
update comment
samples/python/topology/games/fizz_buzz.py
samples/python/topology/games/fizz_buzz.py
from streamsx.topology.topology import Topology import streamsx.topology.context import fizz_buzz_functions def main(): """ Plays Fizz Buzz (https://en.wikipedia.org/wiki/Fizz_buzz) Example: python3 fizz_buzz.py Output: 1 2 Fizz! 4 Buzz! Fiz...
Python
0
@@ -503,17 +503,16 @@ eclare a -n stream
13afade2f33e2e99127526777585357a405983ff
Remove unused comments & add weights check
sklearn_porter/classifier/KNeighborsClassifier/__init__.py
sklearn_porter/classifier/KNeighborsClassifier/__init__.py
from .. import Classifier class KNeighborsClassifier(Classifier): """ See also -------- sklearn.neighbors.KNeighborsClassifier http://scikit-learn.org/0.18/modules/generated/sklearn.neighbors.KNeighborsClassifier.html """ SUPPORTED_METHODS = ['predict'] # @formatter:off TEMPLATE...
Python
0
@@ -1718,25 +1718,24 @@ .metric%0A -%0A # print( @@ -1730,817 +1730,167 @@ -# print('algorithm', self.model.algorithm)%0A # print('classes_', self.model.classes_)%0A # print('metric', self.model.metric)%0A # print('metric_params', self.model.metric_params)%0A # print('n_nei...
16725435efdf7ae05fa6ae04a0ce2d0ffe547b9c
Tidy up a bit
2015/python/2015-20.py
2015/python/2015-20.py
def total_presents(house_number, presents_per_elf, elf_limit=None): """Calculate how many presents house_number should receive Each house is visited by numbered elves which match the divisors of house_number, and each elf delivers a quantity of presents that match the elf’s number times by presents_per...
Python
0
@@ -1870,100 +1870,8 @@ lf)%0A - if house_number %25 10_000 == 0:%0A print(f'%7Bhouse_number:,%7D: %7Bpresents:,%7D')%0A @@ -2432,33 +2432,8 @@ * 2 -%0A closest_house = None %0A%0A @@ -2600,131 +2600,36 @@ -high_presents = total_presents(high_point)%0A low_presents = to...
fca6289f6fe1e0e5605a7ea12a54395fe98d0425
Define rio tasks.
rio/tasks.py
rio/tasks.py
# -*- coding: utf-8 -*- """ rio.tasks ~~~~~~~~~~ Implement of rio tasks based on celery. """ from os import environ from celery import Celery from .conf import configure_app def register_tasks(app): """Register tasks to application. """ pass def create_app(): """Celery application factory functio...
Python
0.000449
@@ -131,22 +131,53 @@ import -Celery +task%0Afrom celery.task.http import URL %0A%0Afrom . @@ -178,18 +178,18 @@ from .co -nf +re import @@ -193,251 +193,218 @@ rt c -onfigure_app%0A%0Adef register_tasks(app):%0A %22%22%22Register tasks to application.%0A %22%22%22%0A pass%0A%0A%0Adef create_app():%0A...
e5ef3e3899a7af05551c6d18b0c52adf5c067236
replace cleandir by shutil.rmtree
pp/samples/mask_pack/test_mask.py
pp/samples/mask_pack/test_mask.py
""" This is a sample on how to define custom components. You can make a repo out of this file, having one custom component per file """ import os import shutil from pathlib import Path import numpy as np import pytest import pp from pp.add_termination import add_gratings_and_loop_back from pp.component import Compone...
Python
0.000491
@@ -133,18 +133,8 @@ %22%22%22%0A -import os%0A impo @@ -191,22 +191,8 @@ s np -%0Aimport pytest %0A%0Aim @@ -2021,337 +2021,8 @@ c%0A%0A%0A -@pytest.fixture%0Adef cleandir():%0A build_folder = CONFIG%5B%22samples_path%22%5D / %22mask_custom%22 / %22build%22%0A if build_folder.exists():%0A shutil.rmtr...
b7927ff8f82bc6f9f025bf6e42ba69346ac242e7
Refactor worker/task loops
2018/python/2018_07.py
2018/python/2018_07.py
"""Advent of Code 2018 Day 7: The Sum of Its Parts""" import aoc_common from collections import deque, defaultdict DAY = 7 TEST_INPUT = """\ Step C must be finished before step A can begin. Step C must be finished before step F can begin. Step A must be finished before step B can begin. Step A must be finished befor...
Python
0
@@ -1981,16 +1981,143 @@ e_bias%0A%0A + def free_workers():%0A for idx, time in enumerate(workers_times):%0A if not time:%0A yield idx%0A%0A whil @@ -2130,32 +2130,32 @@ workers_times):%0A - total_ti @@ -2408,16 +2408,62 @@ = None%0A%0A + for worker_idx in fre...
2b995c68c980f1f38e1e6c6bb69ab88b78353cce
Update version.
pyhmsa/__init__.py
pyhmsa/__init__.py
#!/usr/bin/env python __author__ = "Philippe T. Pinard" __email__ = "philippe.pinard@gmail.com" __version__ = "0.1.5" __copyright__ = "Copyright (c) 2013-2014 Philippe T. Pinard" __license__ = "MIT" # This is required to create a namespace package. # A namespace package allows programs to be located in different dire...
Python
0
@@ -113,9 +113,9 @@ 0.1. -5 +6 %22%0A__
c46f46197589a89e98c8d5960d5c587a7c3dd6b0
delete load data part
train.py
train.py
import keras import cv2 from load import load_args if __name__ == '__main__': args = load_args() print args
Python
0
@@ -45,16 +45,41 @@ ad_args%0A +from load import load_img %0A%0Aif __n @@ -133,8 +133,35 @@ t args%0A%0A +%09img = load_img(args.PATH)%0A
4c025819cb34939c7b97b145155ee89c8f0b2e93
add concept of entity in the askomics abstraction
askomics/libaskomics/integration/AbstractedEntity.py
askomics/libaskomics/integration/AbstractedEntity.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import logging import json from askomics.libaskomics.ParamManager import ParamManager from askomics.libaskomics.utils import pformat_generic_object class AbstractedEntity(object): """ An AbstractedEntity represents the classes of the database. It is defined...
Python
0.998542
@@ -792,16 +792,119 @@ ass ;%5Cn%22 +%0A%0A turtle += (len(self.get_uri()) + 1) * %22 %22 + %22displaySetting:entity %5C%22true%5C%22%5E%5Exsd:boolean ;%5Cn%22 %0A
1a5942364a6c47a221d0e4e8c008ead1685a1e33
Add failing tests for first part of #213
test/completion/imports.py
test/completion/imports.py
# ----------------- # own structure # ----------------- # do separate scopes def scope_basic(): from import_tree import mod1 #? int() mod1.a #? [] import_tree.a #? [] import_tree.mod1 import import_tree #? str() import_tree.a #? [] import_tree.mod1 def scope_pkg():...
Python
0
@@ -965,24 +965,140 @@ th.dirname%0A%0A +#? os.path.join%0Afrom os.path import join%0A%0Afrom os.path import (%0A expanduser%0A)%0A%0A#? os.path.expanduser%0Aexpanduser%0A%0A from itertoo
47e18f41581cc93f8c6d9b3dcb8254323b65fbd5
Add a '--unified-report' option to the code coverage prep script
utils/prepare-code-coverage-artifact.py
utils/prepare-code-coverage-artifact.py
#!/usr/bin/env python from __future__ import print_function '''Prepare a code coverage artifact. - Collate raw profiles into one indexed profile. - Generate html reports for the given binaries. ''' import argparse import glob import os import subprocess import sys def merge_raw_profiles(host_llvm_profdata, profile...
Python
0.000216
@@ -1102,33 +1102,35 @@ eport_dir, binar -y +ies ,%0A @@ -1217,17 +1217,19 @@ at(binar -y +ies ), end=' @@ -1262,70 +1262,170 @@ -binary_report_dir = os.path.join(report_dir, os.path.basename( +objects = %5B%5D%0A for i, binary in enumerate(binaries):%0A if i == 0:%0A object...
2b9d8dba5f421ad854574e9d1b7004578dd78346
Bump version to 4.1.1b2
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Python
0
@@ -624,17 +624,17 @@ , 1, %221b -1 +2 %22)%0A__ver
89a4d4dcf5533e2045d32282c3ad43c42d745a34
fix problem with wrong datatype
train.py
train.py
#!/usr/bin/env python # # (c) 2016 -- onwards Georgios Gousios <gousiosg@gmail.com> # import argparse import pickle import json from keras.models import Sequential from keras.layers import LSTM, Dense, Activation, Embedding, Bidirectional from keras.callbacks import CSVLogger, EarlyStopping, ModelCheckpoint, ReduceL...
Python
0.000344
@@ -637,36 +637,34 @@ m_output', type= -floa +in t, default=256)%0A @@ -702,36 +702,34 @@ g_output', type= -floa +in t, default=512)%0A
94756c1e7e6a164546b4808c8b8fb9db78e1990a
Update cluster_info.py
examples/cluster_info.py
examples/cluster_info.py
#!/usr/local/bin/python2.7 from pythonlsf import lsf print '\n Hosts in cluster: ', lsf.get_host_names() print '\n Clustername: ', lsf.ls_getclustername(), '\n' print '{0:15s} {1:20s} {2:20s} {3:5s} {4:4s}'.format('Hostname', 'Type', 'Model', 'Cores', 'Load') fo...
Python
0.000001
@@ -1,30 +1,26 @@ #! + /usr/ -local/ bin/ +env python -2.7 %0A%0Afr @@ -44,16 +44,58 @@ rt lsf%0A%0A +if lsf.lsb_init(%22test%22) %3E 0:%0A exit(1)%0A%0A print '%5C
e187ab0f5285378a891552b7cecba0bad47395ab
upgrade plenum version to 1.6
plenum/__metadata__.py
plenum/__metadata__.py
""" plenum package metadata """ __title__ = 'indy-plenum' __version_info__ = (1, 5) __version__ = '.'.join(map(str, __version_info__)) __author__ = "Hyperledger" __author_email__ = 'hyperledger-indy@lists.hyperledger.org' __maintainer__ = 'Hyperledger' __maintainer_email__ = 'hyperledger-indy@lists.hyperledger.org' __...
Python
0
@@ -79,9 +79,9 @@ (1, -5 +6 )%0A__
8fb2d6b9194968ae6d56f0874b210101fe06c205
Update matmul binop in lu docs.
scipy/sparse/linalg/dsolve/_add_newdocs.py
scipy/sparse/linalg/dsolve/_add_newdocs.py
from numpy.lib import add_newdoc add_newdoc('scipy.sparse.linalg.dsolve._superlu', 'SuperLU', """ LU factorization of a sparse matrix. Factorization is represented as:: Pr * A * Pc = L * U To construct these `SuperLU` objects, call the `splu` and `spilu` functions. Attributes --...
Python
0
@@ -192,21 +192,21 @@ Pr -* A * +@ A @ Pc = L * U%0A @@ -201,17 +201,17 @@ Pc = L -* +@ U%0A%0A @@ -1781,25 +1781,25 @@ r.T -* +@ (lu.L -* +@ lu.U) -* +@ Pc. @@ -2332,17 +2332,17 @@ : A -* +@ x == rh @@ -2377,17 +2377,17 @@ : A%5ET -* +@ x == rh @@ -2415,9 +2415,9 @@ A%5EH -* +...
b65e329720154799057cfeee023b4b86e0fc85ac
Require correct hash lengths
pylibscrypt/mcf.py
pylibscrypt/mcf.py
#!/usr/bin/env python # Copyright (c) 2014 Jan Varho # # 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 use, copy, modify, me...
Python
0.996339
@@ -2699,16 +2699,20 @@ lt, hash +, 64 %0A%0A%0A# Cry @@ -4247,16 +4247,20 @@ lt, hash +, 32 %0A%0A%0Adef s @@ -4755,16 +4755,22 @@ lt, hash +, hlen = param @@ -4826,17 +4826,12 @@ len= +h len -(hash) )%0A
1a18445482c67b38810e330065e5ff04e772af4a
Fix from_email in IncomingLetter migrations
foundation/letters/migrations/0009_auto_20151216_0656.py
foundation/letters/migrations/0009_auto_20151216_0656.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def split_models(apps, schema_editor): # We can't import the Person model directly as it may be a newer # version than this migration expects. We use the historical version. L = apps.get_model("letter...
Python
0
@@ -567,13 +567,8 @@ emp_ -from_ emai
269b511d113b5b2029fe3cc18872cfa7fc4009fd
Add a feature: mortality rate
problem/covid/lag/lag.py
problem/covid/lag/lag.py
#! /usr/bin/env python # Copyright 2022 John Hanley. MIT licensed. from pathlib import Path from sklearn.ensemble import RandomForestRegressor from sklearn.linear_model import LinearRegression, SGDRegressor from sklearn.svm import LinearSVR from sklearn.tree import DecisionTreeRegressor import matplotlib.pyplot as plt...
Python
0.999998
@@ -141,153 +141,8 @@ sor%0A -from sklearn.linear_model import LinearRegression, SGDRegressor%0Afrom sklearn.svm import LinearSVR%0Afrom sklearn.tree import DecisionTreeRegressor%0A impo @@ -480,16 +480,144 @@ dropna() + # Trim the final row.%0A df%5B'mortality'%5D = df.deaths / df.cases%0A df = df.dropna() ...
11b293afd11b6d568644a559dff9299ec9dc916f
Add comments on current Timer abstraction
plenum/common/timer.py
plenum/common/timer.py
from abc import ABC, abstractmethod from functools import wraps from typing import Callable, NamedTuple import time from sortedcontainers import SortedListWithKey class TimerService(ABC): @abstractmethod def get_current_time(self) -> float: pass @abstractmethod def schedule(self, delay: int...
Python
0
@@ -160,16 +160,63 @@ thKey%0A%0A%0A +# TODO: Consider renaming this into Scheduler?%0A class Ti @@ -319,32 +319,236 @@ @abstractmethod%0A + # TODO: Swapping callback and delay would allow defaulting delay to zero,%0A # effectively simplifying use-case when we want delay execution of some code%0A # just t...
317c19b2d2767276a426a4d058191dbaaf8f4c6f
Extend the duration of the tough_filters_cases page set.
tools/perf/page_sets/tough_filters_cases.py
tools/perf/page_sets/tough_filters_cases.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class ToughFiltersCasesPage(page_module.Page): def ...
Python
0.000035
@@ -376,9 +376,10 @@ ait( -5 +10 )%0A%0A%0A
bdddee22a4e710e580e105cf187ce77c59f09d31
enable auto parallel and non-uniform k-points
silicon-crystal/silicon-crystal.py
silicon-crystal/silicon-crystal.py
### ### GPAW benchmark: Silicon Crystal ### from __future__ import print_function from ase.lattice import bulk from gpaw import GPAW, Mixer, ConvergenceError from gpaw.eigensolvers.rmm_diis import RMM_DIIS from gpaw.mpi import size, rank try: from gpaw import use_mic except ImportError: use_mic = False # no. ...
Python
0.000001
@@ -432,12 +432,19 @@ %0Akpt +s = -1 +(1,1,1) %0Atxt @@ -785,36 +785,20 @@ pts= -(%25d,%25d,%25d)%22 %25 (kpt, kpt, +%22 + str( kpt +s ))%0A @@ -878,19 +878,18 @@ Cs: %22 + -rep +st r(use_mi @@ -1068,21 +1068,12 @@ pts= -( kpt -,kpt,kpt) +s , xc @@ -1161,16 +1161,56 @@ ter=2),%0A + parallel=...
130d966f933983dc366a3023ac78a2ba24bf064c
add flag for data set binarization
train.py
train.py
""" Andrin Jenal, 2017 ETH Zurich """ import tensorflow as tf from dcgan import DCGAN import hdf5_dataset from checkpoint_saver import CheckpointSaver from visualizer import ImageVisualizer flags = tf.app.flags flags.DEFINE_string("dataset", "datasets/celeb_dataset_3k_colored.h5", "sample results dir") flags.DEFINE...
Python
0
@@ -293,32 +293,98 @@ e results dir%22)%0A +flags.DEFINE_boolean(%22binarized%22, False, %22data set binarization%22)%0A flags.DEFINE_str @@ -1415,20 +1415,30 @@ arized=F -alse +LAGS.binarized , valida
9933920ebc49b4e275ff93bd6d918945ee77e9a4
Make keepalive tests under macOS less stressful
cheroot/test/test_wsgi.py
cheroot/test/test_wsgi.py
"""Test wsgi.""" from concurrent.futures.thread import ThreadPoolExecutor import pytest import portend import requests from requests_toolbelt.sessions import BaseUrlSession as Session from jaraco.context import ExceptionTrap from cheroot import wsgi @pytest.fixture def simple_wsgi_server(): """Fucking simple w...
Python
0.000013
@@ -246,16 +246,104 @@ rt wsgi%0A +from cheroot._compat import IS_MACOS, IS_WINDOWS%0A%0A%0AIS_SLOW_ENV = IS_MACOS or IS_WINDOWS%0A %0A%0A@pytes @@ -767,16 +767,40 @@ timeout= +600 if IS_SLOW_ENV else 20)%0A @@ -1454,16 +1454,39 @@ workers= +10 if IS_SLOW_ENV else 50) as p @@ -1544,16 +1544,16 @@ equest)%0...
92c876aaa9258928123469593b36097c9834b937
Remove unneeded list concatenation
tests/scripts/generate_bignum_tests.py
tests/scripts/generate_bignum_tests.py
#!/usr/bin/env python3 """Generate test data for bignum functions. With no arguments, generate all test data. With non-option arguments, generate only the specified files. """ # Copyright The Mbed TLS Contributors # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License")...
Python
0.000003
@@ -3233,41 +3233,18 @@ -for pair in list(%0A +yield from ite @@ -3296,15 +3296,18 @@ - - ) + +yield from cls @@ -3322,32 +3322,8 @@ ases -:%0A yield pair %0A%0A
32528fb029ec97cc0b195b80363556f69315f164
Condense code in Bishop
chess_py/pieces/bishop.py
chess_py/pieces/bishop.py
# -*- coding: utf-8 -*- """ Class stores Bishop on the board | rank | 7 8 ║♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜ | 6 7 ║♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟ | 5 6 ║… … … … … … … … | 4 5 ║… … … … … … … … | 3 4 ║… … … … … … … … | 2 3 ║… … … … … … … … | 1 2 ║♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙ | 0 1 ║♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖ | ----╚═══════════════ | ——---a b c d e f g h | -----0 1 2 3 4 5 6...
Python
0.999999
@@ -1069,521 +1069,180 @@ -if rook.direction_moves(lambda x: x.shift_up_right(), position) is not None:%0A moves.extend(rook.direction_moves(lambda x: x.shift_up_right(), position))%0A%0A if rook.direction_moves(lambda x: x.shift_up_left(), position) is not None:%0A moves.extend(rook....
8dcb7e6c7b1990541c86159cd5df85f2f7a57ddb
Fix tests
tests/source/csv/test_import_assets.py
tests/source/csv/test_import_assets.py
import os import json from tests.base import ApiDBTestCase from zou.app.models.entity import Entity from zou.app.models.entity_type import EntityType class ImportCsvAssetsTestCase(ApiDBTestCase): def setUp(self): super(ImportCsvAssetsTestCase, self).setUp() self.generate_fixture_project_status...
Python
0.000003
@@ -2871,35 +2871,25 @@ -error = json.loads( +result = self.upl @@ -2918,32 +2918,142 @@ th_fixture, 400) +%0A if type(result) != str:%0A result = result.decode(%22utf-8%22)%0A error = json.loads(result )%0A self.a @@ -3483,35 +3483,25 @@ -error = json.loads( +res...
88327c5e0a7ba7af086ad461e20395a33215b96c
Update api.py
chris_backend/core/api.py
chris_backend/core/api.py
from django.conf.urls import url, include from rest_framework.urlpatterns import format_suffix_patterns from feeds import views # API v1 endpoints urlpatterns = format_suffix_patterns([ url(r'^v1/$', views.api_root), url(r'^v1/feeds/$', views.FeedList.as_view(), name='feed-list'), url(r'^v1/feeds/(?P<pk...
Python
0.000001
@@ -703,18 +703,4 @@ %0A%5D%0A%0A -print('lolo')%0A
51fb4cc79ecba178b811a1a0bb403c91317a116e
allow kwargs in ASE atoms converter
pymatgen/io/ase.py
pymatgen/io/ase.py
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals, absolute_import """ This module provides conversion between the Atomic Simulation Environment Atoms object and pymatgen Structure objects. """ __author__ = ...
Python
0
@@ -808,16 +808,26 @@ tructure +, **kwargs ):%0A @@ -962,16 +962,96 @@ tructure +%0A **kwargs: other keyword args to pass into the ASE Atoms constructor %0A%0A @@ -1448,18 +1448,49 @@ rue, - cell=cell +%0A cell=cell, **kwargs )%0A%0A
5b3e77ba874ff36bb5f06e7db56a620c9f2fef62
Make missing personalisation error consistent
app/notifications/process_notifications.py
app/notifications/process_notifications.py
import uuid from datetime import datetime from flask import current_app from notifications_utils.clients import redis from notifications_utils.recipients import ( get_international_phone_info, validate_and_format_phone_number, format_email_address ) from app import redis_store from app.celery import prov...
Python
0.999999
@@ -1248,18 +1248,9 @@ = ' -Template m +M issi
8c827f95c69d187ecca5a38a39b23e839f31d7b7
Fix get_value to get the value with the instance custom getters
prometheus/collectors.py
prometheus/collectors.py
import collections import json from multiprocessing import Lock import quantile from metricdict import MetricDict # Used so only one thread can access the values at the same time mutex = Lock() # Used to return the value ordered (not necessary byt for consistency useful) decoder = json.JSONDecoder(object_pairs_hoo...
Python
0
@@ -1368,32 +1368,124 @@ values%5Blabels%5D%0A%0A + def get(self, labels):%0A %22%22%22Handy alias%22%22%22%0A return self.get_value(labels)%0A%0A def _label_n @@ -2183,19 +2183,83 @@ -result = %5B%5D +items = self.values.items()%0A%0A result = %5B%5D%0A for k, v in items: %0...
8f17ee334a27917187d16b1416af505971909585
Enhance kernel PLS example
examples/kpls_example.py
examples/kpls_example.py
#!/usr/bin/python3 """An example of the use of non-linear kernel PLS regression on the output of a function z(x) = 4.26(exp (−x) − 4 exp (−2x) + 3 exp (−3x)) Reproduces figure 3 from "Overview and Recent Advances in Partial Least Squares" Roman Rosipal and Nicole Krämer SLSFS 2005, LNCS 3940, pp. 34–51, 2006. """ # ...
Python
0
@@ -304,17 +304,95 @@ 51,%0A2006 -. + and figure 3 from %22Nonlinear Partial Least Squares: An Overview%22 Roman%0ARosipal %22%22%22%0A%0A# @@ -2142,8 +2142,999 @@ .show()%0A +fig.clear()%0A%0A# Plot some of the extracted components%0A%0A# These figures plot the underlying function based on 100 (xi, z(xi)) pairs%0...
a775da72446d057af61503fed6bf85896a7a490d
Add missing quote
scripts/fixtures/radar_fixtures/cohorts.py
scripts/fixtures/radar_fixtures/cohorts.py
from radar.models.groups import Group, GROUP_TYPE from radar.pages import PAGE from radar_fixtures.utils import add COHORTS = [ { 'code': 'BONEITIS', 'name': 'Bone-itis', 'short_name': 'Bone-itis', 'pages': [ PAGE.PRIMARY_DIAGNOSIS, PAGE.DIAGNOSES, ...
Python
0.000283
@@ -554,16 +554,17 @@ : 'ADTKD +' ,%0A
c97651e6ac93fcc23c9c263cd1a6200fffb04431
Version bump
pymisp/__init__.py
pymisp/__init__.py
__version__ = '2.4.48.1' from .api import PyMISP, PyMISPError, NewEventError, NewAttributeError, MissingDependency, NoURL, NoKey
Python
0.000001
@@ -19,9 +19,9 @@ .48. -1 +2 '%0A%0Af
aad71ec87196381e66e801f62d7b7566c279f16a
Make sure that this view is named appropriately
project_template/urls/defaults.py
project_template/urls/defaults.py
from django.conf.urls.defaults import patterns, include, url from armstrong.core.arm_wells.views import QuerySetBackedWellView from armstrong.core.arm_sections.views import SimpleSectionView, SectionFeed from armstrong.apps.articles.models import Article from armstrong.apps.articles.views import ArticleFeed from django...
Python
0.00001
@@ -1482,16 +1482,29 @@ x.html%22) +, name=%22home%22 ),%0A%0A
5907932dc3783d341338b9b8bc184fd49187977d
add exchange input
web/cgi-bin/bittrader/bitcoinaverager.py
web/cgi-bin/bittrader/bitcoinaverager.py
#!/usr/bin/python # Copyright (c) 2014 Bitquant Research Laboratories (Asia) Ltd. # 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 righ...
Python
0.000003
@@ -1605,39 +1605,9 @@ tor%0A -compositor = PriceCompositor() %0A + %0Aapp @@ -2509,16 +2509,132 @@ size=3%3E +%3Cbr%3E%0AExchanges: %3Cinput name=exchanges value=%22bitfinexUSD,bitstampUSD,itbitUSD,itbitEUR,krakenEUR,itbitSGD,anxhkHKD%22%3E %0A%3Cp%3E%0AInc @@ -3640,16 +3640,58 @@ rvals'%5D) +%0A exchanges =...
dbeedb49c1c35a6ba6a1e6dfb287493e3786961f
Save the refresh token with all authentication methods
pynubank/nubank.py
pynubank/nubank.py
import json import os import uuid from typing import Tuple import requests from qrcode import QRCode from requests import Response PAYMENT_EVENT_TYPES = ( 'TransferOutEvent', 'TransferInEvent', 'TransferOutReversalEvent', 'BarcodePaymentEvent' ) class NuException(Exception): def __init__(self, ...
Python
0
@@ -3600,32 +3600,87 @@ ponse(response)%0A + self.refresh_token = auth_data%5B'refresh_token'%5D %0A self.he @@ -4342,24 +4342,79 @@ e(response)%0A + self.refresh_token = auth_data%5B'refresh_token'%5D %0A sel
6db9a65c7b734c7c421075cbae11b5b1df35980e
Remove RingBuffer TODO from midi_monitor example
examples/midi_monitor.py
examples/midi_monitor.py
#!/usr/bin/env python3 """JACK client that prints all received MIDI events.""" import jack import binascii client = jack.Client("MIDI-Monitor") port = client.midi_inports.register("input") @client.set_process_callback def process(frames): for offset, data in port.incoming_midi_events(): # TODO: use rin...
Python
0
@@ -294,39 +294,8 @@ ():%0A - # TODO: use ringbuffer%0A
e47b7e5952d4001459aee5ba570a7cc6d4c10d43
Add import of the InvalidDirectoryValueError to the directory package's test file
tests/unit/directory/test_directory.py
tests/unit/directory/test_directory.py
"""Contains the unit tests for the inner directory package""" import unittest import os from classyfd import Directory class TestDirectory(unittest.TestCase): def setUp(self): self.fake_path = os.path.abspath("hello-world-dir") return def test_create_directory_object(self): d = D...
Python
0
@@ -113,16 +113,44 @@ irectory +, InvalidDirectoryValueError %0A%0Aclass @@ -408,16 +408,24 @@ return%0A + %0A %0A %0A%0Aif __n
f1ceb45a0b332db80c2a963195e81f4dc5a822dd
Remove before_build and after_build hook
pypaas/checkout.py
pypaas/checkout.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import copy import datetime import os import os.path import shutil import subprocess from configparser import ConfigParser from . import options class Checkout(object): def __init__(self, branch, commit, name): self.branch, self.commit, self.name = branch, ...
Python
0
@@ -2996,50 +2996,8 @@ f):%0A - self.run_hook_cmd('before_build')%0A @@ -3124,49 +3124,8 @@ ) -%0A self.run_hook_cmd('after_build') %0A%0A
6037630389ec902098b7a0fb8db1d89e35fbff60
make mail notification helper function more generic
src/bda/plone/orders/mailnotify.py
src/bda/plone/orders/mailnotify.py
import smtplib from email.MIMEText import MIMEText from email.Utils import formatdate from email.Header import Header from zope.i18n import translate from zope.i18nmessageid import MessageFactory from souper.soup import get_soup from repoze.catalog.query import Any from Products.CMFCore.utils import getToolByName from ...
Python
0.000001
@@ -1671,32 +1671,43 @@ reate_mail_body( +templates, context, attrs): @@ -1710,47 +1710,8 @@ rs): -%0A templates = get_templates(context) %0A @@ -3403,71 +3403,197 @@ -arguments%5B'item_listing'%5D = create_mail_listing(context, attrs) +item_listing_callback = templates%5B'item_listing_callback'%5D%0A ...
3e996903031bd394bab9a343cb60f725cfe4de29
add error for common mistake
AFQ/api/participant.py
AFQ/api/participant.py
import nibabel as nib import os.path as op from time import time import logging from AFQ.definitions.mapping import SlrMap from AFQ.api.utils import ( check_attribute, AFQclass_doc, export_all_helper, valid_exports_string) from AFQ.tasks.data import get_data_plan from AFQ.tasks.mapping import get_mapping_plan...
Python
0.000097
@@ -2732,16 +2732,205 @@ t_dir%7D%22) +%0A if %22tractography_params%22 in kwargs:%0A raise ValueError((%0A %22unrecognized parameter tractography_params, %22%0A %22did you mean tracking_params ?%22)) %0A%0A
91eddb82671842cfd1dd7aa58dc42d7ffd1d1550
call passed functions in get_function
tensorforce/util/config_util.py
tensorforce/util/config_util.py
# Copyright 2016 reinforce.io. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
0.000003
@@ -1470,18 +1470,32 @@ -return +func = fn%0A + else:%0A @@ -1541,24 +1541,28 @@ '.', 1)%0A + + module = imp @@ -1595,16 +1595,20 @@ e_name)%0A + func
d6532c24675956c6dc093dd330be1b78d691994f
Build Test
rppy/rppy.py
rppy/rppy.py
# rppy - a geophysical library for Python # Copyright (C) 2015 Sean Matthew Contenti # # 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 2 of the License, or # (a...
Python
0.000001
@@ -844,10 +844,41 @@ y as np%0A +import matplotlib.pyplot as plt %0A%0A
7ab671fea7fda45be5994d85378bfb326eddd7fb
Fix invalid use of F() when creating user story
taiga/projects/occ/mixins.py
taiga/projects/occ/mixins.py
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
Python
0.000211
@@ -1381,16 +1381,39 @@ one%22%7D)%0A%0A + if obj.id:%0A @@ -1450,16 +1450,17 @@ n') + 1%0A +%0A
4b7b2727a35cfcb0117b0ba4571da9a0ea81824a
Remove old reimplementation of routes.
greenmine/base/routers.py
greenmine/base/routers.py
# -*- coding: utf-8 -*- from rest_framework import routers # Special router for actions. actions_router = routers.Route(url=r'^{prefix}/{methodname}{trailing_slash}$', mapping={'{httpmethod}': '{methodname}'}, name='{basename}-{methodnamehyphen}', ...
Python
0
@@ -58,517 +58,61 @@ rs%0A%0A -# Special router for actions.%0Aactions_router = routers.Route(url=r'%5E%7Bprefix%7D/%7Bmethodname%7D%7Btrailing_slash%7D$',%0A mapping=%7B'%7Bhttpmethod%7D': '%7Bmethodname%7D'%7D,%0A name='%7Bbasename%7D-%7Bmethodnamehyphen%7D...
0e2c092ce3472bf26db7d3b836eb230cfb002656
fix method naming conflict
examples/sanic_peewee.py
examples/sanic_peewee.py
## You need the following additional packages for this example # aiopg # peewee_async # peewee ## sanic imports from sanic import Sanic from sanic.response import json ## peewee_async related imports import uvloop import peewee from peewee_async import Manager, PostgresqlDatabase # we instantiate a custom loop so ...
Python
0.000042
@@ -1356,35 +1356,35 @@ ost')%0Aasync def -roo +pos t(request):%0A @@ -1548,11 +1548,10 @@ def -roo +ge t(re
53e4a8a00d4b1c0bed0ae93bb48831b04f1fc12d
Exclude msaa on Mac bots Review URL: https://codereview.appspot.com/7055043
slave/skia_slave_scripts/run_gm.py
slave/skia_slave_scripts/run_gm.py
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Run the Skia GM executable. """ from utils import shell_utils from build_step import BuildStep import errno import os import s...
Python
0.000023
@@ -1670,16 +1670,170 @@ gm_args%0A + # msaa16 is flaky on Macs (driver bug?) so we skip the test for now%0A if sys.platform == 'darwin':%0A cmd.extend(%5B'--exclude-config', 'msaa16'%5D)%0A self
ff68546c69b68c4f83eb843f3ecb5789358d2f32
enable category select plugin by default
searx/plugins/search_on_category_select.py
searx/plugins/search_on_category_select.py
''' searx is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. searx is distributed in the hope that it will be useful, but WITHOUT ANY WA...
Python
0
@@ -704,16 +704,24 @@ %0Aname = +gettext( 'Search @@ -739,16 +739,17 @@ select' +) %0Adescrip @@ -813,16 +813,56 @@ selected +. Disable to select multiple categories. ')%0Adefau @@ -873,12 +873,11 @@ n = -Fals +Tru e%0A%0Aj
cf983ed1832699a85cacb2d33d8dcb2735df01cf
fix build for FilteredModelIteratorBuilder
corehq/apps/dump_reload/sql/filters.py
corehq/apps/dump_reload/sql/filters.py
from abc import ABCMeta, abstractmethod import six from django.db.models import Q from dimagi.utils.chunked import chunked class DomainFilter(six.with_metaclass(ABCMeta)): @abstractmethod def get_filters(self, domain_name): """Return a list of filters. Each filter will be applied to a queryset indep...
Python
0
@@ -1938,34 +1938,29 @@ def -build(self, domain +queryset(self , model_ @@ -2032,26 +2032,22 @@ -queryset = +return objects @@ -2094,24 +2094,133 @@ eta.pk.name) +%0A%0A def build(self, domain, model_class, db_alias):%0A queryset = self.queryset(model_class, db_alias) %0A ret @@ -2...
a55822e8a9e6b1433118d139358bf72efd073b13
Remove ambiguous funcs
bqx/abstract.py
bqx/abstract.py
class Comparable: """Abstract class of 'comparable' clauses. Please mind that 'comparable' is not about Python, but is about SQL. Inherit this to clarify that sub-classes can't be 'calculated' without explicit implementation. See implementations in parts.py. """ def __init__(self): pass...
Python
0.999999
@@ -2854,117 +2854,4 @@ me%0A%0A - def alias_name(self):%0A return self.alias_name%0A%0A def real_name(self):%0A return self.real_name%0A
e6a72c4987246e5c56863a7b98cdbe8be729a688
fix syntax errors
slider/templatetags/slider_tags.py
slider/templatetags/slider_tags.py
# -*- coding: utf-8 -*- from django import template from slider.models import SliderImage import random register = template.Library() def get_random_item(l,max=None): res= [] size = len(l) indexs = range(0,size) if max = None: max = size for i in range(0: max): index = random.choi...
Python
0.000009
@@ -231,16 +231,17 @@ if max = += None:%0A @@ -279,17 +279,17 @@ range(0 -: +, max):%0A
3bd59973df4a14c575e24c73e0629524daae6cad
Handle in feed_tools when language isn't specified
podcasts/feed_tools.py
podcasts/feed_tools.py
from bs4 import BeautifulSoup from dateutil import parser import feedparser from urllib.error import HTTPError from urllib.request import urlopen def get_podcast_data(feed_url): try: feed_request = urlopen(feed_url) except HTTPError as e: raise e feed_xml = feed_request.read() feed =...
Python
0.000001
@@ -837,21 +837,31 @@ urn +getattr( feed -. +, ' language %5B:2%5D @@ -856,16 +856,24 @@ language +', '??') %5B:2%5D%0A%0A%0Ad
7ed873c44467ab09b5b168777f89f59f7e7b1ab7
fix blksize
pyscf/mp/dfgmp2.py
pyscf/mp/dfgmp2.py
#!/usr/bin/env python # Copyright 2014-2020 The PySCF Developers. 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 # # U...
Python
0.000925
@@ -3519,16 +3519,98 @@ em_now)%0A + if orbspin is None:%0A fac = 2%0A else:%0A fac = 1%0A @@ -3726,17 +3726,19 @@ **2*2)/( -2 +fac *nocc*nv
73cd64313ae1238c592af464533ee80389df3b0e
save and predict on best Lv model
sfddd/sgd.py
sfddd/sgd.py
import cPickle import gzip import logging import os import time import lasagne import numpy as np import theano import theano.tensor as T from tqdm import tqdm from sfddd import models from .preproc import SIZE_X, SIZE_Y from .util import gpu_free_mem logger = logging.getLogger(__name__) DEFAULT_BATCHSIZE = 32 LEAR...
Python
0
@@ -1439,18 +1439,17 @@ epochs= -10 +2 ,%0A @@ -2789,16 +2789,61 @@ ('gb'))%0A +%0A best_val_loss, best_epoch = None, None%0A%0A for @@ -3612,149 +3612,589 @@ -logger.info(%22epoch%5B%25d%5D -- Ls: %25.3f %7C Lv: %25.3f %7C ACCv: %25.3f %7C Ts: %25.3f%22%0A %25 (epoch, train_...
7bf673eb581e037bb7f06c05b258995ff41002a2
add level.intermediate
src/c3nav/mapdata/models/level.py
src/c3nav/mapdata/models/level.py
from django.db import models from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ from shapely.geometry import JOIN_STYLE from shapely.ops import cascaded_union from c3nav.mapdata.models.base import MapItem class Level(MapItem): """ A map level (-1, 0, 1...
Python
0.000028
@@ -1615,16 +1615,285 @@ tude'%5D%0A%0A + if 'intermediate' not in data:%0A raise ValueError('missing intermediate.')%0A%0A if not isinstance(data%5B'intermediate'%5D, bool):%0A raise ValueError('intermediate has to be boolean.')%0A%0A kwargs%5B'intermediate'%5D = data%5B'int...
d18b37b8329e156b8573edc6c1bc8a6e4eb6f23a
Undo run_tests.py modification in the hopes of making this merge
run_tests.py
run_tests.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
Python
0
@@ -1631,18 +1631,19 @@ .tests.a -pi +uth _unittes @@ -1676,77 +1676,8 @@ .api - import *%0Afrom nova.tests.api.rackspace import *%0Afrom nova.tests.auth _uni
82b4ea673aefd73384eb442c1769211d55c74c14
Update test infrastructure
project/settings/test.py
project/settings/test.py
# Local from .base import * # Heroku ALLOWED_HOSTS = [ 'testserver', ] # Redis RQ_QUEUES['default']['ASYNC'] = False # Email EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
Python
0.000001
@@ -190,8 +190,135 @@ ackend'%0A +%0A# Cloudinary%0ACLOUDINARY_URL = None%0AMEDIA_URL = '/media/'%0ADEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'%0A
e2ef73097ae220be4e52563e4e098aea228f82fa
rename polls hook
polls/wagtail_hooks.py
polls/wagtail_hooks.py
from django.conf.urls import url from polls.admin import QuestionsModelAdmin from polls.admin_views import QuestionResultsAdminView from polls.models import PollsIndexPage from wagtail.wagtailcore import hooks from wagtail.contrib.modeladmin.options import modeladmin_register from django.contrib.auth.models import User...
Python
0.000014
@@ -1010,31 +1010,29 @@ def -show_main_language_only +hide_polls_index_page (par
5fc16267239890acbf6c4d7ab4685c4a2f420360
allow empty domain in tests
corehq/form_processor/utils/general.py
corehq/form_processor/utils/general.py
from django.conf import settings from corehq.toggles import USE_SQL_BACKEND, NAMESPACE_DOMAIN, NEW_EXPORTS, TF_USES_SQLITE_BACKEND from dimagi.utils.logging import notify_exception def should_use_sql_backend(domain_name): from corehq.apps.domain.models import Domain if settings.UNIT_TESTING: return _...
Python
0.000001
@@ -1498,16 +1498,32 @@ elif +domain_name and getattr(
ad73d9f8960eea834d1ff9fa73e3b79aa3445b8d
return errno to travis
run_tests.py
run_tests.py
#!/usr/bin/env python def interact(line, stdin, process): # print line pass import unittest import sys import os import subprocess import argparse import tmuxp.testsuite from tmuxp.util import tmux from tmuxp import t tmux_path = sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) if tmux_path not...
Python
0.999999
@@ -2446,28 +2446,30 @@ re -turn +sult = unittest.Te @@ -2506,16 +2506,129 @@ suites)%0A + if result.wasSuccessful():%0A sys.exit(0)%0A else:%0A sys.exit(1)%0A sess @@ -2783,20 +2783,22 @@ )%0A re -turn +sult = unittes @@ -2838,16 +2838,97 @@ ...
d72f2a59f0df669ea3ccb223869121afd7a7fe7f
update docs
common/src/gosa/common/mqtt_connection_state.py
common/src/gosa/common/mqtt_connection_state.py
# This file is part of the clacks framework. # # http://clacks-project.org # # Copyright: # (C) 2010-2012 GONICUS GmbH, Germany, http://www.gonicus.de # # License: # GPL-2: http://www.gnu.org/licenses/gpl-2.0.html # # See the LICENSE file in the project's top-level directory for details. import zope from lxml import...
Python
0.000001
@@ -775,45 +775,89 @@ elve -d +s in -a 2- +2 stage -d manner. First +s. As soon as they are connected to the%0A MQTT Broker they send -ing + the 'in @@ -869,18 +869,15 @@ tate +. %0A -and w +W hen @@ -972,24 +972,216 @@ eady' state. +%0A Those two states can be send right after each other when ...
a486d9bb6f498391997639b549b51b691490f4fa
Update settings.py
project_name/settings.py
project_name/settings.py
# -*- coding: utf-8 -*- import os from cartoview.settings import * PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) BASE_DIR = os.path.dirname(PROJECT_DIR) # static settings section STATICFILES_DIRS += [os.path.join(PROJECT_DIR, "static"), ] MEDIA_ROOT = os.path.join(BASE_DIR, "uploaded") MEDIA_URL = "/upload...
Python
0.000001
@@ -60,16 +60,49 @@ mport *%0A +PROJECT_NAME = %22%7B%7Bproject_name%7D%7D%22 %0APROJECT
7deae8b534e3a0ce8a05804661ba2270ba549b61
Generate no_custom outputs in tests
run_tests.py
run_tests.py
import os import unittest from JSOV import generator class Run_Tests(unittest.TestCase): INPUT_JSON = "tests/input/sample.json" INPUT_TEMPLATE = "tests/input/template.jsov" OUTPUT_HTML = "tests/output/output.html" OUTPUT_CSS = "tests/output/style.css" GENERATED_DIR = "tests/generated/" GENERATED_HTML = "tests/...
Python
0.998531
@@ -489,16 +489,124 @@ PLATE)%0A%0A +%09def generate_no_custom(self):%0A%09%09self.visualizer.generate_htmlcss(self.GENERATED_HTML, self.GENERATED_CSS)%0A%0A %09def tes
01bb58dfe82c69763d699b4ad5c637eee9bb7d36
remove commit title
solvebio/resource/datasetcommit.py
solvebio/resource/datasetcommit.py
import time from .apiresource import ListableAPIResource from .apiresource import CreateableAPIResource from .apiresource import UpdateableAPIResource from .solveobject import convert_to_solve_object from .task import Task def follow_commits(task, sleep_seconds): """Utility used to wait for commits""" while ...
Python
0.012209
@@ -2007,34 +2007,26 @@ mit -'%7B0%7D' (%7B4%7D) +%7B3%7D is %7B -1 +0 %7D: %7B -2%7D/%7B3 +1%7D/%7B2 %7D re @@ -2079,87 +2079,15 @@ elf. -title,%0A self.status,%0A +status, sel @@ -2159,38 +2159,8 @@ tal, -%0A sel @@ -22...
0a6e2be8c67265e37ff9600522ded4a861d165a2
Fix #54
cleverhans/utils_mnist.py
cleverhans/utils_mnist.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D f...
Python
0.000001
@@ -1797,32 +1797,79 @@ bsample=(2, 2),%0A + dim_ordering=%22th%22,%0A @@ -2035,24 +2035,43 @@ 2),%0A + dim_ordering=%22th%22, border_mode @@ -2180,16 +2180,43 @@ e=(1, 1) +,%0A dim_ordering=%22th%22 ))%0A m
70b61dd599529009f9cf9631c9ae505dd210c23b
Fix flake8 issues with OtsuMultipleThreshold.py
tomviz/python/OtsuMultipleThreshold.py
tomviz/python/OtsuMultipleThreshold.py
def transform_scalars(dataset): """This filter performs semi-automatic multithresholding of a data set. Voxels are automatically classified into a chosen number of classes such that inter-class variance of the voxel values is minimized. The output is a label map with one label per voxel class. """ ...
Python
0
@@ -181,17 +181,17 @@ such +%0A that -%0A int @@ -261,18 +261,18 @@ is a +%0A label -%0A map @@ -1462,16 +1462,29 @@ eFilter%5B +%0A itk_inpu @@ -1529,16 +1529,16 @@ %5D.New()%0A - @@ -1654,17 +1654,16 @@ mphasis) -; %0A @@ -1908,16 +1908,31 @@ ge_type%5D + %5C%0...
47bca8347afd67765756abcb7b7c20c817171697
Remove unused import
runme.py
runme.py
import datetime import os import sys from socket import socket, AF_INET, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR from arguments import parse from cases import cases from httphandler import HTTPRequest from settings import HONEYPORT, HONEYFOLDER # TODO unittests # import signal # exit -- something to do on SIGINT # signa...
Python
0
@@ -217,19 +217,8 @@ port - HONEYPORT, HON
9d3ed4b59ca951fe877986a72aa63092bb536385
fix video cache
apps/widget/video_cache.py
apps/widget/video_cache.py
# Universal Subtitles, universalsubtitles.org # # Copyright (C) 2010 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License...
Python
0.000003
@@ -3839,32 +3839,48 @@ .get(cache_key)%0A + print value%0A if value is @@ -4199,36 +4199,28 @@ return -cache.get(cache_key) +return_value %0A%0Adef ge
3e1f330236fdb0af692099f91ee3435d273a7bad
Fix import error "No module named six.moves" for plugin sanity job
tools/generate-tempest-plugins-list.py
tools/generate-tempest-plugins-list.py
#! /usr/bin/env python # Copyright 2016 Hewlett Packard Enterprise Development Company, L.P. # # 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.000005
@@ -995,36 +995,265 @@ re%0A%0A -from six.moves import urllib +try:%0A # For Python 3.0 and later%0A from urllib.error import HTTPError as HTTPError%0A import urllib.request as urllib%0Aexcept ImportError:%0A # Fall back to Python 2's urllib2%0A import urllib2 as urllib%0A from urllib2 import HTTPErr...
9507516da333a42e0ab0def6741bbd8755a5b19f
Fix submodule imports before running tests.
run_tests.py
run_tests.py
#!/usr/bin/env python # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
Python
0
@@ -782,16 +782,70 @@ color.%0A%0A +from grow import submodules%0Asubmodules.fix_imports()%0A%0A %0Adef mai
e065515362281039f459e5fa79292957f0435aa7
Fix copyright year
opentracing_instrumentation/client_hooks/_singleton.py
opentracing_instrumentation/client_hooks/_singleton.py
# Copyright (c) 2018 Uber Technologies, Inc. # # 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 use, copy, modify, merge, publ...
Python
0.999997
@@ -9,16 +9,21 @@ ght (c) +2015, 2018 Ube
d896082b282d17616573de2bcca4b383420d1e7a
Fix a bad import (get_version)
python/__init__.py
python/__init__.py
# -*- coding: UTF-8 -*- # Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend # Import from itools from itools.pkg import get_version __version__ = get_version()
Python
0.001665
@@ -111,11 +111,12 @@ ols. -pkg +core imp
b78ce84f2a36789fc0fbb6b184b5c8d8ebb23234
Clarify py.test arguments in run_test.py
run_tests.py
run_tests.py
#!/usr/bin/env python import sys import pytest if __name__ == '__main__': sys.exit(pytest.main())
Python
0.000015
@@ -68,16 +68,372 @@ ain__':%0A + # show output results from every test function%0A args = %5B'-v'%5D%0A # show the message output for skipped and expected failure tests%0A args.append('-rxs')%0A # compute coverage stats for bluesky%0A args.extend(%5B'--cov', 'bluesky'%5D)%0A # call pytest and exi...
b42112d6286b22db65cf71885d92f77a6fa91e06
update scribbler and table configs
twirl.py
twirl.py
#!/usr/bin/env python # Tai Sakuma <sakuma@cern.ch> import os, sys import argparse import ROOT import AlphaTwirl import Framework import Scribbler ROOT.gROOT.SetBatch(1) ##__________________________________________________________________|| parser = argparse.ArgumentParser() parser.add_argument("-i", "--input", hel...
Python
0
@@ -1121,32 +1121,87 @@ llCollector()),%0A + (Scribbler.HFPreRecHit(), NullCollector()),%0A # (Scrib @@ -1784,24 +1784,539 @@ 10, 0), )),%0A + dict(%0A branchNames = ('hfrechit_QIE10_energy', ),%0A binnings = (Round(0.1, 0), ),%0A indices = ('(*)', ),%0A ...
bc9112cc5532a08f8b577935cb7dd7b912743ac3
remove superfluous import
test/test_extract_value.py
test/test_extract_value.py
# Copyright Hugh Perkins 2016 """ 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, software ...
Python
0.998454
@@ -685,30 +685,8 @@ cl%0A -import pyopencl.tools%0A impo
6b89fab7d7ac30a04bcac063a247b1e2a03b4ac7
Use get_rpc_transport instead of get_transport
barbican/queue/__init__.py
barbican/queue/__init__.py
# Copyright (c) 2013-2014 Rackspace, 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 ...
Python
0.00005
@@ -1335,16 +1335,20 @@ ing.get_ +rpc_ transpor
d134e9c461af2c9b67673aa97fc15a302dcbc58c
Add comments
beetsplug/smartplaylist.py
beetsplug/smartplaylist.py
from __future__ import print_function from beets.plugins import BeetsPlugin from beets import config, ui from beets.util import normpath, syspath import os database_changed = False library = None def update_playlists(lib): print("Updating smart playlists...") playlists = config['smartplaylist']['playlists']...
Python
0
@@ -1,12 +1,732 @@ +# This file is part of beets.%0A# Copyright 2013, Dang Mai %3Ccontact@dangmai.net%3E.%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining%0A# a copy of this software and associated documentation files (the%0A# %22Software%22), to deal in the Software without restriction, in...
178834a747be8b9a60fb36dc95513305cf10851d
Fix cache busting (#285)
runserver.py
runserver.py
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys import shutil import logging import time import re import requests # Currently supported pgoapi pgoapi_version = "1.1.6" # Moved here so logger is configured at load time logging.basicConfig(format='%(asctime)s [%(threadName)16s][%(module)14s][%(levelnam...
Python
0
@@ -1455,19 +1455,26 @@ om flask -.ex +_cache_bus t import @@ -1474,16 +1474,21 @@ import +init_ cache_bu @@ -1489,16 +1489,19 @@ che_bust +ing %0A%0Afrom p @@ -5918,19 +5918,8 @@ -cache_bust. init
d043eef098be68690b9d6cd5790b667cdb2d825b
Add comments about security issue
runserver.py
runserver.py
from wKRApp import app app.secret_key = "my precious" # 2 security flaws, need to sort out app.run(debug=True)
Python
0
@@ -20,38 +20,8 @@ app%0A -app.secret_key = %22my precious%22 # 2 @@ -53,16 +53,164 @@ sort out +%0A # %09%091. the key should be randomy generated%0A # %09%092. the key should be set in a config file that is then imported in.%0Aapp.secret_key = %22my precious%22 %0Aapp.run
f56d1c7502e5499c37dce690a5d13f3e099baa77
Save neighbourhoods figure manually
bin/plot_neighbourhoods.py
bin/plot_neighbourhoods.py
"""plot_neighbourhoods.py Plot the neighbourhoods of all classes for the city specified as an input with the following color codes * Black: where the class is over-represented (with 99% CI) * Light grey: where the class is 'normally' represented * White: where the class is under-represented """ import sys import math ...
Python
0
@@ -3360,16 +3360,17 @@ ze=25)%0A%0A +# plt.save @@ -3455,17 +3455,17 @@ %22, %22%22),%0A - +#
db4b77ee5be099cf0ac751956d010777e1ff6640
Add DefinitionNotFoundError
UM/Settings/SettingsError.py
UM/Settings/SettingsError.py
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. class SettingsError(Exception): pass class InvalidFileError(SettingsError): def __init__(self, path): super().__init__("File {0} is an invalid settings file".format(path)) class InvalidVersionError(Sett...
Python
0.000078
@@ -409,24 +409,186 @@ file %7B0%7D%22.format(path))%0A +%0Aclass DefinitionNotFoundError(SettingsError):%0A def __init__(self, type_id):%0A super().__init__(%22Could not find machine definition %7B0%7D%22.format(type_id))%0A