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
79f119e81ab855164edd83408d0fc344801a2f64
fix naming
tests/test_netgen.py
tests/test_netgen.py
import pathlib import tempfile import numpy as np import pytest import meshio from . import helpers test_set = [ helpers.empty_mesh, helpers.line_mesh, helpers.tri_mesh_2d, helpers.tri_mesh, helpers.triangle6_mesh, helpers.quad_mesh, helpers.quad8_mesh, helpers.tri_quad_mesh, hel...
Python
0.000001
@@ -453,25 +453,24 @@ h,%0A%5D%0A%0A%0Anetge -t n_mesh_direc @@ -2009,17 +2009,16 @@ tr(netge -t n_mesh_d
66eddf04efd46fb3dbeae34c4d82f673a88be70f
Test the ability to add phone to the person
tests/test_person.py
tests/test_person.py
from copy import copy from unittest import TestCase from address_book import Person class PersonTestCase(TestCase): def test_get_groups(self): pass def test_add_address(self): basic_address = ['Russian Federation, Kemerovo region, Kemerovo, Kirova street 23, apt. 42'] person = Pers...
Python
0.000032
@@ -643,36 +643,378 @@ (self):%0A -pass +basic_phone = %5B'+79237778492'%5D%0A person = Person(%0A 'John',%0A 'Doe',%0A copy(basic_phone),%0A %5B'+79834772053'%5D,%0A %5B'john@gmail.com'%5D%0A )%0A person.add_phone('+79234478810')%0A ...
5017ee713fd03902aa502836654e1961fb7575f1
test form action url
tests/test_plugin.py
tests/test_plugin.py
from bs4 import BeautifulSoup from cms.api import add_plugin from cms.models import Placeholder from django.test import TestCase from cmsplugin_feedback.cms_plugins import FeedbackPlugin, \ DEFAULT_FORM_FIELDS_ID, DEFAULT_FORM_CLASS from cmsplugin_feedback.forms import FeedbackMessageForm class FeedbackPluginTes...
Python
0.000002
@@ -89,16 +89,61 @@ eholder%0A +from django.core.urlresolvers import reverse%0A from dja @@ -2132,16 +2132,278 @@ ).string, text)%0A +%0A def test_form_action_url(self):%0A plugin = self.add_plugin()%0A html = plugin.render_plugin(%7B%7D)%0A soup = BeautifulSoup(html)%0A self.assertEqu...
5e2b9410a7db019e4ad1056ec0a3d507374e5e4b
Make sure that get_user_config is called in replay.dump
tests/test_replay.py
tests/test_replay.py
# -*- coding: utf-8 -*- """ test_replay ----------- """ import json import os import pytest from cookiecutter import replay, utils from cookiecutter.config import get_user_config @pytest.fixture def replay_dir(): """Fixture to return the expected replay directory.""" return os.path.expanduser('~/.cookiecu...
Python
0.000005
@@ -2615,16 +2615,143 @@ dump')%0A%0A + mock_get_user_config = mocker.patch(%0A 'cookiecutter.config.get_user_config',%0A return_value=replay_dir%0A )%0A%0A repl @@ -2870,16 +2870,60 @@ led == 1 +%0A assert mock_get_user_config.called == 1 %0A%0A re
840691a6cb226472fff4a25d2b255483ab80cb4b
refactor outcomes to helper assertion
tests/test_socket.py
tests/test_socket.py
# -*- coding: utf-8 -*- import pytest from pytest_socket import enable_socket PYFILE_SOCKET_USED_IN_TEST = """ import socket def test_socket(): socket.socket(socket.AF_INET, socket.SOCK_STREAM) """ @pytest.fixture(autouse=True) def reenable_socket(): # The tests can leave the s...
Python
0.000007
@@ -479,16 +479,74 @@ esult):%0A + result.assert_outcomes(passed=0, skipped=0, failed=1)%0A resu @@ -569,24 +569,24 @@ h_lines(%22%22%22%0A - *Soc @@ -1317,44 +1317,8 @@ e%22)%0A - result.assert_outcomes(0, 0, 1)%0A @@ -1515,44 +1515,8 @@ t%22)%0A - result.assert_outcomes(0, 0, 1)%0A ...
02bd3772fcf20d9dc54bd94c125c2efc6ae01537
Make sure structs are pickleable
tests/test_struct.py
tests/test_struct.py
#!/usr/bin/env python """ Contains various tests for the `Struct` class of the base module. :file: StructTests.py :date: 30/08/2015 :authors: - Gilad Naaman <gilad@naaman.io> """ from .utils import * ######################### # "Structs" for testing # ######################### class SmallStruct(Struct): on...
Python
0.000225
@@ -2659,16 +2659,276 @@ pass%0A%0A + def test_pickles(self):%0A import pickle%0A o = pickle.loads(pickle.dumps(SimpleStruct()))%0A self.assertEqual(o, SimpleStruct())%0A%0A o = pickle.loads(pickle.dumps(ComplicatedStruct()))%0A self.assertEqual(o, ComplicatedStruct())%0A%0A %0...
28f6af7f84860535a1a82750df286f78320a6856
Fix monkeypatching
tests/test_things.py
tests/test_things.py
from __future__ import division import stft import numpy import pytest @pytest.fixture(params=[1, 2]) def channels(request): return request.param @pytest.fixture(params=[0, 1, 4]) def padding(request): return request.param @pytest.fixture(params=[2048]) def length(request): return request.param @pyt...
Python
0.000001
@@ -2298,21 +2298,8 @@ ons%0A - try:%0A @@ -2318,16 +2318,25 @@ .signal%0A + try:%0A @@ -2397,30 +2397,25 @@ except -AttributeError +Exception :%0A
551e0f44d9da2d5ac39912b8b5787505deb5588c
remove old tests
tests/test_timing.py
tests/test_timing.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import pandas as pd import librosa from amen.audio import Audio from amen.utils import example_audio_file from amen.utils import example_mono_audio_file from amen.timing import TimeSlice t = 5 d = 10 dummy_audio = None time_slice = TimeSlice(t, d, dummy...
Python
0.000743
@@ -831,38 +831,24 @@ left, right -, zero_indexes = time_slic @@ -927,557 +927,8 @@ ) %0A%0A -def test_get_offsets_no_zero_indexes():%0A zero_index = np.array(%5B0, 1, 2, 5, 6%5D)%0A real_zero_indexes = %5Bzero_index, zero_index%5D%0A%0A left, right, zero_indexes = time_slice._get_offsets(3, 4, faux_audio...
36200dea5889bdf4ad920adc1ab04ae3870f74ac
Edit varnet model (#5096)
tests/test_varnet.py
tests/test_varnet.py
# Copyright (c) MONAI Consortium # 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, so...
Python
0.000004
@@ -1232,11 +1232,10 @@ s = -1 2%0A + TEST @@ -1308,27 +1308,24 @@ es, (1, -10, 300, 20 +3, 50, 5 0, 2), ( @@ -1327,23 +1327,21 @@ 2), (1, -300, 20 +50, 5 0)%5D) # @@ -1419,19 +1419,16 @@ (2, -10, 300, 20 +3, 50, 5 0, 2 @@ -1438,15 +1438,13 @@ (2, -300, 20 +50, 5 0)%5D) @@ -2029,19 +2029,19 @@ , mask...
ddd3947514900d99bc644b8a791a92807bee4f2c
use mock
tests/test_worker.py
tests/test_worker.py
import unittest import functools from tornado import ioloop as ti, gen as tg from acddl import worker class TestWorker(unittest.TestCase): def setUp(self): self._worker = worker.Worker() self._worker.start() self.assertTrue(self._worker.is_alive()) def tearDown(self): async...
Python
0.000016
@@ -4,24 +4,25 @@ ort +f un -ittest +ctools %0Aimport func @@ -17,25 +17,56 @@ %0Aimport -functools +unittest%0Afrom unittest import mock as um %0A%0Afrom t @@ -925,30 +925,31 @@ def -testDoWithSync +_createSyncMock (self):%0A @@ -960,144 +960,105 @@ -x = %5B1%5D%0A def fn():%0A ...
e0a4459f732d605bc1c3d528078c1ea7fd8eb916
Add short wait function and call before each test.
tests/test_yummly.py
tests/test_yummly.py
import os import unittest import json import yummly HERE = os.path.dirname(__file__) class TestYummly( unittest.TestCase ): def setUp( self ): config_file = os.path.join( HERE, 'config.json' ) with open( config_file ) as f: config = json.load(f) self.yummly = yummly ...
Python
0
@@ -4,17 +4,16 @@ port os%0A -%0A import u @@ -31,16 +31,39 @@ ort json +%0Afrom time import sleep %0A%0Aimport @@ -590,16 +590,131 @@ = None%0A%0A + @staticmethod%0A def wait():%0A # wait some time inbetween tests for throttling self%0A sleep(0.5)%0A%0A @sta @@ -929,24 +929,51 @@ onality...
ec72440af0785b449e8a74b3fcadbfa214a4c304
Extend tests for _spec_signature
tests/testhelpers.py
tests/testhelpers.py
# Copyright (C) 2007-2011 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/ from tests.support import unittest2 from mock import Mock, ANY, call, _spec_signature class SomeClass(object): def one(self, a, b): pass def two(self): ...
Python
0.000001
@@ -193,16 +193,27 @@ k import + MagicMock, Mock, A @@ -4281,17 +4281,16 @@ foo')%0A%0A%0A -%0A def @@ -4871,36 +4871,428 @@ (self):%0A -pass +class BuiltinSubclass(list):%0A attr = %7B%7D%0A%0A mock = _spec_signature(BuiltinSubclass)%0A self.assertEqual(list(mock), %5B%5D)%0...
3e84dcb7b449db89ca6ce2b91b34a5e8f8428b39
Allow sub- and superscript tags
core/markdown.py
core/markdown.py
from markdown.extensions import nl2br, sane_lists, fenced_code from pymdownx import magiclink from mdx_unimoji import UnimojiExtension import utils.markdown markdown_extensions = [ magiclink.MagiclinkExtension(), nl2br.Nl2BrExtension(), utils.markdown.ExtendedLinkExtension(), sane_lists.SaneListExtensi...
Python
0.000006
@@ -505,16 +505,30 @@ , 'img', + 'sub', 'sup', %0A # c
e569f3590348eedd79b6e8e2b933d9919796c598
Fix settings
core/settings.py
core/settings.py
""" Django settings for core project. Generated by 'django-admin startproject' using Django 1.8.4. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ from email.util...
Python
0.000001
@@ -359,16 +359,76 @@ ort Path +%0Afrom secrets import choice%0Afrom string import ascii_letters %0A%0Aimport @@ -588,16 +588,476 @@ otenv)%0A%0A +DOCKER_BUILD = env.bool('DOCKER_BUILD', default=False)%0A%0Aif DOCKER_BUILD:%0A # If we are in a Docker build, I want to set a random secret key.%0A # I consider th...
b3c55b059293d664d3e029b9c3d03203ff4af5a5
remove ws
resturo/tests/models.py
resturo/tests/models.py
from ..models import Organization as BaseOrganization from ..models import Membership as BaseMembership class Organization(BaseOrganization): """ """ class Membership(BaseMembership): """ Provide non-abstract implementation for Membership model, define some roles """ ROLE_MEMBER = 1
Python
0.000054
@@ -309,9 +309,8 @@ BER = 1%0A -%0A
56cb14754d2084f5660c8c7e16906e13d99973fd
Fix lstm
thinc/layers/lstm.py
thinc/layers/lstm.py
from typing import Optional, Tuple, Callable from functools import partial from ..model import Model from ..backends import Ops from ..backends.jax_ops import jax_jit from ..config import registry from ..util import get_width from ..types import RNNState, Array2d, Array3d, Padded from .bidirectional import bidirection...
Python
0.001513
@@ -37,16 +37,22 @@ Callable +, cast %0Afrom fu @@ -250,16 +250,15 @@ ort -RNNState +Array1d , Ar @@ -2506,16 +2506,30 @@ %0A W = + cast(Array2d, model.g @@ -2545,16 +2545,17 @@ %22W%22) +) %0A b = mod @@ -2550,16 +2550,30 @@ %0A b = + cast(Array1d, model.g @@ -2589,16 +2589,17 @@ %22b%22) +) ...
32dd33126c9fa0076c8d7c9e8024a709674f8614
Bump Version 0.0.28 -> 0.0.29
threebot/__init__.py
threebot/__init__.py
# -*- encoding: utf-8 -*- __version__ = '0.0.28'
Python
0
@@ -39,11 +39,11 @@ = '0.0.2 -8 +9 '%0A
25ae4d42a2d3c50007d369c3288c0482037d95e0
Fix encoding error in ecr/models.py
moto/ecr/models.py
moto/ecr/models.py
from __future__ import unicode_literals # from datetime import datetime from random import random from moto.core import BaseBackend, BaseModel from moto.ec2 import ec2_backends from copy import copy import hashlib class BaseObject(BaseModel): def camelCase(self, key): words = [] for i, word in e...
Python
0.000068
@@ -3734,16 +3734,32 @@ contents +.encode('utf-8') ).hexdig
de9525f328373e180f8b5793620a0ca217a7434c
fix setting board
trellocardupdate/cli.py
trellocardupdate/cli.py
#!/usr/bin/env python #TODO write bash completion scripts - matching is already there, #the work is just figuring out the syntax again to 'complete' import sys import re from operator import itemgetter import Levenshtein from external_editor import edit as external_edit import trello_update import simpledispatchargp...
Python
0.000001
@@ -4852,26 +4852,8 @@ and( -metavar='BOARD_ID' )%0A @@ -4868,17 +4868,16 @@ t_board( -s ): print @@ -4895,15 +4895,39 @@ oard - to', s +...'; trello_update.set_board() %0A
d0e369fcf43dadf01a2f4d7ba4cd172f2ffebde5
FIX rounding
account_voucher_double_validation/account_voucher.py
account_voucher_double_validation/account_voucher.py
# -*- coding: utf-8 -*- from openerp import models, fields, api, _ import openerp.addons.decimal_precision as dp from openerp.exceptions import Warning class account_voucher(models.Model): _inherit = "account.voucher" company_double_validation = fields.Boolean( related='company_id.double_validation' ...
Python
0.000001
@@ -4818,32 +4818,79 @@ %0A if +voucher.currency_id.round(%0A voucher.amount ! @@ -4888,18 +4888,17 @@ .amount -!= +- voucher @@ -4911,16 +4911,17 @@ y_amount +) :%0A
363583654998e404baba9b72860d2465bb3d339e
Remove convoluted meshgrid statement.
mplstyles/plots.py
mplstyles/plots.py
from matplotlib import cm import matplotlib.pyplot as plt from mplstyles import cmap as colormap import numpy as np import scipy.ndimage def contour_image(x,y,Z,cmap=None,vmax=None,vmin=None,interpolation='nearest',contour_smoothing=0,contour_opts={},label_opts={},imshow_opts={},clegendlabels=[],label=False): ax = pl...
Python
0.000005
@@ -962,78 +962,12 @@ rid( -np.linspace(x%5B0%5D,x%5B-1%5D,Z.shape%5B1%5D), np.linspace(y%5B0%5D,y%5B-1%5D,Z.shape%5B0%5D) +x, y )%0A%09C
35ff1a2b83c4251a818ae280db04c5ae4b8cdb0d
add option to set config file to check style
tools/check-style.py
tools/check-style.py
#!/usr/bin/env python3 # This file is part of the Soletta Project # # Copyright (C) 2015 Intel Corporation. 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 ...
Python
0
@@ -3608,24 +3608,34 @@ , uncrustify +, cfg_file ):%0A diff_ @@ -3866,38 +3866,10 @@ -c -data/schemas/uncrustify.schema +%25s -l @@ -3900,16 +3900,26 @@ rustify, + cfg_file, diff_li @@ -5465,24 +5465,158 @@ %3Crefspec%3E%22)%0A + parser.add_argument(%22-c%22, help=%22Path for the config file%22, dest=...
5846d9689f756d0552fbb887397f853c574c6bf8
add number of windows to output
tools/get_texture.py
tools/get_texture.py
#!/usr/bin/env python2 """Calculate texture properties for a masked area.""" from __future__ import absolute_import, division, print_function import argparse from collections import defaultdict import numpy as np import dwi.files import dwi.mask import dwi.standardize import dwi.texture import dwi.util def parse_...
Python
0.000008
@@ -5731,16 +5731,136 @@ = names +%0A # Number of windows, or resulting texture map volume in general.%0A attrs%5B'tmap_voxels'%5D = np.count_nonzero(pmask) %0A%0A if
2da0c539817ee6e98d67a669a6f1351dbae146c0
fix a spelling bug
myaccount/views.py
myaccount/views.py
from django.shortcuts import render,HttpResponse,HttpResponseRedirect from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.contrib import mes...
Python
0.003114
@@ -4163,17 +4163,17 @@ count:my -p +P rojects'
d1da925995de8a4fae070a8c6947985441fbfaa3
remove localhost db
mysite/settings.py
mysite/settings.py
""" Django settings for mysite 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/ """ import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # Quick-...
Python
0.999813
@@ -3011,16 +3011,20 @@ ent out +sql for Hero @@ -3026,16 +3026,16 @@ Heroku%0A - DATABASE @@ -3586,13 +3586,43 @@ = %5B -'root +%0A 'admin ',%0A @@ -3652,20 +3652,15 @@ - 'fake +'ass ',%0A - @@ -3712,38 +3712,37 @@ - 'ass +'fake ',%0A ...
7177f7e0263d8a5f2adf458f9bfe33bff12137e0
fix syntax error
n_sided_polygon.py
n_sided_polygon.py
import turtle import turtlehack import random # A function that draws an n-sided polygon def n_sided_polygon(turtle, n, color="#FFFFFF", line_thickness=1): ''' Draw an n-sided polygon input: turtle, n, line_length ''' # for n times: # Draw a line, then turn 360/n degrees and draw another # set initial paramete...
Python
0.000003
@@ -749,20 +749,32 @@ e()%0A -%0Aturtlehack. +# Call the polygon code%0A n_si @@ -846,16 +846,33 @@ (4,8))%0A%0A +# Close and exit%0A ignore = @@ -872,16 +872,20 @@ gnore = +raw_ input(%22h @@ -910,16 +910,17 @@ inue:%22)%0A +# graphic.
458d61ffb5161394f8080cea59716b2f9cb492f3
Add error message for not implemented error
nbgrader_config.py
nbgrader_config.py
c = get_config() c.CourseDirectory.db_assignments = [dict(name="1", duedate="2019-12-09 17:00:00 UTC")] c.CourseDirectory.db_students = [ dict(id="foo", first_name="foo", last_name="foo") ] c.ClearSolutions.code_stub = {'python': '##### Implement this part of the code #####\nraise NotImplementedError()'}
Python
0.000001
@@ -227,16 +227,18 @@ ython': +'' '##### I @@ -277,10 +277,9 @@ #### -%5Cn +%0A rais @@ -300,12 +300,62 @@ edError( -) +%22Code not implemented, follow the instructions.%22)'' '%7D%0A
460c6ca46524963f1c17d8773dfced0db14af521
Version number -> 0.5
nbopen/__init__.py
nbopen/__init__.py
"""Open a notebook from the command line in the best available server""" __version__ = '0.4.3' from .nbopen import main
Python
0.000067
@@ -88,11 +88,9 @@ '0. -4.3 +5 '%0A%0Af
1cae5cf5b2874eb2bafc9486d4873abfa1a58366
Add log_to_file method
toolsweb/__init__.py
toolsweb/__init__.py
# -*- coding: utf-8 -*- import flask import jinja2 import os.path import oursql def connect_to_database(database, host): default_file = os.path.expanduser('~/replica.my.cnf') if not os.path.isfile(default_file): raise Exception('Database access not configured for this account!') return oursql...
Python
0.000008
@@ -45,16 +45,31 @@ jinja2%0A +import logging%0A import o @@ -75,16 +75,16 @@ os.path%0A - import o @@ -628,16 +628,46 @@ ath=None +,%0A log_file=None ):%0A a @@ -1037,16 +1037,16 @@ %5D)%0A%0A - retu @@ -1053,8 +1053,159 @@ rn app%0A%0A +def log_to_file(app, log_file):%0A handler ...
cf8cc12b9a3bb4cfb550db1c75b1fa24db3c357d
{{{config.options}}} returns a list in some circumstances.
trac/tests/config.py
trac/tests/config.py
# -*- coding: iso8859-1 -*- # # Copyright (C) 2005 Edgewall Software # Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de> # # Trac 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 # Lic...
Python
0.999999
@@ -2936,24 +2936,29 @@ ion', 'x'), +iter( config.optio @@ -2964,16 +2964,17 @@ ons('a') +) .next()) @@ -3017,16 +3017,21 @@ , 'y'), +iter( config.o @@ -3041,16 +3041,17 @@ ons('b') +) .next())
9ff4fbcdf5b21d263e8b20abb0a3d0395ce28981
Document the reason for accepting only `POST` requests on `/wiki_render`, and allow `GET` requests from `TRAC_ADMIN` for testing purposes.
trac/wiki/web_api.py
trac/wiki/web_api.py
# -*- coding: utf-8 -*- # # Copyright (C) 2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consists o...
Python
0
@@ -878,33 +878,8 @@ der' - and req.method == 'POST' %0A%0A @@ -903,32 +903,317 @@ uest(self, req): +%0A # Allow all POST requests (with a valid __FORM_TOKEN, ensuring that%0A # the client has at least some permission). Additionally, allow GET%0A # requests from TRAC_ADMIN for testing purposes...
bb696f7c5b97563339f04206e649b54759fc9c6b
add transform for in__id to base get method
actions/lib/action.py
actions/lib/action.py
from st2actions.runners.pythonrunner import Action import requests __all__ = [ 'NetboxBaseAction' ] class NetboxBaseAction(Action): """Base Action for all Netbox API based actions """ def __init__(self, config): super(NetboxBaseAction, self).__init__(config) def get(self, endpoint_uri...
Python
0.000001
@@ -778,16 +778,148 @@ %7D%0A%0A + # transform %60in__id%60 if present%0A if kwargs.get('in__id'):%0A kwargs%5B'in__id'%5D = ','.join(kwargs%5B'in__id'%5D)%0A%0A
e1074fbc814b238a8d6d878810a8ac665a169f03
Fix template name in views
nomadblog/views.py
nomadblog/views.py
from django.views.generic import ListView, DetailView from django.shortcuts import get_object_or_404 from django.conf import settings from nomadblog.models import Blog, Category from nomadblog import get_post_model DEFAULT_STATUS = getattr(settings, 'PUBLIC_STATUS', 0) POST_MODEL = get_post_model() class NomadBlog...
Python
0
@@ -981,24 +981,71 @@ POST_MODEL%0A + template_name = 'nomadblog/post_list.html'%0A paginate @@ -1314,16 +1314,65 @@ ST_MODEL +%0A template_name = 'nomadblog/post_detail.html' %0A%0A de
44161337282d14a48bde278b6e1669e8b3c94e4e
Bump version to 0.1.7
notify/__init__.py
notify/__init__.py
__version__ = "0.1.6"
Python
0.000001
@@ -16,7 +16,7 @@ 0.1. -6 +7 %22%0A
72a827b8cca6dc100e7f0d2d92e0c69aa67ec956
change name and docstring
apps/auth/iufOAuth.py
apps/auth/iufOAuth.py
from social.backends.oauth import BaseOAuth2 # see http://psa.matiasaguirre.net/docs/backends/implementation.html class IUFOAuth2(BaseOAuth2): """Github OAuth authentication backend""" name = 'github' AUTHORIZATION_URL = 'https://iufinc.org/login/oauth/authorize' ACCESS_TOKEN_URL = 'https://iufinc.org/...
Python
0.000002
@@ -148,14 +148,11 @@ %22%22%22 -Github +IUF OAu @@ -196,14 +196,11 @@ = ' -github +iuf '%0A
c8f0be88729bd8b18a7e58c092c17b606feed475
Stop returning None from judge prediction function (#179)
atcodertools/constprediction/constants_prediction.py
atcodertools/constprediction/constants_prediction.py
import re from typing import Tuple, Optional from bs4 import BeautifulSoup from atcodertools.client.models.problem_content import ProblemContent, InputFormatDetectionError, SampleDetectionError from atcodertools.common.judgetype import ErrorType, NormalJudge, DecimalJudge, InteractiveJudge, Judge from atcodertools.co...
Python
0.000001
@@ -2998,23 +2998,13 @@ -%3E -Optional%5B Judge -%5D :%0A @@ -4463,35 +4463,92 @@ -return None +# No error value candidate is found%0A return NormalJudge() %0A%0A if
140f96ab4cddebd465ad2fdcca4560c683ca5770
add django-markdown url for tutorials app
oeplatform/urls.py
oeplatform/urls.py
"""oeplatform URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
Python
0
@@ -768,98 +768,298 @@ gs%0A%0A -handler500 = %22base.views.handler500%22%0Ahandler404 = %22base.views.handler404%22%0A%0Aurlpatterns = %5B +# This is used for Markdown forms in the tutorials app%0Afrom markdownx import urls as markdownx%0A%0Ahandler500 = %22base.views.handler500%22%0Ahandler404 = %22base.views.handle...
7c77a7b14432a85447ff74e7aa017ca56c86e662
Make api-tokens view exempt from CSRF checks
oidc_apis/views.py
oidc_apis/views.py
from django.http import JsonResponse from django.views.decorators.http import require_http_methods from oidc_provider.lib.utils.oauth2 import protected_resource_view from .api_tokens import get_api_tokens_by_access_token @require_http_methods(['GET', 'POST']) @protected_resource_view(['openid']) def get_api_tokens_v...
Python
0.000001
@@ -158,16 +158,69 @@ rce_view +%0Afrom django.views.decorators.csrf import csrf_exempt %0A%0Afrom . @@ -270,16 +270,29 @@ token%0A%0A%0A +@csrf_exempt%0A @require
69fe8cce71a9046a99932045b1dbe57edc420cae
add __str__
openhab/openhab.py
openhab/openhab.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Georges Toth (c) 2014 <georges@trypill.org> # # python-openhab is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your ...
Python
0.020582
@@ -3182,16 +3182,129 @@ value%0A%0A + def __str__(self):%0A return u'%3C%7B0%7D - %7B1%7D : %7B2%7D%3E'.format(self.type_, self.name, self.state_).encode('utf-8')%0A%0A %0Aclass D
4c12bd87a9ebe10b7d42d09d25c83abad6103b19
Fix default arguments for info command
scriptorium/__main__.py
scriptorium/__main__.py
#!/usr/bin/env python #Script to build a scriptorium paper in a cross-platform friendly fashion import argparse import argcomplete import shutil import sys import os import os.path import yaml import scriptorium def build_cmd(args): """Creates PDF from paper in the requested location.""" pdf = scriptorium.to...
Python
0.000002
@@ -4069,16 +4069,27 @@ ult='.', + nargs='?', help='D
2645159df7cd98fa3577eb8e729b1ed085ca87bd
Fix BuildHelpers to create all necessary directories
scripts/BuildHelpers.py
scripts/BuildHelpers.py
#coding=UTF-8 ## Collection of helpers for Build scripts ## import sys, argparse, subprocess, platform from xml.etree import ElementTree from os.path import join, isdir, isfile, basename, exists from os import listdir, mkdir from shutil import copy, rmtree from glob import glob # Staging repo base url repo = "http:/...
Python
0.000002
@@ -215,20 +215,23 @@ stdir, m -k +ake dir +s %0Afrom sh @@ -517,12 +517,15 @@ :%0A%09m -k +ake dir +s (res
0417707ab0dca78f0daa8aa3b9003913ba90bbac
Add length and highway attribute to the edges
osmABTS/network.py
osmABTS/network.py
""" Road network formation ====================== The primary purpose of this model is to abstract a road connectivity network from the complicated OSM raw GIS data. The network is going to be stored as a NetworkX graph. The nodes are going to be just the traffic junctions and the dead ends of the road traffic system...
Python
0
@@ -679,16 +679,140 @@ aveller. +%0AAlso there is an attribute %60%60length%60%60 for the length of the actual road and%0Aattribute %60%60highway%60%60 for the type of the road. %0A%0A%22%22%22%0A%0Ai @@ -3796,16 +3796,33 @@ el_time, + length=distance, %0A @@ -3837,16 +3837,33 @@ + highway=highway,...
e5aaa0a050baf1aaa49b0400843047c1bbec76e1
allow empty file names
ownpaste/models.py
ownpaste/models.py
# -*- coding: utf-8 -*- """ ownpaste.models ~~~~~~~~~~~~~~~ Module with SQL-Alchemy models. :copyright: (c) 2012 by Rafael Goncalves Martins :license: BSD, see LICENSE for more details. """ from datetime import datetime from flask import current_app from flask.ext.sqlalchemy import SQLAlchemy fro...
Python
0.000007
@@ -2510,24 +2510,67 @@ he basename%0A + if self.file_name is not None:%0A self @@ -2612,16 +2612,20 @@ /')%5B-1%5D%0A +
981715431ae2710fb0c19f1a7caa749bef1c1593
add comments to build commands
packaging/build.py
packaging/build.py
import string import tarfile import scriptine import stat from scriptine import path, log from scriptine.shell import call from ConfigParser import ConfigParser def load_build_conf(): parser = ConfigParser() parser.readfp(open(path(__file__).dirname() + 'build.ini')) config = {} for key, value in pars...
Python
0
@@ -3255,24 +3255,64 @@ _command():%0A + %22%22%22%0A Clean up build dir.%0A %22%22%22%0A config%5B' @@ -3350,24 +3350,84 @@ _command():%0A + %22%22%22%0A Build GeoBox application and installer.%0A %22%22%22%0A build_ap @@ -3484,24 +3484,82 @@ _command():%0A + %22%22%22%0A Unpack, p...
7e9dd7469f88d676959141534809b0bc10fc9a66
Print newline on de-initialization.
picotui/context.py
picotui/context.py
from .screen import Screen class Context: def __init__(self, cls=True, mouse=True): self.cls = cls self.mouse = mouse def __enter__(self): Screen.init_tty() if self.mouse: Screen.enable_mouse() if self.cls: Screen.cls() return self ...
Python
0
@@ -494,16 +494,164 @@ en.deinit_tty()%0A + # This makes sure that entire screenful is scrolled up, and%0A # any further output happens on a normal terminal line.%0A print()%0A
1a8ab29c9f7a02730cababc077f196f9b21e26d4
Use own repo slug by default for Bitbucket.deploy_key.all() .
bitbucket/deploy_key.py
bitbucket/deploy_key.py
# -*- coding: utf-8 -*- URLS = { # deploy keys 'GET_DEPLOY_KEYS': 'repositories/%(username)s/%(repo_slug)s/deploy-keys', 'SET_DEPLOY_KEY': 'repositories/%(username)s/%(repo_slug)s/deploy-keys', 'GET_DEPLOY_KEY': 'repositories/%(username)s/%(repo_slug)s/deploy-key/%(key_id)s', 'DELETE_DEPLOY_KEY': 'r...
Python
0
@@ -686,32 +686,96 @@ epo%0A %22%22%22%0A + repo_slug = repo_slug or self.bitbucket.repo_slug or ''%0A url = se
30843082f3847c3117db62cfb5015f7b993292d2
Add PIP_UPGRADE=True to localrc of ucsm test job
neutron_ci/ci/tests/test_ml2_ucsm.py
neutron_ci/ci/tests/test_ml2_ucsm.py
# Copyright 2014 Cisco Systems, 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 o...
Python
0.000001
@@ -2245,16 +2245,33 @@ ONE=True +%0APIP_UPGRADE=True %0A%0A%5B%5Bpost
85b1cf05b63da5e627f0f37276f80a43781aee4d
true AsyncConnectionContextManager
aioworkers_redis/base.py
aioworkers_redis/base.py
from typing import Optional, Union import aioredis from aioworkers.core.base import ( AbstractConnector, AbstractNestedEntity, LoggingEntity ) from aioworkers.core.config import ValueExtractor from aioworkers.core.formatter import FormattedEntity class Connector( AbstractNestedEntity, AbstractConnector, ...
Python
0.99889
@@ -4838,16 +4838,30 @@ nector', + '_connection' )%0A%0A d @@ -4993,35 +4993,122 @@ -return self._connector.pool +self._connection = await self._connector.pool%0A self._connection.__enter__()%0A return self._connection %0A%0A @@ -5173,9 +5173,55 @@ -pass +self._connection.__exit__(exc_...
ce53d45f48b8ad64dc97c2924f20d639292ecaed
Fix issues reported by flake8 in vm_manager
akanda/rug/vm_manager.py
akanda/rug/vm_manager.py
import netaddr import time from oslo.config import cfg from akanda.rug.api import configuration from akanda.rug.api import nova from akanda.rug.api import quantum from akanda.rug.api import akanda_client as router_api DOWN = 'down' UP = 'up' CONFIGURED = 'configured' RESTART = 'restart' MAX_RETRIES = 3 BOOT_WAIT = ...
Python
0.000003
@@ -681,22 +681,30 @@ address( +self. router +_id )%0A @@ -1344,32 +1344,37 @@ t_router_detail( +self. router_id)%0A%0A @@ -1771,23 +1771,59 @@ ting -. I -P +D : %25s', - addr +%0A self.router_id )%0A%0A @@ -2247,32 +2247,37 @@ t_router_detail( +self. router_id)%0A%0A ...
6650e5898ca058d1dc8494dbc3d0ba2e2d8c1e4c
Compute the distance between two points on the globe and determine if air travel is possible between them in the time between when localities were recorded
alerts/geomodel/alert.py
alerts/geomodel/alert.py
from datetime import datetime from operator import attrgetter from typing import List, NamedTuple, Optional import netaddr from alerts.geomodel.config import Whitelist from alerts.geomodel.locality import State, Locality _DEFAULT_SUMMARY = 'Authenticated action taken by a user outside of any of '\ 'their known ...
Python
0.998967
@@ -23,16 +23,28 @@ atetime%0A +import math%0A from ope @@ -230,16 +230,94 @@ ality%0A%0A%0A +_AIR_TRAVEL_SPEED = 1000.0 # km/h%0A%0A_EARTH_RADIUS = 6373.0 # km # approximate%0A%0A _DEFAULT @@ -1704,20 +1704,715 @@ -return False +lat1 = math.radians(loc1.latitude)%0A lat2 = math.radians(loc2.latitude)%0A ...
451c821118eff98d7e92b3a3f46b1a76048abbb5
add wiki canned response
androiddev_bot/config.py
androiddev_bot/config.py
import praw # Put your vars here suspect_title_strings = ['?', 'help', 'stuck', 'why', 'my', 'feedback'] subreddit = 'androiddev' # Canned responses cans = { 'questions_thread': "Removed because, per sub rules, this doesn't merit its own post. We have a questions thread every day, please use it for questions lik...
Python
0
@@ -396,16 +396,157 @@ rules.' +,%0A 'wiki': %22Removed because relevant information can be found in the /r/androiddev %5Bwiki%5D(https://www.reddit.com/r/androiddev/wiki/index)%22 %0A%7D%0A%0A# Sp @@ -1717,8 +1717,9 @@ code'%5D)) +%0A
0d561690eb3a59a50b54cdc2ab36130114a5bea1
Fix bugs
ansible-check-builder.py
ansible-check-builder.py
# Author - Sagi Yosef # Creation Date 30.07.2017 # # This script builds sensu check json file by user input. # # --- HOW TO RUN --- # Copy the script to the ansible server and run the script # # python check-json-builder-standalone.py # # *** Notice you have to install python *** import sys import json import os impor...
Python
0.000004
@@ -2775,33 +2775,30 @@ n%5B'checks'%5D%5B -strCheckN +args.n ame%5D%5B'subscr @@ -3255,33 +3255,30 @@ n%5B'checks'%5D%5B -strCheckN +args.n ame%5D%5B'subscr @@ -3412,16 +3412,20 @@ erval'%5D= +int( args.int @@ -3429,16 +3429,17 @@ interval +) %0A %0A # @@ -3501,33 +3501,30 @@ n%5B'checks'%5D%5B -strCheckN ...
831e288d99cb978d18adba26049c91801b8c4473
remove the code to process kwargs because these are done in the parent class' methods already in ini backend
anyconfig/backend/ini.py
anyconfig/backend/ini.py
# # Copyright (C) 2011 - 2017 Satoru SATOH <ssato @ redhat.com> # License: MIT # # pylint: disable=unused-argument r"""INI backend: - Format to support: INI or INI like ones - Requirements: The following standard module which should be available always. - ConfigParser in python 2 standard library: https://docs...
Python
0
@@ -1145,22 +1145,9 @@ tems -, OrderedDict %0A + from @@ -2394,33 +2394,48 @@ ble to make -container +dict or dict-like object %0A :return @@ -2500,250 +2500,8 @@ %22%22%22%0A - if kwargs.get(%22ac_ordered%22, False) or kwargs.get(%22dict_type%22, False):%0A kwargs%5B%22dict_type%22%5D = container =...
4f74b5e1d75b570229098531b172f2eb4877f78d
initialize 'dict_type' keyword argument for configparser.SafeConfigParser correctly
anyconfig/backend/ini.py
anyconfig/backend/ini.py
# # Copyright (C) 2011 - 2015 Satoru SATOH <ssato @ redhat.com> # License: MIT # # pylint: disable=unused-argument """INI or INI like config files backend. .. versionchanged:: 0.3 Introduce 'ac_parse_value' keyword option to switch behaviors, same as original configparser and rich backend parsing each parameter...
Python
0.000023
@@ -2574,16 +2574,24 @@ +kwargs%5B%22 dict_typ @@ -2591,16 +2591,18 @@ ict_type +%22%5D = to_co
e5dcea13a27b90f89469518386a1748f3e141b5b
Improve docs of doQuery.py file.
app/lib/query/doQuery.py
app/lib/query/doQuery.py
# -*- coding: utf-8 -*- """ Receive SQL query in stdin, send to configured database file, then return the query result rows. Usage: ## methods of input: # Pipe text to the script. $ echo "SELECT * FROM Trend LIMIT 10" | python -m lib.query.doQuery # Redirect text from .sql file to the script. $ p...
Python
0
@@ -119,16 +119,200 @@ rows.%0A%0A +Note that db queries don't have to done through python like this,%0Abut can be done in SQL directly. For example:%0A $ sqlite3 path/to/db -csv -header %3C path/to/query %3E path/to/report%0A%0A Usage:%0A @@ -742,16 +742,17 @@ trl+D%3E%0A%0A +%0A ## m @@ -797,18 +797,16 @...
7a6d62f01e7b69c4f5ded3b7a0d8f7798601b0ff
Print matplotlib warning on stderr
nupic/research/monitor_mixin/plot.py
nupic/research/monitor_mixin/plot.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
Python
0.000002
@@ -1054,16 +1054,27 @@ raceback +%0Aimport sys %0A%0Atry:%0A @@ -1236,16 +1236,31 @@ %0A print + %3E%3E sys.stderr, %22Cannot @@ -1313,16 +1313,31 @@ %0A print + %3E%3E sys.stderr, traceba
6d71726ab50a1fc81ff1ee03edbc77de3422bce8
change back _ to unused name
openquake/hazardlib/shakemap/maps.py
openquake/hazardlib/shakemap/maps.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2018-2021 GEM Foundation # # OpenQuake 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 Licen...
Python
0.002502
@@ -1131,17 +1131,26 @@ -_ +assoc_dist =None, m @@ -1367,11 +1367,8 @@ aram - _: ass @@ -1374,17 +1374,17 @@ soc_dist -, +: unused
fe3e09af2accaf6924fc42b9df6ae5c99a005056
Remove moxstubout usage
oslo_i18n/tests/test_gettextutils.py
oslo_i18n/tests/test_gettextutils.py
# Copyright 2012 Red Hat, Inc. # Copyright 2013 IBM Corp. # 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....
Python
0
@@ -3214,29 +3214,47 @@ -self.stubs.Se +mock_patcher = mock.patch.objec t(locale @@ -3282,16 +3282,34 @@ + + 'list' i @@ -3361,16 +3361,34 @@ + + else 'lo @@ -3429,16 +3429,34 @@ + + _mock_lo @@ -3472,16 +3472,88 @@ tifie...
c4907587ef2d14ad746baf79b4c52252026b711a
add the test plans list in the subject
app/utils/report/test.py
app/utils/report/test.py
# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be usefu...
Python
0.000016
@@ -4412,24 +4412,100 @@ database)%0A%0A + if not plans:%0A plans_string = %22All the results are included%22%0A subject_ @@ -4568,33 +4568,24 @@ kernel)%0A -%0A -if not plans +else :%0A @@ -4606,86 +4606,121 @@ = %22 -All the results are included%22%0A else:%0A plans_stri...
db2f6f4c2a70875aade3741fb57d0bc1b109ce3c
Add regexp to create_user form logic
app/views/create_user.py
app/views/create_user.py
from flask import request, flash, render_template import bcrypt from app import app, helpers @app.route('/create_user', methods=['GET', 'POST']) def create_user(): if request.method == 'POST': username = request.form.get('username', None).strip() password = request.form.get('password', None) ...
Python
0
@@ -254,17 +254,36 @@ .strip() + # Aa09_.- allowed %0A - @@ -393,107 +393,30 @@ if -not username or username == '' or not password or password == '':%0A flash('Please enter a +re.match(r'%5E%5B%5Cw.-%5D+$', use @@ -420,16 +420,17 @@ username +) and pas @@ -438,25 +438,8 @@ word -.')%0A%...
e4097fc77139abde6311886c2a7792d675e5f805
Update merge_intervals.py
array/merge_intervals.py
array/merge_intervals.py
""" Given a collection of intervals, merge all overlapping intervals. """ class Interval: """ In mathematics, a (real) interval is a set of real numbers with the property that any number that lies between two numbers in the set is also included in the set. """ def __init__(self, start=0, end=...
Python
0.000002
@@ -1612,38 +1612,17 @@ (res))%0A%0A - @staticmethod%0A +%0A def merg @@ -1630,36 +1630,32 @@ _v2(intervals):%0A - %22%22%22 Merges i @@ -1684,28 +1684,24 @@ f list. %22%22%22%0A - if inter @@ -1714,20 +1714,16 @@ s None:%0A - @@ -1734,20 +1734,16 @@ rn None%0A - in...
ef69106ceb6a494cb809bcda1883bfc31cf12ea5
Move raise_for_status to BaseResponse.
asks/response_objects.py
asks/response_objects.py
import codecs from types import SimpleNamespace import json as _json from async_generator import async_generator, yield_ import h11 from .http_utils import decompress, parse_content_encoding from .utils import timeout_manager from .errors import BadStatus class BaseResponse: ''' A response object supporting...
Python
0
@@ -998,16 +998,684 @@ s = %5B%5D%0A%0A + def raise_for_status(self):%0A '''%0A Raise BadStatus if one occurred.%0A '''%0A if 400 %3C= self.status_code %3C 500:%0A raise BadStatus(%0A '%7B%7D Client Error: %7B%7D for url: %7B%7D'.format(%0A se...
5e11d6766bea9098b89a8c5246518b4a09a163d5
Add some paramters to the generic REST API class: - api_root - timeout - api_version
atlassian/rest_client.py
atlassian/rest_client.py
import json import logging from urllib.parse import urlencode, urljoin import requests log = logging.getLogger("atlassian") class AtlassianRestAPI: def __init__(self, url, username, password): self.url = url self.username = username self.password = password self._session = reque...
Python
0.999987
@@ -157,138 +157,384 @@ def - __init__(self, url, username, password):%0A self.url = url%0A self.username = username%0A self.password = password +ault_headers=%7B'Content-Type': 'application/json', 'Accept': 'application/json'%7D%0A%0A def __init__(self, url, username, password, timeout=60, ap...
484c3caecb3cb5fa2a6d2a4c59071e531378aba3
Output error if Google blocks ip
autoload/stackanswers.py
autoload/stackanswers.py
import re import json import requests import vim import sys API_KEY = "vYizAQxn)7tmkShJZyHqWQ((" def strip_html(html): pattern = re.compile(r'<.*?>') return pattern.sub('', html) def query_google(query, domain): search = "https://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=%s" url = search...
Python
0.999909
@@ -393,36 +393,8 @@ -except:%0A return None%0A @@ -453,16 +453,48 @@ sults%22%5D%0A + except:%0A return None%0A urls @@ -3752,37 +3752,196 @@ t(%5B%22 -Not connected to the Internet +Error fetching data...%22, %22There are a few possibilities:%22, %221) You are not connected to the ...
304d7c75f68e999536f610e4e6eecfbfaa8c069e
make sure that nested calls succeed
awaitchannel/__init__.py
awaitchannel/__init__.py
""" Extends the synchronisation objects of asyncio (e.g. Lock, Event, Condition, Semaphore, Queue) with Channels like in Go. Channels can be used for asynchronous or synchronous message exchange. The select() can be used to react on finished await-calls and thus also on sending or receiving with channels. The helpers g...
Python
0.000001
@@ -4581,24 +4581,61 @@ )%0A try:%0A + while go_tasks:%0A done, others = loop.run_un @@ -4671,16 +4671,64 @@ tasks))%0A + for d in done:%0A go_tasks.remove(d)%0A finall
8bcc09e4d3d0a14abd132e023bb4b4896aaac4f2
make imports Python 3 friendly
barak/absorb/__init__.py
barak/absorb/__init__.py
from absorb import * from equiv_width import * from aod import *
Python
0.000012
@@ -1,13 +1,14 @@ from +. absorb i @@ -20,16 +20,17 @@ *%0Afrom +. equiv_wi @@ -47,16 +47,17 @@ *%0Afrom +. aod impo
4b6bffdb048aa44b42cb80a54fca9a204ede833f
Update version to 0.0.3
boto3facade/metadata.py
boto3facade/metadata.py
# -*- coding: utf-8 -*- """Project metadata Information describing the project. """ # The package name, which is also the "UNIX name" for the project. package = 'boto3facade' project = "boto3facade" project_no_spaces = project.replace(' ', '') version = '0.0.2' description = 'A simple facade for boto3' authors = ['Ge...
Python
0.000001
@@ -254,17 +254,17 @@ = '0.0. -2 +3 '%0Adescri
b9cd8a6656e3f271b4ca273981ca4a2315ced91a
Improve warning
bumpversion/__init__.py
bumpversion/__init__.py
import ConfigParser import argparse import os.path import warnings import re import sre_constants def attempt_version_bump(args): try: regex = re.compile(args.parse) except sre_constants.error: warnings.warn("--patch '{}' is not a valid regex".format(args.parse)) return if args.cu...
Python
0.000007
@@ -721,16 +721,20 @@ ot find +key %7B%7D in %7B%7D @@ -774,16 +774,34 @@ .format( +%0A repr( e.messag @@ -801,16 +801,17 @@ .message +) , repr(p
81df185279a8d46ca2e8ed9fbed4c3204522965e
Extend potential life of social media queue entries
bvspca/social/models.py
bvspca/social/models.py
import logging from datetime import datetime, timedelta from django.db import models from wagtail.core.models import Page logger = logging.getLogger('bvspca.social') class SocialMediaPostable(): def social_media_ready_to_post(self): raise NotImplemented() def social_media_post_text(self): r...
Python
0.000003
@@ -591,17 +591,18 @@ er than -7 +14 days%0A%0A @@ -720,9 +720,10 @@ lta( -7 +14 )).d
e1aafc85403366dba19963abb1c868bd328a4706
fix unicode writes
bzETL/util/env/files.py
bzETL/util/env/files.py
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from datetime import datetime import io impor...
Python
0.005837
@@ -4233,16 +4233,163 @@ ontent:%0A + if isinstance(c, str):%0A from .logs import Log%0A Log.error(%22expecting to write unicode only%22)%0A%0A @@ -4415,16 +4415,32 @@ .write(c +.encode(%22utf-8%22) )%0A%0A%0A
77f4b5b1bc3c30fb454212d3c4d2aa62d8c06ca8
Update exportyaml.py
canmatrix/exportyaml.py
canmatrix/exportyaml.py
#!/usr/bin/env python from __future__ import absolute_import from .canmatrix import * import codecs import yaml from yaml.representer import SafeRepresenter from builtins import * import copy #Copyright (c) 2013, Eduard Broecker #All rights reserved. # #Redistribution and use in source and binary forms, with or witho...
Python
0.000001
@@ -2534,16 +2534,17 @@ ename,%22w +b %22)%0A i
df679af352f156ad4846fbc53a8efc43814b897c
Update ce.transformer.utils
ce/transformer/utils.py
ce/transformer/utils.py
import itertools from ce.expr import Expr from ce.transformer.core import TreeTransformer from ce.transformer.biop import associativity, distribute_for_distributivity, \ BiOpTreeTransformer from ce.analysis import expr_frontier def closure(tree, depth=None): return BiOpTreeTransformer(tree, depth=depth).clos...
Python
0.000001
@@ -2127,49 +2127,8 @@ _':%0A - from matplotlib import pyplot as plt%0A @@ -2154,16 +2154,16 @@ logger%0A + from @@ -2274,25 +2274,19 @@ ontier, -zip_resul +Plo t%0A lo @@ -2687,16 +2687,28 @@ ,%0A %7D%0A + @timeit%0A def @@ -2823,23 +2823,16 @@ front = -timeit( closure_ @@ -2839,...
1a50aaf6be0f866046d88944607802a4e8661c61
Revert "Test jenkins failure"
ceam_tests/test_util.py
ceam_tests/test_util.py
# ~/ceam/tests/test_util.py from unittest import TestCase from datetime import timedelta from unittest.mock import Mock import numpy as np import pandas as pd from ceam.engine import SimulationModule from ceam.util import from_yearly, to_yearly, rate_to_probability, probability_to_rate class TestRateConversions(Te...
Python
0
@@ -1674,58 +1674,8 @@ ))%0A%0A - def test_failure(self):%0A assert False%0A%0A %0A# E
219dccb4deb0abc255d80a35c6106ded9f89a315
Fix typo
checks.d/supervisord.py
checks.d/supervisord.py
from collections import defaultdict import errno import socket import time import xmlrpclib from checks import AgentCheck import supervisor.xmlrpc DEFAULT_HOST = 'localhost' DEFAULT_PORT = '9001' DEFAULT_SOCKET_IP = 'http://127.0.0.1' DD_STATUS = { 'STOPPED': AgentCheck.CRITICAL, 'STARTING': AgentCheck.UNKN...
Python
0.999999
@@ -2585,24 +2585,29 @@ 'Make sure +that supervisor i @@ -2769,20 +2769,20 @@ ke sure -sure +that supervi @@ -2829,29 +2829,16 @@ and -socket is enabled and +that the soc
c00c7e6099269c66b64a15c15318093eadbf3851
Fix excluded_extensions when ignore_hidden is False
checksumdir/__init__.py
checksumdir/__init__.py
""" Function for deterministically creating a single hash for a directory of files, taking into account only file contents and not filenames. Usage: from checksumdir import dirhash dirhash('/path/to/directory', 'md5') """ import os import hashlib import re import pkg_resources __version__ = pkg_resources.require...
Python
0
@@ -1571,17 +1571,55 @@ .extend( -%5B +%0A %5B%0A _filehas @@ -1634,32 +1634,44 @@ h.join(root, f), + hash_func) %0A @@ -1667,34 +1667,48 @@ - +for f in files %0A @@ -1714,61 +1714,138 @@ -hash_func) for f in files if f n...
ee9a6d126237679114da3afd6120861474905402
fix for messaging address
clearblade/Messaging.py
clearblade/Messaging.py
import paho.mqtt.client as mqtt import thread import time import Client import UserClient import math import random import string import auth from urlparse import urlparse class Messaging(): CB_MSG_ADDR = "" response = 0 keep_alive = 30 subscribeDict = dict() def __init__(self, clientType): self.client = "" ...
Python
0.000001
@@ -378,25 +378,8 @@ ADDR -, seperator, port = u @@ -418,23 +418,59 @@ loc. -rpartition(':') +split(':')%0A%09%09self.CB_MSG_ADDR = self.CB_MSG_ADDR%5B0%5D %0A%09%09s
093d905f6800b9e6b4c0beeeccde55a20f9fa3f3
Add Colemak lesson #3
colemaktutor/lessons.py
colemaktutor/lessons.py
# Copyright (c) 2014 Benjamin Althues <benjamin@babab.nl> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AU...
Python
0
@@ -1031,14 +1031,59 @@ '),%0A + 'Lesson 3 - letters ' + green('AO'),%0A %5D%0A - %0A @@ -1220,50 +1220,74 @@ art= -None):%0A if not start or start = +1):%0A n = 0%0A for i in self.titles:%0A n + = 1 -: %0A @@ -1299,43 +1299,71 @@ -self.lesson1()%0A +...
f1dd824978ad8581113a088afe1d1bdf99a00802
Move to dev.
command_line/griddex.py
command_line/griddex.py
from __future__ import absolute_import, division, print_function import libtbx.phil import libtbx.load_env help_message = ''' Cross reference indexing solutions. Examples:: %s expts0.json refl0.json ''' % libtbx.env.dispatcher_name phil_scope = libtbx.phil.parse(""" d_min = None .type = float(value_min=0...
Python
0
@@ -1,12 +1,59 @@ +# LIBTBX_SET_DISPATCHER_NAME dev.dials.griddex%0A from __futur
cab9666d25988d13ac4294d9bc88e46c632ce4d8
change error log
commands/FBClassDump.py
commands/FBClassDump.py
#!/usr/bin/python import os import re import string import lldb import fblldbbase as fb import fblldbobjcruntimehelpers as runtimeHelpers def lldbcommands(): return [ FBPrintClassInstanceMethods(), FBPrintClassMethods() ] class FBPrintClassInstanceMethods(fb.FBCommand): def name(self): return 'pcl...
Python
0.000001
@@ -4753,35 +4753,29 @@ :%0A print -%22-- error ---%22 %0A return @@ -5006,19 +5006,13 @@ int -%22-- error ---%22 %0A
9ebc7c3aee73f4a950d4975034f3c41417d59444
clean up unused imports
common/util/__init__.py
common/util/__init__.py
import itertools import sublime from plistlib import readPlistFromBytes from .parse_diff import parse_diff syntax_file_map = {} def move_cursor(view, line_no, char_no): # Line numbers are one-based, rows are zero-based. line_no -= 1 # Negative line index counts backwards from the last line. if lin...
Python
0.000001
@@ -1,22 +1,4 @@ -import itertools%0A%0A impo @@ -53,44 +53,8 @@ es%0A%0A -from .parse_diff import parse_diff%0A%0A synt
8c3b20f8aa655a7f8fe1ae485e493aa4a5f24abd
Remove __getattr__ method from CompositeField
composite_field/l10n.py
composite_field/l10n.py
from copy import deepcopy from django.conf import settings from django.db.models.fields import Field, CharField, TextField, FloatField from django.utils.functional import lazy from django.utils import six from . import CompositeField LANGUAGES = map(lambda lang: lang[0], getattr(settings, 'LANGUAGES', ())) class...
Python
0
@@ -844,298 +844,8 @@ s)%0A%0A - def __getattr__(self, name):%0A # Proxy all other getattr calls to the first language field. This makes%0A # it possible to access subfield specific details like 'max_length',%0A # 'blank', etc. without duplication.%0A return getattr(self%5Bself.languages...
5caf134eedc4ace933da8c2f21aacc5f5b1224ef
bump version
confetti/__version__.py
confetti/__version__.py
__version__ = "2.2.0"
Python
0
@@ -16,7 +16,7 @@ 2.2. -0 +1 %22%0A
0a188bfdf15660161faac1dc90176be180728af6
fix bugs related to logging
rplugin/python3/chromatica/chromatica.py
rplugin/python3/chromatica/chromatica.py
# ============================================================================ # FILE: chromatica.py # AUTHOR: Yanfei Guo <yanf.guo at gmail.com> # License: MIT license # based on original version by BB Chung <afafaf4 at gmail.com> # ============================================================================ from chr...
Python
0
@@ -2025,32 +2025,34 @@ = False%0A + # self.debug(%22par @@ -2611,24 +2611,26 @@ %0A + # self.debug( @@ -3476,32 +3476,34 @@ event%22%22%22%0A + # self.debug(%22hig @@ -3847,24 +3847,31 @@ +if not self.parse(c @@ -3869,32 +3869,56 @@ f.parse(context) +:%0A ...
b48a29e1f940f6b9c0305dbcc15e98ea37057232
Update moscow.py
russian_metro/parser/providers/moscow.py
russian_metro/parser/providers/moscow.py
# -*- coding: utf-8 -*- import requests from bs4 import BeautifulSoup from russian_metro.parser.base import BaseDataProvider class DataProvider(BaseDataProvider): metro_lines_src = u"http://ru.wikipedia.org/wiki/Модуль:MoscowMetro#ColorByNum" metro_stations_src = u"http://ru.wikipedia.org/w/index.php?title=\...
Python
0
@@ -1981,128 +1981,8 @@ or:%0A - logger.warning(%0A u'MetroLine with number %25d does not exist' %25 line%0A )%0A
3dae8f25cda4827397ab3812ea552ed27d37e757
Remove contraints on dotted names
base_vat_optional_vies/models/res_partner.py
base_vat_optional_vies/models/res_partner.py
# Copyright 2015 Tecnativa - Antonio Espinosa # Copyright 2017 Tecnativa - David Vidal # Copyright 2019 FactorLibre - Rodrigo Bonilla # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models class ResPartner(models.Model): _inherit = 'res.partner' vies_passed ...
Python
0.000001
@@ -1347,41 +1347,8 @@ vat' -, 'commercial_partner.country_id' )%0A
32c2415a9daa4e2320b75e02648e9caaddcac58d
Revert "Raise exception in normalik, since it is buggy."
scikits/learn/machine/em2/likelihoods.py
scikits/learn/machine/em2/likelihoods.py
#! /usr/bin/python # # Copyrighted David Cournapeau # Last Change: Sat Jan 24 07:00 PM 2009 J """This module implements various basic functions related to multivariate gaussian, such as likelihood, confidence interval/ellipsoids, etc...""" import numpy as np from _lk import mquadform, logsumexp as _logsumexp def no...
Python
0.000059
@@ -64,21 +64,21 @@ ge: -Sat +Fri Jan 2 -4 07 +3 01 :00 @@ -360,56 +360,8 @@ e):%0A - raise ValueError(%22Does not work correctly%22)%0A
6ed3f5d97fe8f8967df5624f62e69ce2a58a9413
Add color to pytest tests on CI (#20723)
scripts/ci/images/ci_run_docker_tests.py
scripts/ci/images/ci_run_docker_tests.py
#!/usr/bin/env python3 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
Python
0
@@ -3053,43 +3053,35 @@ = ( -%0A %22-n%22,%0A %22auto%22,%0A +%22-n%22, %22auto%22, %22--color=yes%22 )%0A%0A
b5b31136ff716b423d78d307e107df4b8d8cfedc
Add images field on article model abstract, is many to many
opps/core/models/article.py
opps/core/models/article.py
# -*- coding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ValidationError, ObjectDoesNotExist from opps.core.models.published import Published from opps.core.models.date import Date from opps.core.models.channel import Channel from ...
Python
0.000059
@@ -306,16 +306,57 @@ Channel +%0Afrom opps.core.models.image import Image %0A%0Afrom t @@ -884,24 +884,136 @@ Content%22))%0A%0A + images = models.ManyToManyField(Image, through='ArticleImage',%0A related_name='article_images')%0A%0A%0A tags = T
5cf84d646796bf5d2f96c67b12a21dc557532c4f
move recv_threads checking loop to run()
orchard/cli/socketclient.py
orchard/cli/socketclient.py
# Adapted from https://github.com/benthor/remotty/blob/master/socketclient.py from select import select import sys import tty import fcntl import os import termios import threading import time import errno import logging log = logging.getLogger(__name__) class SocketClient: def __init__(self, socket_in=...
Python
0
@@ -1760,25 +1760,84 @@ -self.alive_check( +while any(t.is_alive() for t in self.recv_threads):%0A time.sleep(1 )%0A%0A @@ -3096,170 +3096,8 @@ e%0A%0A - def alive_check(self):%0A while True:%0A time.sleep(1)%0A%0A if not any(t.is_alive() for t in self.recv_threads):...
6aa92f13673ec49a67b5f9e2970c7751a852c19b
Fix typos in test_handler.py (#1953)
opentelemetry-sdk/tests/logs/test_handler.py
opentelemetry-sdk/tests/logs/test_handler.py
# Copyright The OpenTelemetry Authors # # 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.0006
@@ -1475,33 +1475,32 @@ gger.warning(%22Wa -n rning message%22)%0A @@ -2291,17 +2291,16 @@ ning(%22Wa -n rning me
d6811b34bbb7628307f82fbe7ef5284b1fa20172
Remove orderer's user name, line item count from order database model's text representation
byceps/services/shop/order/dbmodels/order.py
byceps/services/shop/order/dbmodels/order.py
""" byceps.services.shop.order.dbmodels.order ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from datetime import datetime from typing import Optional, TYPE_CHECKING if TYPE_CHECKING: hybrid_property = property else:...
Python
0.000001
@@ -3523,134 +3523,8 @@ ) %5C%0A - .add('placed_by', self.placed_by.screen_name) %5C%0A .add_custom(f'%7Blen(self.line_items):d%7D line items') %5C%0A
a25141dca6ce6f8ead88c43fa7f5726afb2a9dba
Fix currency dialog to match model changes
cbpos/mod/currency/views/dialogs/currency.py
cbpos/mod/currency/views/dialogs/currency.py
from PySide import QtGui from cbpos.mod.currency.models.currency import Currency import cbpos class CurrencyDialog(QtGui.QWidget): def __init__(self): super(CurrencyDialog, self).__init__() self.name = QtGui.QLineEdit() self.symbol = QtGui.QLineEdit() self.value =...
Python
0.000001
@@ -21,16 +21,71 @@ tGui%0D%0A%0D%0A +import cbpos%0D%0A%0D%0Alogger = cbpos.get_logger(__name__)%0D%0A%0D%0A from cbp @@ -106,25 +106,16 @@ y.models -.currency import @@ -124,28 +124,69 @@ rrency%0D%0A -import cbpos +%0D%0Afrom cbpos.mod.currency.views import CurrenciesPage %0D%0A%0D%0Aclas @@ -312,190 +312,12...
3af6de3097c864d0674245c5329e5887380f3b75
fix to cooling network
cea/plots/supply_system/supply_system_map.py
cea/plots/supply_system/supply_system_map.py
""" Show a Pareto curve plot for individuals in a given generation. """ from __future__ import division from __future__ import print_function import pandas as pd import geopandas import json import cea.inputlocator import cea.plots.supply_system from cea.technologies.network_layout.main import network_layout from cea...
Python
0.000001
@@ -4773,36 +4773,43 @@ gs_DC = %5Bx for x +, y in +zip( building_connect @@ -4820,36 +4820,52 @@ y%5B'Name'%5D.values - if%0A +,%0A @@ -4911,110 +4911,40 @@ vity -.loc%5Bbuilding_connectivity%5B'Name'%5D == x%5D%5B%0A 'DC_connectivity'...
0dacb5382e3099d0b9faa65e207c3be407747eeb
Use .array
chainerrl/optimizers/nonbias_weight_decay.py
chainerrl/optimizers/nonbias_weight_decay.py
# This caused an error in py2 because cupy expect non-unicode str # from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() ...
Python
0
@@ -1007,12 +1007,13 @@ ram. -data +array , pa
b1f894c128c62b02ce21c6ccd22376347c356059
Bump version for a release
sh00t/settings.py
sh00t/settings.py
import os BANNER = """ _ ___ ___ _ | | / _ \ / _ \| | ___| |__ | | | | | | | |_ / __| '_ \| | | | | | | __| \__ \ | | | |_| | |_| | |_ |___/_| |_|\___/ \___/ \__| A Testing Environment for Manual Security Testers """ NAME = "sh00t!" DESCRIPTION = "An integration testing framework" VERSIO...
Python
0
@@ -321,11 +321,11 @@ N = -0.1 +1.0 %0A%0A#
83eb166addc3fc54ff97118770ac8cfd7685b10f
Fix service info
shaddock/model.py
shaddock/model.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2014 Thibaut Lapierre <root@epheo.eu>. 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 # # ...
Python
0.000002
@@ -2848,16 +2848,53 @@ , None)%0A + if service_info:%0A @@ -2927,32 +2927,36 @@ fo.get('ports')%0A + @@ -3009,16 +3009,20 @@ + + privileg @@ -3049,32 +3049,36 @@ t('privileged')%0A + @@ -3120,24 +3120,114 @@ twork_mode') +%0A ...
65df9fd5c6820733b7ba0ec78152bfffb01301db
Fix #3323
rest_framework/filters.py
rest_framework/filters.py
""" Provides generic filtering backends that can be used to filter the results returned by list views. """ from __future__ import unicode_literals import operator from functools import reduce from django.core.exceptions import ImproperlyConfigured from django.db import models from django.utils import six from rest_f...
Python
0
@@ -3168,32 +3168,166 @@ fields', None)%0A%0A + search_terms = self.get_search_terms(request)%0A%0A if not search_fields or not search_terms:%0A return queryset%0A%0A orm_look @@ -3456,141 +3456,8 @@ %5D -%0A search_terms = self.get_search_terms(request)%0A%0A if not...
1006ac44b8ef9654976c1b57ccf20387877db1cb
Update results/title/forms100.py
results/title/forms100.py
results/title/forms100.py
from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont import os.path from laboratory.settings import FONTS_FOLDER from directions.models import Issledovaniya from reportlab.platypus import Paragraph, Table, TableStyle, Spacer from reportlab.lib.styles import getSampleStyleSheet from rep...
Python
0
@@ -1311,17 +1311,16 @@ lWidths= - 180 * mm
89714d70273bdeb386cedf810ea53ef540be49a4
switch to failsafe_add to prevent race conditions (#204)
funnel/views/session.py
funnel/views/session.py
# -*- coding: utf-8 -*- from baseframe import _ from flask import request, render_template, jsonify from coaster.views import load_models from .helpers import localize_date from .. import app, lastuser from ..models import db, Profile, Proposal, ProposalRedirect, ProposalSpace, ProposalSpaceRedirect, Session from ..f...
Python
0
@@ -131,16 +131,60 @@ d_models +%0Afrom coaster.sqlalchemy import failsafe_add %0A%0Afrom . @@ -1593,30 +1593,101 @@ -db.session.add(session +session = failsafe_add(db.session, session, proposal_space_id=space.id, url_id=session.url_id )%0A
4ea9a0bc8b7ef47dd98c155b3f35440fe88b564a
Fix output order, add uri attribute
resync/capability_list.py
resync/capability_list.py
"""ResourceSync Capability List object An Capability List is a set of capabilitys with some metadata for each capability. The Capability List object may also contain metadata and links like other lists. """ import collections from resource import Resource from resource_set import ResourceSet from list_base import ...
Python
0.000022
@@ -1462,12 +1462,8 @@ # - now bui @@ -1481,16 +1481,24 @@ uris in +defined order fo @@ -1508,16 +1508,289 @@ terator%0A + for cap in self.order:%0A if (cap in uris):%0A for uri in sorted(uris%5Bcap%5D):%0A self._iter_next_list.append(uri)%0A ...