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
98ec51a18c96bc68b9a088a7d23d8aae058ed1f5
Create tmp dir if it does not exist
spoolgore/backend.py
spoolgore/backend.py
from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend import threading import os import time spoolgore_local = threading.local() class EmailBackend(BaseEmailBackend): __tmp__ = "%s/tmp" % settings.SPOOLGORE_DIRECTORY def send_messages(self, email_messages): pid...
Python
0
@@ -1229,16 +1229,99 @@ lename)%0A + if not os.path.exists(self.__tmp__):%0A os.makedirs(self.__tmp__)%0A
551abd09046b613cdd187ffeef4f2448fc60001a
Fix test
tests/net_tests/test_alex.py
tests/net_tests/test_alex.py
import unittest import numpy import chainer from chainer import cuda from chainer.testing import attr from deepmark_chainer.net import alex class TestAlex(unittest.TestCase) def setUp(self): self.x = numpy.random.uniform(-1, 1, (1, 3, 224, 224)).astype(numpy.float32) self.l = alex.Alex() ...
Python
0.000004
@@ -171,16 +171,17 @@ estCase) +: %0A%0A de
36b4fdd1ff248f3065ac3bc2e08b4f609e903738
fix test cases
tests/nlu/test_components.py
tests/nlu/test_components.py
import pytest from rasa.nlu import registry, train from rasa.nlu.components import find_unavailable_packages from rasa.nlu.config import RasaNLUModelConfig from rasa.nlu.model import Interpreter, Metadata @pytest.mark.parametrize("component_class", registry.component_classes) def test_no_components_with_same_name(co...
Python
0.000013
@@ -4971,36 +4971,37 @@ %5B%5D, %22Empty l -anguage list +ists for both %22),%0A @@ -5036,36 +5036,37 @@ ne, %22Empty l -anguage list +ists for both %22),%0A @@ -5105,20 +5105,21 @@ ty l -anguage list +ists for both %22),%0A @@ -5348,32 +5348,85 @@ import Component +%0A from rasa.shared.except...
8959c0146470e27e494573df0c3ceb370da70305
Implement Domains on Nameserver API
spyonweb/spyonweb.py
spyonweb/spyonweb.py
import os from argparse import ArgumentParser import requests class spyonweb(object): def __init__(self, token, url=None): self.token = token if url: self.url = url else: self.url = "https://api.spyonweb.com/v1/" def summary(self, domain_name): data =...
Python
0
@@ -1178,16 +1178,317 @@ json()%0A%0A + def dns_domain(self, name, limit=None):%0A full_url = self.url + %22dns_domain/%22 + name + %22?access_token=%22 + self.token%0A if limit:%0A full_url = full_url + %22&limit=%22 + str(limit)%0A data = requests.get(full_url)%0A # TODO: im...
b10f2af0f034cdc8ea23d09f4669f5f468965622
remove orphaned containers when killing test-production environment
tests/production_test_env.py
tests/production_test_env.py
#!/usr/bin/env python2.7 import os import sys import subprocess import argparse import conftest import shutil import common from MenderAPI import auth, adm sys.path.insert(0, "./tests") from common_update import common_update_procedure parser = argparse.ArgumentParser(description='Helper script to bring up production...
Python
0
@@ -4715,11 +4715,31 @@ n%22, %22-v%22 +, %22--remove-orphans%22 %5D)%0A
94c3a5df4e5634cf256e52a2fcbc1ffc38bf6770
Add GlassDataSetTest
tests/real/1_dataset_in_r.py
tests/real/1_dataset_in_r.py
import os from manifold.infrastructure import Retriever, Displayer DATA_SETS_DIR = '../datasets' DATA_SET = 'glass/glass.data' def main(): data_set_file = os.path.join(DATA_SETS_DIR, DATA_SET) print('Displaying data set {%s} in the Rn' % data_set_file) glass = Retriever(data_set_file, delimiter=',') ...
Python
0
@@ -2,16 +2,47 @@ mport os +%0A%0Afrom unittest import TestCase %0Afrom ma @@ -92,29 +92,111 @@ player%0A%0A -DATA_SETS_DIR +%0Aclass GlassDataSetTest(TestCase):%0A def test_display_dimensions(self):%0A data_sets_dir = '../d @@ -204,24 +204,32 @@ tasets'%0A -DATA_SET + data_set = 'glas @@ -247,...
75f58333d4c6702a55fb7db6074c0efd138b09f0
Remove extra newline.
tests/test_HDF5_searchers.py
tests/test_HDF5_searchers.py
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>" __date__ = "$Jul 28, 2014 11:50:37 EDT$" import itertools import os import shutil import tempfile import h5py import nanshe.nanshe.HDF5_searchers class TestHDF5Searchers(object): groups_0 = [u"000", u"005", u"010", u"015", u"020", u"025", u"030", u"035",...
Python
0
@@ -4364,9 +4364,8 @@ ir = %22%22%0A -%0A
a5435f8c61a2474d3c04e38d00ed7e6432f8a60e
fix zsh escaping tests
tests/test_cmd_completion.py
tests/test_cmd_completion.py
from six import StringIO import pytest from doit.exceptions import InvalidCommand from doit.cmdparse import CmdOption from doit.plugin import PluginDict from doit.task import Task from doit.cmd_base import Command, TaskLoader, DodoTaskLoader from doit.cmd_completion import TabCompletion from doit.cmd_help import Help ...
Python
0.000001
@@ -2738,18 +2738,18 @@ assert -%22 ' +%22 -s%5Bmy de @@ -2743,37 +2743,37 @@ rt '%22-s%5Bmy desc%5D -' %5C%5C%22 +%22 %5C%5C' == TabCompletio @@ -2922,18 +2922,18 @@ assert -%22 ' +%22 --lll%5Bmy @@ -2938,21 +2938,21 @@ my desc%5D -' %5C%5C%22 +%22 %5C%5C' == TabC @@ -3128,18 +3128,18 @@ assert ( -%22...
4bdb3de0e37241fb429c04e32a4459904f4294d7
Kill print messages
src/atomic.py
src/atomic.py
# # atomic.py - Simple atoms for simple Eva demo # Copyright (C) 2015 Linas Vepstas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License v3 as # published by the Free Software Foundation and including the exceptions # at http://opencog.o...
Python
0.000001
@@ -1790,32 +1790,8 @@ ():%0A -%09print %22Python wake up%22%0A %09evl @@ -1850,36 +1850,8 @@ ():%0A -%09print %22Python go to sleep%22%0A %09evl
329e74f280537aab41d5b810f8650bfd8d6d81f5
Add teardown specific to the former TestCase class
tests/test_generate_files.py
tests/test_generate_files.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_generate_files ------------------- Test formerly known from a unittest residing in test_generate.py named TestGenerateFiles.test_generate_files_nontemplated_exception """ import pytest from cookiecutter import generate from cookiecutter import exceptions @pyte...
Python
0
@@ -222,16 +222,66 @@ on%0A%22%22%22%0A%0A +from __future__ import unicode_literals%0Aimport os%0A import p @@ -286,16 +286,17 @@ pytest%0A +%0A from coo @@ -357,16 +357,691 @@ eptions%0A +from cookiecutter import utils%0A%0A%0A@pytest.fixture(scope=%22function%22)%0Adef clean_system_remove_additional_folders(req...
cfe013915332b7d1d6d5fa208f2dc476dcc3afba
Backup to new hard drive
src/backup.py
src/backup.py
"""Makes backups of Delphi files and databases.""" # standard library import datetime import os import subprocess import time # first party import delphi.operations.secrets as secrets #General setup dest = '/home/automation/backups' tag = datetime.datetime.today().strftime('%Y%m%d_%H%M%S') print('Destination: %s | ...
Python
0.000001
@@ -2444,12 +2444,10 @@ /usb -500g +2t /bac
2c0947fcba8e260e01420182fe0da307af5a8426
Rename sys modules access to web module
tests/test_online_checker.py
tests/test_online_checker.py
"""This module is for testing the online checker.""" import sys from unittest import TestCase ONLINE_CHECKER = sys.modules["Rainmeter.http.online_checker"] class TestRmDocOnlineChecker(TestCase): """Test of the online checks for Rainmeter Documentation using unittest.""" def test_is_rm_doc_online(self): ...
Python
0.000001
@@ -135,12 +135,11 @@ ter. -http +web .onl
676864afe327b6e3a16d49cee1c89c2fe4198d42
Fix zorder in geom_text
ggplotx/geoms/geom_text.py
ggplotx/geoms/geom_text.py
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.text import Text from ..utils import to_rgba, suppress from ..utils.doctools import document from ..positions import position_nudge from .geom import geom # Note: hjust & vjust are parameters...
Python
0.000012
@@ -2222,24 +2222,66 @@ ontweight'%5D%0A + data%5B'zorder'%5D = params%5B'zorder'%5D%0A data
d4c252c711e7e367cfdb31740782a52e192e73ae
Fix typo in utils.py
utils.py
utils.py
import requests import traceback import six import logging import ansi import config print_ = six.print_ PY3 = six.PY3 PY34 = six.PY34 PY2 = six.PY2 commands = {} cmd_list = [] def add_cmd(name, minArgs=1, alias=None, owner=False, admin=False, hide=False): def real_command(func): global commands ...
Python
0.9984
@@ -2282,17 +2282,17 @@ ans = li -a +s t(config
ae10598cb03c928c383f64d8e2b033b9abfcebbb
fix error on fb_plugin menu creation
gnome_plugins/fb_plugin.py
gnome_plugins/fb_plugin.py
#!/usr/bin/env python # # Copyright (c) 2012 Raul Gutierrez S. - rgs@itevenworks.net # Copyright (c) 2013 Alan Aguiar alanjas@hotmail.com # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software with...
Python
0.000001
@@ -1918,16 +1918,31 @@ nu_item, + make_sub_menu, MENUBAR @@ -3259,20 +3259,8 @@ u = -MenuBuilder. make
a4ade93206171559fa2558a70635d336d0c4b9c8
Fix docker build invocation.
test/docker_setup.py
test/docker_setup.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/. from subprocess import call, Popen, PIPE def create_image(): create_image_command = 'docker build -t="pulse:testin...
Python
0
@@ -300,17 +300,16 @@ uild -t= -%22 pulse:te @@ -317,9 +317,8 @@ ting -%22 tes
dbf43ddd75a9c634eb00c8cf548d32b782baa9af
correct 404 handling
views.py
views.py
__license__ = "Apache 2.0" __copyright__ = "Copyright 2008 nb.io" __author__ = "Randy Reddig - ydnar@nb.io" from django.template import RequestContext from django.shortcuts import render_to_response from django.http import HttpResponse, Http404 from django.template import loader import os.path import re DEFAULT_CON...
Python
0.000007
@@ -393,16 +393,29 @@ wargs):%0A + try:%0A t = @@ -441,15 +441,13 @@ -if not +excep t:%0A
ca9f4391c0bb0d0484ffce822f11a938a2e5f1d8
Add to records queue as they come in from the vehicle.
views.py
views.py
import json from collections import deque from flask import request, render_template from flask import current_app as app, abort from util import make_status_response, generate_filename, jsonify RECORDS_QUEUE = deque(maxlen=100) def _prime_records_queue(q): with open(generate_filename(app.config), 'r') as trac...
Python
0
@@ -1154,16 +1154,101 @@ cord)))%0A + record%5B'timestamp'%5D = timestamp%0A RECORDS_QUEUE.append(record)%0A retu
1c6480a9b46acb3966af7fe5fb4146aa99335756
Fix the test script path in the awesome JSON script
test/test-awesome.py
test/test-awesome.py
#!/usr/bin/env python3 from urllib.request import urlopen from urllib.error import URLError import hashlib import os import json import subprocess test_dir = os.path.dirname(os.path.realpath(__file__)) list_file = os.path.join(test_dir, "awesome-json-datasets") outdir = os.path.join(test_dir, "awesome-json-results") ...
Python
0.000139
@@ -1349,19 +1349,20 @@ node%22, %22 -bin +test /test.js
59dd2d1b8db23fd00058f343317f6eaa5e18618b
Fix UnknownLocaleError on pt-BR
frappe/geo/country_info.py
frappe/geo/country_info.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # all country info from __future__ import unicode_literals import os, json, frappe from frappe.utils.momentjs import get_all_timezones def get_country_info(country=None): data = get_all() data = frappe._dict(data.ge...
Python
0.000001
@@ -862,16 +862,25 @@ cal.lang +, sep=%22-%22 )%0A%0A%09# ti
ebcb55fe8ad4028bd6699fdc5db60f9dc7d7c6e4
Add color to Slack notifications
freight/notifiers/slack.py
freight/notifiers/slack.py
from __future__ import absolute_import __all__ = ['SlackNotifier'] import json from freight import http from freight.models import App, TaskStatus from .base import Notifier, NotifierEvent class SlackNotifier(Notifier): def get_options(self): return { 'webhook_url': {'required': True}, ...
Python
0
@@ -188,16 +188,92 @@ Event%0A%0A%0A +STATUS_TO_COLOR = %7B%0A 'finished': '#2ab27b',%0A 'failed': '#f43f20',%0A%7D%0A%0A%0A class Sl @@ -1989,21 +1989,165 @@ ' -text': title, +attachments': %5B%7B%0A 'fallback': title,%0A 'title': title,%0A 'color': STATUS_TO_CO...
40c3fd305fff3ee60cb46f1d379171d5023591a4
Increase test coverage.
test/test_apriori.py
test/test_apriori.py
""" Tests for apyori.apriori. """ from nose.tools import eq_ from mock import Mock from apyori import TransactionManager from apyori import SupportRecord from apyori import RelationRecord from apyori import OrderedStatistic from apyori import apriori def test_empty(): """ Test for empty data. """ tr...
Python
0
@@ -1108,16 +1108,929 @@ , %5B%5D)%0A%0A%0A +def test_filtered():%0A %22%22%22%0A Test for filtered data.%0A %22%22%22%0A transaction_manager = Mock(spec=TransactionManager)%0A dummy_return = OrderedStatistic(%0A frozenset(%5B'A'%5D), frozenset(%5B'B'%5D), 0.1, 0.7)%0A def gen_support_records(...
7ef2d632190a3b97ddc8159c15fc1e4ce6edfb79
Remove dead code.
test/test_element.py
test/test_element.py
from pml.exceptions import PvException import pml.element import pml.device import cs_dummy from pml.physics import Physics from pml.units import UcPoly import pytest @pytest.fixture def get_element(length=0.0, uc=UcPoly([1, 0])): cs = cs_dummy.CsDummy() element = pml.element.Element(1, 'Quad', Physics(6)) ...
Python
0.00001
@@ -2506,221 +2506,4 @@ 4.0%0A -%0A'''%0A# dummy_control_system.get = mock.MagicMock(return_value=4)%0A# self._cs.get('duumy')%0A# dummy_control_system.get.assert_called_with('dummy')%0A# dummy_control_system.set.assert_called_with(pv, value)%0A'''%0A
52243269fc080af7094debc63121357035af9c82
Make test/test_logging work on python 2.6
test/test_logging.py
test/test_logging.py
"""Stupid tests that ensure logging works as expected""" import logging as log from StringIO import StringIO import beets.logging as blog from _common import unittest, TestCase class LoggingTest(TestCase): def test_logging_management(self): l1 = log.getLogger("foo123") l2 = blog.getLogger("foo123...
Python
0.000059
@@ -1001,16 +1001,92 @@ baz%22)%0A%0A%0A +def suite():%0A return unittest.TestLoader().loadTestsFromName(__name__)%0A%0A%0A if __nam @@ -1122,10 +1122,29 @@ st.main( +defaultTest='suite' )%0A
c640143c726f63c09a721247bdca1ae5c9ed847a
fix byte+str error on python3.x
test/test_poyonga.py
test/test_poyonga.py
import struct import unittest from mock import patch, Mock from poyonga import Groonga, GroongaResult class PoyongaHTTPTestCase(unittest.TestCase): def setUp(self): self.g = Groonga() @patch('poyonga.client.urlopen') def test_json_result_with_http(self, mock_urlopen): m = Mock() ...
Python
0.000068
@@ -849,16 +849,23 @@ ue, _cas +, _data = %5C%0A @@ -908,16 +908,22 @@ 2, 0, 0 +, %22%7B%7D%22 %0A @@ -957,16 +957,18 @@ BHBBHIIQ +2s %22,%0A @@ -1048,16 +1048,23 @@ ue, _cas +, _data )%0A @@ -1099,15 +1099,8 @@ data - + %22%7B%7D%22 %0A @@ -1212,32 +1212,32 @@ GroongaResult)%0A + ...
8e000eaba42ddbbbdec9f48a7b2c45dfe59dc3fd
add search test
src/test_linked_list.py
src/test_linked_list.py
"""Test for singly linked list from link_list.py.""" def test_node_init_data(): """Test that Node constructor works.""" from linked_list import Node temp = Node(2) assert temp.data == 2 def test_node_init_next_none(): """Test that Node constructor works with empty next.""" from linked_list i...
Python
0.000001
@@ -2695,8 +2695,251 @@ () == 0%0A +%0Adef test_search_val():%0A %22%22%22Test to search for, return value.%22%22%22%0A from linked_list import LinkedList%0A test_list = LinkedList()%0A test_list.push(4)%0A test_list.push(6)%0A test_list.push(8)%0A assert test_list.search(6).data == 6%0A
00fdc94568db8d5c1c79db1d136eaa54a2a41028
use monomial_pow in Monomial.__pow__
diofant/polys/monomials.py
diofant/polys/monomials.py
"""Tools and arithmetics for monomials of distributed polynomials. """ from ..core import Mul, S, Tuple, sympify from ..core.compatibility import iterable from .polyerrors import ExactQuotientFailed from .polyutils import dict_from_expr __all__ = 'Monomial', 'itermonomials' def itermonomials(variables, degree): ...
Python
0.000019
@@ -4941,12 +4941,13 @@ if n -ot n + %3E= 0 :%0A @@ -4980,227 +4980,39 @@ ild( -%5B0%5D*len(self))%0A elif n %3E 0:%0A exponents = self.exponents%0A%0A for i in range(1, n):%0A exponents = monomial_mul(exponents, self.exponents)%0A%0A return self.rebuild(expon...
3dc59aa4c999f477c45edb2dcb6c5b9302fd8ac7
Remove useless compatible code
test/test_tracing.py
test/test_tracing.py
# -*- coding: utf-8 -*- import sys import pytest import six from _utils import factorial, find_stats, foo from profiling.stats import RecordingStatistics from profiling.tracing import TracingProfiler if six.PY3: map = lambda *x: list(six.moves.map(*x)) def test_setprofile(): profiler = TracingProfiler() ...
Python
0.000001
@@ -201,67 +201,8 @@ r%0A%0A%0A -if six.PY3:%0A map = lambda *x: list(six.moves.map(*x))%0A%0A%0A def
4d111918f01a3cb599f1b496de01cfc43ef9bd86
Switch from temporary content tests gyp target to final target
Source/web/web_tests.gyp
Source/web/web_tests.gyp
# # Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions an...
Python
0.000001
@@ -2727,12 +2727,8 @@ port -_tmp ',%0A
aa4d4cdfb646a53c59790d29066fddca6fec688b
Fix and extend tests
tests/00_test_otc.py
tests/00_test_otc.py
import otc def test_shade_works(): """Test shade works""" cloud = otc.OTCCloud() def test_otc(): """Basic Test""" cloud = otc.OTCCloud() images = cloud.list_images() assert len(images) >= 0 # vim: sts=4 sw=4 ts=4 et:
Python
0
@@ -73,24 +73,36 @@ = otc.O -TC +tc Cloud( +cloud='test' )%0A%0Adef t @@ -154,16 +154,28 @@ tc.O -TC +tc Cloud( +cloud='test' )%0A @@ -234,16 +234,470 @@ ) %3E= 0%0A%0A +def test_otcclient():%0A %22%22%22Test otcclient%22%22%22%0A cloud = otc.OtcCloud(cloud='test')%0A vpcs = cloud.otcclient.vpcs()%0A...
c6b13a6ed3d299a185ca4a2a646ec1de92e431d8
fix Authenticate error
Client.py
Client.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # # # Copyright 2012 Netsco Inc. # Copyright 2012 Minsu Kang # Copyright 2013 Jioh L. Jung from urllib import quote from urllib2 import urlopen, Request, HTTPError from base64 import b64encode import hmac import hashlib import json import re import os UCLOUD_API_KEY = 'YO...
Python
0.000005
@@ -2486,16 +2486,211 @@ .api_key +%0A %0A # For safty reason, force Quote some character.%0A for i in args.keys():%0A args%5Bi%5D = args%5Bi%5D.replace(%22%25%22, %22%2526%22)%0A args%5Bi%5D = args%5Bi%5D.replace(%22/%22, %22%252f%22) %0A%0A
151c15036f29d92f5c3c15450471605571d6914d
Remove unused modules
django_databrowse/sites.py
django_databrowse/sites.py
from django import http from django.db import models from django_databrowse.datastructures import EasyModel from django.shortcuts import render_to_response from django.utils.safestring import mark_safe from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger class AlreadyRegistered(Exception): pas...
Python
0.000001
@@ -35,68 +35,31 @@ o.db - import models%0Afrom django_databrowse.datastructures +.models.loading import Easy @@ -54,21 +54,21 @@ import -EasyM +get_m odel%0Afro @@ -232,16 +232,72 @@ nteger%0A%0A +from django_databrowse.datastructures import EasyModel%0A%0A %0Aclass A @@ -4025,17 +4025,16 @@ class',%0A - ...
b9b1de1f27c48a865bcce92607a6672efabd9d48
remove python 2 compatibility
django_datawatch/models.py
django_datawatch/models.py
# -*- coding: UTF-8 -*- from __future__ import unicode_literals from dateutil import relativedelta from django.utils import timezone from django.conf import settings from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from d...
Python
0.000011
@@ -193,70 +193,8 @@ els%0A -from django.utils.encoding import python_2_unicode_compatible%0A from @@ -577,37 +577,8 @@ s%0A%0A%0A -@python_2_unicode_compatible%0A clas @@ -3800,37 +3800,8 @@ )%0A%0A%0A -@python_2_unicode_compatible%0A clas
2046a04c9f6dbba4d1f327b1202a36624dc2e8f5
Update main.py
src/trumpscript/main.py
src/trumpscript/main.py
import argparse import os import sys from trumpscript.compiler import * from trumpscript.utils import * __author__ = 'github.com/samshadwell' def main(): parser = argparse.ArgumentParser(prog='TRUMP', description='Making programming great again') parser.add_argument('--Wall', action='store_true', help='If se...
Python
0.000002
@@ -395,17 +395,17 @@ ('--shut -_ +- up', act
c8b2327cae9a04a97cfd051fe37a47c94459a5b3
fix test docstring
tests/font/BULLET.py
tests/font/BULLET.py
#!/usr/bin/env python '''Test that font.Text horizontal alignment works. Three labels will be rendered aligned left, center and right. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet import font import base_text class TEST_HALIGN(base_text.TextTestBase): font_name = ...
Python
0.000001
@@ -33,107 +33,115 @@ hat -font.Text horizontal alignment works.%0A%0AThree labels will be rendered aligned left, center and right +rendering of bullet glyphs works.%0A%0AYou should see 5 bullet glyphs rendered in the bottom-left of the window .%0A''
c309be03dba1c257275cceae9bf383105629fbf6
add comment
src/utils/csvmanager.py
src/utils/csvmanager.py
# -*- coding: utf-8 -*- import os.path import csv import logger current_dir = os.path.abspath(os.path.dirname(__file__)) resources_dir = os.path.abspath(current_dir + "/../../resources/data") class Template: """Valid CSV templates""" from collections import OrderedDict # python sort dictionary keys, thats why I...
Python
0
@@ -753,16 +753,72 @@ plate*%0A%0A +%09:raises: *Error* if header fields not match template%0A%09%0A %09:return @@ -1475,45 +1475,8 @@ ad%0A%09 -%09%09or header fields not match template %0A%09Ex
59b0b90bf709f41e5e2d4b2b980ce310ae64be2c
Use 'conf' instead of 'fn' for the processed arg YamlConfig
teuthology/suite/__init__.py
teuthology/suite/__init__.py
# this file is responsible for submitting tests into the queue # by generating combinations of facets found in # https://github.com/ceph/ceph-qa-suite.git import logging import os import time import teuthology from ..config import config, YamlConfig from ..report import ResultsReporter from ..results import UNFINISHE...
Python
0
@@ -1364,18 +1364,20 @@ s):%0A +con f -n = proce @@ -1397,18 +1397,20 @@ %0A if +con f -n .verbose @@ -1470,18 +1470,20 @@ if not +con f -n .machine @@ -1491,18 +1491,20 @@ type or +con f -n .machine @@ -1593,18 +1593,20 @@ lti' in +con f -n .machine @@ -1756,18 +1756,20 @@ %0A if +con ...
e8e6e13f1f4a4f819b223c66a6183f78413a18a9
Bump version number
VMEncryption/main/Common.py
VMEncryption/main/Common.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 # # ...
Python
0.000002
@@ -769,17 +769,17 @@ .0.99917 -6 +7 '%0A ex
586b86990fc6548f9a2232cecc578d0a7a2451a1
Fix on merging versions
passhport_admin/manager/requests_functions.py
passhport_admin/manager/requests_functions.py
# -*-coding:Utf-8 -*- """Contains functions which make requests to the server""" # Compatibility 2.7-3.4 from __future__ import absolute_import from __future__ import unicode_literals from builtins import input import sys, locale import requests from . import user as user from . import target as target from . impor...
Python
0
@@ -597,21 +597,8 @@ %22%22%22%0A -%3C%3C%3C%3C%3C%3C%3C HEAD%0A @@ -1013,353 +1013,8 @@ (%22%22) -%0A=======%0A confirmation = str.upper(input(prompt_confirmation))%0A%0A # Loop until user types %5By/N%5D%0A while confirmation != %22Y%22 and confirmation != %22N%22 and confirmation:%0A print(%2...
465587e9a1c2dba14ea4f060a4f5b5d1be03ee54
connect to mysql database
zipkin/zipkin-generate-false-data.py
zipkin/zipkin-generate-false-data.py
import time import random def ts_microseconds(): return int( time.time() * 1000000 ) def generate_id(): return random.getrandbits(64) print 'timestamp: ' + str(ts_microseconds()) print 'random id: ' + str(generate_id())
Python
0.000001
@@ -20,16 +20,32 @@ random%0A%0A +import MySQLdb%0A%0A def ts_m @@ -154,16 +154,185 @@ ts(64)%0A%0A +# reference to database connector%0Adef get_db_connection():%0A return MySQLdb.connect('localhost', 'zipkin', 'kinect', 'zipkin')%0A%0Adb = get_db_connection()%0A%0Aprint db%0A%0A%0A# print 't @@ -368,16 +368,18...
7f1cb8b122d60fee97ca23bfddac181110635185
Add flatten kwarg to FrameStackingWrapper to merge channel and stack dims.
acme/wrappers/frame_stacking.py
acme/wrappers/frame_stacking.py
# python3 # Copyright 2018 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 re...
Python
0.000008
@@ -1006,16 +1006,54 @@ int = 4 +,%0A flatten: bool = False ):%0A %22 @@ -1179,16 +1179,93 @@ stack.%0A + flatten: Whether to flatten the channel and stack dimensions together.%0A %22%22%22%0A @@ -1450,16 +1450,33 @@ m_frames +, flatten=flatten ),%0A @@ -2427,16 +2427,39 @@ mes: ...
b7db8dd62a323b2f6707c2e660acd94471037f10
Add configuration url to Surepetcare (#58039)
homeassistant/components/surepetcare/entity.py
homeassistant/components/surepetcare/entity.py
"""Entity for Surepetcare.""" from __future__ import annotations from abc import abstractmethod from surepy.entities import SurepyEntity from homeassistant.core import callback from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from . import Su...
Python
0
@@ -1102,16 +1102,83 @@ ceInfo(%0A + configuration_url=%22https://surepetcare.io/dashboard/%22,%0A
2a772ed74613d8842de2efb10282830c9b368174
Add new layers to docs_api. Change: 128179419
tensorflow/contrib/layers/__init__.py
tensorflow/contrib/layers/__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.000035
@@ -1013,39 +1013,213 @@ %0A%0A@@ -convolution2d%0A@@fully_connected +avg_pool2d%0A@@batch_norm%0A@@convolution2d%0A@@convolution2d_in_plane%0A@@convolution2d_transpose%0A@@flatten%0A@@fully_connected%0A@@max_pool2d%0A@@one_hot_encoding%0A@@repeat%0A@@separable_convolution2d%0A@@stack%0A@@unit_norm %0A%0AAl
d7fb2703e7eb6d0c2af2b89cf2f87402a98764e9
Add information about the variables parsed from the map
terminus/builders/osm_city_builder.py
terminus/builders/osm_city_builder.py
from geometry.point import Point from imposm.parser import OSMParser import math from models.city import City from models.street import Street from models.trunk import Trunk from models.block import Block from models.building import Building from models.ground_plane import GroundPlane from models.road import * impor...
Python
0
@@ -3357,16 +3357,201 @@ tial'%5D%0A%0A + # osmid: OSM id for the way/street%0A # tags: tag dictionary with various information about the way (name, type, etc)%0A # refs: nodes that are part of the way/street%0A @@ -4135,24 +4135,116 @@ coords '''%0A + # osmid: OSM id for the no...
de3dacda79274b126501d8bbc61313a7b4ae4197
Fix agreement user property: user_id can be 0
indico/modules/agreements/models/agreements.py
indico/modules/agreements/models/agreements.py
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
Python
0.999999
@@ -4525,20 +4525,16 @@ if -not self.use @@ -4537,16 +4537,24 @@ .user_id + is None :%0A
1e46c981aebe4db31642d066b622bd477ea11f62
Add TODO for disabling buttons on random order
run_battery.py
run_battery.py
import sys import os import random import datetime import pandas as pd import PyQt4.QtCore as QtCore import PyQt4.QtGui as QtGui from interface import main_window from tasks import ant, mrt, sart, ravens, digitspan_backwards class BatteryWindow(QtGui.QMainWindow, main_window.Ui_CognitiveBattery): def __init__(se...
Python
0
@@ -1323,16 +1323,74 @@ leter)%0A%0A + # TODO disable Up/Down buttons if order is random%0A
a16e706c83088b4f5199069e033da26236f21e6f
Fix activity_log timestamp default value. It was static.
src/core/models.py
src/core/models.py
from __future__ import unicode_literals from sqlalchemy import create_engine, Column, ForeignKey, Integer, String,\ Boolean, Unicode, Date, DateTime from sqlalchemy.orm import relationship, backref, sessionmaker from sqlalchemy.engine.url import URL from sqlalchemy.ext.declarative import declarative_base, declared_...
Python
0.000001
@@ -5165,43 +5165,8 @@ .now -(pytz.timezone(settings.CLIENT_TZ)) )%0A%0A
61fc65b63a3dc5cc928a3cf97f55bb66ec8ba13e
add a smoke test for the admin search view
test_project/core/tests/test_admin.py
test_project/core/tests/test_admin.py
import json from django.contrib.auth.models import User from django.test import TestCase try: from django.core.urlresolvers import reverse except ImportError: # Django 2.0 from django.urls import reverse class DjangoQLAdminTest(TestCase): def setUp(self): self.credentials = {'username': 'test'...
Python
0
@@ -3857,20 +3857,313 @@ ms': %5B%5D,%0A %7D)%0A +%0A def test_query(self):%0A url = reverse('admin:core_book_changelist') + '?q=price=0'%0A self.assertTrue(self.client.login(**self.credentials))%0A response = self.client.get(url)%0A # There should be no error at least%0A s...
f247e3d31b25908a46cb64754166fca2a421edd9
Update P1_lookingBusy.py added docstring
pythontutorials/books/AutomateTheBoringStuff/Ch18/Projects/P1_lookingBusy.py
pythontutorials/books/AutomateTheBoringStuff/Ch18/Projects/P1_lookingBusy.py
# Write a script to nudge your mouse cursor slightly every ten seconds. # The nudge should be small enough so that it won’t get in the way if # you do happen to need to use your computer while the script is running. import pyautogui, time def main(): while True: time.sleep(10) pyautogui.moveRel(1...
Python
0
@@ -1,10 +1,25 @@ -# +%22%22%22Looking busy%0A%0A Write a @@ -80,18 +80,16 @@ econds.%0A -# The nudg @@ -148,18 +148,16 @@ way if%0A -# you do h @@ -221,16 +221,21 @@ nning.%0A%0A +%22%22%22%0A%0A import p
e8e3a7daaa1e6afc4c8f9853f6db77dcd557f4d3
Call 'lower()' on the input
examples/black-whitelist/whitelist_generator.py
examples/black-whitelist/whitelist_generator.py
""" instabot example Whitelist generator: generates a list of users which will not be unfollowed. """ import sys import os import random sys.path.append(os.path.join(sys.path[0], '../../')) from instabot import Bot bot = Bot() bot.login() print("This script will generate whitelist.txt file with users" ...
Python
0.999999
@@ -875,16 +875,24 @@ put_line +.lower() :%0A
c2bbc9b3c977377083dacf475715ed38a6def539
Update package_utils.py
stakkr/package_utils.py
stakkr/package_utils.py
"""Gives useful information about the current virtualenv, files locations if stakkr is installed as a package or directly cloned""" import os import sys from distutils.sysconfig import get_config_vars, get_python_lib def get_venv_basedir(): """Returns the base directory of the virtualenv, useful to read configur...
Python
0
@@ -386,23 +386,37 @@ refix'%5D%0A -%0A -if +has_real_prefix = hasattr @@ -440,19 +440,142 @@ x') -is False or +or (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix)%0A if has_real_prefix is False or (hasattr(sys, 'real_prefix') and exe @@ -610,16 +610,17 @@ _prefix) +) :%0A
9917150d995bcb4956afdec73256319bd7d042d4
Update ELU layer
thinc/neural/_classes/elu.py
thinc/neural/_classes/elu.py
from .affine import Affine from ... import describe from ...describe import Dimension, Synapses, Biases class ELU(Affine): def predict(self, input__BI): output__BO = Affine.predict(self, input__BI) self.ops.elu(output__BO, inplace=True) return output__BO def begin_update(self, input__...
Python
0
@@ -742,25 +742,8 @@ ient -, *args, **kwargs )%0A
02616c3edbe3cd5abf18cc9b8ece7e627898776b
Fix RemovedInDjango19Warning
threadedcomments/__init__.py
threadedcomments/__init__.py
""" Change the attributes you want to customize """ from threadedcomments.models import ThreadedComment from threadedcomments.forms import ThreadedCommentForm # following PEP 440 __version__ = "1.0" def get_model(): return ThreadedComment def get_form(): return ThreadedCommentForm
Python
0
@@ -45,16 +45,80 @@ ize%0A%22%22%22%0A +%0A%0A# following PEP 440%0A__version__ = %221.0%22%0A%0Adef get_model():%0A from thr @@ -165,165 +165,110 @@ ent%0A -from t + return T hreaded -c +C omment -s.forms import T +%0A%0Adef get_form():%0A from t hreaded -C +c omment -Form%0A%0A# following PEP 440%0A_...
541387c4a2f59cf746bbb7e018d3f0af3aef127c
Add a check against working with the same person
scapp/views.py
scapp/views.py
from flask import Flask, session, url_for, flash, redirect, request, render_template from . import app from . import models from . import profiles from . import forms from . import recurse from . import events from .oauth import auth, get_login, login_required def session_init(resp, next_url): session['oauth_to...
Python
0
@@ -3804,16 +3804,247 @@ id%22%5D))%0A%0A + buddies = events.get_buddies_by_uid(login%5B%22id%22%5D)%0A if chosen_person in buddies:%0A flash(%22You cannot submit the same person more than once!%22)%0A return redirect(url_for('profile', uid=login%5B%22id%22%5D))%0A%0A
7bb26efe9f3de34650bffe60f5dff1ad08b7fb36
handle cases missing dateCreation
scrap_hatvp.py
scrap_hatvp.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys, re, json, time import requests DEBUG = len(sys.argv) > 1 imgpath = os.path.join("images", "logos-HATVP") for d in ["data", "images", imgpath]: if not os.path.exists(d): os.makedirs(d) imgfmt = lambda f: "png" if "png" in f else "jpg" data = ...
Python
0.000015
@@ -1464,16 +1464,169 @@ d(act)%0A%0A +def get_debut(h):%0A for k in %5B%22dateCreation%22, %22dateDebut%22%5D:%0A if k in h:%0A return h%5Bk%5D%0A raise(%22no starting date found for %25s%22 %25 h)%0A%0A for org @@ -2134,25 +2134,20 @@ if -h%5B%22dateCreation%22%5D +get_debut(h) != @@ ...
7c0a7a517cb408f412f2ff9f62283bf35172a866
fix variable
script/iris.py
script/iris.py
# coding: UTF-8 # # --- Iris.py --- # Irisのデータを用いてtsaliisエントロピー正則化FCM法を試す # import numpy as np import matplotlib.pyplot as plt from sklearn import datasets as ds from sklearn.metrics import accuracy_score import random import math import sys def main(): # Irisのデータを読み込む iris = ds.load_iris() # Irisのデータをロードする ...
Python
0.000011
@@ -2479,21 +2479,22 @@ :%0A%09 if +p re -sul +dic t%5Bk%5D == @@ -2500,29 +2500,30 @@ first:%0A%09%09 +p re -sul +dic t%5Bk%5D = 0%0A%09 @@ -2527,21 +2527,22 @@ %09 elif +p re -sul +dic t%5Bk%5D == @@ -2547,29 +2547,30 @@ = last:%0A%09%09 +p re -sul +dic t%5Bk%5D = 2%0A%09 @@ -2579,21 +2579,...
61bcc691e878809686bb2cf8eb10cd6b2b79b7a7
Remove the correlation-id assertion
tests/mixin_tests.py
tests/mixin_tests.py
import socket import time from . import base def assert_between(low, value, high): if not (low <= value < high): raise AssertionError('Expected {} to be between {} and {}'.format( value, low, high)) class MeasurementTestCase(base.AsyncServerTestCase): def test_measurement_was_sent(self...
Python
0.999995
@@ -2201,137 +2201,8 @@ 16) -%0A self.assertEqual(%0A measurement.fields%5B'correlation_id'%5D,%0A base.NamedRequestHandler.correlation_id) %0A%0A
8b5cd0c203ce0b4841a9be6494e99d4a2a252769
Fix command options, can now provide custom options in YAML
hpcbench/benchmark/shoc.py
hpcbench/benchmark/shoc.py
"""The Scalable HeterOgeneous Computing (SHOC) Benchmark Suite https://github.com/vetter/shoc """ import re from cached_property import cached_property from hpcbench.api import ( Benchmark, Metrics, MetricsExtractor, ) from hpcbench.toolbox.process import find_executable class SHOCExtractor(MetricsEx...
Python
0
@@ -1344,16 +1344,114 @@ %0A %7D%0A%0A + @property%0A def check_metrics(self):%0A return False # all metrics are not mandatory%0A%0A @pro @@ -2356,16 +2356,80 @@ driver'%0A + DEFAULT_OPTIONS = %5B'-s', '3'%5D%0A DEFAULT_BENCHMARK = %22all%22%0A CATE @@ -2568,24 +2568,74 @@ butes=dict...
6bd621775b3ccc78960cba3eef269d3fd0c61506
Fix bug Shooting through walls when colliding is no longer possible
src/combat.py
src/combat.py
from utils import * # Shots MG_SHOT1 = {'tex':'mg_shot1', 'speed':42, 'damage':10} SHOT1 = {'tex':'shot1', 'speed':70, 'damage':100} PLASMA_SHOT = {'tex':'shot2', 'speed':30, 'damage':25, 'slowdown':2.5} # Weapons STD_MG = {'shot':MG_SHOT1, 'type':'std_mg', 'ammo':9999, 'freq':8} H_GUN = {'shot':SHOT1, 'type':'h_gun'...
Python
0.000001
@@ -2441,16 +2441,200 @@ t None:%0A +%09%09%09%09%09head = self.owner.snake%5B0%5D%0A%09%09%09%09%09heading = self.owner.snake.heading%0A%09%09%09%09%09%0A%09%09%09%09%09if add_vecs(head, mul_vec(heading, 1)) not in %5C%0A%09%09%09%09%09self.game._map and head not in self.game._map:%0A%09 %09%09%09%09%09sel @@ -2645,...
b575ea3b68cdc8022e4490217a5321f6da75bb1f
Fix to function to check if grid engine is present
src/common.py
src/common.py
"""Wrapper functions for running the various programs in the jobTree package. """ #Copyright (C) 2011 by Benedict Paten (benedictpaten@gmail.com) # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Softwa...
Python
0
@@ -1592,15 +1592,12 @@ at - -version +help %22) =
40aae5592603005a84ee2222eaa07a879f99309d
fix test
tests/test_bridge.py
tests/test_bridge.py
# -*- coding: utf-8 -*- from unittest import TestCase from kogniserver.services import create_rsb_config, Bridge from mock import MagicMock class TestKogniServerBridge(TestCase): def setUp(self): self.config = create_rsb_config() def tearDown(self): self.b.deactivate() #def __init__(se...
Python
0.000002
@@ -98,18 +98,54 @@ b_config -, +%0Afrom kogniserver.pubsub import PubSub Bridge%0Af @@ -472,32 +472,38 @@ self.b = +PubSub Bridge('/foo/bar @@ -537,24 +537,30 @@ , 'string', +PubSub Bridge.RSB_T @@ -815,32 +815,38 @@ self.b = +PubSub Bridge('/foo/bar @@ -880,24 +880,30 @@ , 'string', +PubSu...
640acc276cf0143858ebe8b264e2745358bad245
Enable ses_id in message packages
src/config.py
src/config.py
#!/bin/python import os import sys import json import logging import configparser from datetime import datetime # TODO: Parsing for binary packages? (1byte 2bytes) config_dir = os.path.dirname(os.path.abspath(__file__)) # Get configuration file name which send as first argumen to the program if len(sys.argv) < 2: ...
Python
0.000001
@@ -2474,19 +2474,22 @@ ' -msg +ses_id ',%0A @@ -2486,26 +2486,24 @@ id',%0A - # 'ses_time', @@ -2515,17 +2515,12 @@ -# 'ses_id +'msg ',%0A%5D
aee7b9b50c27bc9f645316c9422b3b187e54e192
set backend to avoid errors in Travis
tests/test_charts.py
tests/test_charts.py
# -*- coding: utf-8 -*- """ test_charts.py Tests for the charts.py module. """ from __future__ import absolute_import, print_function import unittest import matplotlib import pandas as pd from hydrofunctions import charts dummy = {'col1': [1, 2, 3, 38, 23, 1, 19], 'col2': [3, 4, 45, 23, 2, 4, 76]} class T...
Python
0.000009
@@ -162,16 +162,305 @@ plotlib%0A +# Recommended that I use this line to avoid errors in TravisCI%0A# See https://matplotlib.org/faq/howto_faq.html%0A# Basically, matplotlib usually uses an 'X11 connection' by default; Travis CI%0A# does not have this configured, so you need to set your backend explicitly.%0Amatplotli...
7faffbef68faf268bd310d07df1c24368379dfb9
Fix PEP8 for errorck
src/etc/errorck.py
src/etc/errorck.py
# Copyright 2015 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://...
Python
0.000004
@@ -577,13 +577,25 @@ sys -, os, +%0Aimport os%0Aimport re%0A
fd60c4c9e3bcba56c436353ffefe6904cab123e8
Disable tests checking posix permissions on Windows
tests/test_config.py
tests/test_config.py
# -*- coding: utf-8 -*- import os import pytest import yaml import giraffez from giraffez.constants import * from giraffez.errors import * from giraffez.types import Columns from giraffez.utils import * @pytest.mark.usefixtures('config', 'tmpfiles') class TestConfig(object): def test_get_set_list_value(self, t...
Python
0
@@ -27,16 +27,32 @@ mport os +%0Aimport platform %0A%0Aimport @@ -2193,32 +2193,274 @@ elf, tmpfiles):%0A + # Tests for permissions on linux or unix-like system only. Windows%0A # requires the use of Windows-only APIs to determine and set the%0A # permissions on files.%0A if platform.syst...
66affcf1b509dc2476fcd3e41deb4b22138ce5c3
remove TESTRUN variable
src/findreplace.py
src/findreplace.py
#! /usr/bin/env python3 # encoding: utf-8 """ findreplace -- find and replace strings in text files findreplace is a description It defines classes_and_methods @author: Norbert Auer @copyright: Copyright 2016 Acib GmbH, Vienna. All rights reserved. @license: license @contact: norbert.auer@boku.ac.at @d...
Python
0.000438
@@ -3736,19 +3736,8 @@ EBUG - or TESTRUN :%0A
9decdff03e3729b93e90d29b920381bf21eb8ec1
test config: add the new distributed_collage filter to the list
tests/test_config.py
tests/test_config.py
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from os.path import expanduser from unittest import TestCase import ...
Python
0
@@ -3097,24 +3097,79 @@ ers.curve',%0A + 'thumbor.filters.distributed_collage',%0A
88f81e9d052561b88cc8da4572c26c62cd9976b5
Test coverage
tests/test_fields.py
tests/test_fields.py
import os from django.conf import settings from django.db import models from buckets.fields import S3File, S3FileField from .mocks import FakeS3Storage, create_file, make_dirs # noqa ############################################################################# # S3File ###########################################...
Python
0.000001
@@ -1644,35 +1644,38 @@ t'))%0A%0A%0Adef test_ -g +del et +e _file(make_dirs) @@ -4208,16 +4208,125 @@ text'%0A%0A%0A +def test_get_internal_type():%0A field = S3FileField()%0A assert field.get_internal_type() == 'URLField'%0A%0A%0A class Fi
ab1c168bdd67a4a7f4bda46380bd07cfb58ccb16
Set async connect for gevent's test_connection_timeout
tests/test_gevent.py
tests/test_gevent.py
import sys import bonsai.errors from bonsai import get_vendor_info from bonsai import LDAPClient from bonsai import LDAPEntry import pytest from conftest import get_config, network_delay try: from gevent import socket from bonsai.gevent import GeventLDAPConnection except ImportError: pass gevent = pytest....
Python
0.000001
@@ -915,16 +915,143 @@ n cli%0A%0A%0A +@pytest.fixture%0Adef turn_async_conn():%0A bonsai.set_connect_async(True)%0A yield None%0A bonsai.set_connect_async(False)%0A%0A%0A def test @@ -4917,32 +4917,49 @@ _timeout(gclient +, turn_async_conn ):%0A %22%22%22 Test @@ -4978,24 +4978,44 @@ imeout. %22%22%2...
f7d7b67c9c7623545fd74e67fd2ca255fde42fe0
Fix typos
tests/test_mcache.py
tests/test_mcache.py
import unittest import os import time from subprocess import Popen, PIPE from tests.common import load_check class TestMemCache(unittest.TestCase): def setUp(self): self.agent_config = { "memcache_server": "localhost", "memcache_instance_1": "localhost:11211:mytag", "m...
Python
0.999999
@@ -437,32 +437,33 @@ %7B'ur +l ': %22localhost%22%7D, @@ -471,32 +471,33 @@ %7B'ur +l ': %22localhost%22, @@ -548,32 +548,33 @@ %7B'ur +l ': %22localhost%22, @@ -1332,16 +1332,17 @@ %7B'ur +l ': %22loca @@ -2668,16 +2668,17 @@ 'ur +l ': 'loca
9868cd4e810d6545d292fe1480d8fa413d00a8cd
truncate long title
funnel/extapi/boxoffice.py
funnel/extapi/boxoffice.py
# -*- coding: utf-8 -*- import requests from ..util import extract_twitter_handle from .. import app __all__ = ['Boxoffice'] class Boxoffice(object): """ An interface that enables data retrieval from Boxoffice. """ def __init__(self, access_token): self.access_token = access_token se...
Python
0.999996
@@ -1593,17 +1593,26 @@ ('title' -) +, '')%5B:80%5D ,%0A
f552779d0c7b66922f843cd61ecc89e1e76dd0da
Test model pass-through.
tests/test_models.py
tests/test_models.py
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals, absolute_import from . import * from gtabview.models import as_model def test_model_vect(): model = as_model([1, 2, 3]) assert(model.header_shape() == (0, 0)) assert(model.shape() == (3, 1)) assert(materialize(model) == ...
Python
0
@@ -146,16 +146,107 @@ model%0A%0A%0A +def test_model_id():%0A model = as_model(%5B1, 2, 3%5D)%0A assert(as_model(model) is model)%0A%0A def test
13bb256fade89f3882d0a08786f4cb02dbdcaed4
Fix multidispatch type inference for Group
gaphor/diagram/grouping.py
gaphor/diagram/grouping.py
""" Grouping functionality allows to nest one item within another item (parent item). This is useful in several use cases - artifact deployed within a node - a class within a package or a component - composite structures (i.e. component within a node) The grouping adapters has to implement three methods, see `Abstrac...
Python
0.000011
@@ -2154,16 +2154,57 @@ %0A%0A%0AGroup +: FunctionDispatcher%5BType%5BAbstractGroup%5D%5D = multi @@ -2220,32 +2220,37 @@ object, object)( +%0A NoGrouping)%0A%0A# U @@ -2243,16 +2243,17 @@ Grouping +%0A )%0A%0A# Unt
1a7e168a508d6fecb83e08a8cbbe8855db93205b
Update test case with desired outcome
tests/test_parser.py
tests/test_parser.py
import re import unittest from hashedindex import textparser class TfidfTestCase(unittest.TestCase): def test_zero_term_frequency(self): assert textparser.tfidf(tf=0, df=10, corpus_size=1) == 0 def test_zero_document_frequency(self): assert textparser.tfidf(tf=10, df=0, corpus_size=1) == 0 ...
Python
0.000001
@@ -5079,24 +5079,262 @@ ), (')',)%5D%0A%0A + def test_inner_punctuation(self):%0A assert list(textparser.word_tokenize(%0A text='is the oven pre-heated?',%0A retain_punctuation=True%0A )) == %5B('is', ), ('the', ), ('oven',), ('pre-heated', ), ('?',)%5D%0A%0A def test
4ae76225c2f04cda0a45f279a957422418806841
remove interface random_key
georest/storage/storage.py
georest/storage/storage.py
# -*- encoding: utf-8 -*- __author__ = 'ray' __date__ = '6/3/14' """ georest.storage.storage ~~~~~~~~~~~~~~~~~~~~~~~ Geo Feature Storage Interface. """ from collections import namedtuple class FeatureDataSourceResult( namedtuple('FeatureDataSourceResult', 'success feature version')): pass cla...
Python
0.000001
@@ -530,191 +530,8 @@ %22%22%0A%0A - def random_key(self):%0A %22%22%22Generate a unique random key%0A%0A :param str prefix: add prefix to the key%0A :rtype: str%0A %22%22%22%0A raise NotImplementedError%0A%0A
8459273143ba5db815a425f047782553d347fdc0
Fix deprecated usage of exeption value
tests/projects/test_project_models.py
tests/projects/test_project_models.py
import os import pytest from dateutil.parser import parse from django.conf import settings from django.urls import reverse from django.test.utils import override_settings from freezegun import freeze_time from adhocracy4.projects import models from adhocracy4.test import helpers @pytest.mark.django_db def test_get_...
Python
0.000001
@@ -1831,16 +1831,22 @@ in str(e +.value )%0A%0A%0A@ove
daccfe4d9a082db8d1fdc126c92d358ba2a0149b
fix import test
tests/source/csv/test_import_shots.py
tests/source/csv/test_import_shots.py
import os from tests.base import ApiDBTestCase from zou.app import db from zou.app.models.entity_type import EntityType from zou.app.models.project import ProjectTaskTypeLink from zou.app.models.task import Task from zou.app.models.task_type import TaskType from zou.app.services import shots_service class ImportCsv...
Python
0
@@ -1795,80 +1795,137 @@ -task = tasks%5B0%5D%0A self.assertEqual(str(task.entity_id), shot%5B%22id%22%5D +self.assertEqual(%0A set(str(task.entity_id) for task in tasks),%0A set(shot%5B%22id%22%5D for shot in shots),%0A )%0A%0A
daac3f87a551cb0107e5c7c23049912550a12a44
use junctions of windows
jenkins.py
jenkins.py
#!/usr/bin/env python3 # Copyright (c) 2014, Ruslan Baratov # All rights reserved. # https://github.com/ruslo/polly/wiki/Jenkins import os import subprocess import sys import tempfile import shutil def run(): cdir = os.getcwd() hunter_root = cdir toolchain = os.getenv('TOOLCHAIN') if not toolchain: sys...
Python
0.000001
@@ -1888,16 +1888,59 @@ sting')%0A + os.makedirs(testing_dir, exist_ok=True)%0A%0A if os. @@ -1949,24 +1949,24 @@ me == 'nt':%0A - hunter_j @@ -2035,29 +2035,26 @@ ns:%0A te -sting +mp _dir = tempf @@ -2086,16 +2086,179 @@ nctions) +%0A shutil.rmtree(temp_dir)%0A subprocess.check_output(%0A...
1528c92e14a73ad186e887fe2493af5676a96913
edit type
journal.py
journal.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """A Pyramid app for my learning journal """ from __future__ import unicode_literals import os from pyramid.config import Configurator from pyramid.view import view_config from waitress import serve import sqlalchemy as sa from sqlalchemy.ext.declarative import declarative...
Python
0.000002
@@ -432,29 +432,8 @@ ion%0A -%3C%3C%3C%3C%3C%3C%3C HEAD%0A=======%0A impo @@ -448,22 +448,8 @@ ime%0A -%3E%3E%3E%3E%3E%3E%3E step2%0A %0A%0ADB
7df0a7433510d6caee1277c911d374b538a40df9
Add status endpoint to task resource
girder/task/server/task.py
girder/task/server/task.py
import io import cherrypy import json from girder.api.rest import RestException from girder.api import access from girder.api.describe import Description from ConfigParser import ConfigParser from girder.api.docs import addModel from girder.constants import AccessType from girder.api.rest import RestException from .bas...
Python
0.000002
@@ -668,24 +668,81 @@ elf.update)%0A + self.route('GET', (':id','status'), self.status)%0A #sel @@ -3126,28 +3126,402 @@ d=False, paramType='body'))%0A +%0A @access.user%0A def status(self, id, params):%0A user = self.getCurrentUser()%0A%0A task = self._model.load(id, user=user)%0A...
180ccd38b948a58f2ae945c13cf8eb947623bba6
Refactor out get_log_reviewers_from_file
git_reviewers/reviewers.py
git_reviewers/reviewers.py
#!/usr/bin/env python3 import argparse import subprocess import sys if sys.version_info < (3, 0): # NOQA pragma: no cover raise SystemError("Must be using Python 3") __version__ = '0.1.2' UBER = False class FindReviewers(): def get_reviewers(self): """ All review classes should implement t...
Python
0.000011
@@ -1687,32 +1687,36 @@ es%0A%0A def get_ +log_ reviewers(self): @@ -1700,37 +1700,58 @@ et_log_reviewers -(self +_from_file(self, file_path ):%0A %22%22%22 F @@ -1793,149 +1793,23 @@ log -of the diffed +for a file -s %22%22%22%0A - changed_files = self.get_changed_files()%0A reviewers...
60056d8573d4c8a9f69dc7f3e41af91ca79c9e8b
Remove an unnecessary call to pyramid.threadlocal.get_current_request()
github2fedmsg/traversal.py
github2fedmsg/traversal.py
from hashlib import md5 import tw2.core as twc import github2fedmsg.models import github2fedmsg.widgets import pyramid.threadlocal from pyramid.security import authenticated_userid def make_root(request): return RootApp(request) class RootApp(dict): __name__ = None __parent__ = None def __init__(s...
Python
0.000006
@@ -102,35 +102,8 @@ ets%0A -import pyramid.threadlocal%0A from @@ -753,68 +753,8 @@ day%0A - request = pyramid.threadlocal.get_current_request()%0A @@ -787,16 +787,21 @@ _userid( +self. request)
9812fce48153955e179755ea7a58413c3bee182f
Update stamp.py
theonionbox/stamp.py
theonionbox/stamp.py
__title__ = 'The Onion Box' __description__ = 'Dashboard to monitor Tor node operations.' __version__ = '20.2rc1' __stamp__ = '20200119|095654'
Python
0.000001
@@ -106,11 +106,8 @@ 20.2 -rc1 '%0A__ @@ -133,8 +133,9 @@ %7C095654' +%0A
56bc9c79522fd534f2a756bd5a18193635e2adae
Fix missing mock and rename variable
tests/test_default_security_groups.py
tests/test_default_security_groups.py
"""Test default Security Groups.""" from unittest import mock from foremast.securitygroup.create_securitygroup import SpinnakerSecurityGroup @mock.patch('foremast.securitygroup.create_securitygroup.get_properties') def test_default_security_groups(mock_properties): """Make sure default Security Groups are added ...
Python
0.000001
@@ -137,16 +137,87 @@ Group%0A%0A%0A +@mock.patch('foremast.securitygroup.create_securitygroup.get_details')%0A @mock.pa @@ -330,16 +330,30 @@ operties +, mock_details ):%0A %22 @@ -735,16 +735,25 @@ t_sg = %7B +%0A 'myapp': @@ -754,16 +754,29 @@ yapp': %5B +%0A %7B'start_ @@ -827,11 +827...
15ff8c9b93b6572bbd7db1318c7041b0b123e69c
fix test case
tests/test_upload_n_download_excel.py
tests/test_upload_n_download_excel.py
import pyexcel as pe from _compact import BytesIO, PY2 from nose.tools import eq_ _XLSX_MIME = ( "application/" + "vnd.openxmlformats-officedocument.spreadsheetml.sheet") FILE_TYPE_MIME_TABLE = { "csv": "text/csv", "tsv": "text/tab-separated-values", "csvz": "application/zip", "tsvz": "applica...
Python
0.000022
@@ -38,17 +38,8 @@ port - BytesIO, PY2
4f02fa53b9ff9b0ba5afb485df69177d2f35ad3b
Add readFlagBit() function
s7/__init__.py
s7/__init__.py
#!/usr/bin/env python import ctypes class S7Exception: def __init__(self, msg, err): self._err = err self._msg = msg def __str__(self): return "%s (%d)" % (self._msg, self._err) class S7Comm: def __init__(self, address): self._address = address self._s7obj = ctypes...
Python
0
@@ -3348,28 +3348,381 @@ f._err_to_string(ret), ret)%0A +%0A def readFlagBit(self, byteNum, bitNum):%0A value = ctypes.c_uint8()%0A ret = self._s7obj.s7comm_read_flag_bit(self._s7conn, (byteNum * 8) + bitNum, ctypes.byref(value))%0A%0A if ret != 0:%0A raise S7Exception(self._err_to_s...
eabae1855f40c2c7d69e2d88cb45e37ba1ef29e6
resolve false negatives due to hashes in requirements file
safety/util.py
safety/util.py
from dparse.parser import setuptools_parse_requirements_backport as _parse_requirements from collections import namedtuple import click import sys import json import os Package = namedtuple("Package", ["key", "version"]) RequirementFile = namedtuple("RequirementFile", ["path"]) def read_vulnerabilities(fh): retur...
Python
0
@@ -607,16 +607,82 @@ =%22)%5B-1%5D%0A + if ' --hash' in line:%0A line = line.split(%22 --hash%22)%5B0%5D%0A retu
c774b223f4de4815d97dfdfd782d1069de1717cd
Update to real default ships
server/game.py
server/game.py
""" Battleships game components. """ from copy import copy # Useful constants HORIZONTAL = 0 VERTICAL = 1 # Use a 10x10 board BOARD_SIZE = 10 # Just used for formatting output SHIP_NAMES = { 1: "Submarine", 2: "Destroyer", 3: "Cruiser", 4: "Battleship", 5: "Aircraft Carrier" } # Default Ships av...
Python
0
@@ -327,24 +327,9 @@ e%0A# -2 x Submarine, 2 +1 x D @@ -338,17 +338,17 @@ troyer, -1 +2 x Crusi @@ -420,18 +420,12 @@ 3, -2 +3 , 2 -, 1, 1 %5D%0A%0A%0A
6cf4901344033b50c6e56a9c878a7e89f33d3880
Fix 2to3 fixers to work with Python 3.
2to3/fix_reload.py
2to3/fix_reload.py
# Based on fix_intern.py. Original copyright: # Copyright 2006 Georg Brandl. # Licensed to PSF under a Contributor Agreement. """Fixer for intern(). intern(s) -> sys.intern(s)""" # Local imports from lib2to3 import pytree from lib2to3 import fixer_base from lib2to3.fixer_util import Name, Attr, touch_import class ...
Python
0
@@ -531,17 +531,16 @@ ('imp', -u 'reload'
c1a291c362df384b11bdc9b829b75c5ecd505aa9
add config for new session cam
Utils/py/GoPro/config.py
Utils/py/GoPro/config.py
from goprocam.constants import * # NaoCam / a1b0a1b0a1 # NAOCAM_2 / a1b0a1b0a1 # GP26329941 / family3887 / D6:B9:D4:D7:B7:40 # GP26297683 / epic0546 / F8:D2:E9:F0:AC:0B ssid = 'GP26329941' passwd = 'family3887' mac = 'D6:B9:D4:D7:B7:40' retries = -1 # if the following configs are set, the cam tries to set them befo...
Python
0
@@ -73,16 +73,40 @@ 0a1b0a1%0A +# NAOCAM_3 / a1b0a1b0a1%0A # GP2632
6a8dcdb1cda3707cf39e0c29ab6a213c7182b253
add a dot anchor to the regex to restrict it to a subdomain
4ChanWebScraper.py
4ChanWebScraper.py
#downloads an IMAGE to the provided path. #this fails on .WEBM or other media def downloadImage(url,path): import requests from PIL import Image img = requests.get(url) i = Image.open(StringIO(img.content)) i.save(path) #Checks if input folder exists in the current directory. If not, create it. de...
Python
0
@@ -1104,16 +1104,18 @@ .)?4chan +%5C. '%0A if
e6a489eef1e85146b223bd4e8cf58c1f1b049cf3
Add tip about being able to edit message.
VocaBot/contentparser.py
VocaBot/contentparser.py
import math from collections import defaultdict from telegram import Emoji from constants import Context, VOCADB_BASE_URL from i18n import _ # I'm not exactly proud of this module's code.. but it does the job. def names_text(song): if len(song['names']) > 1: names = _('<b>Additional names:</b>\n') ...
Python
0
@@ -7038,16 +7038,24 @@ Did you +perhaps misspell @@ -7058,16 +7058,75 @@ pell it? + %22%0A %22(tip: you can edit your message.) %22)%0A
fb1d55de93ae2ef49feea278a4c99013a690c858
Fix unicode_literals issue
south/utils/__init__.py
south/utils/__init__.py
""" Generally helpful utility functions. """ def _ask_for_it_by_name(name): "Returns an object referenced by absolute path." bits = name.split(".") ## what if there is no absolute reference? if len(bits)>1: modulename = ".".join(bits[:-1]) else: modulename=bits[0] module = __...
Python
0.001667
@@ -135,20 +135,25 @@ bits = +str( name +) .split(%22 @@ -224,9 +224,11 @@ its) -%3E + %3E 1:%0A @@ -295,17 +295,19 @@ dulename -= + = bits%5B0%5D%0A
ec5d0bde476e71ff26a6f249017abef86781144f
Load 'database_backup' model
infrastructure/__init__.py
infrastructure/__init__.py
# -*- coding: utf-8 -*- import command import database import database_type import db_back_up_policy import db_filter import environment import environment_repository import environment_version import instance import instance_host import mailserver import partner import repository import repository_branch import serve...
Python
0.000001
@@ -70,16 +70,39 @@ se_type%0A +import database_backup%0A import d
3b164c2c28b38d8936d85b8774bfc2285dc372b5
use single quote instead of double quotes
storj/file_crypto.py
storj/file_crypto.py
from Crypto.Cipher import AES from Crypto import Random import hashlib class FileCrypto: def encrypt_file(self, algorithm, file_path, encrypted_file_save_path, password): if algorithm == "AES": with open(file_path, 'rb') as in_file, open(encrypted_file_save_path, 'wb') as out_file: ...
Python
0
@@ -187,37 +187,37 @@ if algorithm == -%22AES%22 +'AES' :%0A wi @@ -485,13 +485,13 @@ == -%22AES%22 +'AES' :%0A @@ -2237,33 +2237,33 @@ aise ValueError( -%22 +' bad decrypt pad @@ -2266,17 +2266,17 @@ pad (%25d) -%22 +' %25 paddi @@ -2550,17 +2550,17 @@ ueError( -%22 +' bad decr @@ -2566,9 +...
3bbcdc74ad277c71cdb08bedd5e1da0eeddc436e
Add delete override for Submission model with directory path debug msg
submission/models.py
submission/models.py
import time import uuid from django.db import models from django.template.defaultfilters import filesizeformat from django.contrib.auth.models import User from django.utils import timezone from django.utils.translation import ugettext_lazy as _ import forms DB_NAME_LENGTH = 100 class Team(models.Model): id = ...
Python
0
@@ -16,16 +16,30 @@ ort uuid +%0Aimport shutil %0A%0Afrom d @@ -1437,16 +1437,398 @@ .team)%0A%0A + def delete(self, *args, **kwargs):%0A for result in Result.objects.filter(submission_id__exact = self.id):%0A result.delete()%0A dir_path = os.path.dirname(self.package.path)%0A prin...
e4fcd6aa0e3f1d1c759f55cb72966693d8fa774b
Build all targets for a config at once
tools/run_tests/run_tests.py
tools/run_tests/run_tests.py
#!/usr/bin/python """Run tests in parallel.""" import argparse import glob import itertools import multiprocessing import sys import time import jobset import watch_dirs # SimpleConfig: just compile with CONFIG=config, and run the binary to test class SimpleConfig(object): def __init__(self, config): self.buil...
Python
0
@@ -2137,24 +2137,8 @@ 1),%0A - target,%0A @@ -2155,24 +2155,45 @@ G=%25s' %25 cfg%5D + + _MAKE_TEST_TARGETS %0A for @@ -2216,48 +2216,8 @@ figs -%0A for target in _MAKE_TEST_TARGETS ),%0A
515e1dc6fd3741afe8df7ce7a7c94b1ffa2db8c3
Remove useless imports from `tmserver/__init__.py`
tmserver/__init__.py
tmserver/__init__.py
# TmServer - TissueMAPS server application. # Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen # # 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...
Python
0
@@ -777,55 +777,8 @@ /%3E.%0A -import tmserver.model%0Aimport tmserver.serialize %0Afro
72146ca11a7a203bd37657ddd8b78b29edd4239e
use new memoized abstraction for setting cache; not so nice, but I can improve if/when it becomes a common use-case
corehq/apps/reports/standard/__init__.py
corehq/apps/reports/standard/__init__.py
import dateutil from django.core.urlresolvers import reverse from corehq.apps.groups.models import Group from corehq.apps.reports import util from corehq.apps.adm import utils as adm_utils from corehq.apps.reports.dispatcher import ProjectReportDispatcher, CustomProjectReportDispatcher from corehq.apps.reports.fields i...
Python
0.000001
@@ -1239,107 +1239,8 @@ ct): -%0A def __init__(self):%0A self._get_by_user_id_cache = %7B%7D%0A self._by_domain_cache = %7B%7D %0A%0A @@ -1354,24 +1354,143 @@ r in users:%0A + # put users in the cache for get_by_user_id%0A # so that function never has to touch the database%0A...
8fc6b9d53b4af882d868e5a4f0dfa0981bfd242b
Use is_pilot as a property, not a callable
cotracker/checkouts/tests/test_models.py
cotracker/checkouts/tests/test_models.py
from django.contrib.auth.models import User from django.test import TestCase from checkouts.models import (Checkout, user_full_name, user_is_pilot) import helper class AircraftTypeTests(TestCase): def test_unicode(self): o, attributes = helper.create_aircrafttype(object_only=False) self.assertEqual(o.__u...
Python
0.00004
@@ -4145,18 +4145,16 @@ is_pilot -() )%0A %0A