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
a829100920bfad61575ceb3c00874dd86a0c44de
fix youtube regex
jarvis/websearch.py
jarvis/websearch.py
#!/usr/bin/env python3 ############################################################################### # Module Imports ############################################################################### import bs4 import googleapiclient.discovery as googleapi import requests import warnings import wikipedia as wiki fro...
Python
0.998638
@@ -1891,24 +1891,28 @@ core.rule(r' +(?i) .*youtube%5C.c @@ -1952,16 +1952,20 @@ .rule(r' +(?i) .*youtu%5C
eb1e1cbe0b529e4c3ccc88809639deb1f2c354c5
mark percentile tests as xfail, still not sure why this happens
tests/percentile_approx_test.py
tests/percentile_approx_test.py
import platform import numpy as np import vaex import pytest import sys version = tuple(map(int, np.__version__.split('.'))) @pytest.mark.skipif(((1,17,0) <= version <= (1,18,1)) and platform.system().lower() == 'windows', reason="strange ref count issue with numpy") @pytest.mark.skipif(((1,17,0) <= version <= (1,18...
Python
0.000014
@@ -431,32 +431,51 @@ ue with numpy%22)%0A +@pytest.mark.xfail%0A def test_percent @@ -1542,16 +1542,35 @@ numpy%22)%0A +@pytest.mark.xfail%0A def test
616e9ab5e83b664aebef54a6d6109cb9d587afb7
Fix installer tests passing with a noop
tests/product/test_installer.py
tests/product/test_installer.py
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
Python
0
@@ -817,16 +817,90 @@ Cluster%0A +from tests.no_hadoop_bare_image_provider import NoHadoopBareImageProvider%0A from tes @@ -958,21 +958,8 @@ Case -, docker_only %0Afro @@ -1290,16 +1290,91 @@ setUp()%0A + self.setup_cluster(NoHadoopBareImageProvider(), self.BARE_CLUSTER)%0A @@ -1653,33 +1653,16 @@...
e00e784ba56a205dfb891b01b8d26527b501a52e
Update analyze.py.
tests/dynamic_geometry_rxns/analyze.py
tests/dynamic_geometry_rxns/analyze.py
#!/usr/bin/env python # Run this file to generate the min and max counts used in # test_description.json import os import numpy as np mol_counts = None mol_means = None mol_stds = None files = os.listdir(os.getcwd()) # build a list of reaction data file names file_prefix = "counts" files = [f for f in files if f....
Python
0
@@ -130,16 +130,320 @@ as np%0A%0A +num_seeds = 100%0Amcell_name = %22mcell%22%0Amdl_name = %22main_no_dg.mdl%22%0Aprint(%22Begin running MCell simulations%22)%0Afor i in range(1, num_seeds+1):%0A print('%5CtSeed: %25i' %25 i)%0A os.popen(%22%25s -quiet -seed %25i %25s%22 %25 (mcell_name, i, mdl_name))%0Aprint(...
6765a560326a365b197a00884ba0fd7412dd9e2b
Use TMP_STATE_TREE
tests/integration/states/virtualenv.py
tests/integration/states/virtualenv.py
# -*- coding: utf-8 -*- ''' tests.integration.states.virtualenv ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` :copyright: © 2012 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. ''' # Import pyth...
Python
0.000149
@@ -1986,39 +1986,8 @@ th)%0A - print dir(integration)%0A @@ -2100,29 +2100,22 @@ ion. -FILES, 'file', 'base' +TMP_STATE_TREE , 'i
56aeaf2064dccdc02236f1728dedb752cd60893e
Fix issue in test_address.py
tests/test_data/test_address.py
tests/test_data/test_address.py
# -*- coding: utf-8 -*- import re import elizabeth.data.common as common from tests.test_data import DummyCase class AddressTestCase(DummyCase): def test_street_number(self): result = self.generic.address.street_number() self.assertTrue(re.match(r'[0-9]{1,5}$', result)) def test_street_name...
Python
0.000005
@@ -714,24 +714,25 @@ sert -True(len +IsNotNone (result) %3E 6 @@ -731,13 +731,8 @@ ult) - %3E 6) %0A%0A
700e3ee272d07857534d6b7d9327ad8b746b2582
Test queue running.
tests/network/test_actions_syncback.py
tests/network/test_actions_syncback.py
from ..util.crispin import crispin_client ACCOUNT_ID=1 NAMESPACE_ID=1 THREAD_ID=1 # Unit tests for the functions, not the queue runners. These tests use a real # Gmail test account and idempotently put the account back to the state it # started in when the test is done. They intentionally make the local Inbox # datas...
Python
0
@@ -35,16 +35,60 @@ _client%0A +from ..util.api import api_client%0A%0AUSER_ID=1 %0AACCOUNT @@ -3725,12 +3725,788 @@ cases here.%0A +%0A# Higher-level tests.%0A%0Adef test_queue_running(db, api_client):%0A %22%22%22 Just the very minimal basics for now: makes sure that the methods run%0A without raising an...
d5f3f66a271d6ec81fd9172ee48c6f4957be40b9
Correct client instantiation test
tests/nydus/db/backends/redis/tests.py
tests/nydus/db/backends/redis/tests.py
from __future__ import absolute_import from tests import BaseTest from nydus.db.backends.redis import Redis from nydus.db.base import Cluster, create_cluster import mock import redis class RedisTest(BaseTest): def setUp(self): self.redis = Redis(num=0, db_num=1) self.redis.flushdb() def te...
Python
0.000001
@@ -1786,17 +1786,52 @@ one, - password +%0A password=None, unix_socket_path =Non
690fdb11ab2dfb7fc9e729de085d64101b31ec1d
increase test timeout
tests/unittests/tests/01-run.py
tests/unittests/tests/01-run.py
#!/usr/bin/env python3 # Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import os import sys def testfunc(child): child.expect(u"OK...
Python
0
@@ -503,13 +503,14 @@ timeout= -6 +12 0))%0A
2ab738e3d966402511d436fef88325542deac008
remove debug print
lib/neuroimaging/__init__.py
lib/neuroimaging/__init__.py
""" Insert long description here. """ import re from path import path __version__ = "0.01a" packages = ( 'neuroimaging', 'neuroimaging.tests', 'neuroimaging.data', 'neuroimaging.data.tests', 'neuroimaging.fmri', 'neuroimaging.fmri.tests', 'neuroimaging.fmri.fmristat', 'neuroimaging.fmri.fmristat.tests...
Python
0.000008
@@ -2371,55 +2371,8 @@ e.%22%0A - print %22import_from:%22,modulename,objectname%0A
567feb08488d6e4bc58dca80ed736bbec8050b29
change comment
totalvoice/cliente/api/validanumero.py
totalvoice/cliente/api/validanumero.py
# coding=utf-8 from __future__ import absolute_import from .helper import utils from .helper.routes import Routes from totalvoice.cliente.api.totalvoice import Totalvoice import json, requests class ValidaNumero(Totalvoice): def __init__(self, cliente): super(ValidaNumero, self).__init__(cliente) de...
Python
0
@@ -1491,17 +1491,20 @@ de -compostos +validaNumero .%0A%0A
d28a3cf6336a9fca5626c97bced8c586f37bd919
Remove unused imports
JetBrains/JetbrainsURLProvider.py
JetBrains/JetbrainsURLProvider.py
#!/usr/bin/env python # # Copyright 2015 # # 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.000001
@@ -620,25 +620,16 @@ ort%0A -import re %0Aimport urll @@ -624,22 +624,20 @@ %0Aimport -urllib +json %0Aimport @@ -643,28 +643,16 @@ urllib2 -%0Aimport json %0A%0Afrom a @@ -5062,8 +5062,9 @@ _shell() +%0A
9aa18e50d999deed16b7a0b8ea2fc27ced1faf0e
Make verify-po.py work with pre-2.3 Pythons.
tools/hook-scripts/verify-po.py
tools/hook-scripts/verify-po.py
#!/usr/bin/env python """This is a pre-commit hook that checks whether the contents of PO files committed to the repository are encoded in UTF-8. """ import codecs import string import sys from svn import core, fs, delta, repos # Set to the path of the 'msgfmt' executable to use msgfmt to check # the syntax of the po...
Python
0
@@ -2331,14 +2331,8 @@ code -Decode Erro
3e7847fcfb33dd0aa06fea2ccbf02f5c07e2b5ea
Enable webrtc on non-android since those tests don't seem to fail.
tools/perf/benchmarks/webrtc.py
tools/perf/benchmarks/webrtc.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from core import perf_benchmark from measurements import webrtc import page_sets from telemetry import benchmark @benchmark.Disabled # http://crbug.com/5...
Python
0.00001
@@ -276,29 +276,8 @@ k%0A%0A%0A -@benchmark.Disabled # ht @@ -297,16 +297,73 @@ m/501383 +%0A# http://crbug.com/508344%0A@benchmark.Disabled('android') %0Aclass W
8a4a540743cbb0419d605a7a52b3097675f42dd2
Update messages.py
src/pandas_profiling/model/messages.py
src/pandas_profiling/model/messages.py
"""Logic for alerting the user on possibly problematic patterns in the data (e.g. high number of zeros , constant values, high correlations).""" from enum import Enum, unique from typing import List, Union import warnings from contextlib import suppress import re from dateutil.parser import parse import numpy as np f...
Python
0.000001
@@ -4950,77 +4950,35 @@ on%5B%22 -composition%22%5D%5B%22min_length%22%5D%0A == description%5B%22composition%22%5D +min_length%22%5D == description %5B%22ma
1da94e9512944f2cdb33c9f3520ebc0216026950
Update file helpers
src/lib/file_ops.py
src/lib/file_ops.py
import os import logging try: import yaml except ImportError: pass logger = logging.getLogger(__name__) def create_directory(path): """ Creates a directory if it doesn't already exist. """ # Check if path is a file_path or a dir_path. Dir path is a string that ends with os.sep. if path[-...
Python
0.000001
@@ -1,12 +1,256 @@ +# Copyright (C) 2015 Google Inc., authors, and contributors %3Csee AUTHORS file%3E%0A# Licensed under http://www.apache.org/licenses/LICENSE-2.0 %3Csee LICENSE file%3E%0A# Created By: jernej@reciprocitylabs.com%0A# Maintained By: jernej@reciprocitylabs.com%0A%0A import os%0Aim @@ -525,16 +525,22 @@...
1f7b08d4eaf5143736bad758db30ef298dc054a3
add seek
restkit/http/tee.py
restkit/http/tee.py
# -*- coding: utf-8 - # # This file is part of restkit released under the MIT license. # See the NOTICE for more information. """ TeeInput replace old FileInput. It use a file if size > MAX_BODY or memory. It's now possible to rewind read or restart etc ... It's based on TeeInput from unicorn. """ import os impor...
Python
0.000002
@@ -1329,16 +1329,290 @@ elf._len +%0A %0A def seek(self, offset, whence=0):%0A if self._is_socket:%0A pos = self.tmp.tell()%0A while True:%0A if not self._tee(CHUNK_SIZE):%0A break%0A self.tmp.seek(pos)%0A self.tmp.seek(offset,...
f1b6aebb7ac579924764bef531c2825cfa6cc9b1
Fix definition of `ALPHANUMERIC`
restle/resources.py
restle/resources.py
import logging import string import six from requests import Session from restle.exceptions import NotFoundException, HTTPException, MissingFieldException from restle.options import ResourceOptions logger = logging.getLogger(__name__) ALPHANUMERIC = set(string.ascii_letters + string.ascii_letters) class ResourceB...
Python
0.999816
@@ -281,28 +281,21 @@ string. -ascii_letter +digit s)%0A%0A%0Acla
251b169c4fbb89381bfa0d7168c412e50b2b6074
Increments version to 2.5.1
revscoring/about.py
revscoring/about.py
__name__ = "revscoring" __version__ = "2.5.0" __author__ = "Aaron Halfaker" __author_email__ = "ahalfaker@wikimedia.org" __description__ = ("A set of utilities for generating quality scores for " + "MediaWiki revisions") __url__ = "https://github.com/wikimedia/revscoring" __license__ = "MIT"
Python
0.99969
@@ -40,9 +40,9 @@ 2.5. -0 +1 %22%0A__
47e91a816e196ff357e348bc8fd02819bf00059a
remove useless broker conf in dev.
rio/settings/dev.py
rio/settings/dev.py
# -*- coding: utf-8 -*- DEBUG = True SECRET_KEY = 'OOxdXBtiwPHGpjxaACWvzpYCbDhBmaYk' SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/rio.db' BROKER_URL = 'redis://localhost/2' CELERY_BROKER_URL = 'redis://localhost/2' CELERY_RESULT_BACKEND = 'db+' + SQLALCHEMY_DATABASE_URI
Python
0
@@ -136,43 +136,8 @@ b'%0A%0A -BROKER_URL = 'redis://localhost/2'%0A CELE
418faae8f7e1052e3a198ef7e69dff55deb7d141
Add max password length check.
esp8266/scripts/webrepl_setup.py
esp8266/scripts/webrepl_setup.py
import sys import socket import time from websocket import * import websocket_helper def setup_server(): s = socket.socket() s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) ai = socket.getaddrinfo("0.0.0.0", 8266) addr = ai[0][4] s.bind(addr) s.listen(1) return s def getpass(st...
Python
0
@@ -1617,16 +1617,114 @@ ontinue%0A + elif len(passwd1) %3E 9:%0A ws.write(%22Password too long%5Cr%5Cn%22)%0A continue%0A
5b69d2666b7f51d1b25bbdbcaad615e33e4e099d
Fix crash when enemy in sensor tower range + support destructible rocksu
sc2/game_state.py
sc2/game_state.py
from .units import Units from .power_source import PsionicMatrix class Common(object): ATTRIBUTES = [ "player_id", "minerals", "vespene", "food_cap", "food_used", "food_army", "food_workers", "idle_worker_count", "army_count", "warp_gate_count", "larva_count" ] ...
Python
0
@@ -57,16 +57,48 @@ icMatrix +%0Afrom .pixel_map import PixelMap %0A%0Aclass @@ -707,97 +707,8 @@ on)%0A - self.units = Units.from_proto(observation.observation.raw_data.units, game_data)%0A @@ -813,16 +813,16 @@ ources)%0A - @@ -873,16 +873,642 @@ e_loop%0A%0A + destructables = %5Bx...
441261ba9f7c8ef02ea363905c984799066ce120
throw away old parse notes on URL error
OIPA/iati/parser/parse_manager.py
OIPA/iati/parser/parse_manager.py
from IATI_2_01 import Parse as IATI_201_Parser from IATI_1_05 import Parse as IATI_105_Parser from IATI_1_03 import Parse as IATI_103_Parser from iati_organisation.parser.organisation_2_01 import Parse as Org_2_01_Parser from iati_organisation.parser.organisation_1_05 import Parse as Org_1_05_Parser from iati.filegrabb...
Python
0
@@ -1465,32 +1465,106 @@ _source = False%0A + IatiXmlSourceNote.objects.filter(source=self.source).delete()%0A note @@ -2519,32 +2519,106 @@ _source = False%0A + IatiXmlSourceNote.objects.filter(source=self.source).delete()%0A note
ae3fd0172972f672c3cf3291bcf9f28073e8d4d0
Fix stray “commands” (#5712)
scrapy/cmdline.py
scrapy/cmdline.py
import sys import os import argparse import cProfile import inspect import pkg_resources import scrapy from scrapy.crawler import CrawlerProcess from scrapy.commands import ScrapyCommand, ScrapyHelpFormatter from scrapy.exceptions import UsageError from scrapy.utils.misc import walk_modules from scrapy.utils.project i...
Python
0
@@ -201,16 +201,38 @@ ormatter +, BaseRunSpiderCommand %0Afrom sc @@ -1143,19 +1143,20 @@ and -not obj == +obj not in ( Scra @@ -1164,16 +1164,39 @@ yCommand +, BaseRunSpiderCommand) %0A
bd5978083cdd096fa1f83e43a4e8dbb36cd5f2a7
Clean up the lunar heightmap
states/lunar_surface.py
states/lunar_surface.py
import math import pygame from Box2D import * import backgrounds from camera import Camera from player import Player from heightmap import heightmap_1d from debug import draw_body class LunarSurface(object): def __init__(self): self.background = backgrounds.LunarSurface() self.camera = Camera() ...
Python
0.003321
@@ -5,16 +5,30 @@ rt math%0A +import random%0A import p @@ -160,16 +160,49 @@ tmap_1d%0A +from config import screen_height%0A from deb @@ -275,16 +275,59 @@ (self):%0A + %22%22%22 Good god what is this even %22%22%22%0A @@ -499,17 +499,18 @@ tmap_1d( -8 +12 )%0A @@ -515,27 +515,34 @@ ...
b1f8e376f343bfad5c740f2dce1a0fbc066d3b01
Add command line args for the pH.
scripts/calc_E.py
scripts/calc_E.py
# -*- coding: utf-8 -*- """ Created on Mon Jan 25th 2015 @author: flamholz """ from component_contribution.component_contribution_trainer import ComponentContribution from component_contribution.kegg_reaction import KeggReaction from component_contribution.thermodynamic_constants import F, default_T import argparse ...
Python
0
@@ -801,16 +801,293 @@ units.') +%0A%09parser.add_argument('--pH_min', default=5, type=int,%0A%09%09%09%09help='lowest pH to produce E0 for.')%0A%09parser.add_argument('--pH_max', default=9, type=int,%0A%09%09%09%09help='highest pH to produce E0 for.')%0A%09parser.add_argument('--pH_step', default=0.05, type=float,%0A...
3e62dc46770889701e33eff699c4f11b96ebced3
Create snippet when concept is set, standalone otherwise.
scripts/create.py
scripts/create.py
#!/usr/bin/env python import os import sys import shutil from os.path import basename, dirname import argparse PROJECT_NAME_MACRO = "%%%ProjectName%%%" PROJECT_ROOT_MACRO = "%%%ProjectRoot%%%" def ReplaceMacros(path, project_macros): f = open(path) content = f.read() f.close() os.remove(path) ...
Python
0
@@ -1907,32 +1907,36 @@ f))%0A%0A if +not options. language:%0A @@ -1923,24 +1923,23 @@ options. -language +concept :%0A @@ -2692,16 +2692,25 @@ rgument( +%0A '-l', '- @@ -2721,32 +2721,16 @@ guage',%0A - @@ -2744,32 +2744,16 @@ ='cpp',%0A - ...
44fba617f5671742955a214d5362694674ff4fc3
Add hook for subclass to handle enriching
stream_django/enrich.py
stream_django/enrich.py
import collections from collections import defaultdict import operator import itertools try: from django.apps import apps get_model = apps.get_model except ImportError: from django.db.models.loading import get_model def combine_dicts(a, b, op=operator.add): return dict(list(a.items()) + list(b.items(...
Python
0
@@ -4540,16 +4540,104 @@ field%5D = + self.enrich_instance(instance)%0A%0A def enrich_instance(self, instance):%0A return instanc
4016dbec6a2ea903bc8162ea41d77c3ae811a6f0
fix pylint warnings in rdp module
salt/modules/rdp.py
salt/modules/rdp.py
# -*- coding: utf-8 -*- ''' Manage RDP Service on Windows servers ''' # Import python libs import re # Import salt libs import salt.utils POWERSHELL='C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe' def __virtual__(): ''' Only works on Windows systems ''' if salt.utils.is_windows(): ...
Python
0
@@ -144,17 +144,19 @@ WERSHELL -= + = 'C:%5C%5CWin @@ -766,37 +766,33 @@ .enable%0A '''%0A - %0A + cmd = '-Inpu @@ -1259,37 +1259,33 @@ disable%0A '''%0A - %0A + cmd = '-Inpu @@ -1757,20 +1757,16 @@ '''%0A - %0A cmd
93f79fca1212424731cd2e7d18f494bd0cfa1eee
Add helper method for determining whether or not a Damageable is alive.
schema/component.py
schema/component.py
from math import sqrt class Component(object): def __init__(self, ent): self.ent = ent def tick(self): pass class Positionable(Component): def __init__(self, ent, x, y): super(Positionable, self).__init__(ent) self.position = x, y def distance_from(self, ent): ...
Python
0
@@ -1866,24 +1866,80 @@ - self.hp%0A%0A + def alive(self):%0A return self.hp %3E self.min%0A%0A def __st @@ -2162,16 +2162,17 @@ le_str%0A%0A +%0A class Vo
4470dfc1b96c604b113dea34964be65f94ae26e8
Check for the command prefix in the right place in %help
src/modules/core.py
src/modules/core.py
# Waterbug, a modular IRC bot written using Python 3 # Copyright (C) 2011 Arvid Fahlström Myrman # # 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 Licen...
Python
0.000011
@@ -2440,35 +2440,38 @@ ormat(responder. -bot +server .prefix, ' '.joi @@ -3382,19 +3382,22 @@ sponder. -bot +server .prefix,
e1067ab4e5d028fa22437ac0451ae3237f7d3a2f
update guestbook example css
examples/python/guestbook/get.py
examples/python/guestbook/get.py
# # Handles GET /guestbook -- returns a list of items in the guestbook # with a form to add more. # from flask import current_app, escape import redis # Connect to redis. This is run only when this file is loaded; as # long as the pod is alive, the connection is reused. redisConnection = redis.StrictRedis(host='redi...
Python
0
@@ -566,16 +566,75 @@ ml%3E%3Cbody + style=%22font-family:sans-serif;font-size:2rem;padding:40px%22 %3E%0A
9163ee22240c747225ce5eb795b2a488c287182d
refactor render_meshes.py example
examples/render/render_meshes.py
examples/render/render_meshes.py
# Copyright (c) 2018-2022, Manfred Moitzi # License: MIT License import math from pathlib import Path import ezdxf from ezdxf.render import forms, MeshBuilder from itertools import cycle DIR = Path("~/desktop/Outbox").expanduser() if not DIR.exists(): DIR = Path(".") def write_mesh(filename, mesh: MeshBuilder): ...
Python
0.000002
@@ -74,32 +74,22 @@ ath%0A -from pathlib import -P +p ath +lib %0Aimp @@ -175,22 +175,30 @@ le%0A%0A -DIR = +CWD = pathlib. Path(%22~/ desk @@ -193,17 +193,17 @@ Path(%22~/ -d +D esktop/O @@ -230,19 +230,19 @@ %0Aif not -DIR +CWD .exists( @@ -252,23 +252,239 @@ -DIR = Path(%22.%22) +CWD = pathlib.P...
c951576e0c6f3e7b4a4df6ba843c144e49ff1ba8
add missing new line at the end of file
treeherder/workers/management/commands/shutdown_workers.py
treeherder/workers/management/commands/shutdown_workers.py
from django.core.management.base import BaseCommand from celery.task.control import broadcast class Command(BaseCommand): help = "Broadcast a warm shutdown event to all the workers." def handle(self, *args, **options): self.stdout.write("Sending shutdown event") broadcast("shutdown") ...
Python
0.000003
@@ -349,12 +349,13 @@ event sent%22) +%0A
bd9526e0044f6cdf47c4ed2e45ddde58f67905b3
add line to run unittests
lib/new_xml_parsing/test_xml_driver.py
lib/new_xml_parsing/test_xml_driver.py
#!/usr/bin/env python import os import re import unittest from xml_driver import XMLElement, XMLHandler from xml.sax import make_parser, handler # Directory of test files xml_files = [x for x in os.listdir('test_xml_files') if re.match(r"2012_\d.xml", x) != None] # Match fixtures parsed_xml = [] for xf ...
Python
0.000001
@@ -690,8 +690,24 @@ files)%0A%0A +unittest.main()%0A
fb847fff6d2f9168a61c1e12ad4877eac19f6c59
Fix time implementation to match wpilib
lib/pyfrc/wpilib/_wpilib/_fake_time.py
lib/pyfrc/wpilib/_wpilib/_fake_time.py
''' Implements all useful time-related classes and functions needed to simulate a running robot. ''' class FakeTime(object): ''' Internal fake_wpilib timekeeper, pretends that time is passing by on the robot ''' def __init__(self): self.Reset() def Reset(self): ...
Python
0.000001
@@ -449,24 +449,75 @@ time):%0A %0A + if time %3C 0:%0A time = 0%0A %0A fina @@ -5848,25 +5848,24 @@ ulated_time -+ = self.Get()
708439135d26a8a4b38ad84665938f742a6e7f8c
Update description
examples/tic_ql_tabular_fixed.py
examples/tic_ql_tabular_fixed.py
''' Q-Learning is used to learn the state-action values for a Tic-Tac-Toe board position against a fixed Alpha-Beta opponent ''' from capstone.game.games import TicTacToe from capstone.game.players import AlphaBeta, RandPlayer from capstone.game.utils import tic2pdf from capstone.rl import FixedGameMDP, Environment fro...
Python
0.000001
@@ -19,21 +19,24 @@ used to -learn +estimate the sta
d0764aae3224c6f99293032e6ac3bfca4d678713
make tcpv4connect.py example tracer more robust
examples/tracing/tcpv4connect.py
examples/tracing/tcpv4connect.py
#!/usr/bin/python # # tcpv4connect Trace TCP IPv4 connect()s. # For Linux, uses BCC, eBPF. Embedded C. # # USAGE: tcpv4connect [-h] [-t] [-p PID] # # This is provided as a basic example of TCP connection & socket tracing. # # All IPv4 connection attempts are traced, even if they ultimately fail. # # Copyright (c) 2015...
Python
0.000062
@@ -1554,16 +1554,34 @@ printk(%22 +trace_tcp4connect %25x %25x %25d @@ -1942,16 +1942,27 @@ rn dq%0A%0A# + filter and format @@ -1977,17 +1977,82 @@ hile 1:%0A -%09 + # Read messages from kernel pipe%0A try:%0A (task, p @@ -2099,10 +2099,27 @@ s()%0A -%09( + (_tag, sadd...
37bec74984f1d3b88f640f2bc9d7788090acdf58
Remove commented out code
lvsm/__main__.py
lvsm/__main__.py
#!/usr/bin/env python # Khosrow Ebrahimpour - Sep 2012 """ lvsm - LVS Manager LVS Manager is a shell that eases the management of a linux virtual server. Using it without arguments will enter an interactive shell. Supplying one or more command-line arguments will run lvsm for a "single-shot" use. Usage: lvsm [-h] [-...
Python
0
@@ -1914,50 +1914,8 @@ ry:%0A - # shell = lvsm.MainPrompt(config)%0A
cb14fb14f5c227aa780a06a2ce7bff758c74962c
update version
jsonapi/__init__.py
jsonapi/__init__.py
""" JSON:API realization.""" __version = (0, 7, 3) __version__ = version = '.'.join(map(str, __version)) __project__ = PROJECT = __name__
Python
0
@@ -45,9 +45,9 @@ 7, -3 +4 )%0A%0A_
ab55890ba85fe03f649a6173a996bf3c9435b011
Make error msg of test_api_for_build_and_run_environment more informative (#13435)
lib/spack/spack/test/package_sanity.py
lib/spack/spack/test/package_sanity.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """This test does sanity checks on Spack's builtin package database.""" import os.path import re import pytest import sp...
Python
0
@@ -5271,16 +5271,100 @@ nt %5B%7B1%7D%5D +, for further information see'%0A 'https://github.com/spack/spack/pull/11115 ')%0A a
519528718232f2fdb9581cdfa54f5e15a0527a3c
Add back accidentally deleted `order_by` from 7f9d258c9229e29da51bd3e08a9f806fd64661ad
judge/views/blog.py
judge/views/blog.py
from django.conf import settings from django.db.models import Count, Max from django.http import Http404 from django.urls import reverse from django.utils import timezone from django.utils.functional import lazy from django.utils.translation import ugettext as _ from django.views.generic import ListView from judge.com...
Python
0
@@ -3998,16 +3998,76 @@ le=True) + %5C%0A .order_by('start_time') %0A%0A
88753822c379177a309a1e195520d487835b10cf
update hotfix version
jumpbox/_version.py
jumpbox/_version.py
# Copyright (C) 2017 Bradley Sakdol <bsakdol@turnitin.com> # # This file is part of Jumpbox # # Jumpbox is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
Python
0
@@ -736,11 +736,11 @@ = '1.3. -0 +1 '%0A
1d92546b68412b48dd57e6eb5a703f5ae25419b6
Add last intent to context (Bot Engine)
kadot/bot_engine.py
kadot/bot_engine.py
from kadot.classifiers import NeuralClassifier from kadot.models import CRFExtractor from kadot.tokenizers import regex_tokenizer, Tokens from kadot.utils import SavedObject from kadot.vectorizers import VectorDict from io import IOBase import json import logging from typing import Any, Callable, Optional, Sequence, IO...
Python
0.000002
@@ -617,16 +617,48 @@ expired%0A + self.last_intent = None%0A @@ -6032,16 +6032,58 @@ output)%0A + context.last_intent = best_intent%0A @@ -6340,32 +6340,73 @@ (text, context)%0A + context.last_intent = intent%0A cont
ece5438dda41e8d50346860bc33931c109f14ec8
bump version number for win32 port
kapteyn/__init__.py
kapteyn/__init__.py
"""Kapteyn package. """ from os import path package_dir = path.abspath(path.dirname(__file__)) __all__=['celestial', 'wcs', 'wcsgrat', 'tabarray', 'maputils', 'mplutil', 'positions', 'shapes', 'rulers', 'filters', 'interpolation','kmpfit'] __version__='2.3'
Python
0
@@ -272,10 +272,12 @@ n__='2.3 +.1 '%0A
7365a739660927f373cbf613e1d869265fb16e7d
remove some obsolete code
meshio/_files.py
meshio/_files.py
import sys from contextlib import contextmanager try: # Python 3.6+ from os import PathLike except ImportError: from pathlib import PurePath as PathLike def is_buffer(obj, mode): return ("r" in mode and hasattr(obj, "read")) or ( "w" in mode and hasattr(obj, "write") ) @contextmanager d...
Python
0.999736
@@ -1,15 +1,4 @@ -import sys%0A from @@ -36,125 +36,8 @@ er%0A%0A -try:%0A # Python 3.6+%0A from os import PathLike%0Aexcept ImportError:%0A from pathlib import PurePath as PathLike%0A%0A %0Adef @@ -255,24 +255,24 @@ buf, mode):%0A + yiel @@ -289,330 +289,8 @@ buf%0A - elif sys.version_info %3...
30794989f1c33c55ff8adfc91aa575a47bd98dfd
Increment version to 1.0.6
select2/__init__.py
select2/__init__.py
__version_info__ = (1, 0, 5) __version__ = '.'.join(map(str, __version_info__))
Python
0.000993
@@ -23,9 +23,9 @@ 0, -5 +6 )%0A__
d95412425a5d5a76cacb463fc8c137f576c8b7ad
Fix line-wrapping of help text.
zerver/management/commands/generate_realm_creation_link.py
zerver/management/commands/generate_realm_creation_link.py
from __future__ import absolute_import from __future__ import print_function from typing import Any from django.conf import settings from django.core.management.base import BaseCommand from django.db import ProgrammingError from confirmation.models import generate_realm_creation_url from zerver.models import Realm imp...
Python
0.000005
@@ -71,16 +71,74 @@ nction%0A%0A +from argparse import ArgumentParser, RawTextHelpFormatter%0A from typ @@ -152,16 +152,16 @@ ort Any%0A - from dja @@ -422,16 +422,21 @@ lp = %22%22%22 +%0A Outputs @@ -789,16 +789,295 @@ nk %22%22%22%0A%0A + # Fix support for multi-line usage%0A def create_parser(self...
781a706391a8fd62fc24afd0119ac495e357724a
Minimize error text
sentry_jira/jira.py
sentry_jira/jira.py
from __future__ import absolute_import import logging from requests.exceptions import ConnectionError, RequestException from sentry.http import build_session from sentry.utils import json from sentry.utils.cache import cache from simplejson.decoder import JSONDecodeError from BeautifulSoup import BeautifulStoneSoup f...
Python
0.999994
@@ -1172,16 +1172,22 @@ nse_text +%5B:128%5D )%0A%0A @
a1e028c4cbd414073163f076fb766f64068eb728
Bump version
sequere/__init__.py
sequere/__init__.py
version = (0, 2, 4) __version__ = '.'.join(map(str, version)) from .registry import register, autodiscover __all__ = ['register', 'autodiscover'] default_app_config = 'sequere.apps.SequereConfig'
Python
0
@@ -14,9 +14,9 @@ 2, -4 +5 )%0A%0A_
081be22efa042db2f706cf3adc08e40ab605c6d0
modify comment
server/datastore.py
server/datastore.py
# -*- coding: utf-8 -*- # from google.appengine.ext import ndb def qdata_key(year=2015): "問題データのparent" return ndb.Key('Qdata', year) def userlist_key(): "UserInfoのparent" return ndb.Key('Users', 'all') class UserInfo(ndb.Model): username = ndb.StringProperty() password = ndb.StringProperty...
Python
0
@@ -794,16 +794,19 @@ %22%E3%82%B3%E3%83%B3%E3%83%86%E3%82%B9%E3%83%88%E7%94%A8%E3%81%AE +%E3%80%81%E5%87%BA%E9%A1%8C %E5%95%8F%E9%A1%8C%E3%83%AA%E3%82%B9%E3%83%88%22%0A
fb6c8d2be457f6043a51ceaae2f9469a02b2aeca
Update MultiWii.py
service/MultiWii.py
service/MultiWii.py
######################################### # MultiWii.py # categories: sensor # more info @: http://myrobotlab.org/service/MultiWii ######################################### # uncomment for virtual hardware virtual = True # port = "/dev/ttyUSB0" port = "COM15" # start optional virtual arduino service, used for test if...
Python
0
@@ -199,16 +199,18 @@ ardware%0A +# virtual
e8e0aa64437bcf7eb98f1d8ee89e7fcf918c81ca
Update Multiwii.py
service/Multiwii.py
service/Multiwii.py
#define POLL_PERIOD 20 serial = Runtime.start("serial","Serial") COMPORT= "COM19" BAUDRATE = 9600 #define MSP_SET_RAW_RC 200 #define MSP_SET_RAW_RC_LENGTH 16 RC_MIN = 1000 RC_MID = 1500 RC_MAX = 2000 ROLL = 0 PITCH = 1 YAW = 2 THROTTLE = 3 AUX1 = 4 AUX2 = 5 AUX3 = 6 AUX4 = ...
Python
0
@@ -824,24 +824,33 @@ l.write( +0) # min throttle Value)%0A @@ -841,22 +841,17 @@ throttle -Value) + %0A seria @@ -862,91 +862,173 @@ ite( -yawValue)%0A serial.write(pitchValue)%0A serial.write(rollValue)%0A serial.write(aux1) +2000) # max yaw %0A serial.write(1000) # min pitch%0A serial.write(1000) # mi...
45f6b1a853b316401c39f63d38dd72319b3a0a12
move version logic to fix python 3.5 compatibility (fixes #12)
muttdown/main.py
muttdown/main.py
from __future__ import print_function import argparse import sys import smtplib import re import os.path import email import email.iterators from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import subprocess import six import markdown import pynliner from . import config from . im...
Python
0
@@ -3990,16 +3990,94 @@ tParser( +prog='muttdown')%0A parser.add_argument('-v', '--version', action='version', version=
62a04170e41d599d653e94afe0844576e175c314
Add comments on variable settings
settings_example.py
settings_example.py
import os import re from imap import EmailCheckError, EmailServer from postgresql import DatabaseServer CSV_FOLDER = os.getcwd() CSV_NAME_FORMAT = '{year}-{month}-{day}T{hour}{minute}.csv' # Restrict emails by sender. EMAIL_FROM = 'sender@example.com' # Restrict emails by subject. EMAIL_SUBJECT_RE = re.compile(''...
Python
0
@@ -126,16 +126,55 @@ tcwd()%0A%0A +# Values come from %60EMAIL_SUBJECT_RE%60.%0A CSV_NAME @@ -629,16 +629,55 @@ trip()%0A%0A +# Values come from %60EMAIL_SUBJECT_RE%60.%0A TABLE_NA
ce1c46ecbf5623ec99c8fc2871d0cb35c5dc9100
Update sshkey.py
setup/ssh/sshkey.py
setup/ssh/sshkey.py
# -*- coding: utf-8 -*- # Author : jeonghoonkang, https://github.com/jeonghoonkang from __future__ import print_function import subprocess import os import sys if __name__ == '__main__': print ("usage : python sshkey.py {IP_ADD} {PORT}, {} : user should input") if len(sys.argv) < 2: exit("[bye] you ...
Python
0.000004
@@ -221,16 +221,19 @@ key.py %7B +ID@ IP_ADD%7D
0df211c91ce899e34bfb5691dde0e0ba1a78f36d
Add fiware-ut-12 tag to the test_objectstorage_available_to_widgets
src/wirecloud/fiware/tests/selenium.py
src/wirecloud/fiware/tests/selenium.py
from wirecloud.commons.utils.testcases import WirecloudSeleniumTestCase __test__ = False class FiWareSeleniumTestCase(WirecloudSeleniumTestCase): def test_add_fiware_marketplace(self): self.login() self.add_marketplace('fiware', 'http://localhost:8080', 'fiware') test_add_fiware_marketpla...
Python
0
@@ -1446,28 +1446,97 @@ al(api_element.text, 'Yes')%0A + test_objectstorage_available_to_widgets.tags = ('fiware-ut-12',)%0A
70323a09af7c99578f247fd714c536ddfba5e20b
Add format_number function
shuup/utils/i18n.py
shuup/utils/i18n.py
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. import babel import babel.numbers from babel import UnknownLocale...
Python
0
@@ -400,16 +400,47 @@ currency +, format_decimal, parse_pattern %0Afrom dj @@ -1853,24 +1853,476 @@ rn locale%0A%0A%0A +def format_number(value, digits=None):%0A locale = get_current_babel_locale()%0A if digits is None:%0A return format_decimal(value, locale=locale)%0A (min_digits, max_digits) = (%0A...
b3c307a57d8466b089c8ce937ee5be6b5325984d
Fix some type annotation issues for system.py
siebenapp/system.py
siebenapp/system.py
# coding: utf-8 import sqlite3 from html import escape from os import path from typing import Union, Callable, List, Dict from siebenapp.goaltree import Goals from siebenapp.enumeration import Enumeration from siebenapp.zoom import Zoom DEFAULT_DB = 'sieben.db' MIGRATIONS = [ # 0 [ 'create table migra...
Python
0.00002
@@ -4855,28 +4855,28 @@ r()%0A -goal +name s = %5Brow for @@ -5201,20 +5201,20 @@ s.build( -goal +name s, edges
2078ba357b331f071e1bd36e71ed69ed68cceb1d
Add todo annotation.
st2actions/st2actions/runners/utils.py
st2actions/st2actions/runners/utils.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Python
0
@@ -2227,22 +2227,16 @@ n't work -%0A # (e.g. o @@ -2237,16 +2237,22 @@ e.g. old +%0A # action @@ -2311,16 +2311,131 @@ signment + post class instantiation.%0A # TODO: Remove in next major version once all the affected actions have been updated .%0A tr
0e345fb7624e5d30e7e689bb3d6a05dfe7193d13
Convert major and minor versions to integers for version matching
kombu/utils/text.py
kombu/utils/text.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from difflib import SequenceMatcher from kombu import version_info_t def fmatch_iter(needle, haystack, min_ratio=0.6): for key in haystack: ratio = SequenceMatcher(None, needle, key).ratio() if ratio >= min_ratio: yield r...
Python
0.99939
@@ -1033,28 +1033,38 @@ _info_t( +int( major +) , +int( minor +) , micro,
0fabc8d522c07c7f64557d840b53ecb723a7b07f
Rename char
node/rickroll.py
node/rickroll.py
#!/usr/bin/env python from nodes import Node class RickRoll(Node): char = "never gonna give you up" args = 0 results = 1 def func(self): """Redirect to RickRoll""" return "Never gonna let you down"
Python
0.00019
@@ -74,17 +74,17 @@ char = %22 -n +N ever gon
45d8d6a5daeb7819c3ca44d31c27d8e9d6836dcd
Disable pagination, should not be used when tiling
spillway/views.py
spillway/views.py
import math from rest_framework.response import Response from rest_framework.generics import GenericAPIView, ListAPIView from spillway import forms, renderers from spillway.generics import BaseGeoView class MapView(GenericAPIView): """View for rendering map tiles from /{z}/{x}/{y}/ tile coordinates.""" rend...
Python
0.000004
@@ -891,24 +891,47 @@ eoModel.%22%22%22%0A + paginate_by = None%0A renderer
b15984e46fdc75a18f0977d775a20960a0e8dc39
throw away aleph code
krauler/__init__.py
krauler/__init__.py
import os import cgi import yaml import logging import requests from urlparse import urljoin, urlparse from lxml import html from tempfile import mkstemp from aleph.crawlers.crawler import Crawler from krauler.util import as_list, normalize_url log = logging.getLogger(__name__) class WebCrawlerState(object): ...
Python
0.000003
@@ -1,14 +1,4 @@ -import os%0A impo @@ -111,81 +111,8 @@ html -%0Afrom tempfile import mkstemp%0A%0Afrom aleph.crawlers.crawler import Crawler %0A%0Afr @@ -200,31 +200,23 @@ %0A%0Aclass -WebCraw +Krau ler -State (object) @@ -246,92 +246,15 @@ f, c -rawler, source, config):%0A self.crawler = crawler%0A ...
880b389d9b26d7f39dd6a87e5546757f40ca17cd
Move Moon computation to Planet.__call__()
skyfield/planets.py
skyfield/planets.py
import jplephem from numpy import array from skyfield import earthlib, timescales from skyfield.coordinates import ICRS DAY_S = 24.0 * 60.0 * 60.0 KM_AU = 1.0 / earthlib.AU_KM T0 = timescales.T0 class Planet(object): def __init__(self, ephemeris, jplephemeris, jplname): self.ephemeris = ephemeris ...
Python
0
@@ -622,30 +622,122 @@ , jd) * -self.ephemeris +e.earth_share%0A elif self.jplname == 'moon':%0A pv = c('earthmoon', jd) + c('moon', jd) * e .moon_sh @@ -1433,20 +1433,16 @@ emeris = - e = jplephe @@ -1464,109 +1464,8 @@ ule) -%0A self.moon_share = 1.0 / (1.0 + e.EMRAT)%0A self.ea...
c8be023cb26e34fd1a1055b11b320f570c87b4ab
Fix undefined version
oddt/__init__.py
oddt/__init__.py
"""Open Drug Discovery Toolkit ============================== Universal and easy to use resource for various drug discovery tasks, ie docking, virutal screening, rescoring. Attributes ---------- toolkit : module, Toolkits backend module, currenlty OpenBabel [ob] and RDKit [rdk]. This settin...
Python
0.025184
@@ -789,16 +789,29 @@ file__)%0A + v = None%0A if o
0cf45657c01349b6304470e0ee7349e9f62874f5
Bump version 0.19.0rc3 --> 0.19.0rc4
lbrynet/__init__.py
lbrynet/__init__.py
import logging __version__ = "0.19.0rc3" version = tuple(__version__.split('.')) logging.getLogger(__name__).addHandler(logging.NullHandler())
Python
0
@@ -36,9 +36,9 @@ .0rc -3 +4 %22%0Ave
4bcf0ab7fb40902b49b877f41fc4dbbb7d5b7c56
Bump version 0.20.2rc1 --> 0.20.2rc2
lbrynet/__init__.py
lbrynet/__init__.py
import logging __version__ = "0.20.2rc1" version = tuple(__version__.split('.')) logging.getLogger(__name__).addHandler(logging.NullHandler())
Python
0
@@ -36,9 +36,9 @@ .2rc -1 +2 %22%0Ave
e83ff4772251d5c997ddcdc70686c898ea454c82
Bump version 0.20.1rc1 --> 0.20.1rc2
lbrynet/__init__.py
lbrynet/__init__.py
import logging __version__ = "0.20.1rc1" version = tuple(__version__.split('.')) logging.getLogger(__name__).addHandler(logging.NullHandler())
Python
0
@@ -32,17 +32,17 @@ 0.20.1rc -1 +2 %22%0Aversio
334a55bf7fd31ed5937744a437e42eee597bd7e1
Bump version 0.17.0rc14 --> 0.17.0rc15
lbrynet/__init__.py
lbrynet/__init__.py
import logging __version__ = "0.17.0rc14" version = tuple(__version__.split('.')) logging.getLogger(__name__).addHandler(logging.NullHandler())
Python
0
@@ -37,9 +37,9 @@ 0rc1 -4 +5 %22%0Ave
6ace2095f77cf6354b56d30f6f60a93bde79f476
Complete preorder iter sol
lc0100_same_tree.py
lc0100_same_tree.py
"""Leetcode 100. Same Tree Easy URL: https://leetcode.com/problems/same-tree/ Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical and the nodes have the same value. Example 1: Input: 1 1 / \ ...
Python
0
@@ -1241,16 +1241,669 @@ ght))%0A%0A%0A +class SolutionPreorderIter(object):%0A def isSameTree(self, p, q):%0A %22%22%22%0A :type p: TreeNode%0A :type q: TreeNode%0A :rtype: bool%0A %22%22%22%0A if not p or not q:%0A return p is q%0A %0A stack = %5B...
89bae6765a23d3844c784ea097deda59a434c463
Make a ball bounce walls, not get into them
ookoobah/core.py
ookoobah/core.py
class Grid(dict): def size(self): # TODO Cache me, maybe return tuple(n + 1 for n in map(max, zip(*self.keys()))) class Block(object): def act(self, ball): raise NotImplementedError() class Launcher(object): def __init__(self, direction=None): if direction is None: ...
Python
0.000001
@@ -555,32 +555,52 @@ on%5B1%5D,%0A ) +%0A return True %0A%0Aclass Mirror(B @@ -1952,32 +1952,90 @@ def step(self):%0A + keep_moving = True%0A while keep_moving:%0A self.bal @@ -2043,16 +2043,20 @@ .move()%0A + @@ -2100,16 +2100,20 @@ + if block ...
bd709a9f0008819d73ec927b5d477f6eb21fc945
switch alignment
tensortools/ensemble.py
tensortools/ensemble.py
""" Main interface to solvers, fits an ensemble of tensor decompositions over a specified range of tensor ranks. """ import numpy as np from time import time from .cpdirect import cp_direct from .cprand import cp_rand from .kruskal import align_factors from .tensor_utils import norm import pdb # dictionary holding va...
Python
0.000001
@@ -5914,32 +5914,35 @@ odel%0A + _, factors, _, sco @@ -5926,35 +5926,32 @@ _, factors, - _, score = align_f @@ -5958,32 +5958,34 @@ actors(results%5Br ++1 %5D%5B'factors'%5D%5B0%5D, @@ -5986,34 +5986,32 @@ '%5D%5B0%5D, results%5Br -+1 %5D%5B'factors'%5D%5B0%5D)
847df3a3cd4d95bf71c78ce70594d42a880d97d9
drop the data when user.name is empty
page_get/user.py
page_get/user.py
# -*-coding:utf-8 -*- from db.models import User from logger.log import storage from page_get.basic import get_page from page_parse.basic import is_404 from db.user import save_user, get_user_by_uid from db.seed_ids import set_seed_crawled from page_parse.user import enterprise, person, public base_url = 'http://weib...
Python
0.000287
@@ -2252,32 +2252,58 @@ et_level(html)%0A%0A + if user.name:%0A save_use @@ -2310,16 +2310,20 @@ r(user)%0A + @@ -2376,17 +2376,20 @@ er_id))%0A -%0A + @@ -2400,16 +2400,55 @@ rn user%0A + else:%0A return None%0A%0A else @@ -2493,24 +2493,109 @@...
f37ca31fd2a0c14b01d4329cbcaa4dae954e3965
Simplify test case
test/funk/test_tools.py
test/funk/test_tools.py
from nose.tools import assert_raises from funk.tools import assert_raises_str from funk.tools import assert_that from funk.matchers import Matcher def test_assert_raises_str_passes_if_test_raises_specified_exception_with_correct_message(): def func(): raise AssertionError("Oh noes!") assert_raises_str...
Python
0.020494
@@ -1807,16 +1807,10 @@ -passed = +if len @@ -1820,52 +1820,8 @@ lue) - == 0%0A %0A if not passed :%0A @@ -1894,16 +1894,45 @@ value))%0A + return False%0A @@ -1955,22 +1955,20 @@ return -passed +True %0A
986398ee03d77b81129cfcdef475a53680812207
Add boolean operators and boolean expr testing
soap/expr/common.py
soap/expr/common.py
""" .. module:: soap.expr.common :synopsis: Common definitions for expressions. """ ADD_OP = '+' SUBTRACT_OP = '-' UNARY_SUBTRACT_OP = '-' MULTIPLY_OP = '*' DIVIDE_OP = '/' BARRIER_OP = '|' OPERATORS = [ADD_OP, MULTIPLY_OP] UNARY_OPERATORS = [UNARY_SUBTRACT_OP] ASSOCIATIVITY_OPERATORS = [ADD_OP, MULTIPLY_OP] COM...
Python
0.00134
@@ -170,16 +170,114 @@ P = '/'%0A +%0AEQUAL_OP = '=='%0AGREATER_OP = '%3E'%0ALESS_OP = '%3C'%0AUNARY_NEGATION_OP = '!'%0AAND_OP = '&'%0AOR_OP = '%7C'%0A%0A BARRIER_ @@ -282,17 +282,17 @@ R_OP = ' -%7C +# '%0A%0AOPERA @@ -320,16 +320,202 @@ PLY_OP%5D%0A +BOOLEAN_OPERATORS = %5B%0A EQUAL_OP, GREATER_OP, LESS_OP, ...
95ea4ca3fff725c6d8238c1c6cf177184d84e865
Fix line length issues in test_parameters
test/test_parameters.py
test/test_parameters.py
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher from ..pyautoupdate.exceptions import CorruptedFileWarning from .pytest_makevers import fixture_update_dir import os import warnings import pytest @pytest.fixture(scope='function') def fixture_rm_log(request): ""...
Python
0.000105
@@ -1807,16 +1807,23 @@ the path +%0A attempt @@ -1947,15 +1947,8 @@ rom/ -proper/ secu @@ -1962,16 +1962,34 @@ licies', +%0A 'wanna.c @@ -2036,17 +2036,18 @@ ck_empty -V +_v ersion(f @@ -2252,16 +2252,17 @@ %7D 404', + 'a URL t
d03b385b5d23c321ee1d4bd2020be1452e8c1cab
Remove Python 2.4 support monkey patch and bump rev
pika/__init__.py
pika/__init__.py
# ***** BEGIN LICENSE BLOCK ***** # # For copyright and licensing please refer to COPYING. # # ***** END LICENSE BLOCK ***** __version__ = '0.9.13p1' from pika.connection import ConnectionParameters from pika.connection import URLParameters from pika.credentials import PlainCredentials from pika.spec import BasicPrope...
Python
0
@@ -140,17 +140,17 @@ '0.9.13p -1 +2 '%0A%0Afrom @@ -572,327 +572,4 @@ ion%0A -%0A# Python 2.4 support: add struct.unpack_from if it's missing.%0Atry:%0A import struct%0A getattr(struct, %22unpack_from%22)%0Aexcept AttributeError:%0A def _unpack_from(fmt, buf, offset=0):%0A slice = buffer(buf, offse...
dba97468d24ea6883f303cb723f2af34b71e319c
Update rtree.py
plotink/rtree.py
plotink/rtree.py
# -*- coding: utf-8 -*- # rtree.py # part of plotink: https://github.com/evil-mad/plotink # # See below for version information # # Written by Michal Migurski https://github.com/migurski @michalmigurski # as a contribution to the AxiDraw project https://github.com/evil-mad/axidraw/ # # Copyright (c) 2022 Windell H. Osk...
Python
0
@@ -1537,16 +1537,153 @@ t math%0A%0A +def version(): # Version number for this document%0A %22%22%22Return version number of this script%22%22%22%0A return %221.0%22 # Dated 2022-01-03%0A%0A class In
820274e71fe101a362d51ab6b2f5dbdbd70e77a7
include nuq0t in list of 'mlab4s' for staging and testing
plsync/slices.py
plsync/slices.py
#!/usr/bin/python import pprint from planetlab.types import * from users import user_list # The CentOS build adds new functionality to slices through vsys capabilities # for restart, update and yum configuration. These attributes should be added # to all slices on M-Lab. centos_slice_attrs = [ Attr(None, vsys='slice...
Python
0
@@ -1406,16 +1406,92 @@ 4.prg01' +, %0A 'mlab1.nuq0t', 'mlab2.nuq0t', 'mlab3.nuq0t', 'mlab4.nuq0t' %5D%0A%0A# nam
b2f0670e1859368f0efb7b3cc485a41b1e9cb14a
Update tarot.py
plugins/tarot.py
plugins/tarot.py
""" 🔮 Spooky fortunes and assistance for witches """ from util import hook, http @hook.command def tarot(inp): ".tarot <cardname> -- finds a card by name" try: card = http.get_json( "https://tarot-api.com/find/{search}".format( search=inp ) ) except...
Python
0.000001
@@ -237,66 +237,15 @@ ind/ -%7Bsearch%7D%22.format(%0A search=inp%0A ) +%22 + inp %0A @@ -387,16 +387,29 @@ rds%22%5D)%0A%0A +@hook.command %0Adef for @@ -681,28 +681,29 @@ %22, %22.join(card%5B%22keywords%22%5D) +%0A
d24dae63883ef204509f08c19f125a41109f67ce
add address param for nas_disk
tests/aqdb/test_disk.py
tests/aqdb/test_disk.py
#!/usr/bin/env python2.5 # ex: set expandtab softtabstop=4 shiftwidth=4: -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2009 Contributor # # This program is free software; you can redistribute it and/or modify # it under the terms of the EU DataGrid Software License. You should # have received a...
Python
0.000001
@@ -4059,23 +4059,16 @@ - device_n @@ -4081,16 +4081,33 @@ _drive', + address='0:1:0', service
ff4239ecd4c46a59c819a15c11d87f5deca71ad6
use python_2_unicode_compatible for model str
souvenirs/models.py
souvenirs/models.py
from __future__ import absolute_import, unicode_literals from django.conf import settings from django.db import models from django.utils import timezone class Souvenir(models.Model): """ One instance of seeing an active user """ user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASC...
Python
0.00014
@@ -147,17 +147,108 @@ imezone%0A -%0A +from django.utils.encoding import python_2_unicode_compatible%0A%0A%0A@python_2_unicode_compatible %0Aclass S @@ -539,11 +539,10 @@ f __ -rep +st r__( @@ -568,12 +568,8 @@ rn ' -%3C%7B%7D user @@ -582,12 +582,9 @@ en=%7B -!r%7D%3E +%7D '.fo @@ -592,64 +592,20 @@ mat( -%...
3f3ec55191c9010a52c471e76a18632ea3894fea
Support parsing image buttons
praw/objector.py
praw/objector.py
"""Provides the Objector class.""" import re from .exceptions import APIException class Objector(object): """The objector builds :class:`.RedditBase` objects.""" @staticmethod def _camel_to_snake(name): """Return `name` converted from camelCase to snake_case. Code from http://stackoverf...
Python
0
@@ -3106,17 +3106,8 @@ if %7B -'color', 'tex @@ -3125,32 +3125,89 @@ issubset(data):%0A + if 'color' in data or 'linkUrl' in data:%0A pars @@ -3246,45 +3246,22 @@ -elif %7B'text', 'url'%7D.issubset(data):%0A + else:%0A @@ -4732,24 +4732,55 @@ erators')):%0A + ...
e21f1f97e02a8d8272e42d3783347e3aaa4f5787
Add back content type option in util
tests/mock_vws/utils.py
tests/mock_vws/utils.py
""" Utilities for tests for the VWS mock. """ import json from string import hexdigits from typing import Any, Dict, Optional from urllib.parse import urljoin from requests import Response from requests_mock import POST from common.constants import ResultCodes from tests.utils import VuforiaServerCredentials from vw...
Python
0.000001
@@ -154,16 +154,32 @@ rljoin%0A%0A +import requests%0A from req @@ -353,34 +353,51 @@ import -target_api_request +authorization_header, rfc_1123_date %0A%0A%0Aclass @@ -5213,24 +5213,82 @@ PI.%0A %22%22%22%0A + date = rfc_1123_date()%0A request_path = '/targets'%0A%0A content @@ -5340,37 +5340,51 ...
70fd93901be2a7d6662525fcd5b3914c2ffbc7d4
add open_file into tests run through old runner
tests/runalldoctests.py
tests/runalldoctests.py
import doctest import getopt import glob import sys try: import pkg_resources pkg_resources.require('OWSLib') except (ImportError, pkg_resources.DistributionNotFound): pass def run(pattern): if pattern is None: testfiles = glob.glob('*.txt') else: testfiles = glob.glob(pattern) ...
Python
0.000001
@@ -180,16 +180,252 @@ pass%0A%0A +def open_file(filename, mode='r'):%0A %22%22%22Helper function to open files from within the tests package.%22%22%22%0A import os%0A return open(os.path.join(os.path.dirname(__file__), filename), mode)%0A%0AEXTRA_GLOBALS = %7B'open_file': open_file%7D%0A%0A def run( @@ -6...
b0c8b5abe20790c1c47b4ab85c98ad2a99ec3ec5
fix #527
tests/test_apiserver.py
tests/test_apiserver.py
# -*- coding: utf-8 -*- """ tests.apiserver ~~~~~~~~~~~~ Tests cobra.api :author: 40huo <git@40huo.cn> :homepage: https://github.com/wufeifei/cobra :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2017 Feei. All rights reserved """ import requests import json ...
Python
0.000001
@@ -860,17 +860,49 @@ rget%22: %5B -%22 +os.path.join(project_directory, ' tests/vu @@ -918,11 +918,11 @@ ties -%22%5D, +')%5D %0A @@ -2671,298 +2671,99 @@ -while True:%0A cobra_process = os.popen('ps aux %7C grep python').read +s = socket.socket ()%0A - - cobra_process_num = len(cobra_proce...
c6faf05bee36541b8288de50b103394977977730
Remove superflous code
tests/test_fandjango.py
tests/test_fandjango.py
from nose.tools import with_setup from datetime import datetime, timedelta from django.test.client import Client from django.test.client import RequestFactory from django.test.utils import setup_test_environment from django.core.urlresolvers import reverse from django.core.management import call_command from django.c...
Python
0
@@ -158,61 +158,8 @@ ory%0A -from django.test.utils import setup_test_environment%0A from @@ -558,34 +558,8 @@ b'%0A%0A -setup_test_environment()%0A%0A call
34f0f0dae773e0b85dbb35d1752cb01268fc6765
Test that Fandjango renews expired signed requests
tests/test_fandjango.py
tests/test_fandjango.py
import pytest TEST_ACCESS_TOKEN = 'AAACk2tC9zBYBAOHQLGqAZAjhIXZAIX0kwZB8xsG8ItaEIEK6EFZCvKaoVKhCAOWtBxaHZAXXNlpP9gDJbNNwwQlZBcZA7j8rFLYsUff8EyUJQZDZD' TEST_SIGNED_REQUEST = '3JpMRg1-xmZAo9L7jZ2RhgSjVi8LCt5YkIxSSaNrGvE.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImV4' \ 'cGlyZXMiOjAsImlzc3VlZF9hdCI6MTMy...
Python
0
@@ -1737,24 +1737,867 @@ ode == 403%0A%0A +def test_fandjango_renews_signed_request():%0A %22%22%22%0A Verify that the signed request is renewed if its access token%0A has expired.%0A %22%22%22%0A from datetime import datetime, timedelta%0A from django.conf import settings%0A from django.test.clie...
cd39d46af592116ba4f5ae563161e2b1b21e38aa
test sanitize num page
tests/test_paginator.py
tests/test_paginator.py
from sqla_wrapper import SQLAlchemy, Paginator def create_test_model(): db = SQLAlchemy('sqlite://') class Item(db.Model): id = db.Column(db.Integer, primary_key=True) class Part(db.Model): id = db.Column(db.Integer, primary_key=True) item_id = db.Column(db.Integer, db.ForeignKey...
Python
0.000001
@@ -39,16 +39,38 @@ aginator +, sanitize_page_number %0A%0A%0Adef c @@ -651,16 +651,308 @@ Part%0A%0A%0A +def test_sanitize_page_number():%0A assert sanitize_page_number(%221%22) == 1%0A assert sanitize_page_number(%22-1%22) == 1%0A assert sanitize_page_number(%220%22) == 1%0A assert sanitize_page_numbe...
c3f7ae17289c38fcdfad45c0b71f553f8004c0fd
Update list test.
tests/test_resources.py
tests/test_resources.py
#!/usr/bin/python3 import os import sys import unittest from unittest.mock import patch LIB_PATH = os.path.dirname(os.path.realpath(__file__)) + '/../' CONFIG_PATH = os.path.join(LIB_PATH, 'grafcli.conf.example') sys.path.append(LIB_PATH) from climb.config import load_config_file load_config_file(CONFIG_PATH) from ...
Python
0
@@ -1072,16 +1072,97 @@ els'))%0A%0A + with self.assertRaises(InvalidPath):%0A r.list('invalid_path')%0A%0A def
9044e9888de41c85637b7a09c99e3e345225524b
replace border template with :scissors:
todo/pagination_list.py
todo/pagination_list.py
from botstory import utils from botstory.ast import callable, loop, story_context from botstory.middlewares import any, option, text import emoji import logging from todo import reflection logger = logging.getLogger(__name__) pagination_loop = None BORDER = '>< >< >< >< >< >< >< >< >< >< >< >< >< >< >< >< >< >< >< >...
Python
0
@@ -259,67 +259,37 @@ = ' -%3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C %3E%3C +%E2%9C%81---------------------------- '%0A%0A%0A
2da5e1c6a8dee0df38cf1f4f75632dc80c2d49f3
clarify documentation, make all classes special
tools/blockquote2div.py
tools/blockquote2div.py
#!/usr/bin/env python """Pandoc filter to convert Blockquotes with attributes into Div with attributes. Usage: pandoc source.md --filter=blockquote2div.py --output=output.html A blockquote will be converted if 1. it begins with a header 2. that 1. match "Prerequisites", "Objectives" or 2. has attrib...
Python
0.000083
@@ -243,24 +243,31 @@ der%0A2. that + either %0A 1. mat @@ -268,16 +268,18 @@ . match +es %22Prereq @@ -304,11 +304,37 @@ ves%22 - or +, %22Callout%22 or %22Challenge%22 OR %0A @@ -404,16 +404,40 @@ one of %5B +'prereq', 'objectives', 'callout @@ -684,16 +684,210 @@ %3C/div%3E%0A%0A +This is also a ...
057a7e17a87438921484b44a950e75df8f198d10
Raise RuntimeError if query is neither PubMed ID nor PubMed URL
pubmed_lookup.py
pubmed_lookup.py
import re import sys from urllib.parse import urlparse from urllib.request import urlopen from Bio import Entrez class Publication(object): """ Use a PubMedLookup record to make a Publication object with info about a scientific publication. """ def __init__(self, pubmed_record): """ ...
Python
0.001804
@@ -3984,12 +3984,135 @@ -pass +raise RuntimeError(%0A %22Query (%7B%7D) doesn't appear to be a PubMed ID or PubMed URL%22%0A .format(query)) %0A%0A
c36cb6d28333d3a3ce89974c062c807ce3e0a1ff
Update image IO ops to reflect CHW tensor layout return (#2695)
torchvision/io/image.py
torchvision/io/image.py
import torch import os import os.path as osp import importlib.machinery _HAS_IMAGE_OPT = False try: lib_dir = osp.join(osp.dirname(__file__), "..") loader_details = ( importlib.machinery.ExtensionFileLoader, importlib.machinery.EXTENSION_SUFFIXES ) extfinder = importlib.machinery.Fi...
Python
0
@@ -905,35 +905,25 @@ put (Tensor%5B -image_width +3 , image_heig @@ -918,33 +918,43 @@ , image_height, -3 +image_width %5D)%0A %22%22%22%0A i @@ -1561,35 +1561,25 @@ put (Tensor%5B -image_width +3 , image_heig @@ -1574,33 +1574,43 @@ , image_height, -3 +image_width %5D)%0A %22%22%22%0A i @@ -2230...
e8419924de6f454dc108666ef7d22ce84f6c816d
Allow custom timeouts per call on connections
torncache/connection.py
torncache/connection.py
# -*- mode: python; coding: utf-8 -*- """ Torncache Connection """ from __future__ import absolute_import import os import stat import socket import time import logging import functools from tornado import iostream from tornado import stack_context from tornado.ioloop import IOLoop from tornado.platform.auto import...
Python
0
@@ -150,16 +150,31 @@ rt time%0A +import numbers%0A import l @@ -2153,35 +2153,49 @@ out(self, reason +, timeout=None ):%0A - %22%22%22Add a @@ -2370,25 +2370,163 @@ -if self._request_ +# Allow to override default timeout per call%0A if not isinstance(timeout, numbers.Integral):%0A ...
cd53db3377412cc520f2f7e48119a18029071e6e
support fallback to png if browser doesn't support svg
tracblockdiag/plugin.py
tracblockdiag/plugin.py
# -*- coding: utf-8 -*- import re from bz2 import compress, decompress from base64 import b64encode, b64decode from trac.core import * from trac.util.html import html from trac.web import IRequestHandler from trac.wiki import IWikiMacroProvider from trac.wiki.formatter import system_message from . import diag, cache...
Python
0.000001
@@ -2025,16 +2025,80 @@ f-8')))%0A + type_ = name%5B:-4%5D%0A fmt = args.pop('type', 'png')%0A @@ -2115,25 +2115,21 @@ 'type': -name%5B:-4%5D +type_ , 'data' @@ -2139,58 +2139,168 @@ ata, -%0A 'fmt': args.pop('type', + 'fmt': 'png'%7D%0A attrs = args.copy()%0A ...
31cc3515e3dd07a5c352cad6211f95e972c93378
Fix MMAP_MIN_ADDR which is wrong for some ARM binaries
pwndbg/memory.py
pwndbg/memory.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Reading, writing, and describing memory. """ import gdb import pwndbg.compat import pwndbg.typeinfo PAGE_SIZE = 0x1000 MMAP_MIN_ADDR = 0x10000 def read(addr, count, partial=False): try: result = gdb.selected_inferior().read_memory(addr, count) except g...
Python
0.000015
@@ -181,18 +181,17 @@ DDR = 0x -10 +8 000%0A%0Adef
3b36ae57d7521fa6d19174d75fbea5567955f253
Bump version
pyhn/__init__.py
pyhn/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- __title__ = 'pyhn' __version__ = '0.2.0' __author__ = 'Geoffrey Lehée' __license__ = 'AGPL3' __copyright__ = 'Copyright 2013 Geoffrey Lehée'
Python
0
@@ -78,17 +78,17 @@ = '0.2. -0 +1 '%0A__auth
c22638085d2b4ad0efc6c1bf03b1732604b2b039
Fix rank2.
pykmer/sparse.py
pykmer/sparse.py
import array class sparse: def __init__(self, B, xs): self.B = B self.S = B - 10 self.xs = xs self.toc = array.array('I', [0 for i in xrange(1024+1)]) for x in xs: v = x >> self.S self.toc[v+1] += 1 t = 0 for i in xrange(1024+1): ...
Python
0
@@ -935,32 +935,46 @@ %3E= x1:%0A + break%0A return ( @@ -982,16 +982,17 @@ 0, r1)%0A%0A +%0A def