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
7d114d01a7721f93e8b8adbe9a61ac379dd0f393
Move variables outside for loop
mail_template_multi_report/models/email_template.py
mail_template_multi_report/models/email_template.py
# -*- coding: utf-8 -*- # © 2016 Savoir-faire Linux # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import base64 from openerp import api, fields, models from openerp.tools.safe_eval import safe_eval class EmailTemplate(models.Model): _inherit = 'email.template' report_line_ids = fields.On...
Python
0.000001
@@ -645,16 +645,44 @@ late_id) +%0A report_ext = '.pdf' %0A%0A @@ -1479,47 +1479,8 @@ ce)%0A - report_format = 'pdf'%0A%0A @@ -1525,16 +1525,16 @@ result)%0A + %0A @@ -1628,51 +1628,8 @@ ce%0A%0A - ext = %22.%22 + report_format%0A%0A @@ -1668,16 +1668,...
395252dc876ebc843d0e3a6c0726fba06eacebb6
save method overriden, will now update resolve time if the resolved_state changes
IssueTracker/models.py
IssueTracker/models.py
from django.db import models from LabtrackerCore.models import Item,InventoryType,Group from django.contrib.auth.models import User from django.test import TestCase class ResolveState(models.Model): """ Issues are resolved into a resolve state such as this """ rs_id = models.AutoField(primary_key=True...
Python
0
@@ -1,20 +1,50 @@ +from datetime import datetime%0A from django.db impor @@ -2063,16 +2063,352 @@ ield()%0A%0A + def save(self, *args, **kwargs):%0A # check to see if the resolved_state has changed, if so, then change %0A # resolve_time%0A old = Issue.objects.get(pk=self.pk)%0A%0A if ol...
e87ee0f670731a203d34e53d5befa30b374d06b9
Remove whitespace
spock/plugins/helpers/start.py
spock/plugins/helpers/start.py
""" This plugin creates a convenient start() method and attaches it directly to the client. More complex bots will likely want to create their own initialization plugin, so StartPlugin stays out of the way unless you call the start() method. However, the start() method is very convenient for demos and tutorials, and il...
Python
0.999999
@@ -615,17 +615,16 @@ start',%0A -%0A %7D%0A
528edba420089249bd58c0621e06225db84e223f
Add missing translation on logging contrib app
opps/contrib/logging/models.py
opps/contrib/logging/models.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.db import models from django.conf import settings from django.utils.translation import ugettext_lazy as _ from opps.core.models import NotUserPublishable class Logging(NotUserPublishable): user = models.ForeignKey( settings.AUTH_USER_MODEL, ...
Python
0.000001
@@ -334,24 +334,56 @@ blank=True,%0A + verbose_name=_(u'User')%0A )%0A ap @@ -868,8 +868,107 @@ kwargs)%0A +%0A class Meta:%0A verbose_name = _(u'Logging')%0A verbose_name_plural = _(u'Loggings')%0A
229fbef2849965bd75005e418a491971feb803ca
support default loc scale for logpdf too
numpyro/distributions/distribution.py
numpyro/distributions/distribution.py
import scipy.stats as sp from jax import lax from jax.numpy.lax_numpy import _promote_args import jax.numpy as np from numpy.random import mtrand class jax_continuous(sp.rv_continuous): def rvs(self, *args, **kwargs): rng = kwargs.pop('random_state') if rng is None: rng = self.random_s...
Python
0
@@ -1193,32 +1193,56 @@ ale', args.pop() + if len(args) %3E 0 else 1 )%0A loc = @@ -1269,16 +1269,40 @@ gs.pop() + if len(args) %3E 0 else 0 )%0A
411decbdb193b28bb3060e02e81bfa29483e85a9
Remove debug code from staticgen views.
staticgen_demo/blog/staticgen_views.py
staticgen_demo/blog/staticgen_views.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from staticgen.staticgen_pool import staticgen_pool from staticgen.staticgen_views import StaticgenView from .models import Post class BlogPostListView(StaticgenView): is_paginated = True i18n = True def items(self): return ('blog...
Python
0
@@ -334,617 +334,8 @@ )%0A%0A - def _get_paginator(self, url):%0A response = self.client.get(url)%0A print 'status_code: %25s' %25 response.status_code%0A if not response.status_code == 200:%0A pass%0A else:%0A context = %7B%7D%0A if hasattr(response, 'c...
b1c51bbc47f55b217e1919b301031a5d0dd0ef27
order fields
django-openstack/django_openstack/dash/views/images.py
django-openstack/django_openstack/dash/views/images.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.000001
@@ -2870,24 +2870,33 @@ tion%22)%0A%0A -# + +# setting self.fi @@ -2913,13 +2913,96 @@ der -= %5B%0A# +seems to break validation,%0A # so ordering fields manually%0A field_list = (%0A @@ -3017,17 +3017,16 @@ 'name',%0A -# @@ -3042,17 +3042,16 @@ _data',%0A -# @@ ...
e4c81cc6ca06cddf8402c8d1285e9057f0322171
Fix duplicate line from the merge conflict
application/frontend/forms.py
application/frontend/forms.py
# -*- coding: utf-8 -*- from flask_wtf import Form from wtforms import StringField, RadioField, DecimalField, HiddenField, TextAreaField, FieldList, DateField, FormField from wtforms.validators import DataRequired, Optional import simplejson from datatypes import postcode_validator, price_validator from application.fr...
Python
0.000014
@@ -3816,42 +3816,8 @@ t)%0A%0A - data = simplejson.dumps(%7B%0A
d3eb173136e8ba6f62f94ec3539de0884ce89cd7
rewrite code
mozaik_membership_request/models/membership_line.py
mozaik_membership_request/models/membership_line.py
# Copyright 2021 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging from datetime import timedelta from odoo import _, fields, models _logger = logging.getLogger(__name__) class MembershipLine(models.Model): _inherit = "membership.line" def _mark_as_paid(self, amo...
Python
0.000054
@@ -154,16 +154,21 @@ mport _, + api, fields, @@ -175,16 +175,16 @@ models%0A - %0A_logger @@ -287,16 +287,385 @@ .line%22%0A%0A + @api.model%0A def _get_states_put_amount_on_membership(self):%0A %22%22%22%0A For some membership states, we want to set the amount on the%0A membership li...
cef5fe7a81e505b2e096effa050a3e9e8d4d4d26
remove irrelevant TODO
experiment/maintenance/shift_nodepool_capacity.py
experiment/maintenance/shift_nodepool_capacity.py
#!/usr/bin/env python3 # Copyright 2018 The Kubernetes 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 appl...
Python
0.998601
@@ -954,72 +954,8 @@ SK.%0A -# TODO: delete this once dynamic kubelet config is available%0A%0A%0A%0A %0Aimp
8ac489554f6407ce5bb2f45f6c6ca808c1034a91
remove unused variable
timesketch/lib/analyzers/yetiindicators.py
timesketch/lib/analyzers/yetiindicators.py
"""Index analyzer plugin for Yeti indicators.""" from __future__ import unicode_literals from flask import current_app import requests from timesketch.lib.analyzers import interface from timesketch.lib.analyzers import manager from timesketch.lib import emojis def build_query_for_indicators(indicators): """Buil...
Python
0.00003
@@ -2434,69 +2434,8 @@ %22%22%22%0A - search_query = %7B'name': '', 'type': 'intrusion-set'%7D%0A
c02719f44cc7bdb1183a3ffbda9171cac9fb222e
rewrite nose-optional-call check, fixes python2.4 compat
_py/test/plugin/pytest_nose.py
_py/test/plugin/pytest_nose.py
"""nose-compatibility plugin: allow to run nose test suites natively. This is an experimental plugin for allowing to run tests written in 'nosetests style with py.test. Usage ------------- type:: py.test # instead of 'nosetests' and you should be able to run nose style tests and at the same time can make...
Python
0.000001
@@ -3241,23 +3241,24 @@ -argspec +ismethod = inspe @@ -3264,18 +3264,16 @@ ect. -getargspec +ismethod (met @@ -3289,96 +3289,90 @@ -if argspec%5B0%5D == %5B'self'%5D:%0A argspec = argspec%5B1:%5D%0A if not any(argspec) +rawcode = py.code.getrawcode(method)%0A if not rawcode....
9ba6272f34a767b74d9c1ade1bcc12b9136e38d2
fix to unit_test_brace_matching in Python3
app/unit_test_brace_matching.py
app/unit_test_brace_matching.py
# -*- coding: latin-1 -*- # Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
Python
0.000007
@@ -3776,15 +3776,15 @@ CTRL_Q, -b +u 'n'%5D)%0A
2ba5b77b31cec9ccbaca262ce44df9ba175f4485
Refactor ElectronicAttenuator to use @property
engineering_project/Instrument/ElectronicAttenuator.py
engineering_project/Instrument/ElectronicAttenuator.py
#!/usr/bin/env python3 import time import logging # from scipy.interpolate import UnivariateSpline # import numpy as np from Instrument.GenericInstrument import GenericInstrument as GenericInstrument class ElectronicAttenuator(GenericInstrument): def __init__(self, instrument): super().__init__(instrumen...
Python
0
@@ -810,62 +810,8 @@ 7,%22) -%0A self.attenuation = float(self.query(%22ATTN?%22)) %0A%0A @@ -901,21 +901,25 @@ -def set(self, +@property%0A def att @@ -926,16 +926,21 @@ enuation +(self ):%0A @@ -946,48 +946,106 @@ -if attenuation != self.attenuation:%0A +return(float(self.query(...
45df0a7370456b285f7116cc3d1bc05d683f31d1
Update ElectronicAttenuator.MarconiInstruments2187 with preset value
engineering_project/Instrument/ElectronicAttenuator.py
engineering_project/Instrument/ElectronicAttenuator.py
#!/usr/bin/env python3 """.""" # import time # import logging # from scipy.interpolate import UnivariateSpline # import numpy as np try: from Instrument.GenericInstrument import GenericInstrument from Instrument.IEEE488 import IEEE488 from Instrument.SCPI import SCPI except ImportError: from GenericIns...
Python
0
@@ -1524,54 +1524,54 @@ -@attenuation.setter%0A # @validsteps(3,4,5,6) +# @validsteps(3,4,5,6)%0A @attenuation.setter %0A @@ -1684,16 +1684,86 @@ dB'%5D))%0A%0A + def preset(self):%0A %22%22%22.%22%22%22%0A self.attenuation = 144%0A%0A %0AREGISTE
05fd77bf62e14b965fe6b560d913ef26f001dc7f
Fix for new engine
nuxeo-drive-client/nxdrive/engine/next/processor.py
nuxeo-drive-client/nxdrive/engine/next/processor.py
__author__ = 'loopingz' from nxdrive.engine.processor import Processor as OldProcessor from nxdrive.logging_config import get_logger from nxdrive.client.base_automation_client import DOWNLOAD_TMP_FILE_PREFIX from nxdrive.client.base_automation_client import DOWNLOAD_TMP_FILE_SUFFIX log = get_logger(__name__) import os ...
Python
0
@@ -2835,63 +2835,19 @@ -# Move rename%0A updated_info = local_client.move( +rel_path = loca @@ -2873,17 +2873,16 @@ mp_file) -, %0A @@ -2886,61 +2886,38 @@ - doc_pair.local_parent +local_client.set_remote_id(rel _pat @@ -2927,36 +2927,35 @@ doc_pair.remote...
15be37bfad04ff6ed3514c24e323059b04ccc92e
Add shallow copy comment
lc0040_combination_sum_ii.py
lc0040_combination_sum_ii.py
"""Leetcode 40. Combination Sum II Medium URL: https://leetcode.com/problems/combination-sum-ii/ Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target. Each number in candidates may only be used once in...
Python
0
@@ -858,24 +858,56 @@ arget == 0:%0A + # Use shallow copy.%0A
16766d1fae67d1a949e6fb27c3147a882d964957
Revise docstring and main()
lc206_reverse_linked_list.py
lc206_reverse_linked_list.py
"""206. Reverse Linked List Easy Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? """ # Definition for singly-linked list. class ListNode(object): def __init__(self,...
Python
0
@@ -199,16 +199,17 @@ sively. +%0A Could yo @@ -1490,24 +1490,43 @@ %3E2-%3E1-%3ENULL%0A + # Should be 5.%0A print So @@ -1616,25 +1616,20 @@ l%0A # -Shoule be +Ans: 4.%0A @@ -1634,36 +1634,35 @@ print Solution -Recu +Ite r().reverseList( @@ -1687,17 +1687,12 @@ # -Shoule be +Ans: 3.%0A...
fdcbbe747a4a85589629f97d73df257ee65421f9
Add method to merge config
symaps_proxies/lib/common/aws_utils.py
symaps_proxies/lib/common/aws_utils.py
# -*- coding: utf-8 -*- import boto3 import logging import sys class AWSEC2Interface(object): def __init__(self, profile): """Constructor Args: profile (string): AWS profile """ # Setup logger self.logger = self.__setup_logger() # Get AWS Session ...
Python
0.000002
@@ -2090,24 +2090,693 @@ n resource%0A%0A + # Taken from http://stackoverflow.com/questions/38987/how-can-i-merge-two-python-dictionaries-in-a-single-expression%0A def merge_dicts(self, *dict_args):%0A '''%0A Given any number of dicts, shallow copy and merge into a new dict,%0A precedence go...
7c5a7923a1997fa5c033e11093a7a40d9263c860
make "commit" a no-op
ldapdb/backends/ldap/base.py
ldapdb/backends/ldap/base.py
# -*- coding: utf-8 -*- # # django-ldapdb # Copyright (c) 2009-2010, Bolloré telecom # All rights reserved. # # See AUTHORS file for a full list of contributors. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # ...
Python
0.99998
@@ -2484,32 +2484,69 @@ :%0A pass%0A%0A + def _commit(self):%0A pass%0A%0A def _cursor(
329360f153d98ffea9e009704b22345da25985c1
Increase timeout on url shortener service
leaguebot/services/alerts.py
leaguebot/services/alerts.py
from leaguebot import app import leaguebot.models.map as screepmap import re import leaguebot.services.db as db import leaguebot.services.slack as slack import leaguebot.services.screeps as screeps import leaguebot.services.twitter as twitter from pyshorteners import Shortener def mark_sent(alert_id): tick = scr...
Python
0
@@ -3898,16 +3898,27 @@ r('Isgd' +, timeout=1 )%0A
83dc0283f4b31da76cf6ea1dcb102b11c6dc2a91
Rearrange tests so that test_zero is only things that don't work with ask()
sympy/assumptions/tests/test_newask.py
sympy/assumptions/tests/test_newask.py
from sympy.assumptions.newask import newask from sympy import symbols, Q, assuming, Implies from sympy.utilities.pytest import raises x, y = symbols('x y') def test_newask(): # No relevant facts assert newask(Q.real(x), Q.real(x)) is True assert newask(Q.real(x), ~Q.real(x)) is False assert newask(Q...
Python
0.000002
@@ -964,16 +964,108 @@ is True +%0A assert newask(Q.zero(x), Q.zero(x*y)) is None%0A assert newask(Q.zero(x*y), Q.zero(x)) %0A%0Adef te @@ -1254,59 +1254,8 @@ %22%22%22 -%0A%0A assert newask(Q.zero(x), Q.zero(x*y)) is None %0A
e2a3a54228822c92aed07e2c8c0c49baaf1a509f
fix test modes
gdsfactory/simulation/gtidy3d/tests/test_modes.py
gdsfactory/simulation/gtidy3d/tests/test_modes.py
import numpy as np import gdsfactory.simulation.gtidy3d as gt from gdsfactory.simulation.gtidy3d.modes import Waveguide, group_index, si, sio2 nm = 1e-3 def test_neff_cached(): c = Waveguide( wavelength=1.55, wg_width=0.5, wg_thickness=0.22, slab_thickness=0.0, ncore=si, ...
Python
0.000001
@@ -629,35 +629,36 @@ ,%0A cache= -Non +Fals e,%0A )%0A c.c @@ -943,35 +943,36 @@ ,%0A cache= -Non +Fals e,%0A )%0A ng @@ -1358,19 +1358,20 @@ cache= -Non +Fals e,%0A )
67d171c169f34d18166278b1d1508ac6a27bf484
Tweak squashed migration.
private_messages/migrations/0001_squashed_0004_auto_20150828_1520.py
private_messages/migrations/0001_squashed_0004_auto_20150828_1520.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import uuid class Migration(migrations.Migration): replaces = [(b'private_messages', '0001_initial'), (b'private_messages', '0002_auto_20150826_1413'), (b'private_messages', ...
Python
0
@@ -960,32 +960,34 @@ (' +uu id', models.Auto @@ -986,70 +986,52 @@ els. -Auto +UUID Field( -verbose_name='ID', serialize=False, auto_created=Tru +default=uuid.uuid4, serialize=Fals e, p @@ -2724,312 +2724,8 @@ ),%0A - migrations.RemoveField(%0A model_name='privatemessage',%0A ...
d20b2d67211d88e0bcfc91669f661b1502c717f3
Remove unused package
triangular_lattice/growing_string_run.py
triangular_lattice/growing_string_run.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # # written by Shotaro Fujimoto # 2016-09-27 from growing_string import Main import random import time if __name__ == '__main__': # import timeit # print(timeit.timeit("Main(Lx=60, Ly=60, size=[3,] * 1, \ # strings=[{'id': 1, 'x': 15, ...
Python
0.000004
@@ -120,22 +120,8 @@ ain%0A -import random%0A impo
9b807cf03b3b2a45d9ef79c557d206a4a106e1a5
Corrige l'accès aux qualifications
apps/challenge/views/session.py
apps/challenge/views/session.py
# -*- coding: utf-8 -*- # # defivelo-intranet -- Outil métier pour la gestion du Défi Vélo # Copyright (C) 2015 Didier Raboud <me+defivelo@odyx.org> # # 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 ...
Python
0.000013
@@ -902,16 +902,62 @@ geMixin%0A +from django.core.exceptions import FieldError%0A from dja @@ -1678,36 +1678,20 @@ -return (%0A +qs = super(S @@ -1732,20 +1732,42 @@ - +try:%0A return qs .filter( @@ -1767,16 +1767,20 @@ filter(%0A + @@ -1852,16 +1852,20...
970f6b138988e91fb0a133e4ba6f5e1786424ef0
Fix mocking, again.
unit_tests/test_actions_git_reinstall.py
unit_tests/test_actions_git_reinstall.py
from mock import patch with patch('charmhelpers.core.hookenv.config') as config: config.return_value = 'keystone' import keystone_utils as utils # noqa with patch('keystone_utils.register_configs') as register_configs: import git_reinstall from test_utils import ( CharmTestCase ) TO_PATCH =...
Python
0
@@ -1037,24 +1037,82 @@ g_changed')%0A + @patch('charmhelpers.contrib.openstack.utils.config')%0A def test @@ -1131,16 +1131,24 @@ ll(self, + config, config_ @@ -1164,38 +1164,26 @@ git_install, - action_fail, %0A + @@ -1188,32 +1188,44 @@ +action_fail, action_set):%0A ...
1882edc39ad1b98e432445233cc90e91284522ee
Rename spider class name to more specific
private/realclearpolitics-scraper/realclearpolitics/spiders/spider.py
private/realclearpolitics-scraper/realclearpolitics/spiders/spider.py
import scrapy from realclearpolitics.items import TableItem class spider(scrapy.Spider): name = "realclearpoliticsSpider" start_urls = [] def __init__(self, url): self.url = url def start_requests(self): return [scrapy.FormRequest(self.url, callback=self...
Python
0.000001
@@ -60,17 +60,20 @@ %0A%0Aclass -s +RcpS pider(sc
757d17d4bd4b5803febd2f70e3edc8949dcc77a8
Add the version number
ph_unfolder/phonon/__init__.py
ph_unfolder/phonon/__init__.py
Python
0.999813
@@ -0,0 +1,22 @@ +__version__ = '0.2.0'%0A
030af1a74ebf95ca6f255c1830cabcb75c2e32dc
Use create_or_resolve_commit in pipelines
valohai_cli/commands/pipeline/run/run.py
valohai_cli/commands/pipeline/run/run.py
import contextlib from typing import Optional import click from click import Context from valohai_yaml.objs import Config, Pipeline from valohai_cli.api import request from valohai_cli.commands.pipeline.run.utils import build_edges, build_nodes, match_pipeline from valohai_cli.ctx import get_project from valohai_cli....
Python
0.000001
@@ -337,16 +337,79 @@ success%0A +from valohai_cli.utils.commits import create_or_resolve_commit%0A %0A%0A@click @@ -1269,24 +1269,25 @@ ert project%0A +%0A commit = @@ -1292,55 +1292,68 @@ = c -ommit or project.resolve_commit()%5B'identifier'%5D +reate_or_resolve_commit(project, commit=commit, adhoc=False) ...
f6f8fc8aff8276a6bab5cd0ae079524e93a83980
Fix tests on Python 3.3
stagecraft/apps/datasets/tests/views/test_data_set.py
stagecraft/apps/datasets/tests/views/test_data_set.py
import json from django.test import TestCase class DataSetsViewsTestCase(TestCase): fixtures = ['datasets_testdata.json'] def test_list(self): resp = self.client.get('/data-sets') self.assertEqual(resp.status_code, 200) expected = [ { 'bearer_token': '', '...
Python
0.998618
@@ -1016,32 +1016,48 @@ ads(resp.content +.decode('utf-8') ), expected)%0A%0A @@ -1045,32 +1045,32 @@ 8')), expected)%0A - %0A def test_li @@ -1627,32 +1627,48 @@ ads(resp.content +.decode('utf-8') ), expected)%0A%0A @@ -2587,32 +2587,48 @@ ads(resp.content +.decode('utf-8') ), expected)%0A%0A @@ -3014...
40469eb52e4f4a2a7bd3c05630002f08dac42e8c
Disable testPlayWaitForEnded for chromeos
telemetry/telemetry/internal/actions/play_unittest.py
telemetry/telemetry/internal/actions/play_unittest.py
# Copyright 2013 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 import decorators from telemetry.internal.actions import play from telemetry.testing import tab_test_case import py_utils AUDIO_1_PLAYING_C...
Python
0.000005
@@ -3213,16 +3213,28 @@ ed('mac' +, 'chromeos' ) # crb
673d6cecfaeb0e919f30997f793ee2bb18e399ee
Fix V2 hypervisor server schema attribute
tempest/api_schema/response/compute/v2/hypervisors.py
tempest/api_schema/response/compute/v2/hypervisors.py
# Copyright 2014 NEC Corporation. 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.000001
@@ -1064,212 +1064,11 @@ -# NOTE: Now the type of 'id' is integer,%0A # but here allows 'string' also because we%0A # will be able to change it to 'uuid' in%0A # the future.%0A ' +'uu id': @@ -1080,20 +1080,8 @@ pe': - %5B'integer', 'st @@ -1085,17 +...
4ea62d9489ee14c849eeb489455835a66f667940
Increase timeout on Hyper.sh API calls
arxiv_vanity/papers/renderer.py
arxiv_vanity/papers/renderer.py
import os import shlex import docker import hyper_sh from django.conf import settings def create_client(): """ Create a client to either a local Docker instance or Hyper.sh. """ client = docker.from_env() if settings.ENGRAFO_USE_HYPER_SH: client.api = hyper_sh.Client({ 'clouds'...
Python
0
@@ -523,16 +523,95 @@ %7D)%0A + # Sometimes Hyper.sh is very slow.%0A client.api.timeout = 60 * 5%0A retu
48d75f145065b19f45e59f2a55ea6091134b03ea
Apply np.asanyarray() to input data
astropy/stats/sigma_clipping.py
astropy/stats/sigma_clipping.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np __all__ = ['sigma_clip', 'sigma_clipped_stats'] def sigma_clip(data, sig=3, iters=1, cenfunc=np.ma.median, varfunc=np.var,...
Python
0.001445
@@ -6656,24 +6656,55 @@ e.%0A %22%22%22%0A%0A + data = np.asanyarray(data)%0A if mask
fb0ec8f188ad2a9a2330196ff94958094f119058
make the test a bit more accurate
wizard_builder/tests/test_inheritance.py
wizard_builder/tests/test_inheritance.py
import subprocess from django.test import TestCase from ..models import ( Choice, Conditional, FormQuestion, MultipleChoice, PageBase, QuestionPage, SingleLineText, ) class InheritanceTest(TestCase): def test_question_page_instance(self): page = QuestionPage.objects.create() SingleLineT...
Python
0.002374
@@ -2594,32 +2594,99 @@ '', shell=True)%0A + subprocess.run(self.PIPE_DELETE_QUESTION_PAGE, shell=True)%0A subproce
e3e4943c6858f3ee010cebad3ffb2ffbe05a6c06
Add a TODO
src/pushover_complete/pushover_api.py
src/pushover_complete/pushover_api.py
from urllib.parse import urljoin import requests from .error import BadAPIRequestError PUSHOVER_API_URL = 'https://api.pushover.net/1/' class PushoverAPI(object): def __init__(self, token): self.token = token def _send_message(self, user, message, device=None, title=None, url=None, url_title=None,...
Python
0.998547
@@ -423,32 +423,61 @@ session=None):%0A + # TODO: callback url%0A payload
b96495329d8c05545815e49362343262446dc84d
Remove additional backslash in line breaks of values
tools/nodeset_compiler/backend_open62541_datatypes.py
tools/nodeset_compiler/backend_open62541_datatypes.py
from datatypes import Boolean, Byte, SByte, \ Int16, UInt16, Int32, UInt32, Int64, UInt64, Float, Double, \ String, XmlElement, ByteString, Structure, ExtensionObject, LocalizedText, \ NodeId, ExpandedNodeId, DateTime, QualifiedName, StatusCode, \...
Python
0
@@ -985,17 +985,16 @@ %5Cn', r'%5C -%5C n').repl
1ac576923fed3e3854c9c62cc624e6937998ab68
Add 1.7.1 (#11141)
var/spack/repos/builtin/packages/libfabric/package.py
var/spack/repos/builtin/packages/libfabric/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libfabric(AutotoolsPackage): """The Open Fabrics Interfaces (OFI) is a framework focused o...
Python
0
@@ -615,16 +615,112 @@ aster')%0A + version('1.7.1', sha256='312e62c57f79b7274f89c41823932c00b15f1cc8de9c1f8dce17cd7fdae66fa1')%0A vers
db31d216d1cff540be8382617445a95c1113f69b
fix unicode literal in v4.test_convert
IPython/nbformat/v4/tests/test_convert.py
IPython/nbformat/v4/tests/test_convert.py
# -*- coding: utf-8 -*- import copy import nose.tools as nt from IPython.nbformat import validate from .. import convert from . import nbexamples from IPython.nbformat.v3.tests import nbexamples as v3examples from IPython.nbformat import v3, v4 def test_upgrade_notebook(): nb03 = copy.deepcopy(v3examples.nb0) ...
Python
0
@@ -907,16 +907,17 @@ (source= +u '%C3%BCn%C3%ACc%C3%B6%E2%88%82e
19fae1fc2703aa24f9d26ad1426e1ac3c1acd232
Add alternative solution for 'Keyboard Row' problem
Python/keyboard-row.py
Python/keyboard-row.py
# Time: O(n) # Space: O(1) # Given a List of words, return the words that can be typed # using letters of alphabet on only one row's of American keyboard like the image below. # # Example 1: # Input: ["Hello", "Alaska", "Dad", "Peace"] # Output: ["Alaska", "Dad"] # Note: # You may use one character in the keyboard mo...
Python
0.000078
@@ -1116,8 +1116,454 @@ result%0A +%0A%0Aclass Solution2(object):%0A def findWords(self, words):%0A %22%22%22%0A :type words: List%5Bstr%5D%0A :rtype: List%5Bstr%5D%0A %22%22%22%0A keyboard_rows = %5B'qwertyuiop', 'asdfghjkl', 'zxcvbnm'%5D%0A single_row_words = %5B%5D%0A ...
0866efa8dbfaecfcc150e55d24f74b36a9a4e1f3
Fix _pointIsRight cross product
UM/Math/LineSegment.py
UM/Math/LineSegment.py
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. from Float import Float ## Represents a line segment in 2D. # # The line segment is represented by a beginning and an end point. class LineSegment(object): ## Creates a new line segment with the specified start ...
Python
0
@@ -98,16 +98,24 @@ .%0A%0Afrom +UM.Math. Float im @@ -124,16 +124,53 @@ rt Float + #For fuzzy comparison of edge cases. %0A%0A## Re @@ -3124,13 +3124,21 @@ .cross(p + - start ) %3C 0
10abb657bf3ff008785820ffd16d26a27c16dd5e
Increase code readability
count_number_of_inversions.py
count_number_of_inversions.py
""" This is for an educational purposes This is a good practice for intermediate python learners. The definition of the problem: Suppose you are given a list of n elements with an arbitrary order and you are asked to find the number of inversions in a given list by using Divide & Conquer Paradigm in computer science H...
Python
0.000046
@@ -793,22 +793,28 @@ rable):%0A -%09%22%22%22%0A%09 + %22%22%22%0A This fun @@ -914,17 +914,20 @@ er them%0A -%09 + the actu @@ -972,22 +972,28 @@ nction%0A%0A -%09%22%22%22%0A%09 + %22%22%22%0A if len(i @@ -1007,18 +1007,24 @@ ) == 1:%0A -%09%09 + return i @@ -1034,25 +1034,34 @@ ab...
e95c7882a3caeefad0b618eae07691c8fe69cd13
Fix suffixes so it works with current dashboards
newrelic_plugin_agent/plugins/apache_httpd.py
newrelic_plugin_agent/plugins/apache_httpd.py
""" ApacheHTTPD Support """ import logging import re from newrelic_plugin_agent.plugins import base LOGGER = logging.getLogger(__name__) PATTERN = re.compile(r'^([\w\s{1}]+):\s([\d\.{1}]+)', re.M) class ApacheHTTPD(base.HTTPStatsPlugin): DEFAULT_QUERY = 'auto' GUID = 'com.meetme.newrelic_apache_httpd_age...
Python
0.000001
@@ -660,17 +660,17 @@ fix': 'k -B +b '%7D,%0A @@ -811,16 +811,20 @@ : 'bytes +/sec '%7D,%0A @@ -932,16 +932,63 @@ ad Size' +,%0A 'suffix': 'bytes' %7D,%0A
69c6759625c8faacd2ce5194c9845349c61dda7f
Use os_helper to fix ImportError in Python 3.10
tests/py39compat.py
tests/py39compat.py
try: from test.support.os_helpers import FS_NONASCII except ImportError: from test.support import FS_NONASCII # noqa
Python
0.000002
@@ -29,17 +29,16 @@ s_helper -s import
68f4d0351cb02260f942ab9f4cda0d81e43bb6a6
Resolve PR comments
tests/regression.py
tests/regression.py
import os import sys import shlex from subprocess import Popen, PIPE import argparse TEST_CASE_DIRECTORY = "./cases" def get_exitcode_stdout_stderr(cmd): """ Executes an external command and returns the exitcode, stdout and stderr. """ args = shlex.split(cmd) proc = Popen(args, stdout=PIPE, stder...
Python
0
@@ -710,16 +710,20 @@ %0A if +not case.end @@ -736,24 +736,38 @@ %22.in%22):%0A + continue%0A%0A path = o @@ -805,28 +805,24 @@ , case)%0A - - print(path)%0A @@ -822,20 +822,16 @@ (path)%0A%0A - with @@ -867,20 +867,16 @@ - - payload @@ -883,28 +883,24 @@ = f.rea...
4be78b535424f53c1fa313d2a5d483e729b0497b
test data cleanup
tools/remoteserver/test/atest/arguments.py
tools/remoteserver/test/atest/arguments.py
# Can be used in the test data like ${MyObject()} or ${MyObject(1)} class MyObject: def __init__(self, index=''): self.index = index def __str__(self): return '<MyObject%s>' % self.index UNICODE = (u'Hyv\u00E4\u00E4 y\u00F6t\u00E4. ' u'\u0421\u043F\u0430\u0441\u0438\u0431\u043E!') LI...
Python
0
@@ -1,72 +1,4 @@ -# Can be used in the test data like $%7BMyObject()%7D or $%7BMyObject(1)%7D%0A clas @@ -9,16 +9,17 @@ Object:%0A +%0A def @@ -43,10 +43,9 @@ dex= -'' +0 ):%0A @@ -70,16 +70,17 @@ = index%0A +%0A def @@ -126,16 +126,17 @@ t%25s%3E' %25 +( self.ind @@ -137,16 +137,24 @@ lf.index + ...
c5469384b68174b909204620b6bff74bc4b64f3d
Fix wrong function call
backend/newsletters/exporter.py
backend/newsletters/exporter.py
import dataclasses import typing from collections import defaultdict from conferences.models import Conference from django.db.models import Q from pretix.db import user_has_admission_ticket from schedule.models import ScheduleItem from submissions.models import Submission from users.models import User @dataclasses.d...
Python
0.036136
@@ -2865,16 +2865,28 @@ slug +%0A for slu @@ -2906,16 +2906,28 @@ ce_slugs +%0A if user @@ -2952,16 +2952,22 @@ ket(user +.email , slug)%0A
9d3d6c0b058e7c9e1c386c3726305596f086e594
Improve command string of convert_to_json (#3477)
parlai/scripts/convert_data_to_json_format.py
parlai/scripts/convert_data_to_json_format.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Converts data used in a task to json format. (Same as "Conversation" class; ie, for use in ACUTE-eval) Specify the t...
Python
0.000083
@@ -555,35 +555,37 @@ pt(' -dump_data_to_conversations' +convert_to_json', hidden=True )%0Acl @@ -706,16 +706,75 @@ _args()%0A + parser.description = 'Convert data to json format'%0A
f5d9a361ed4eb6862956604334c636191c7b2241
Fix future only jobs for api.
network/api/views.py
network/api/views.py
import django_filters from rest_framework import viewsets, mixins from network.api.perms import StationOwnerCanEditPermission from network.api import serializers from network.base.models import (Antenna, Data, Observation, Satellite, Station, Transponder) class AntennaView(viewsets.M...
Python
0
@@ -1,12 +1,51 @@ +from django.utils.timezone import now%0A%0A import djang @@ -1853,8 +1853,91 @@ ation')%0A +%0A def get_queryset(self):%0A return self.queryset.filter(start__gte=now())%0A
41da6a00853817fec104c816f5d44808120111e6
rearrange the variables
utils/Model.py
utils/Model.py
class Model(object): def __init__(self,configModel,utils,strTrial): self.tag = configModel[0] self.mode = configModel[1] self.featureSet = configModel[2] self.misc = configModel[3] self.masterTest = utils.TEST_IDS_PATH self.bootTrain = utils.MODEL...
Python
0.999999
@@ -625,16 +625,79 @@ Trial %0A + #The following will be regarded as basic feature files%0A @@ -1071,32 +1071,91 @@ '_t' + strTrial +%0A%0A #The following 3 files are implicit feature files %0A self.Im @@ -1211,68 +1211,8 @@ + %5C - #The following 3 files are implicit fea...
91dba59e03e7dfea7f726236ff71c01425e90fcb
remove extra space
tests/e2e/tests/releng_utils.py
tests/e2e/tests/releng_utils.py
# 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/. import requests class FirefoxLocale: def __init__(self, locale, version_info): self.lang = locale ...
Python
0.002319
@@ -4263,17 +4263,16 @@ e_data = - respons
fda460f1fadaafbfdace8bb2282902d36534395f
fix typo
tests/test_rho_limiter.py
tests/test_rho_limiter.py
from gusto import * from firedrake import as_vector, Constant, sin, PeriodicIntervalMesh, \ SpatialCoordinate, ExtrudedMesh, Expression from gusto.rho_limiter import RhoLimiter import json from math import pi # This setup creates a sharp bubble of warm air in a vertical slice # This bubble is then advected by a pr...
Python
0.999991
@@ -1749,17 +1749,17 @@ nction(V -t +r ).interp
0b3bffe67a4c23d6f0937699a451f08d29c43c1a
Remove slash append
project/settings/base.py
project/settings/base.py
# Standard Libary import base64 import datetime import os # Third-Party import dj_database_url import jwt # Django from django.core.exceptions import ImproperlyConfigured def get_env_variable(var_name): """Get the environment variable or return exception.""" try: var = os.environ[var_name] #...
Python
0.000584
@@ -994,16 +994,37 @@ ication' +%0AAPPEND_SLASH = False %0A%0A# Date
c8c8ed7d9b248af3f2a947c8ceef00f1f88a1156
update permissions in ECD report to take into account the new feature preview
corehq/apps/reports/v2/reports/explore_case_data.py
corehq/apps/reports/v2/reports/explore_case_data.py
from __future__ import absolute_import from __future__ import unicode_literals from django.utils.translation import ugettext_lazy from corehq import toggles from corehq.apps.case_search.const import ( SPECIAL_CASE_PROPERTIES_MAP, CASE_COMPUTED_METADATA, ) from corehq.apps.commtrack.const import USER_LOCATION_...
Python
0
@@ -1250,16 +1250,120 @@ case_es%0A +from corehq.feature_previews import (%0A EXPLORE_CASE_DATA_PREVIEW,%0A is_eligible_for_ecd_preview,%0A)%0A %0A%0Aclass @@ -2047,24 +2047,214 @@ ter,%0A %5D%0A%0A + @property%0A def can_view_ecd_preview(self):%0A return (EXPLORE_CASE_DATA_PREVIEW.enabled_for...
144d3ee9f79c46044d2c2b3985402b841e619969
Add RQ to admin
project/settings/base.py
project/settings/base.py
# Standard Libary import os # Third-Party import dj_database_url # Django from django.core.exceptions import ImproperlyConfigured def get_env_variable(var_name): """Get the environment variable or return exception.""" try: var = os.environ[var_name] # Replace unix strings with Python Boolean...
Python
0
@@ -4346,16 +4346,41 @@ %7D,%0A%7D%0A +RQ_SHOW_ADMIN_LINK = True %0A%0A# Appl
560fcd834722dd94f5150f15b3cb44930d2e156a
add `in` filter to assignees
timed/projects/filters.py
timed/projects/filters.py
"""Filters for filtering the data of the projects app endpoints.""" from datetime import date, timedelta from django.db.models import Count, Q from django_filters.constants import EMPTY_VALUES from django_filters.rest_framework import Filter, FilterSet, NumberFilter from timed.projects import models class CustomerF...
Python
0
@@ -228,16 +228,30 @@ k import + BaseInFilter, Filter, @@ -308,24 +308,85 @@ rt models%0A%0A%0A +class NumberInFilter(BaseInFilter, NumberFilter):%0A pass%0A%0A%0A class Custom @@ -4001,16 +4001,62 @@ %22task%22)%0A + tasks = NumberInFilter(field_name=%22task%22)%0A user @@ -4082,32 +4082,32 @@ ld_nam...
af3e10c1f717eefca0227736404dbe240687e6e8
use an absolute scale
tools/draw-importances.py
tools/draw-importances.py
#!/usr/bin/env python3 import struct import sys from os.path import splitext import numpy as np from PIL import Image, ImageDraw from matplotlib import pyplot as plt # Renders block importances output by ContextInner::compute_lookahead_data(). # Usage: # cargo run --features=dump_lookahead_data <input.y4m> -o ...
Python
0.000002
@@ -601,30 +601,184 @@ s))%0A -max_imp = np.max(imps) +%0A# Use a fixed scale where anything %3E= 10 cannot be distinguished%0A# to allow visually comparing multiple pictures%0Amax_imp = 10 ## Replace by %60np.max(imps)%60 for relative scaling %0A%0Afr
8a1bd4178a151fb634095ef6f3a55a8bb5838b07
Change example syntax on easy_install module
lib/ansible/modules/packaging/language/easy_install.py
lib/ansible/modules/packaging/language/easy_install.py
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Matt Wright <matt@nobien.net> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License...
Python
0
@@ -3135,24 +3135,34 @@ all: +%0A name -= +: pip +%0A state -= +: late @@ -3232,20 +3232,29 @@ all: +%0A name -= +: bottle +%0A vir @@ -3260,17 +3260,18 @@ rtualenv -= +: /webapps
25cf3528b96fb93c6622b8b9c31d4de8cddd5fa8
comment explaining why we are sending a date
annotator/jvm_nlp_annotator.py
annotator/jvm_nlp_annotator.py
#!/usr/bin/env python """Annotator to add NLP annotations from REST calls to a webservice""" import requests from annotator import * class JVMNLPAnnotator(): default_base_url = 'http://localhost:8080' annotate_path = '/annotate/getNLPAnnotations' def __init__(self, tiers, base_url=None): """Sp...
Python
0
@@ -808,16 +808,292 @@ .text%7D%0A%0A + # Stanford SUTime can use a reference date to canonicalize relative%0A # dates like %22tomorrow.%22 If we have a doc.date for this document,%0A # send it along and the jvm-nlp will not attempt to find a reference%0A # date in the beginning of the docu...
c33c5795ccaf8d4dbc1470cd3c32d9fdddd980bb
Correct unit tests for Actor-related exceptions
tests/test_actor.py
tests/test_actor.py
# This module is part of Hypatia and is released under the # MIT license: http://opensource.org/licenses/MIT """py.test unit testing for hypatia/actor.py Run py.test on this module to assert hypatia.actor is completely functional. """ import os import pygame import pytest from hypatia import actor from hypatia im...
Python
0.000328
@@ -869,32 +869,37 @@ ise actor.No +Actor Response Reason(2)%0A%0A @@ -886,22 +886,16 @@ Response -Reason (2)%0A%0A @@ -983,32 +983,37 @@ .raises(actor.No +Actor Response):%0A%0A @@ -1030,32 +1030,37 @@ ise actor.No +Actor Response Reason(actor @@ -1039,38 +1039,32 @@ .NoActorResponse -Reason (actor...
3af6c6a9008d521379565e425e87437091263064
build failing resolved
tests/test_async.py
tests/test_async.py
import asyncio import time import unittest from test_sync import setup from pyappbase import Appbase async def hello_world(d, data): while d[0]: await asyncio.sleep(0.1) data.append("Hello") class AsnycTests(unittest.TestCase): def tearDownClass(cls): data = { "type": "...
Python
0
@@ -251,453 +251,8 @@ :%0A%0A%0A - def tearDownClass(cls):%0A data = %7B%0A %22type%22: %22Books%22,%0A %22id%22: %22X2%22,%0A %7D%0A sync_appbase = setup(Appbase)%0A%0A sync_appbase.index(%7B%0A %22type%22: %22Books%22,%0A %22id%22: %22X2%22,%...
fee0e9484d7824d767fa31b8c3358a1af88d2c2d
Fix test_check
tests/test_check.py
tests/test_check.py
from hangman import check def test_check(): assert check('hello', set('h', 'e', 'l', 'o'))
Python
0.000063
@@ -69,16 +69,17 @@ o', set( +%5B 'h', 'e' @@ -88,11 +88,12 @@ 'l', 'o' +%5D ))%0A
f35a015657bdcf3a149b31026eebe454004fd7ef
Add more tests
tests/test_curry.py
tests/test_curry.py
import pytest from currypy import curry class TestCurry: def test_curry_as_decorator(self): """Ensure that currypy.curry can be used as a decorator""" @curry def func(): pass assert func.curried is False def test_curry_refuses_None(self): with pytest.rais...
Python
0
@@ -281,32 +281,85 @@ ses_None(self):%0A + %22%22%22Ensure that currypy.curry refuses None%22%22%22%0A with pyt @@ -373,12 +373,11 @@ ses( -Valu +Typ eErr @@ -405,8 +405,345 @@ y(None)%0A +%0A def test_curries_when_given_parameters(self):%0A @curry%0A def add(a, b):%0A re...
b2e34a07c10394b307641330624fe349675504bd
Clarify more the potential performance improvements in `optimize_rng_use`.
haiku/_src/random.py
haiku/_src/random.py
# Copyright 2020 DeepMind Technologies Limited. 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 ...
Python
0.000836
@@ -2406,20 +2406,8 @@ o a -significant redu @@ -2414,18 +2414,16 @@ ction in -%0A compila @@ -2435,22 +2435,141 @@ time - for %60%60init%60%60: +%0A of both %60%60init%60%60 and %60%60apply%60%60, with %60%60init%60%60 seeing a larger expected speedup%0A as it performs more RNG key splitting in general. %0...
80b4bae5903d4c3ba8c440d4067f6bd443f261f4
Improve watermark functionality (3)
handler/Watermark.py
handler/Watermark.py
import core import tornado import uuid import time import urllib from utils import open_remote_image, add_watermark, open_image class WatermarkHandler(core.BaseHandler): @tornado.web.asynchronous @tornado.gen.coroutine def get(self): self.logger.info('Request watermark generation for remote file')...
Python
0
@@ -48,22 +48,8 @@ ime%0A -import urllib%0A from @@ -376,33 +376,34 @@ = self. -get_query_argumen +request.headers.ge t('propo @@ -404,37 +404,24 @@ 'proportion' -, default=1.5 )%0A te @@ -429,84 +429,45 @@ t = -urllib.unquote(self.get_query_argument('text', default=%22Test%22)).decode('utf8 +self.reque...
e645a73e5e024a055b24a0453c762b8731cacd1a
remove unnecessary variable deletion
astropy/constants/__init__.py
astropy/constants/__init__.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains astronomical and physical constants for use in Astropy or other places. A typical use case might be:: >>> from astropy.constants import c, m_e >>> # ... define the mass of something you want the rest energy of as m ... >>> m = m_...
Python
0.000024
@@ -1525,32 +1525,28 @@ format(conf. -astronom +phys ical_constan @@ -4242,56 +4242,8 @@ ue)%0A - del codata_context, iaudata_context%0A %0A%0A#
1b4271cd0383e833a12b0f707d1906c3fdd7fba8
remove print
xcode_project_diff.py
xcode_project_diff.py
#!/usr/bin/python # # Copyright 2018 Google LLC # # 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 ag...
Python
0.000793
@@ -2888,20 +2888,8 @@ s))%0A - print cmd%0A re
15ef4b48962d64f9999f8efbdae394e2e7e0b6b5
Fix migration
crowdsourcing/migrations/0012_auto_20160107_0521.py
crowdsourcing/migrations/0012_auto_20160107_0521.py
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-01-07 05:21 from __future__ import unicode_literals from django.db import migrations def create_system_financial_account(apps): # We can't import the FinancialAccount model directly as it may be a newer # version than this migration expects. We use th...
Python
0.000006
@@ -179,16 +179,31 @@ unt(apps +, schema_editor ):%0A #
a3ee25df6a3216b6149760a8df49be6073970c97
Test name.
tests/test_input.py
tests/test_input.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import unittest import six from dockermap.functional import lazy_once from dockermap.map.input import (is_path, read_only, get_list, get_shared_volume, get_shared_volumes, get_shared_host_volume, get_shared_host_volumes, ...
Python
0.000002
@@ -5665,20 +5665,16 @@ est_get_ -get_ port_bin
3a2dfcc01040047a3227a64e6217977f4bd8780b
Use global API_URL
src/foremast/securitygroup/create_securitygroup.py
src/foremast/securitygroup/create_securitygroup.py
"""Create Security Groups for Spinnaker Pipelines.""" import configparser import json import logging import os from tryagain import retries from jinja2 import Environment, FileSystemLoader import requests class SpinnakerAppNotFound(Exception): pass class SpinnakerVPCNotFound(Exception): pass class Spinna...
Python
0
@@ -51,28 +51,8 @@ %22%22%22%0A -import configparser%0A impo @@ -89,22 +89,8 @@ os%0A%0A -from tryagain impo @@ -94,20 +94,21 @@ mport re -trie +quest s%0Afrom j @@ -150,31 +150,74 @@ mLoader%0A -import requests +from tryagain import retries%0A%0Afrom ..consts import API_URL %0A%0A%0Aclass @@ -746,110 +746,8 @...
711a58c888a9695c37b924a575fcf156ec9864bd
Correct error message
src/foremast/securitygroup/create_securitygroup.py
src/foremast/securitygroup/create_securitygroup.py
"""Create Security Groups for Spinnaker Pipelines.""" import logging import os import requests from ..consts import API_URL, HEADERS from ..exceptions import (SpinnakerSecurityGroupCreationFailed, SpinnakerTaskError) from ..utils import check_task, get_template, get_vpc_id class SpinnakerS...
Python
0
@@ -1227,34 +1227,24 @@ k, ('Failed -to create Security Gro @@ -1242,24 +1242,32 @@ urity Group +request for %7B0%7D: '%0A
afb6dfe54043c34f19473e771503b5460e29dace
Add missing import
src/zeit/content/cp/browser/editor.py
src/zeit/content/cp/browser/editor.py
from zeit.content.cp.i18n import MessageFactory as _ import zeit.cms.browser.view import zeit.edit.browser.view import zope.interface import zope.lifecycleevent import zope.security.proxy import zope.traversing.browser class Editor(object): title = _('Edit centerpage') def validate(self, area): vali...
Python
0.000466
@@ -67,32 +67,80 @@ ms.browser.view%0A +import zeit.cms.workingcopy.browser.workingcopy%0A import zeit.edit
c58a4829918f275941e96fed880f65da7f0474a5
Create database_mappings directory
luigi/tasks/export/ftp/id_mapping/database_mappings.py
luigi/tasks/export/ftp/id_mapping/database_mappings.py
# -*- coding: utf-8 -*- """ Copyright [2009-2017] EMBL-European Bioinformatics Institute 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...
Python
0.000001
@@ -606,16 +606,27 @@ e.%0A%22%22%22%0A%0A +import os%0A%0A import l @@ -1031,16 +1031,70 @@ as raw:%0A + os.makedirs(export().database_mappings())%0A
ebae9ae0f5aadad8dbe4ccb9a89137c1d7b6c5bc
Fix pep8
sshagentmux/upstream_socket_thread.py
sshagentmux/upstream_socket_thread.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2015, IBM # 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/...
Python
0.000001
@@ -744,16 +744,17 @@ ame__)%0A%0A +%0A class Up @@ -1983,100 +1983,8 @@ sg)%0A - LOG.warning(%22upstream agent error: message didn't receive a response:%22)%0A @@ -2096,29 +2096,31 @@ tream agent -error +request : %25s%22 %25 chun @@ -2479,17 +2479,19 @@ msg%5Bi:i -+ + + 16%5D)%0A%0A...
7acb1962b6119a9895e8847b128e6694632ae15c
test char and string parameter methods
tests/test_model.py
tests/test_model.py
from pyscipopt import Model def test_model(): # create solver instance s = Model() # add some variables x = s.addVar("x", vtype = 'C', obj = 1.0) y = s.addVar("y", vtype = 'C', obj = 2.0) assert x.getObj() == 1.0 assert y.getObj() == 2.0 s.setObjective(4.0 * y + 10.5, clear = False) ...
Python
0
@@ -82,24 +82,349 @@ = Model()%0A%0A + # test parameter methods%0A pric = s.getParam('lp/pricing')%0A s.setParam('lp/pricing', 'q')%0A assert 'q' == s.getParam('lp/pricing')%0A s.setParam('lp/pricing', pric)%0A s.setParam('visual/vbcfilename', 'vbcfile')%0A assert 'vbcfile' == s.getParam('visual/...
1f560a21e0b901f9f0c786f864111a0e92951f5d
fix test
tests/test_price.py
tests/test_price.py
import unittest import dedupe from dedupe.variables.fieldclasses import PriceType class TestPrice(unittest.TestCase): def test_comparator(self) : assert PriceType.comparator(1, 10) == 1 assert PriceType.comparator(10, 1) == 1
Python
0.000002
@@ -49,20 +49,13 @@ les. -fieldclasses +price imp
9ade5ad4da22d8bb200edaf7b4137522c19525f0
Set module category
delivery_carrier_label_postlogistics/__openerp__.py
delivery_carrier_label_postlogistics/__openerp__.py
# -*- coding: utf-8 -*- # © 2013-2016 Yannick Vaucher (Camptocamp SA) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). {'name': 'PostLogistics Labels WebService', 'version': '9.0.1.1.0', 'author': "Camptocamp,Odoo Community Association (OCA)", 'maintainer': 'Camptocamp', 'license': 'AGPL-3', 'c...
Python
0.000001
@@ -324,23 +324,24 @@ gory': ' -version +Delivery ',%0A 'com
bf4d51ea0b00e091728ecf8d4d51aa295448a416
fix error exit when doing spack patch without parameters, same as spack stage
lib/spack/spack/cmd/patch.py
lib/spack/spack/cmd/patch.py
############################################################################## # Copyright (c) 2013, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 ...
Python
0
@@ -1218,16 +1218,44 @@ gparse%0A%0A +import llnl.util.tty as tty%0A import s
00bf4fa13f4044a5becc6beea5fe3f62d484bb42
Delete unnecessary import
tests/test_tools.py
tests/test_tools.py
from windpowerlib.tools import smallest_difference, linear_extra_interpolation import pandas as pd import numpy as np from pandas.util.testing import assert_series_equal from numpy.testing import assert_array_equal, assert_allclose class TestTools: def test_smallest_difference(self): data_frame = pd.Data...
Python
0.000003
@@ -211,25 +211,8 @@ qual -, assert_allclose %0A%0A%0Ac
677c2859c75fbafe4ee5e1fb2b90d7e8da881120
Update csrf test to be compatible with Django 1.8
tests/test_views.py
tests/test_views.py
from django.middleware.csrf import get_token as get_csrf_token from freezegun import freeze_time from pretend import stub from rest_framework.test import APIRequestFactory from django_postcode_lookup import views from django_postcode_lookup.backends.base import PostcodeLookupResult def test_valid_api_key(): rf =...
Python
0
@@ -19,21 +19,16 @@ ware -.csrf import get_ @@ -27,35 +27,12 @@ ort -get_token as get_csrf_token +csrf %0Afro @@ -472,25 +472,15 @@ csrf -_token = get_csrf +.rotate _tok @@ -526,26 +526,43 @@ ken'%5D = -csrf_token +request.META%5B'CSRF_COOKIE'%5D %0A req @@ -597,18 +597,35 @@ %5D = -csrf_token +reques...
826734a3300000f475c5ecf9cd301b0b119c6eec
add XML namespace
tests/twisted/ns.py
tests/twisted/ns.py
AMP = "http://jabber.org/protocol/amp" BYTESTREAMS = 'http://jabber.org/protocol/bytestreams' CHAT_STATES = 'http://jabber.org/protocol/chatstates' CAPS = "http://jabber.org/protocol/caps" DISCO_INFO = "http://jabber.org/protocol/disco#info" DISCO_ITEMS = "http://jabber.org/protocol/disco#items" FEATURE_NEG = 'http://j...
Python
0.000002
@@ -2770,16 +2770,61 @@ x:data'%0A +XML = 'http://www.w3.org/XML/1998/namespace'%0A X_OOB =
945380713f1b44c4ddc5a23926cdbb7f261a6b0a
Add test_util_o2sat(self) and test_util_convert_to_mll(self)
tests/unit_tests.py
tests/unit_tests.py
#!/usr/bin/env python import os import sys import unittest parentDir = os.path.join(os.path.dirname(__file__), "../") sys.path.insert(0, parentDir) from oxyfloat import ArgoData class DataTest(unittest.TestCase): def setUp(self): self.ad = ArgoData(verbosity=2) self.good_oga_floats = ['1900650'] ...
Python
0.001533
@@ -172,16 +172,43 @@ ArgoData +%0Afrom oxyfloat import utils %0A%0Aclass @@ -2577,16 +2577,625 @@ mo_list) +%0A%0A def test_util_o2sat(self):%0A # See http://www.engineeringtoolbox.com/oxygen-solubility-water-d_841.html%0A self.assertAlmostEqual(utils.o2sat(35, 5), 308, places=0)%0A self.as...
8cfd48449262caa19b0795d4b6c1c537372d0782
add forward referencing
frappe/core/page/background_jobs/background_jobs.py
frappe/core/page/background_jobs/background_jobs.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from typing import TYPE_CHECKING, Dict, List from rq import Queue, Worker import frappe from frappe import _ from frappe.utils import cint, convert_utc_to_user_timezone, format_datetime from frappe.utils.background_job...
Python
0.000002
@@ -581,17 +581,9 @@ iled -: bool = += Fals @@ -709,19 +709,21 @@ ob(job: +' Job +' , name: @@ -1770,24 +1770,16 @@ d_jobs() - -%3E None :%0A%09conn @@ -2061,24 +2061,16 @@ status() - -%3E None :%0A%09if is
ea7401b4f2617a13ab829fe217c9cf2f5dab66a5
Fix common.send_file to use pathclass.
frontends/etiquette_flask/etiquette_flask/common.py
frontends/etiquette_flask/etiquette_flask/common.py
import flask; from flask import request import os import mimetypes import traceback import etiquette from voussoirkit import pathclass from . import jsonify from . import sessions root_dir = pathclass.Path(__file__).parent.parent TEMPLATE_DIR = root_dir.with_child('templates') STATIC_DIR = root_dir.with_child('st...
Python
0
@@ -2299,30 +2299,16 @@ -if isinstance( filepath , pa @@ -2303,17 +2303,18 @@ filepath -, + = pathcla @@ -2324,137 +2324,47 @@ Path -):%0A filepath = filepath.absolute_path%0A%0A try:%0A file_size = os.path.getsize(filepath)%0A except FileNotFoundError +(filepath)%0A%0A if not filepat...
a5ba9dd2858ddc1c9a3f32a2c554fc90de63c213
return None if no variable name found
libheap/pydbg/pygdbpython.py
libheap/pydbg/pygdbpython.py
import sys from functools import wraps from libheap.frontend.printutils import print_error try: import gdb except ImportError: print("Not running inside of GDB, exiting...") sys.exit() def gdb_is_running(f): "decorator to make sure gdb is running" @wraps(f) def _gdb_is_running(*args, **kwa...
Python
0.998539
@@ -4008,16 +4008,37 @@ ed.%5Cn%22)%0A + try:%0A @@ -4087,16 +4087,204 @@ ariable) +%0A except ValueError:%0A # variable was not found%0A return None%0A except ValueError:%0A # variable was not found%0A return None %0A%0A ...
2bc0c286ab0cb6b63a905885c78292bb7baff02d
Delete unused modules
tests/chainer_tests/functions_tests/pooling_tests/test_upsampling_2d.py
tests/chainer_tests/functions_tests/pooling_tests/test_upsampling_2d.py
from chainer import functions as F from chainer import cuda from chainer import gradient_check from chainer import testing from chainer import Variable from chainer.testing import attr from chainer.testing import condition from chainer.utils import conv from models import upsampling_2d import chainer.functions as F im...
Python
0.000001
@@ -1,39 +1,4 @@ -from chainer import functions as F%0A from @@ -85,37 +85,8 @@ ing%0A -from chainer import Variable%0A from @@ -258,36 +258,13 @@ ort -cupy%0Aimport numpy%0Aimport six +numpy %0Aimp
b465ccc9b26bdf6f06cfc3f72df2cbdb01c597e4
fix sentry logging in conjunction with celery
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/taskapp/celery.py
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/taskapp/celery.py
{% if cookiecutter.use_celery == "y" %} from __future__ import absolute_import import os from celery import Celery from django.apps import AppConfig from django.conf import settings if not settings.configured: # set the default Django settings module for the 'celery' program. os.environ.setdefault("DJANGO_SETT...
Python
0
@@ -174,16 +174,144 @@ settings +%0A%7B%25 if cookiecutter.use_sentry == %22y%22 -%25%7D%0Afrom raven import Client%0Afrom raven.contrib.celery import register_signal%0A%7B%25- endif %25%7D %0A%0Aif not @@ -927,16 +927,272 @@ =True)%0A%0A + %7B%25 if cookiecutter.use_sentry == %22y%22 -%25%7D%0A if has...
1079a39e5f337435f5947882b1ec93952c59966f
Verify key script in initramfs contents
VMEncryption/main/oscrypto/ubuntu_1404/encryptstates/PatchBootSystemState.py
VMEncryption/main/oscrypto/ubuntu_1404/encryptstates/PatchBootSystemState.py
#!/usr/bin/env python # # VM Backup extension # # Copyright 2015 Microsoft Corporation # # 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
@@ -714,16 +714,46 @@ t sleep%0A +from CommandExecutor import *%0A from OSE @@ -5350,32 +5350,426 @@ -k all', True)%0A +%0A proc_comm = ProcessCommunicator()%0A self.command_executor.ExecuteInBash(command_to_execute=%22lsinitramfs /boot/initrd*%22,%0A raise_e...
36a219c81dfe1aae945ee37cc1405686c3b2d362
Fix migration step for evaluation tables
migrations/versions/201507271114_3fcf833adc2d_add_evaluation_tables.py
migrations/versions/201507271114_3fcf833adc2d_add_evaluation_tables.py
"""Add evaluation tables Revision ID: 3fcf833adc2d Revises: 3778dc365e54 Create Date: 2015-07-27 11:14:06.639780 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql from indico.core.db.sqlalchemy import UTCDateTime # revision identifiers, used by Alembic. revision = '3fcf8...
Python
0.000002
@@ -831,36 +831,35 @@ eTime, nullable= -Fals +Tru e),%0A sa.C @@ -888,36 +888,35 @@ eTime, nullable= -Fals +Tru e),%0A sa.C @@ -3105,32 +3105,149 @@ chema='events')%0A + op.drop_constraint('fk_evaluation_questions_evaluation_id_evaluations', 'evaluation_questions', schema='events')%0A op.drop...
2886a147d5c815d341e1b52a3301cb1f93ef9745
edit conflict
project/acrobot/ros/acrobot/acrobot_control/scripts/acrobot_control.py
project/acrobot/ros/acrobot/acrobot_control/scripts/acrobot_control.py
#!/usr/bin/env python import rospy import math from std_msgs.msg import Float64 from math import sin,cos,atan,atan2,sqrt,fabs from numpy import * from sensor_msgs.msg import JointState def error_state(qd, q): dq = qd%(2*pi) - q%(2*pi) if dq > pi: dq = dq - 2*pi elif dq <= -pi: dq = dq + 2...
Python
0.000001
@@ -332,16 +332,17 @@ urn dq%0A%0A +%0A class Ac @@ -955,32 +955,33 @@ = sin(q%5B0:2,:%5D)%0A +%0A s12 = si
462a24e3e78d3bd6ba7346f8e14fdfa18f726378
Switch test_misc to pytest
databroker/tests/test_misc.py
databroker/tests/test_misc.py
from ..utils.diagnostics import watermark from databroker.pims_readers import Images, get_images from databroker import DataBroker as db from ..examples.sample_data import image_and_scalar from metadatastore.test.utils import mds_setup, mds_teardown from filestore.test.utils import fs_setup, fs_teardown import numpy as...
Python
0.000001
@@ -1,415 +1,899 @@ -from ..utils.diagnostics import watermark +import time as ttime%0Aimport uuid%0A%0Aimport numpy as np%0Aimport pytest%0Afrom filestore.test.utils import fs_setup, fs_teardown%0Afrom metadatastore.commands import insert_run_start %0Afrom -databroker.pims_readers import Images, get_images%0Afrom da...
5a193b2cc977b88bc82506c4fec1610c6ce10467
Remove pathlib cause of python3.2
abcmd/config.py
abcmd/config.py
"""Mixins for building configurations for commands.""" import importlib import logging import os import pprint import sys import types from pathlib import Path if sys.version_info.minor < 5: import collections as cabc from .typingstub import Any, Union, Sequence, Mapping, Callable, IO else: import collect...
Python
0.000017
@@ -49,16 +49,28 @@ ds.%22%22%22%0A%0A +import glob%0A import i @@ -144,33 +144,8 @@ ypes -%0Afrom pathlib import Path %0A%0Aif @@ -2690,37 +2690,8 @@ %5D:%0A%0A - pathobj = Path(path)%0A @@ -2755,19 +2755,16 @@ mat(path -obj ))%0A @@ -2790,21 +2790,37 @@ ter( -path +gl ob -j .glob( +os.path...
27b04ec5b8f425330280743f7dc064c74063497e
Fix collection test
tests/test_create_collection.py
tests/test_create_collection.py
"""Test create collection from graph.""" import pytest import vt_graph_api import vt_graph_api.errors test_graph = vt_graph_api.VTGraph( "Dummy api key", verbose=False, private=False, name="Graph test", user_editors=["agfernandez"], group_viewers=["virustotal"]) def test_create_collection(mocker): m = moc...
Python
0
@@ -591,17 +591,16 @@ _url == -( %22https:/ @@ -638,55 +638,12 @@ ion/ -%22%0A %22%7Bcollection_url%7D%22.format(collection_url= +new_ coll @@ -652,13 +652,10 @@ tion -_url) +%22%0A )%0A%0A%0A
fe15ccd772f39fc397967b86a625e0f82870e315
Fix formatting
tests/test_hector_comparison.py
tests/test_hector_comparison.py
# -*- coding: utf-8 -*- import os import subprocess import pandas as pd from pandas.util.testing import assert_series_equal import pytest import pyhector from pyhector import ( Hector, rcp26, rcp45, rcp60, rcp85, read_hector_input, read_hector_output ) path = os.path.dirname(__file__) rcps = { 'rcp26': rc...
Python
0.057169
@@ -806,17 +806,19 @@ %0A ver -= + = %5B%22awk%22, @@ -859,16 +859,18 @@ t $3%7D%22,%0A +
2666dcbdb42fa562f75c5404e34ce3feb7e542bc
Fix naming of test class.
tests/test_match_manipulator.py
tests/test_match_manipulator.py
import unittest2 from google.appengine.ext import db from google.appengine.ext import testbed from helpers.match_manipulator import MatchManipulator from models.event import Event from models.match import Match class TestTeamManipulator(unittest2.TestCase): def setUp(self): self.testbed = testbed.Testbed...
Python
0.00001
@@ -221,12 +221,13 @@ Test -Team +Match Mani
10fd721038060e39cb6f978e12de585c78d0f7b5
Fix import path
datasets/data_provider.py
datasets/data_provider.py
# -*- coding: utf-8 -*- """ Created on Tue Jan 10 00:15:50 2017 @author: sakurai """ import numpy as np from sklearn.preprocessing import LabelEncoder from fuel.streams import DataStream from fuel.schemes import BatchSizeScheme, SequentialScheme from cars196_dataset import Cars196Dataset from datasets.cub200_2011_da...
Python
0.000012
@@ -290,25 +290,16 @@ et%0Afrom -datasets. cub200_2 @@ -345,17 +345,8 @@ rom -datasets. onli
dd41b0b0d7aeac096deab366e4ceabed28f78fd2
fix test_describe_snapshots by using OrderedDict
tests/unit/ec2/test_snapshot.py
tests/unit/ec2/test_snapshot.py
from tests.unit import AWSMockServiceTestCase from boto.ec2.connection import EC2Connection from boto.ec2.snapshot import Snapshot class TestDescribeSnapshots(AWSMockServiceTestCase): connection_class = EC2Connection def default_body(self): return b""" <DescribeSnapshotsResponse xmlns="...
Python
0.000001
@@ -125,16 +125,52 @@ napshot%0A +from boto.compat import OrderedDict%0A %0A%0Aclass @@ -1791,17 +1791,30 @@ ers= -%7B +OrderedDict((( 'status' : 'p @@ -1809,17 +1809,17 @@ 'status' -: +, 'pendin @@ -1812,32 +1812,33 @@ atus', 'pending' +) ,%0A @@ -1893,16 +1893,29 @@ + ( ...
de59cc4ec06d3666fc9b8e32272b723ed37501fb
Update docx_parser.py
textract/parsers/docx_parser.py
textract/parsers/docx_parser.py
import docx from .utils import BaseParser class Parser(BaseParser): """Extract text from docx file using python-docx. """ def extract(self, filename, **kwargs): text = "" document = docx.Document(filename) # Extract text from root paragraphs text += '\n\n'.join([ paragraph.text for paragraph in docum...
Python
0.000001
@@ -64,17 +64,20 @@ arser):%0A -%09 + %22%22%22Extra @@ -122,15 +122,21 @@ cx.%0A -%09 + %22%22%22%0A%0A -%09 + def @@ -170,18 +170,24 @@ wargs):%0A -%09%09 + text = %22 @@ -188,18 +188,24 @@ xt = %22%22%0A -%09%09 + document @@ -232,18 +232,24 @@ ename)%0A%0A -%09%09 + #...
798d9efed1bf792c6db2f3c008c0017a35fa7943
Version 1.0.6
tle_storage_service/__init__.py
tle_storage_service/__init__.py
from .db import * from .log import LOG_FORMAT from .middlewares import * from .server import * from .tle import * from .utils import * from .web import * __version__ = '1.0.5' __all__ = ( db.__all__ + middlewares.__all__ + server.__all__ + tle.__all__ + utils.__all__ + web.__all__ + ('db',...
Python
0.000001
@@ -171,9 +171,9 @@ 1.0. -5 +6 '%0A%0A_