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
603dbd5deb9c1008a8149308d7edd9aacc34d28c
Update test_pypi_helper.py
_unittests/ut_loghelper/test_pypi_helper.py
_unittests/ut_loghelper/test_pypi_helper.py
""" @brief test log(time=42s) """ import sys import os import unittest import datetime if "temp_" in os.path.abspath(__file__): raise ImportError( "this file should not be imported in that location: " + os.path.abspath(__file__)) from pyquickhelper.loghelper import fLOG from pyquickhelper.lo...
Python
0.000004
@@ -274,29 +274,50 @@ per. -loghelper import fLOG +pycode import ExtTestCase, skipif_circleci %0Afro @@ -348,16 +348,22 @@ r import + fLOG, enumera @@ -428,16 +428,59 @@ Case):%0A%0A + @skipif_circleci(%22connectivity issue%22)%0A def
c47279b32af2fac33ef50ed9cad454896951e0f1
update notrebooks
_unittests/ut_notebooks/test_1A_notebook.py
_unittests/ut_notebooks/test_1A_notebook.py
#-*- coding: utf-8 -*- """ @brief test log(time=60s) """ import sys import os import unittest try: import src except ImportError: path = os.path.normpath( os.path.abspath( os.path.join( os.path.split(__file__)[0], "..", ".."))) if p...
Python
0
@@ -50,9 +50,9 @@ ime= -6 +5 0s)%0A @@ -875,369 +875,573 @@ lder -%0Afrom src.ensae_teaching_cs.automation.notebook_test_helper import ls_notebooks, execute_notebooks, clean_function_1a, unittest_raise_exception_notebook%0A%0A%0Aclass TestNotebookRunner1a_ (unittest.TestCase):%0A%0A def test_notebook_runner_1a(se...
536fc5bc3ea05bb3577e18e470d26e83ea8fdfb6
replace available_power_ac_types with available_ac_types('power')
nilmtk/dataset_converters/ukdale/convert_ukdale.py
nilmtk/dataset_converters/ukdale/convert_ukdale.py
from __future__ import print_function, division from os import remove from os.path import join import pandas as pd from nilmtk.dataset_converters.redd.convert_redd import (_convert, _load_csv) from nilmtk.utils import get_module_directory from nilmtk import DataSet from nilmtk.utils import get_datastore from nilmtk.dat...
Python
0.000072
@@ -2633,14 +2633,8 @@ ble_ -power_ ac_t @@ -2638,16 +2638,23 @@ c_types( +'power' )%0A uk
931e2d1e8ba3fd6b129a6d74e3a1ad9984c1938a
Add benchmark tests for numpy.random.randint.
benchmarks/benchmarks/bench_random.py
benchmarks/benchmarks/bench_random.py
from __future__ import absolute_import, division, print_function from .common import Benchmark import numpy as np class Random(Benchmark): params = ['normal', 'uniform', 'weibull 1', 'binomial 10 0.5', 'poisson 10'] def setup(self, name): items = name.split() name = items.pop(...
Python
0.000001
@@ -109,16 +109,51 @@ y as np%0A +from numpy.lib import NumpyVersion%0A %0A%0Aclass @@ -701,8 +701,931 @@ self.a)%0A +%0A%0Aclass Randint(Benchmark):%0A%0A def time_randint_fast(self):%0A %22%22%22Compare to uint32 below%22%22%22%0A np.random.randint(0, 2**30, size=10**5)%0A%0A def time_randint_...
d8b66d5398bdd52bdeb7d8992dbb38158dc96425
Add a few extensions
identify/extensions.py
identify/extensions.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals EXTENSIONS = { 'apinotes': {'text', 'apinotes'}, 'asar': {'binary', 'asar'}, 'bash': {'text', 'shell', 'bash'}, 'bat': {'text', 'batch'}, 'bz2': {'binary', 'bzip2'}, 'c': {'text', 'c'}, '...
Python
0.000002
@@ -248,24 +248,66 @@ , 'batch'%7D,%0A + 'bmp': %7B'binary', 'image', 'bitmap'%7D,%0A 'bz2': %7B @@ -2371,24 +2371,52 @@ t', 'php'%7D,%0A + 'pl': %7B'text', 'perl'%7D,%0A 'plist': @@ -2606,26 +2606,78 @@ 'r -b': %7B'text', 'ruby +': %7B'text', 'r'%7D,%0A 'rb': %7B'text', 'ruby'%7D,%0A 'rs': %...
bebfca24ae03c7009306a07ff030aa9f99020494
Fix __unicode__ method of docdata transaction
bluebottle/payments_docdata/models.py
bluebottle/payments_docdata/models.py
from decimal import Decimal from django.conf import settings from django.db import models from django.utils.translation import ugettext as _ from bluebottle.payments.exception import PaymentException from bluebottle.payments.models import Payment, Transaction class AbstractDocdataPayment(Payment): """ Abstract ...
Python
0.998839
@@ -6906,12 +6906,21 @@ urn +unicode( self.id +) %0A
343eea168bfa0e84e173dd053f4740c42a58e3d4
Upgrade BeautifulSoup
buildtools/generate-examples-index.py
buildtools/generate-examples-index.py
import os import bs4 from mako.template import Template from argparse import ArgumentParser if __name__ == '__main__': examples = [] parser = ArgumentParser() parser.add_argument( '--app', action='append', nargs=3, metavar=('TITLE', 'HREF', 'DESC'), help='Add an application', default=[], ...
Python
0
@@ -845,16 +845,31 @@ plefile) +, %22html.parser%22 )%0A
2d468bc1ae5de19bbc89750e5c011657f790218d
Update type annotations
src/pybel/struct/mutation/metadata.py
src/pybel/struct/mutation/metadata.py
# -*- coding: utf-8 -*- """Functions to modify the metadata of graphs, their edges, and their nodes.""" import logging from ..pipeline import in_place_transformation from ...constants import ANNOTATIONS, CITATION, CITATION_REFERENCE, CITATION_TYPE __all__ = [ 'strip_annotations', 'add_annotation_value', ...
Python
0
@@ -461,26 +461,34 @@ tions(graph) + -%3E None :%0A - %22%22%22Strip @@ -774,32 +774,50 @@ , annotation +: str , value -) +: str) -%3E None :%0A %22%22%22Add @@ -910,36 +910,32 @@ aph:%0A :param -str annotation:%0A @@ -933,36 +933,32 @@ ion:%0A :param -str value:%0A %22%22%22%0A @@ -1...
4b9df17e4fe02de4e12440372f660d1902e352d8
add ping api to dummyom
src/python/openflow/dummyom/ch_api.py
src/python/openflow/dummyom/ch_api.py
''' Created on May 13, 2010 @author: jnaous ''' from expedient.common.rpc4django import rpcmethod from django.contrib.auth.models import User from pprint import pprint, pformat from models import DummyOM, DummyOMSlice, DummyCallBackProxy from expedient.common.utils import create_or_update from decorator import decorat...
Python
0
@@ -3612,20 +3612,292 @@ sword%0A return %22%22%0A +%0A@check_verified_user%0A@rpcmethod(signature=%5B'string', 'string'%5D, url_name=%22dummyom_rpc%22)%0Adef ping(data, **kwargs):%0A '''%0A Test method to see that everything is up.%0A return a string that is %22PONG: %25s%22 %25 data%0A '''%0A print...
17cf2f15ec3256ae88bb7c6d204e0702fbf5e681
add missing import
cassandra/cqlengine/table_iterator.py
cassandra/cqlengine/table_iterator.py
class TableIterator(object): """ Iterates over a Cassandra table defined by a cqlengine model class using query paging in order to pull back chunks of data that have `blocksize` number of records. Can optionally provide kwargs which are used as where clause filters. These kwargs must be columns on the m...
Python
0.000042
@@ -1,12 +1,44 @@ +from cassandra import cqlengine%0A class TableI
267ed5a924d9097f27653cc6cd5c64b772709bd7
Update load_curve_supply.py
cea/plots/demand/load_curve_supply.py
cea/plots/demand/load_curve_supply.py
""" Implements the Load Curve Supply plot. """ from __future__ import division from __future__ import print_function import plotly.graph_objs as go import cea.plots.demand from cea.plots.variable_naming import NAMING, COLOR class LoadCurveSupplyPlot(cea.plots.demand.DemandPlotBase): """Implement the load-curve-...
Python
0.000001
@@ -1319,24 +1319,117 @@ RID_l_kWh',%0A + 'GRID_v_kWh',%0A 'GRID_ve_kWh',%0A
ca8e15d50b816c29fc2a0df27d0266826e38b5b8
Update serializer to deal with new model
cellcounter/statistics/serializers.py
cellcounter/statistics/serializers.py
from rest_framework.serializers import ModelSerializer from .models import CountInstance class CountInstanceSerializer(ModelSerializer): class Meta: model = CountInstance
Python
0
@@ -166,20 +166,54 @@ del = CountInstance%0A + fields = ('count_total',)%0A
9bf08f2a47ff3cd4d7d52547a389eb2dc3ed0dcd
change default color map
chainercv/visualizations/vis_label.py
chainercv/visualizations/vis_label.py
from __future__ import division import numpy as np def vis_label( label, label_names=None, label_colors=None, ignore_label_color=(0, 0, 0), alpha=1, ax=None): """Visualize a label for semantic segmentation. Example: >>> from chainercv.datasets import VOCSemanticSegmentationDataset ...
Python
0.000001
@@ -47,16 +47,342 @@ as np%0A%0A%0A +def _default_cmap(label):%0A %22%22%22Color map used in PASCAL VOC%22%22%22%0A r, g, b = 0, 0, 0%0A i = label%0A for j in range(8):%0A if i & (1 %3C%3C 0):%0A r %7C= 1 %3C%3C (7 - j)%0A if i & (1 %3C%3C 1):%0A g %7C= 1 %3C%3C (7 - j)%...
56b11241909758f41ec924d761db3762c14698a6
Correct source filtering
changes/api/project_commit_details.py
changes/api/project_commit_details.py
from __future__ import absolute_import, division, unicode_literals from sqlalchemy.orm import joinedload from changes.api.base import APIView from changes.models import Build, Project, Revision, Source class ProjectCommitDetailsAPIView(APIView): def get(self, project_id, commit_id): project = Project.ge...
Python
0.000002
@@ -98,16 +98,32 @@ inedload +, contains_eager %0A%0Afrom c @@ -747,28 +747,98 @@ -joinedload('source') +contains_eager('source'),%0A ).join(%0A Source, Build.source_id == Source.id ,%0A
0beca7bc0cd81a89fa00602ae5860a46f18e077e
Fix convert_engine under Windows
sorl/thumbnail/engines/convert_engine.py
sorl/thumbnail/engines/convert_engine.py
from __future__ import unicode_literals, with_statement import re import os import subprocess from tempfile import NamedTemporaryFile from django.utils.datastructures import SortedDict from django.utils.encoding import smart_str from sorl.thumbnail.base import EXTENSIONS from sorl.thumbnail.conf import settings from ...
Python
0.000003
@@ -87,16 +87,32 @@ process%0A +import tempfile%0A from tem @@ -1428,69 +1428,64 @@ -with NamedTemporaryFile(suffix=suffix, mode='rb') as fp:%0A +os_handle, file_path = tempfile.mkstemp(suffix=suffix)%0A%0A @@ -1497,36 +1497,34 @@ rgs.append(f -p.name)%0A +ile_path)%0A args @@ -1547,20 +...
f945815794e6aef6b2465fe3c27e003a346cc19f
The task which checks ranking is repeated every 5 minutes.
app/soc/modules/gci/tasks/ranking_update.py
app/soc/modules/gci/tasks/ranking_update.py
#!/usr/bin/env python2.5 # # Copyright 2010 the Melange 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 applic...
Python
0.998666
@@ -2293,24 +2293,39 @@ tudent_logic +, repeat_in=600 )%0Adef recalc
ee4a1454764fcfad33ac86d3d2f87b2b7e1cce29
mock return true
rhizome/tests/test_api_geo.py
rhizome/tests/test_api_geo.py
import json from tastypie.test import ResourceTestCase from django.contrib.auth.models import User from setup_helpers import TestSetupHelpers from pandas import read_csv, notnull, to_datetime from rhizome.models import * from pandas import read_csv, notnull, to_datetime, DataFrame, Series from rhizome.cache_meta impor...
Python
0.999992
@@ -2128,16 +2128,17 @@ ocation%0A +%0A def
60a668f44b0311ed899e15d0069425f414068f9f
Update docker_events.py
salt/engines/docker_events.py
salt/engines/docker_events.py
# -*- coding: utf-8 -*- ''' Send events from Docker events :Depends: Docker API >= 1.22 ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import logging import traceback import salt.utils.json import salt.utils.event # pylint: disable=import-error try: import do...
Python
0.000004
@@ -1194,18 +1194,13 @@ -containers +event :%0A
c848357de7a81f23de8c7b6ad2962202171c2108
add unit test for issue_backlog
augur/datasources/augur_db/test_augur_db.py
augur/datasources/augur_db/test_augur_db.py
import os import pytest import pandas as pd @pytest.fixture(scope="module") def augur_db(): import augur augur_app = augur.Application() return augur_app['augur_db']() # def test_repoid(augur_db): # assert ghtorrent.repoid('rails', 'rails') >= 1000 # def test_userid(augur_db): # assert ghtorrent....
Python
0
@@ -3060,8 +3060,220 @@ '%5D == 7%0A +%0Adef test_issue_backlog(augur_db):%0A #repo_id%0A assert augur_db.issue_backlog(21, 21166).iloc%5B0%5D%5B'issue_backlog'%5D == 4%0A%0A #repo_group_id%0A assert augur_db.issue_backlog(21).iloc%5B2%5D%5B'issue_backlog'%5D == 3%0A
e12ff6d2f8c4b872045e249ff238af48de908761
Fix backup schedule update action [WAL-2411]
src/waldur_core/structure/metadata.py
src/waldur_core/structure/metadata.py
from collections import OrderedDict from django.utils.encoding import force_text from django.utils.http import urlencode from rest_framework import exceptions from rest_framework import serializers from rest_framework.metadata import SimpleMetadata from rest_framework.request import clone_request from rest_framework.r...
Python
0
@@ -3233,38 +3233,16 @@ 'PUT')%0A - else:%0A
b2f9f5ec0894fcba54efdc6f8e188b77ef2bedf7
Make modules uninstallable
base_report_auto_create_qweb/__openerp__.py
base_report_auto_create_qweb/__openerp__.py
# -*- encoding: utf-8 -*- ############################################################################## # # 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...
Python
0
@@ -1632,17 +1632,17 @@ %5D,%0A -%22 +' installa @@ -1648,14 +1648,15 @@ able -%22: Tru +': Fals e,%0A%7D
d55d78cccf69e5e4b3dc759d37c98dacf5309596
Update test_models.py
bluebottle/assignments/tests/test_models.py
bluebottle/assignments/tests/test_models.py
from datetime import timedelta, date from django.core import mail from bluebottle.assignments.tests.factories import AssignmentFactory, ApplicantFactory from bluebottle.test.utils import BluebottleTestCase class AssignmentTestCase(BluebottleTestCase): def test_absolute_url(self): activity = AssignmentFa...
Python
0.000008
@@ -2404,8 +2404,966 @@ ox), 0)%0A +%0A def test_check_status_capacity_changed(self):%0A assignment = AssignmentFactory(%0A title='Test Title',%0A status='open',%0A end_date=date.today() + timedelta(days=4),%0A capacity=3,%0A )%0A ApplicantFactory.cre...
a17be5b9e792d3ba5de333490c49b7be89efedcd
Fix to work
src/zstt/src/motion_control_server.py
src/zstt/src/motion_control_server.py
#!/usr/bin/env python from zstt.srv import MotionControl, MotionControlResponse import constants as c import rospy import rospkg import os import yaml NAME = 'motion_control_server' previous_command = None previous_data = None commands = {} def get_command_from_file(): global commands package_path = rosp...
Python
0.000001
@@ -807,17 +807,17 @@ , head_u -p +d , head_i @@ -1797,17 +1797,18 @@ nd('init -W +_w alk', re @@ -1820,33 +1820,33 @@ d_lr, req.head_u -p +d , req.head_init) @@ -1987,17 +1987,17 @@ q.head_u -p +d , req.he
f4af03c4d575af77fed0279d49194018efb68bef
Add back quotes when using one big string.
calico_containers/tests/st/test_mainline.py
calico_containers/tests/st/test_mainline.py
from test_base import TestBase from sh import docker, ErrorReturnCode from time import sleep from docker_host import DockerHost class TestMainline(TestBase): def run_mainline(self, ip1, ip2): """ Setup two endpoints on one host and check connectivity. """ host = DockerHost('host') ...
Python
0
@@ -317,24 +317,26 @@ t')%0A%0A + # etcd_ip = d @@ -413,32 +413,58 @@ stdout.rstrip()%0A + etcd_ip = self.ip%0A etcd_por @@ -1502,32 +1502,33 @@ nspect --format +' %7B%7B .NetworkSetti @@ -1539,24 +1539,25 @@ IPAddress %7D%7D +' node1%22 %25 ca @@ -1642,16 +1642,17 @@ -format +' %7B%...
cbdf70bff1078a80167cfc54caab6b621907ceb6
migrate to pyiem and improve plotting some
scripts/current/today_high.py
scripts/current/today_high.py
# Output the 12z morning low temperature import sys import os, random import iemdb import iemplot import mx.DateTime now = mx.DateTime.now() IEM = iemdb.connect('iem', bypass=True) icursor = IEM.cursor() sql = """ select s.id, x(s.geom) as lon, y(s.geom) as lat, max_tmpf as high, s.network from summary_%s ...
Python
0
@@ -56,81 +56,115 @@ ort -os, random%0Aimport iemdb%0Aimport iem +matplotlib.cm as cm%0Aimport numpy as np%0Aimport datetime%0Afrom pyiem. plot -%0A%0A + import -mx.DateTime%0Anow = mx.DateT +MapPlot%0A%0Anow = datetime.datet ime. @@ -174,46 +174,90 @@ ()%0A%0A -IEM = iemdb.connect('iem', bypass=True +import ps...
27fb200a13095d92e429e83b819a9cb58855aea9
Fix from Joe Stelmach to allow the caller to set the api version to use
DynectDNS.py
DynectDNS.py
""" This library implements a class designed to wrap interactions with the Dynect Managed DNS API via its REST interface. After instantiating a L{DynectRest} object, call the L{DynectRest.connect} method and then the most commonly used method will be L{DynectRest.execute} Requires Python 2.6 or higher, or the "simpl...
Python
0
@@ -1376,16 +1376,39 @@ ssl=True +, api_version=%22current%22 ):%0A @@ -1949,25 +1949,27 @@ rsion = -%22current%22 +api_version %0A
400ce717ac043ceec404103dbaa87dd17d92feb7
allow specifying no timeout
src/vpp-api/python/vpp_papi/vpp_transport_socket.py
src/vpp-api/python/vpp_papi/vpp_transport_socket.py
# # VPP Unix Domain Socket Transport. # import socket import struct import threading import select import multiprocessing import queue import logging logger = logging.getLogger('vpp_papi.transport') logger.addHandler(logging.NullHandler()) class VppTransportSocketIOError(IOError): # TODO: Document different valu...
Python
0.000002
@@ -607,17 +607,20 @@ 0 else -1 +None %0A
6112900144886c378437b8d9832efa9b04c39645
Fix issue when data_dir=None is passed
tensorflow_datasets/core/community/register_path.py
tensorflow_datasets/core/community/register_path.py
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets 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.000129
@@ -3245,20 +3245,16 @@ -if ' data_dir ' in @@ -3253,12 +3253,10 @@ _dir -' in + = bui @@ -3266,16 +3266,48 @@ r_kwargs +.get('data_dir')%0A if data_dir :%0A @@ -3411,16 +3411,17 @@ +f 'Dataset @@ -3449,16 +3449,32 @@ nerated. + Got: %7Bdata_dir%7D '%0A
3f6f2e88116c1ae613a9af2eefba8ccd5df4886b
add test
test/bin/test_send_alerts_for_trigerred_monitors.py
test/bin/test_send_alerts_for_trigerred_monitors.py
import datetime from decimal import Decimal from mock import ANY, patch import pytz from decimal import Decimal from django.test import TestCase from freezegun import freeze_time from twilio.rest.resources import Messages from alert.services import monitor_service from bin.send_alerts_for_triggered_monitors import ma...
Python
0.000002
@@ -455,13 +455,9 @@ -19 -03:00 +3 :00' @@ -1412,16 +1412,12 @@ -19 -00 +3 :00 -:01 ')%0A @@ -1957,32 +1957,32 @@ '+12223334444',%0A - @@ -2183,8 +2183,861 @@ alled()%0A +%0A @patch.object(Messages, 'create')%0A @freeze_time('2017-01-19 2:59')%0A def test_does_not_send_sms_message_i...
1319e336afc9247380830a272a12d4e60ac02271
Print from get_files_from_folder Method deleted
swid_generator/environments/common.py
swid_generator/environments/common.py
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import os import stat import platform from distutils.spawn import find_executable from swid_generator.package_info import FileInfo from swid_generator.exceptions import RequirementsNotInstalledError from swid_gen...
Python
0.000002
@@ -2415,36 +2415,8 @@ es:%0A - print(file)%0A
6f4758b39c257dcabcabc6405cf400e8f6a358ea
Update develop version to 0.36.0
cpt/__init__.py
cpt/__init__.py
__version__ = '0.35.0-dev' def get_client_version(): from conans.model.version import Version from conans import __version__ as client_version from os import getenv # It is a mess comparing dev versions, lets assume that the -dev is the further release return Version(client_version.replace("-dev"...
Python
0
@@ -16,9 +16,9 @@ '0.3 -5 +6 .0-d
ae9ce769c3a51d19f101f83b6fbcb8087388bc43
fix test_set_timeout
t/unit/asynchronous/http/test_curl.py
t/unit/asynchronous/http/test_curl.py
import pytest from unittest.mock import Mock, call, patch from kombu.asynchronous.http.curl import READ, WRITE, CurlClient import t.skip pytest.importorskip('pycurl') @t.skip.if_pypy @pytest.mark.usefixtures('hub') class test_CurlClient: class Client(CurlClient): Curl = Mock(name='Curl') def tes...
Python
0.000004
@@ -3269,32 +3269,63 @@ _timeout(self):%0A + hub = Mock(name='hub')%0A x = self @@ -3324,32 +3324,35 @@ x = self.Client( +hub )%0A x._set @@ -3364,16 +3364,81 @@ out(100) +%0A hub.call_later.assert_called_with(100, x._timeout_check) %0A%0A de
5f4fd82378b991d3e20087ff7a15898c8c678177
Mask hidable subtypes on group map
src/groups/serializers.py
src/groups/serializers.py
from django.utils.translation import ugettext as _ from rest_framework import serializers, exceptions from front.utils import front_url from lib.serializers import ( LegacyBaseAPISerializer, LegacyLocationAndContactMixin, RelatedLabelField, UpdatableListSerializer, ExistingRelatedLabelField) from people.model...
Python
0
@@ -1488,151 +1488,167 @@ s = -RelatedLabel +serializers.SerializerMethod Field( +)%0A %0A - queryset=models.SupportGroupSubtype.objects.all(), many=True, required=False,%0A slug_field='description'%0A ) +def get_subtypes(self, object):%0A return %5Bs.description for s in object.subtypes.all...
523a410141bf5a55718d6867e783de4d8210ce8a
add workers
terminal-kafka-monitor/utils/kafka.py
terminal-kafka-monitor/utils/kafka.py
import subprocess import threading import logging from collections import namedtuple, defaultdict ZOOKEEPER_HOST = 'he-zookeeper-vpc.hackerearth.com:2181' BIN_PATH = '/home/praveen/kafka/kafka_2.9.2-0.8.1.1/bin' CONSUMER_OFFSET_CHECKER_CMD = ' '.join([ '{bin_path}/kafka-run-class.sh', 'kafka.tools.Consu...
Python
0.002618
@@ -2616,16 +2616,152 @@ roblems' +,%0A 'ConsumeParticipationEndedCodeAutoSubmit',%0A 'RealtimeCounterConsumer'%0A 'ConsumeFixSubmissionFileQueue',%0A %5D%0A%0Adef g
2d1e0d65eadde06642771092d382d4da041a57fe
Improve testing of make_web_service script.
test/backend/test_make_web_service.py
test/backend/test_make_web_service.py
import unittest import sys import os import tempfile import shutil from saliweb.make_web_service import MakeWebService import saliweb.backend import StringIO class RunInTempDir(object): """Simple RAII-style class to run a test in a temporary directory""" def __init__(self): self.origdir = os.getcwd() ...
Python
0
@@ -60,16 +60,48 @@ shutil%0A +import saliweb.make_web_service%0A from sal @@ -143,16 +143,29 @@ bService +, get_options %0Aimport @@ -2794,16 +2794,1778 @@ ' + f)%0A%0A + def test_get_options(self):%0A %22%22%22Check make_web_service get_options()%22%22%22%0A def run_get_options(args):%0A ...
0ce29ef16326b0388142b8e51fe659abd6388311
fix fetch example
examples/her/her_sac_gym_fetch_reach.py
examples/her/her_sac_gym_fetch_reach.py
import gym import rlkit.torch.pytorch_util as ptu from rlkit.data_management.obs_dict_replay_buffer import ObsDictRelabelingBuffer from rlkit.launchers.launcher_util import setup_logger from rlkit.samplers.data_collector import GoalConditionedPathCollector from rlkit.torch.her.her import HERTrainer from rlkit.torch.ne...
Python
0.000001
@@ -548,16 +548,97 @@ riant):%0A + # unwrap the TimeLimitEnv wrapper since we manually termiante after 50 steps%0A eval @@ -669,16 +669,20 @@ ach-v1') +.env %0A exp @@ -714,16 +714,20 @@ ach-v1') +.env %0A%0A ob @@ -3023,17 +3023,16 @@ ain()%0A%0A%0A -%0A if __nam
3083d40b6b8ccfa35ca97606372936f059c2b9e2
build script instructions adjusted
scripts/make_cocos_project.py
scripts/make_cocos_project.py
#!/usr/bin/python import argparse from scripting_utils import * set_log_tag('BUILD-APP') if __name__ != "__main__": error('Error. Do not import this script, but run it explicitly.') exit() # ------------------------------------------------------------------ # set arguments parser = argparse.ArgumentParser(de...
Python
0.000001
@@ -3093,35 +3093,39 @@ n %22scripts/build -.sh +_sdk.py %22 script with pr @@ -3640,11 +3640,15 @@ uild -.sh +_sdk.py %22 sc
e3082e0eb57987cc9dfdabf844557e65436a54fd
Remove unneeded enums
src/prover.py
src/prover.py
from bplib.bp import G1Elem, G2Elem from ilin2 import enc def inverse_perm(s): r = [None] * len(s) for index, value in enumerate(s): r[value] = index return r def step1a(n, gk, sigma, g1_polys, g1rho, g2_polys, g2rho): randoms = [gk.q.random() for i in range(n - 1)] # n-1 values inverte...
Python
0.000056
@@ -375,16 +375,20 @@ for +inv_ i, ri in @@ -392,44 +392,12 @@ in -enumerate(randoms):%0A inv_i = +zip( inve @@ -398,35 +398,43 @@ p(inverted_sigma -%5Bi%5D +, randoms): %0A p1_valu @@ -1214,38 +1214,46 @@ for +inv_ i, -( ri, Ai1 -) in -enum +zip(inv er -a te -(zip( +d_sigma, ran...
28bbb0f8928e45813d0b4a66b6122fe9c635b16b
Fix documentation for helpers gapic (#4830)
speech/google/cloud/speech_v1/helpers.py
speech/google/cloud/speech_v1/helpers.py
# Copyright 2017, Google LLC All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
Python
0
@@ -2185,32 +2185,34 @@ Args:%0A + config (:class:%60 @@ -2249,24 +2249,28 @@ nfig%60): The%0A + @@ -2308,32 +2308,34 @@ ream.%0A + requests (Iterab @@ -2379,24 +2379,28 @@ Request%60%5D):%0A + @@ -2432,134 +2432,408 @@ -options (:class:%60google.g...
5d01d4120b269abdef21a47324c37e45790f2b91
fix error message
examples/problem_grader/grader/views.py
examples/problem_grader/grader/views.py
from django.contrib.auth.forms import UserCreationForm from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth.decorators import login_required import logging import json import rubric_functions import...
Python
0.000002
@@ -4249,21 +4249,16 @@ n, model -_type =model,
f052ff59e99534c1e19559c4234a7916d40e606a
test against stories, nlu, domain
tests/docs/test_docs_training_data.py
tests/docs/test_docs_training_data.py
from pathlib import Path from typing import List, Text import re import pytest from rasa.shared.nlu.training_data.formats import RasaYAMLReader DOCS_BASE_DIR = Path("docs/") MDX_DOCS_FILES = list((DOCS_BASE_DIR / "docs").glob("**/*.mdx")) # we're matching codeblocks with either `yaml-rasa` or `yml-rasa` types # we ...
Python
0.000001
@@ -78,72 +78,332 @@ st%0A%0A -from rasa.shared.nlu.training_data.formats import RasaYAMLReader +import rasa.shared.utils.validation%0Afrom rasa.shared.core.training_data.story_reader.yaml_story_reader import (%0A CORE_SCHEMA_FILE,%0A)%0Afrom rasa.shared.nlu.training_data.formats.rasa_yaml import NLU_SCHEMA_FILE%0A...
3245946ff25889149dc60cf6b1364bd09c953809
Change url from relative to internal service endpoint
faas/puzzleboard-pop/puzzleboard_pop.py
faas/puzzleboard-pop/puzzleboard_pop.py
import json from datetime import datetime import requests from .model.puzzleboard import pop_puzzleboard class HuntwordsPuzzleBoardPopCommand(object): '''Command class that processes puzzleboard-pop message''' def run(self, jreq): '''Command that processes puzzleboard-pop message''' req = ...
Python
0.000001
@@ -773,23 +773,14 @@ = ' -/async-function +http:/ /puz @@ -796,17 +796,39 @@ consumed -' +.openfaas-fn:8080'%0A %0A dat
6ced04daf0258e1a5f265845e770b3a8accdd0b7
Fix for the previous fix...
wlauto/instrumentation/perf/__init__.py
wlauto/instrumentation/perf/__init__.py
# Copyright 2013-2015 ARM Limited # # 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 w...
Python
0
@@ -4042,18 +4042,18 @@ ce.platf -r o +r m == 'an
2c58fd815faae7e6b2aeb02a0d0b4aff9131c201
Bring more data into the test failure
tests/integration/states/test_cron.py
tests/integration/states/test_cron.py
""" Tests for the cron state """ import logging import salt.utils.platform from tests.support.case import ModuleCase from tests.support.helpers import slowTest from tests.support.unit import skipIf log = logging.getLogger(__name__) @skipIf(salt.utils.platform.is_windows(), "minion is windows") class CronTest(Modul...
Python
0.000001
@@ -41,16 +41,30 @@ logging +%0Aimport pprint %0A%0Aimport @@ -159,16 +159,42 @@ s import + skip_if_binaries_missing, slowTes @@ -333,16 +333,53 @@ ndows%22)%0A +@skip_if_binaries_missing(%22crontab%22)%0A class Cr @@ -501,32 +501,38 @@ %22%22%22%0A + ret = self.run_state( @@ -565,24 +565,43 @@ ...
efd31bf188239ac1ff5ede46c7543c1d9cd59bf8
fix docstrings
flocker/acceptance/endtoend/test_cli.py
flocker/acceptance/endtoend/test_cli.py
# Copyright ClusterHQ Inc. See LICENSE file for details. """ Tests for the ``flocker-deploy`` command line tool. """ from copy import deepcopy from subprocess import check_call from twisted.python.filepath import FilePath from twisted.trial.unittest import TestCase from yaml import safe_dump from ...control._confi...
Python
0.000101
@@ -779,58 +779,91 @@ ram -test_case: The %60%60TestCase%60%60 running this unit test +cluster: The %60%60Cluster%60%60 to which the supplied config should%0A be applied .%0A @@ -3106,58 +3106,67 @@ ram -test_case: The %60%60TestCase%60%60 running this unit test +cluster: The %60%60Cluster%60%60 to qu...
66d5018dd121f8e20db38992a571487f36215a66
Corrected wording in comment.
tests/modeltests/pagination/models.py
tests/modeltests/pagination/models.py
""" 30. Object pagination Django provides a framework for paginating a list of objects in a few lines of code. This is often useful for dividing search results or long lists of objects into easily readable pages. In Django 0.96 and earlier, a single ObjectPaginator class implemented this functionality. In the Django ...
Python
0.999703
@@ -4702,16 +4702,19 @@ cts with +out a count
54ba5ea1013e83235651dc45da9691ca387d9c6d
Update width and height in tests
tests/selenium/test_main_use_flows.py
tests/selenium/test_main_use_flows.py
import pytest from selenium.webdriver.common.by import By from applitools.geometry import Region from applitools.target import Target @pytest.mark.platform('Linux', 'Windows', 'macOS') @pytest.mark.usefixtures("eyes_session") @pytest.mark.parametrize('eyes', [ {'force_full_page_screenshot': True}, {'force_fu...
Python
0
@@ -522,18 +522,17 @@ width': -12 +8 00, 'hei @@ -537,17 +537,17 @@ eight': -8 +6 00%7D)%0A@py
902e08b963d918d99adf34b1007f32073ff1e1ff
fix broken build, due to py2 missed content variable
tests/test_upload_n_download_excel.py
tests/test_upload_n_download_excel.py
import pyexcel as pe from _compact import BytesIO, PY2 FILE_TYPE_MIME_TABLE = { "csv": "text/csv", "tsv": "text/tab-separated-values", "csvz": "application/zip", "tsvz": "application/zip", "ods": "application/vnd.oasis.opendocument.spreadsheet", "xls": "application/vnd.ms-excel", "xlsx": "a...
Python
0
@@ -1410,16 +1410,82 @@ utf-8')%0A + else:%0A content = io.getvalue()%0A
190c1a8b436f5ead14eddb1d2669c1ef7301159b
Test class for transformer
tests/transformer/test_transformer.py
tests/transformer/test_transformer.py
import os from nose.tools import assert_equals, assert_items_equal from rsk_mind.dataset import Dataset from rsk_mind.transformer import * class CustomTransformer(Transformer): class Feats(): a1 = Feat() a2 = Feat() f1 = CompositeFeat(['a1', 'a2']) def get_a1(self, feat): ret...
Python
0
@@ -134,16 +134,17 @@ port *%0A%0A +%0A class Cu @@ -173,16 +173,17 @@ ormer):%0A +%0A clas @@ -189,18 +189,16 @@ ss Feats -() :%0A @@ -231,17 +231,16 @@ Feat()%0A -%0A @@ -619,10 +619,10 @@ '1'%5D - , + %5B'0. @@ -635,16 +635,63 @@ ', '1'%5D%5D +%0A self.transformer = CustomTra...
6cc6de2effc0419a240c664f83174c9bf252e2cb
convert metadata to text
tests/unit/modules/test_mdadm_raid.py
tests/unit/modules/test_mdadm_raid.py
# -*- coding: utf-8 -*- ''' :codeauthor: Ted Strzalkowski (tedski@gmail.com) tests.unit.modules.mdadm_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals # Import Salt Testing libs from tests.support.mixins import LoaderM...
Python
0.000201
@@ -1631,17 +1631,16 @@ - '-l', '5 @@ -1640,34 +1640,16 @@ -l', '5' -,%0A %5D)%0A @@ -1704,17 +1704,16 @@ - '-e', 'd @@ -1737,17 +1737,16 @@ - '-n', '3 @@ -1748,17 +1748,16 @@ ', '3',%0A - @@ -1855,16 +1855,45 @@ %5B7:10%5D), +%0A ...
62d3c2f9e5fa1f53629bda6bef9f8e3396e45192
Fix references to grid size in bound mappable point
thesis/models/bound_mappable_point.py
thesis/models/bound_mappable_point.py
import logging from thesis.models import DBSession, Base, Layer, DEFAULT_PROJECTION from thesis.models.mappable_point import * from thesis.models.gridded_mappable_point import * from sqlalchemy import ( Column, Integer, Text, Unicode, ForeignKey, ) from sqlalchemy.sql import expression from...
Python
0
@@ -900,15 +900,8 @@ int( -Gridded Mapp @@ -1446,42 +1446,9 @@ ts. -We can't calculate grid_size, so r +R etur @@ -2358,24 +2358,8 @@ 90%5D, - grid_size=None, **k @@ -2402,98 +2402,8 @@ s_%0A%0A - if grid_size == None:%0A grid_size = class_.get_cluster_grid_size(bbox)%0A%0A
ace8e0ff093fc00350ad04c197e9e949e0580823
Reorder parameters when call edit_ticket_once :baby: #5
zendesk_tickets_machine/boards/views.py
zendesk_tickets_machine/boards/views.py
# -*- coding: utf-8 -*- import time from django.conf import settings from django.core.urlresolvers import reverse from django.contrib import messages from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render from django.views.generic import TemplateView, View from .models import B...
Python
0.000004
@@ -3774,16 +3774,44 @@ t_tags,%0A + edit_requester,%0A @@ -3882,36 +3882,8 @@ gnee -,%0A edit_requester %0A
608dc0db688be1dabe3c6ba7647807f6697fcefe
Test image definition in SADL
tools/misc/python/test-data-in-out.py
tools/misc/python/test-data-in-out.py
# TOOL test-data-in-out.py: "Test data input and output in Python" (Data input output test.) # INPUT input TYPE GENERIC # OUTPUT output # OUTPUT OPTIONAL missing_output.txt import shutil shutil.copyfile('input', 'output')
Python
0
@@ -166,16 +166,46 @@ tput.txt +%0A# IMAGE chipster-tools-python %0A%0Aimport
52b1fa1edd1804945e0810369cf785d91a055710
Fix typo in vis/__init__.py
tools/tensorflow_docs/vis/__init__.py
tools/tensorflow_docs/vis/__init__.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0.999775
@@ -762,17 +762,17 @@ g and vi -a +s ualizati
669465706e7a82197cc317cbeba7809d5b436eb6
Send meme list reply to user requesting it
src/boarbot/modules/memelink/memelink.py
src/boarbot/modules/memelink/memelink.py
import discord import mimetypes import pkg_resources import random import re import yaml from boarbot.common.botmodule import BotModule from boarbot.common.events import EventType QUERY_RE = re.compile('[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)+') MEMES_YAML = pkg_resources.resource_string('boarbot.modules.memelink', 'memes...
Python
0
@@ -2484,23 +2484,22 @@ message. -channel +author , reply)
5889d38f06ca644e2548ddc963d4c2cd7b5b77b0
Fix "import cycle not allowed" Go error
grumpy-tools-src/grumpy_tools/grumpc.py
grumpy-tools-src/grumpy_tools/grumpc.py
#!/usr/bin/env python # coding=utf-8 # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
Python
0.000018
@@ -2583,16 +2583,78 @@ rror()%0A%0A + deps = set(deps).difference(_get_parent_packages(modname))%0A%0A import @@ -4580,28 +4580,251 @@ + modname.replace('.', '/')%0A +%0A%0Adef _get_parent_packages(modname):%0A package_parts = modname.split('.')%0A parent_parts = package_parts%5B:-1%5D%0A parent_packages = se...
fd67a079db85fe41425f1814efa15da9229f166b
Add ebusd HotWaterHeader ActualTemperature and OperationMode (#34921)
homeassistant/components/ebusd/const.py
homeassistant/components/ebusd/const.py
"""Constants for ebus component.""" from homeassistant.const import ( ENERGY_KILO_WATT_HOUR, PRESSURE_BAR, TEMP_CELSIUS, TIME_SECONDS, ) DOMAIN = "ebusd" # SensorTypes from ebusdpy module : # 0='decimal', 1='time-schedule', 2='switch', 3='string', 4='value;status' SENSOR_TYPES = { "700": { ...
Python
0
@@ -1183,32 +1183,119 @@ ermometer%22, 0%5D,%0A + %22HWActualTemperature%22: %5B%22HwcStorageTemp%22, TEMP_CELSIUS, %22mdi:thermometer%22, 0%5D,%0A %22HWTimer @@ -1762,32 +1762,103 @@ mdi:timer%22, 1%5D,%0A + %22HWOperativeMode%22: %5B%22HwcOpMode%22, None, %22mdi:math-compass%22, 3%5D,%0A ...
5548e32a32bd1cd5951ce50e74c0fad944a1cf04
Stop using the extra field for Colombia
ideascube/conf/idb_col_llavedelsaber.py
ideascube/conf/idb_col_llavedelsaber.py
"""Configuration for Llave Del Saber, Colombia""" from .idb import * # noqa from django.utils.translation import ugettext_lazy as _ LANGUAGE_CODE = 'es' DOMAIN = 'bibliotecamovil.lan' ALLOWED_HOSTS = ['.bibliotecamovil.lan', 'localhost'] USER_FORM_FIELDS = USER_FORM_FIELDS + ( (_('Personal informations'), ['...
Python
0
@@ -316,17 +316,8 @@ ), %5B -'extra', 'dis @@ -336,42 +336,4 @@ ,%0A)%0A -%0AUSER_EXTRA_FIELD_LABEL = 'Etnicidad'%0A
c1b433e5ed4c06b956b4d27f6da4e8b1dab54aaf
Fix issue in cloudwacth service credentials
services/cloudwatch/sample.py
services/cloudwatch/sample.py
''' =================================== Boto 3 - CloudWatch Service Example =================================== This application implements the CloudWatch service that lets you gets information from Amazon Cloud Watch. See the README for more details. ''' import boto3 ''' Define your AWS credentials: ''' AWS_ACCESS_KE...
Python
0.000001
@@ -325,28 +325,28 @@ = ' -AKIAJM7BQ4WBJJSVU2JQ +%3CYOUR ACCESS KEY ID%3E '%0AAW @@ -372,48 +372,32 @@ = ' -Fq9GmwWEsvbcdHuh4McD+ZUmfowPKrnzFmhczV2U +%3CYOUR SECRET ACCESS KEY%3E '%0A%0A'
a05a05f24c29dcf039e02b55c18c476dc69757df
Update repo entrypoint and remote_update stub.
shell_manager/problem_repo.py
shell_manager/problem_repo.py
""" Problem repository management for the shell manager. """ import spur, gzip from shutil import copy2 from os.path import join def local_update(repo_path, deb_paths=[]): """ Updates a local deb repository by copying debs and running scanpackages. Args: repo_path: the path to the local reposito...
Python
0
@@ -125,16 +125,494 @@ t join%0A%0A +def update_repo(args):%0A %22%22%22%0A Main entrypoint for repo update operations.%0A %22%22%22%0A%0A if args.repo_type == %22local%22:%0A local_update(args.repository, args.package_paths)%0A else:%0A remote_update(args.repository, args.package_paths)%0...
b94505066899ff5eda8e3697a493d7c9994f8cb4
Bump to version 0.2.
Hipshot.py
Hipshot.py
#!/usr/bin/env python2 '''Simulate long-exposure photography Hipshot converts a video file into a single image file simulating a long-exposure photograph. ''' import cv try: from os import EX_DATAERR as _EX_DATAERR from os import EX_NOINPUT as _EX_NOINPUT from os import EX_USAGE as _EX_USAGE except Impo...
Python
0
@@ -660,17 +660,17 @@ __ = '0. -1 +2 '%0A__emai
f04291ad54e345f2265fda886326d3a6c4bd3438
Update Meh.py
Meh/Meh.py
Meh/Meh.py
import discord from discord.ext import commands class Mycog: """Tells a user that you said meh""" def __init__(self, bot): self.bot = bot @commands.command(pass_context=True) async def meh(self, ctx, user : discord.Member): """Tags a person and tells them meh""" #Your code wi...
Python
0
@@ -342,25 +342,21 @@ ssage = -discord.M +ctx.m essage.i
15a7f5e9fee7afe0386ad3640de2d3981106250d
Make collator not choke on process output
srcollator.py
srcollator.py
#!/usr/bin/env python # 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 collections import copy import glob import json import logging import os import stoneridge...
Python
0.000016
@@ -712,15 +712,89 @@ '*. +js. out'))%0A + outfiles.extend(glob.glob(os.path.join(outdir, '*.page.out')))%0A
8cd8e0ecc3f878c13d1d3a8aac85798ecac11afb
remove tfidfpredicate from tfidf.py, its in blocking.py now
dedupe/tfidf.py
dedupe/tfidf.py
#!/usr/bin/python # -*- coding: utf-8 -*- import logging from collections import defaultdict from zope.index.text.parsetree import ParseError logger = logging.getLogger(__name__) class TfidfPredicate(object): type = "TfidfPredicate" def __init__(self, threshold, field): self.__name__ = 'TF-IDF:' + st...
Python
0
@@ -178,526 +178,8 @@ _)%0A%0A -class TfidfPredicate(object):%0A type = %22TfidfPredicate%22%0A%0A def __init__(self, threshold, field):%0A self.__name__ = 'TF-IDF:' + str(threshold) + field%0A self.field = field%0A self.canopy = defaultdict(int)%0A self.threshold = threshold%0A%0A ...
81ffbc77582bab414839bf1753349a20645a2ae1
Add serversig to supported URLs.
standalone.py
standalone.py
#!/usr/bin/python import config, webui, BaseHTTPServer, urllib, sys, getopt, os class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): config = config.Config("config.ini") ssh_user = None def set_content_type(self, content_type): self.send_header('Content-Type', content_type) def run(se...
Python
0
@@ -375,16 +375,30 @@ '/pypi' +, '/serversig' ):%0A
954be7ecb1b678a781f8049b884c7aa76e6cd96b
fix formatting
derek/client.py
derek/client.py
"""Derek client.""" import logging LOG = logging.getLogger(__name__) import json from restkit import Resource, BasicAuth # TODO: OAuth from derek.slice import Slice from derek.branch import Branch from derek.user import User from derek.repo import Repo from derek.cli_registry import Argument, command from derek.de...
Python
0.001459
@@ -988,19 +988,17 @@ payload - = += None):%0A
4133b032164d5203a94f0e6984f6f259d467a3db
Remove incorrect function call
svr_record.py
svr_record.py
from tkinter import * from pcf8591read import * import threading root = Tk() def testytesty(): print ('oh look we used a callback') # words from https://www.randomlists.com/random-words # reader_worker = reader.run class svr_interface(): def __init__(self): self.current = 0 self.words = ['d...
Python
0.000225
@@ -2851,40 +2851,8 @@ = 1%0A - self.r_t.exit()%0A
8282434f913e80bdf2467e130f0c727853651911
Use new debug statement
svr_record.py
svr_record.py
from tkinter import * from pcf8591read import * import threading root = Tk() def testytesty(): print ('oh look we used a callback') # words from https://www.randomlists.com/random-words words = ['dusty','march','direful','complete','superb','poised','wait','quaint','save','copy','interest','separate','bright','ut...
Python
0.000013
@@ -2351,32 +2351,40 @@ minating thread' +,current )%0A reader
b77b573a9b89aafdfdf321d6867f3891b5ed73be
Remove todo
winton_kafka_streams/state/in_memory_key_value_store.py
winton_kafka_streams/state/in_memory_key_value_store.py
class InMemoryKeyValueStore: def __init__(self, name): self.name = name self.dict = {} def initialise(self, context, root): pass # TODO: register with context, passing restore callback def __setitem__(self, key, value): self.dict[key] = value def __getitem__(se...
Python
0.000003
@@ -158,72 +158,8 @@ pass -%0A # TODO: register with context, passing restore callback %0A%0A
ce2b524dc2ea23ed9257d6890c5403c9bfa4f0da
fix snls task
tasks/snls.py
tasks/snls.py
'''Import tasks for the Supernova Legacy Survey. ''' import csv import os from glob import glob from astropy.time import Time as astrotime from astroquery.vizier import Vizier from astrocats.catalog.photometry import PHOTOMETRY, set_pd_mag_from_counts from astrocats.catalog.spectrum import SPECTRUM from astrocats.cat...
Python
0.999999
@@ -2218,25 +2218,8 @@ ode( -python3_only=True )%0A
e0f77da5acfacb95c8899f46f5847ff636bac3b3
fix AttributeError when user is None
tasks/user.py
tasks/user.py
# coding:utf-8 from tasks.workers import app from page_get import user as user_get from db.seed_ids import ( get_seed_ids, get_seed_by_id, insert_seeds, set_seed_other_crawled ) @app.task(ignore...
Python
0.999987
@@ -1170,16 +1170,25 @@ %0A if +user and user.ver
ce9931b15aa4bc3986f36e8cfeae9dc8191eff48
add some redirects for fun
tcamp/urls.py
tcamp/urls.py
from django.conf.urls import patterns, include, url from django.views.generic.base import RedirectView from django.contrib import admin from sked.views import RedirectFromPk admin.autodiscover() urlpatterns = patterns( '', url(r'^logistics/$', RedirectView.as_view(url="/about/logistics/")), url(r'^sessions...
Python
0
@@ -425,16 +425,419 @@ ew()),%0A%0A + # FIXME: These will need to be updated next year.%0A url(r'%5Esubmit/$', RedirectView.as_view(url='/schedule/2013/new/')),%0A url(r'%5Ewall/$', RedirectView.as_view(url='/schedule/2013/wall/?timeslots=11:30am,12:30pm,1:30pm,2:30pm,3:30pm,4:30pm&refresh=300000')),%0A ur...
3faa1c4a550577ef68bf70c6e73bbc08893a4bea
rename new methods
src/cement/cement/core/log.py
src/cement/cement/core/log.py
"""Cement methods to setup and configuring logging.""" import logging from cement import namespaces def setup_logging_for_plugin_provider(provider): """ Setup the logging handlers for a plugin providers module name space. Required Arguments: provider The name of the applicat...
Python
0.000295
@@ -1270,24 +1270,33 @@ clear_ +previous_ loggers()%0A%0A%0A @@ -1293,16 +1293,16 @@ ggers()%0A - %0A%0A if @@ -1343,31 +1343,33 @@ setup_ -configed_loggin +logging_per_confi g()%0A @@ -1424,16 +1424,16 @@ nsole)%0A%0A - def clea @@ -1430,24 +1430,33 @@ %0A%0Adef clear_ +previous_ loggers():%0A...
0f9b394a88ca68f2b8b43da0acf22840e1e97330
Add height to arm_controller_test
Simulator/scripts/arm_controller_test.py
Simulator/scripts/arm_controller_test.py
#!/usr/bin/env python import tf import rospy from geometry_msgs.msg import Point from geometry_msgs.msg import PointStamped import geometry_msgs.msg import math import numpy as np #THIS IS MEANT FOR THE SIMULATOR ONLY! #THE COMMANDS SENT TO THE CONTROLLER ARE NOT REALIZABLE AND WILL BREAK THINGS! '''This publisher sen...
Python
0.000005
@@ -546,16 +546,19 @@ ycomp, r +, z ):%0A d @@ -593,11 +593,9 @@ 10, -0.0 +z )%0A @@ -1091,13 +1091,49 @@ r= -3 +1 .05%0A + z=abs(0.5*np.cos(time))%0A @@ -1152,16 +1152,18 @@ t(x,y, r +,z )%0A
bd614dd623d4898d2f26775e9dec04936b5b10cc
Add round to nearest multiple utility
devito/tools.py
devito/tools.py
import ctypes import itertools from collections import Callable, Iterable, OrderedDict import numpy as np def as_tuple(item, type=None, length=None): """ Force item to a tuple. Partly extracted from: https://github.com/OP2/PyOP2/. """ # Empty list if we get passed None if item is None: ...
Python
0.000126
@@ -1047,24 +1047,150 @@ t(*args))%0A%0A%0A +def roundm(x, y):%0A %22%22%22Return x rounded up to the closest multiple of y.%22%22%22%0A return x if x %25 y == 0 else x + y - x %25 y%0A%0A%0A def flatten(
fc9047b3e2adbd06979be025823ed9bce00a8f15
Handle no moderators returned
dht/crawling.py
dht/crawling.py
""" Copyright (c) 2014 Brian Muller Copyright (c) 2015 OpenBazaar """ from collections import Counter from twisted.internet import defer from log import Logger from dht.utils import deferredDict from dht.node import Node, NodeHeap from protos import objects class SpiderCrawl(object): """ Crawl the network...
Python
0.000001
@@ -6160,32 +6160,101 @@ hasValue(self):%0A + if len(self.response) %3E 0 and len(self.response%5B1%5D) %3E 0:%0A if self. @@ -6280,16 +6280,20 @@ value%22:%0A +
79d139594290779b2f74ca894332aa7f2f7e4735
Fix success_url parameter issue for Edit Snapshot
openstack_dashboard/dashboards/project/snapshots/views.py
openstack_dashboard/dashboards/project/snapshots/views.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
Python
0.018376
@@ -639,48 +639,8 @@ azy%0A -from django.utils.http import urlencode%0A from @@ -4233,162 +4233,43 @@ -success_url = self.request.GET.get('success_url', %22%22)%0A args = (self.kwargs%5B'snapshot_id'%5D,)%0A params = urlencode(%7B%22success_url%22: success_url%7D +args = (self.kwargs%5B'snapshot_i...
9b6ed295cd8c3dbba1b88ce0fdccb497fe45d0b7
Add TODO for cleaning out GitLab AMI lookup
src/foremast/utils/lookups.py
src/foremast/utils/lookups.py
# Foremast - Pipeline Tooling # # Copyright 2016 Gogo, 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...
Python
0
@@ -1560,16 +1560,87 @@ _TOKEN:%0A + # TODO: Remove GitLab repository in favour of JSON URL option.%0A
cb0c111c9acef1436ba7e199151068ef2e2c308b
handle non-string arguments to shell quoting
src/lib/pycbio/sys/procOps.py
src/lib/pycbio/sys/procOps.py
# Copyright 2006-2010 Mark Diekhans "functions operation on processes" # FIXME: thes should build on pipeline # also see stderr changes in genbank copy of this file # FIXME: names are a bit too verbose (callLines instead of callProcLines) import os, re from pycbio.sys import Pipeline def callProc(cmd, keepLastNewLi...
Python
0.000002
@@ -2227,16 +2227,37 @@ 498202/%0A + word = str(word)%0A if s
36dedd5c1aa8dd36a323990cd2a9d131b845dbed
Add unit tests (incomplete coverage)
test/tests.py
test/tests.py
from imgdl import img_dl class TestCreateFolderName(object): def sub_title_and_key(self, title, album_key): return '{0} ({1})'.format(title, album_key) def test_no_change_to_valid_title(self): album_key = 'XbUFk' title_1 = 'A Valid title' name_1 = img_dl.create_folder_name(titl...
Python
0
@@ -1224,28 +1224,945 @@ ey('Test title', album_key)%0A +%0Aclass TestSourceUrl(object):%0A def test_accept_imgur_urls(self):%0A assert img_dl.SourceUrl('http://imgur.com/a/B0s3o').is_imgur() == True%0A%0A def test_extracts_album_key(self):%0A assert img_dl.SourceUrl('http://imgur.com/a/B0s3o').alb...
6f7dba3beccca655b84879ccd0f3071d15536b2f
Add word_count parameter for lorem_ipsum generator
test/utils.py
test/utils.py
# coding: utf-8 import string import random def generate_string(str_len=6, src=string.ascii_lowercase): return "".join(random.choice(src) for x in xrange(str_len)) def lorem_ipsum(): words_count = random.randint(20, 50) lorem = list([]) for i in xrange(words_count): word_length = random.randin...
Python
0.000001
@@ -38,16 +38,17 @@ random%0A%0A +%0A def gene @@ -164,16 +164,17 @@ _len))%0A%0A +%0A def lore @@ -181,23 +181,16 @@ m_ipsum( -):%0A words_co @@ -196,33 +196,13 @@ ount - = random.randint(20, 5 +=3 0) +: %0A
d80f7a89b5bc23802ad5ec9bb8cc6ad523976718
Add rename branch locally test
test_gitnl.py
test_gitnl.py
from __future__ import print_function, division, absolute_import import unittest import gitnl class GitnlTestCase(unittest.TestCase): """Tests from 'gitnl.py'.""" def test_push_remotename_branchfrom(self): desired = 'push remotename branchfrom' actual = gitnl.parse_to_git('push my branch bra...
Python
0
@@ -396,16 +396,230 @@ sired)%0A%0A + def test_rename_branch(self):%0A desired = 'branch -m old_branch new_branch'%0A actual = gitnl.parse_to_git('branch rename branch old_branch to new_branch')%0A self.assertEqual(actual, desired)%0A%0A if __nam
81ce69335caaef6920853c85b5801355374c9eeb
add test to test the accessing of a static file
test_notes.py
test_notes.py
from webtest import TestApp import os import re import notes import dbaccessor DB = 'notes.db' class TestWebserver(): def setUp(self): self.bottle = TestApp(notes.app) def test_route_index(self): dba = dbaccessor.DbAccessor(DB) dba.addNote('eins', 'lorem ipsum') dba.addNote('...
Python
0
@@ -1385,16 +1385,166 @@ added%22%0A%0A + def test_accessing_static_file(self):%0A result = self.bottle.get('/static/css/bootstrap.min.css')%0A assert result.status == '200 OK'%0A%0A def
7b5132af5ababe3ec454b2b3c092d8e95ba5af2b
Increment port in tests so that tests can be parallelized
tests/base.py
tests/base.py
""" Contains the basic classes for test classes. """ import socket import time import threading from graphite import GraphiteServer, GraphiteHandler class IntegrationBase(object): """ This is the base class for integration tests of Statsite. """ DEFAULT_INTERVAL = 1 def pytest_funcarg__client(se...
Python
0
@@ -278,16 +278,252 @@ RVAL = 1 +%0A %22The default flush interval for Statsite servers.%22%0A%0A current_statsite_port = 16000%0A current_graphite_port = 12000%0A %22%22%22The current statsite/graphite ports to use when instantiating%0A servers. These will be incremented.%22%22%22 %0A%0A de @@ -718...
d1aed83b46719422c3676a32e7bcfaa5829508b2
add additional test stubs
tests/test.py
tests/test.py
import sublime from unittest import TestCase version = sublime.version() class TestDiffListener(TestCase): def setUp(self): self.view = sublime.active_window().new_file() def tearDown(self): if self.view: self.view.set_scratch(True) self.view.window().run_command("clo...
Python
0
@@ -332,17 +332,17 @@ def -T +t estOnMod @@ -347,11 +347,9 @@ odif -ied +y (sel @@ -377,17 +377,16 @@ ual test -s here%0A @@ -396,8 +396,75 @@ pass%0A +%0A def testOnClose(self):%0A # insert test here%0A pass
8a47a729a9805032a94b7ce5171609ef3b5cb90d
remove test_missevan
tests/test.py
tests/test.py
#!/usr/bin/env python import unittest from you_get.extractors import ( imgur, magisto, youtube, missevan, acfun ) class YouGetTests(unittest.TestCase): def test_imgur(self): imgur.download('http://imgur.com/WVLk5nD', info_only=True) def test_magisto(self): magisto.downlo...
Python
0.000003
@@ -428,340 +428,8 @@ )%0A%0A - def test_missevan(self):%0A missevan.download('https://m.missevan.com/sound/1285995', info_only=True)%0A missevan.download_playlist(%0A 'https://www.missevan.com/mdrama/drama/24130', info_only=True)%0A missevan.download_playlist(%0A 'https:...
3e2fb3e91acbe5c0db4e6166364c9580715cd6dd
Fix logging
src/pybel/parser/modifiers/truncation.py
src/pybel/parser/modifiers/truncation.py
# -*- coding: utf-8 -*- """ Truncations ~~~~~~~~~~~ Truncations in the legacy BEL 1.0 specification are automatically translated to BEL 2.0 with HGVS nomenclature. :code:`p(HGNC:AKT1, trunc(40))` becomes :code:`p(HGNC:AKT1, var(p.40*))` and is represented with the following dictionary: .. code:: { FUNCT...
Python
0.000007
@@ -2206,29 +2206,16 @@ warning( -%0A 'trunc() @@ -2234,22 +2234,22 @@ ed. -Please look up +Re-encode with ref @@ -2279,47 +2279,27 @@ cid -and encode with HGVS: %7B%7D'.format( +in HGVS: %25s', line) -) %0A
6c3376ed1d6b33ca98339b323c9da0799b35c978
fix up comments; compile to HW by default
src/python/qgl2/basic_sequences/AllXY.py
src/python/qgl2/basic_sequences/AllXY.py
# Copyright 2016 by Raytheon BBN Technologies Corp. All Rights Reserved. # QGL2 simplified versions of AllXY from qgl2.qgl2 import qgl2main, qgl2decl, qreg, QRegister from qgl2.util import init from qgl2.qgl1 import Id, X, Y, X90, Y90, MEAS @qgl2decl def AllXY(q: qreg): # QGL2 version of QGL2 Basic Sequence ...
Python
0
@@ -1809,20 +1809,19 @@ toHW = -Fals +Tru e%0A pl @@ -1835,12 +1835,11 @@ s = -Fals +Tru e%0A @@ -2564,16 +2564,56 @@ ster(1)%0A + # FIXME: Note this relative path...%0A resF @@ -2681,11 +2681,8 @@ llXY -Min .py%22 @@ -3095,16 +3095,50 @@ print( +f%22Compiled sequences; metafile = %7B fileNam...
fb213097e838ddfa40d9f71f1705d7af661cfbdf
Allow tests to be run with Python <2.6.
tests/unit.py
tests/unit.py
# -*- coding: latin-1 -*- import unittest from github2.issues import Issue from github2.client import Github class ReprTests(unittest.TestCase): """__repr__ must return strings, not unicode objects.""" def test_issue(self): """Issues can have non-ASCII characters in the title.""" i = Issue(t...
Python
0
@@ -935,24 +935,25 @@ e.now()%0A +%0A self.ass @@ -948,59 +948,132 @@ -self.assertGreaterEqual((end - start).to +delta = end - start%0A delta_seconds = delta.days * 24 * 60 * 60 + delta.seconds%0A%0A self.assertTrue(del ta -l _seconds (), @@ -1072,15 +1072,13 @@ onds -(), 2.0 + %3E=...
1064c11ec4e8e24564408ca598e16e30e0eb6b7a
Support for django 1.x vs 2.x
tests/urls.py
tests/urls.py
# coding=utf-8 from __future__ import absolute_import from django.conf.urls import url from django.urls import include, path from . import views as test_views from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register(r'user', test_views.MockUserViewSet) urlpatterns = [ url(r'^no-...
Python
0.000002
@@ -81,16 +81,61 @@ ort url%0A +import django%0Aif django.VERSION%5B0%5D == 1:%0A from dja @@ -138,16 +138,21 @@ django. +conf. urls imp @@ -166,14 +166,50 @@ lude -, path +%0Aelse:%0A from django.urls import include %0A%0Afr @@ -2488,12 +2488,11 @@ -path +url (r''
218c2f90b8b8475ca2cebdeb5e083c620abc25c0
Implement rudimentary support for width and height options.
textinator.py
textinator.py
import click from PIL import Image def scale(val, src, dst): """ Scale the given value from the scale of src to the scale of dst. """ return ((val - src[0]) / (src[1]-src[0])) * (dst[1]-dst[0]) + dst[0] def value_to_char(value, palette, value_range=(0, 256)): palette_range = (0, len(palette)) ...
Python
0
@@ -1892,81 +1892,214 @@ -original = Image.open(image)%0A width, height = original.size%0A%0A thumb +if not width or height:%0A width, height = 80, 24%0A%0A if width and not height:%0A height = width%0A if height and not width:%0A width = height%0A%0A original = Image.open(imag...
843ce4bf4b0264cdaca3f054bddc3218938dbc60
Create /var/log in tmproot
VMEncryption/main/oscrypto/encryptstates/StripdownState.py
VMEncryption/main/oscrypto/encryptstates/StripdownState.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.000001
@@ -2147,32 +2147,112 @@ /; done', True)%0A + self.command_executor.ExecuteInBash('mkdir /tmp/tmproot/var/log', True)%0A self.com @@ -2319,16 +2319,20 @@ oot/var/ +log/ ', True)
5840978bfae765c4704151653b0703c6cea718f0
make dedicated _get_inactive_due for reuse within __init__.py, more informative failure when fails to load pickle
duecredit/__init__.py
duecredit/__init__.py
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the duecredit package for the # copyright and license terms. # # ## ### ...
Python
0.000001
@@ -1057,16 +1057,300 @@ true')%0A%0A +@never_fail%0Adef _get_inactive_due():%0A # keeping duplicate but separate so later we could even place it into a separate%0A # submodule to possibly minimize startup time impact even more%0A from .collector import InactiveDueCreditCollector%0A return InactiveDueCredi...
d19fa3b085d691780bbdc7b8e5edf9e8b53906e6
Revert "Adding request context for proper url generation."
todo/views.py
todo/views.py
from todo import app from flask import jsonify, request, url_for from flask import json from todo.database import db_session from todo.models import Entry @app.route("/", methods=["GET", "POST", "DELETE"]) def index(): if request.method == "POST": request_json = request.get_json() entry = Entry(r...
Python
0
@@ -432,33 +432,24 @@ t_dict(entry -, request ))%0A else: @@ -663,25 +663,16 @@ ct(entry -, request ))%0A @@ -836,25 +836,16 @@ .first() -, request ))%0A%0Adef @@ -868,42 +868,11 @@ ntry -, request):%0A with request:%0A +):%0A
6c64723d7c8a741820fa06e25aaefc994cab51bf
Change read_password() logic to better catch improper passwords
tools/mail.py
tools/mail.py
#!/usr/bin/python3 import sys, getpass, urllib.request, urllib.error, json def mgmt(cmd, data=None, is_json=False): # The base URL for the management daemon. (Listens on IPv4 only.) mgmt_uri = 'http://127.0.0.1:10222' setup_key_auth(mgmt_uri) req = urllib.request.Request(mgmt_uri + cmd, urllib.parse.urlencode(d...
Python
0.000002
@@ -897,24 +897,46 @@ word():%0A -%09 + while True:%0A first - = getpas @@ -959,17 +959,137 @@ ord: ')%0A -%09 + if len(first) %3C 4:%0A print('Passwords must be at least four characters.')%0A continue%0A second = @@ -1123,14 +1123,18 @@ ')%0A -%09while + ...
d5b20ed2ffd69a3383c854bced310b391319601e
Fix auth bug
ttrss/auth.py
ttrss/auth.py
from requests.auth import AuthBase import requests import json from exceptions import raise_on_error class TTRAuth(AuthBase): def __init__(self, user, password): self.user = user self.password = password self.sid = None def response_hook(self, r, **kwargs): j = json.loads(r.co...
Python
0.000001
@@ -847,149 +847,157 @@ -if self.sid is None:%0A self.sid = self._get_sid(r.url)%0A %0A data = json.loads(r.body)%0A if 'sid' not in data: + %0A data = json.loads(r.body)%0A if 'sid' not in data:%0A if self.sid is None:%0A self.sid = s...
094679f619e1cb015bb1aba9222fd4345ed289e0
fix heappush invocation (backport).
Lib/sched.py
Lib/sched.py
"""A generally useful event scheduler class. Each instance of this class manages its own queue. No multi-threading is implied; you are supposed to hack that yourself, or use a single instance per application. Each instance is parametrized with two functions, one that is supposed to return the current time, one that i...
Python
0
@@ -4521,15 +4521,18 @@ eappush( +q, event)%0A
823e3cb06f4dd16a1107542c5a1c4af28e0cb7e1
Fix formatting practice again.
LineChain.py
LineChain.py
import re import csnd6 class LineChain: csd_str = "aout=" parseBool = False def __init__(self,str): self.str = str def ugens_handler(self, str, vars): if str == "osc": return "oscili({0})".format(vars) else: return "{0}({1})".format(str, vars) def p...
Python
0
@@ -2222,10 +2222,11 @@ -%25s +%7B0%7D %0A @@ -2268,23 +2268,24 @@ %22%22%22 - %25 self. +.format( csd_str +) %0A
c62e41046e40ec755cf88b95d70db79fabcaadc2
fix error when only using one language
elephantblog/views.py
elephantblog/views.py
from datetime import date from django.http import Http404 from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.utils.translation import ugettext_lazy as _ from feincms.translations import short_language_code # from tagging.models import Tag, TaggedIt...
Python
0.000004
@@ -316,16 +316,61 @@ gedItem%0A +from django.core.exceptions import FieldError %0A%0Afrom f @@ -452,16 +452,17 @@ ttings%0A%0A +%0A def entr @@ -1832,16 +1832,17 @@ except +( Attribut @@ -1847,16 +1847,29 @@ uteError +, FieldError) :%0A
88686c420f403b59a32bad637dd67e4f84dec46d
Fix issue
elizabeth/__init__.py
elizabeth/__init__.py
# -*- coding: utf-8 -*- """ :copyright: (c) 2016 by Likid Geimfari <likid.geimfari@gmail.com>. :software_license: MIT, see LICENSES for more details. :repository: https://github.com/lk-geimfari/elizabeth :contributors: https://github.com/lk-geimfari/elizabeth/blob/master/CONTRIBUTORS.md """ from elizabeth.core import...
Python
0.000001
@@ -217,76 +217,45 @@ rs: -https://github.com/lk-geimfari/elizabeth/blob/master/CONTRIBUTORS.md +see CONTRIBUTING.md for more details. %0A%22%22%22