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
4cbe4e3a6150af17aa66119edcac3ca35117299e
Add a test to make sure we can Add{Pre,Post}Action() on Dir Nodes.
test/pre-post-actions.py
test/pre-post-actions.py
#!/usr/bin/env python # # __COPYRIGHT__ # # 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 without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
Python
0.000035
@@ -1423,16 +1423,25 @@ 'work2' +, 'work3' )%0A%0A%0A%0Ates @@ -3961,24 +3961,543 @@ %22333%5Cn%22)%0A%0A%0A%0A +test.write(%5B'work3', 'SConstruct'%5D, %22%22%22%5C%0Adef pre(target, source, env):%0A pass%0Adef post(target, source, env):%0A pass%0Adef build(target, source, env):%0A open(str(target%5B0%5D)...
0a70a700f450c3c22ee0e7a32ffb57c29b823fe1
Exclude test/assembly on Windows
test/assembly/gyptest-assembly.py
test/assembly/gyptest-assembly.py
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that .hpp files are ignored when included in the source list on all platforms. """ import sys import TestGyp # TODO(bradnelso...
Python
0.001267
@@ -38,10 +38,10 @@ ) 20 -09 +12 Goo @@ -181,93 +181,48 @@ %22%22%22%0A -Verifies that .hpp files are ignored when included in the source list on all%0Aplatform +A basic test of compiling assembler file s.%0A%22 @@ -252,16 +252,46 @@ estGyp%0A%0A +if sys.platform != 'win32':%0A # TODO(b @@ -332,16 +332,18 @@ ...
492f769dd9b40bcf2b13379bdc5618def53832e2
replace namedtuples by more obvious Points as pair of x,y
xoi.py
xoi.py
#! /usr/bin/env python import sys import curses from curses import KEY_ENTER import time from collections import namedtuple KEY = "KEY" K_A = ord("a") K_D = ord("d") class Point: def __init__(self, x, y): self._x = x self._y = y @property def x(self): return self._x @x.sett...
Python
0.000386
@@ -1444,103 +1444,56 @@ r = -namedtuple(%22border%22, %5B%22y%22, %22x%22%5D)(24, 80)%0A self.field = namedtuple(%22field%22, %5B%22y%22, %22x%22%5D)( +Point(x=80, y=24)%0A self.field = Point(x= self @@ -1504,13 +1504,13 @@ der. -y-1, +x, y= self @@ -1517,17 +1517,19 @@ .border. -x +y-1 )%0A ...
bcfa6c5ab4b9ea7cf56a3c4e680efd6433cd6a14
Remove documentation of unused --cache option
iamine/__main__.py
iamine/__main__.py
#!/usr/bin/env python3 """Concurrently retrieve metadata from Archive.org items. usage: ia-mine [--config-file=<FILE>] (<itemlist> | -) [--debug] [--workers WORKERS] [--cache] [--retries RETRIES] [--secure] [--hosts HOSTS] ia-mine [--all | --search QUERY] [[--info | --info --field FIELD...] ...
Python
0
@@ -155,34 +155,24 @@ ers WORKERS%5D - %5B--cache%5D %0A @@ -434,18 +434,8 @@ ERS%5D - %5B--cache%5D %0A @@ -2336,150 +2336,8 @@ 00%5D%0A - -c, --cache Cache item metadata on Archive.org. Items are not%0A cached are not cached by default.%0A -r
101608c8d769e383a849b063bfb002cfe1ed3261
Make sqlalchemy converter be compatible with latest version wtforms.
flask_superadmin/model/backends/sqlalchemy/orm.py
flask_superadmin/model/backends/sqlalchemy/orm.py
from sqlalchemy.orm.exc import NoResultFound from wtforms import ValidationError, fields, validators from wtforms.ext.sqlalchemy.orm import converts, ModelConverter from wtforms.ext.sqlalchemy.fields import QuerySelectField, QuerySelectMultipleField from wtforms.ext.sqlalchemy.orm import model_form from flask.ext.sup...
Python
0
@@ -1979,32 +1979,39 @@ prop, field_args +, *args ):%0A kwarg
86c45216633a3a273d04a64bc54ca1026b3d5069
Fix comment middleware
debreach/middleware.py
debreach/middleware.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import base64 import logging import random from Crypto.Cipher import AES from django.core.exceptions import SuspiciousOperation from debreach.compat import \ force_bytes, get_random_string, string_types, force_text log = logging.getLogger(__name__...
Python
0.000002
@@ -1350,12 +1350,28 @@ pe'%5D - == +.strip().startswith( 'tex @@ -1377,16 +1377,17 @@ xt/html' +) %5C%0A
1e7bbd7b59abbe0bcb01fd98079a362f4f874d3b
Fix long waiting version number up
dedupsqlfs/__init__.py
dedupsqlfs/__init__.py
# -*- coding: utf8 -*- # Documentation. {{{1 """ This Python library implements a file system in user space using FUSE. It's called DedupFS because the file system's primary feature is deduplication, which enables it to store virtually unlimited copies of files because data is only stored once. In addition to dedupli...
Python
0.000075
@@ -992,9 +992,13 @@ 2.94 -7 +9-dev %22%0A%0A#
2b78c7bc3187e640ad093c964fc7a0f0006208f1
comment botan v2
2048.py
2048.py
# -*- coding: utf-8 -*- #import botan import constant_2048 import telebot import urllib import logging from board import Board from telebot import types import sqlite3 # Using the ReplyKeyboardMarkup class # It's constructor can take the following optional arguments: # - resize_keyboard: True/False (default False) ...
Python
0
@@ -3517,16 +3517,17 @@ markup)%0A +# uid @@ -3544,16 +3544,17 @@ chat.id%0A +# mess @@ -3582,16 +3582,17 @@ _dict()%0A +# even
30100751f64e20804dce332fa458a8490be62336
Add the "interval" option to the raw_parameter_script example
examples/raw_parameter_script.py
examples/raw_parameter_script.py
""" The main purpose of this file is to demonstrate running SeleniumBase scripts without the use of Pytest by calling the script directly with Python or from a Python interactive interpreter. Based on whether relative imports work or don't, the script can autodetect how this file was run. With pure Pyth...
Python
0.001246
@@ -2989,24 +2989,47 @@ _js = False%0A + sb.interval = None%0A sb.cap_f
b8b630c0f1bd53960c1f6bb275f25fecbca520ba
tweak output format.
import_profiler.py
import_profiler.py
import collections import time __OLD_IMPORT = None class ImportInfo(object): def __init__(self, name, context_name, counter): self.name = name self.context_name = context_name self._counter = counter self._depth = 0 self._start = time.time() self.elapsed = None ...
Python
0
@@ -2495,33 +2495,34 @@ %22%7B:. -2 +1f %7D%22.format(cumtim @@ -2545,17 +2545,18 @@ %22%7B:. -2 +1f %7D%22.forma @@ -2709,24 +2709,29 @@ rs=(%22cumtime + (ms) %22, %22intime%22, @@ -2728,16 +2728,21 @@ %22intime + (ms) %22, %22name
dd7b10a89e3fd5e431b03e922fbbc0a49c3d8c5e
Fix failing wavelet example due to outdated code
examples/trafos/wavelet_trafo.py
examples/trafos/wavelet_trafo.py
# Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL 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) any later version. #...
Python
0
@@ -1111,32 +1111,33 @@ ce, -nscales=2, wbasis='Haar' +wavelet='Haar', nlevels=2 )%0A%0A#
5e86582ebde98f14df796102062659f185c2bcca
update docs/extensions/fancy_include.py with git_cast_file2repos.py
docs/extensions/fancy_include.py
docs/extensions/fancy_include.py
"""Include single scripts with doc string, code, and image Use case -------- There is an "examples" directory in the root of a repository, e.g. 'include_doc_code_img_path = "../examples"' in conf.py (default). An example is a file ("an_example.py") that consists of a doc string at the beginning of the file, the exampl...
Python
0.000001
@@ -1773,24 +1773,51 @@ image_path)) +%0A rst.append(%22%22) %0A%0A #
342ada244652bb287da86dfb8c2c38031f3be9a8
Update README.
set-ornata-chroma-rgb.py
set-ornata-chroma-rgb.py
#!/usr/bin/env python3 # file: set-ornata-chroma-rgb.py # vim:fileencoding=utf-8:fdm=marker:ft=python # # Copyright Β© 2019 R.F. Smith <rsmith@xs4all.nl> # Created: 2019-06-16T19:09:06+0200 # Last modified: 2019-06-16T20:47:20+0200 """Set the LEDs on a Razer Ornata Chroma keyboard to a static RGB color.""" import argpa...
Python
0
@@ -146,16 +146,47 @@ all.nl%3E%0A +# SPDX-License-Identifier: MIT%0A # Create @@ -246,15 +246,15 @@ 16T2 -0:47:20 +1:52:22 +020
67f431c23dba00860b1e5c13bb8a131cb850c33d
work around some views not being editable but still requiring it to be re-usable for all
go/conversation/templatetags/conversation_tags.py
go/conversation/templatetags/conversation_tags.py
import re from copy import copy from django.conf import settings from django import template from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.urlresolvers import reverse from django.contrib.sites.models import Site from django.template.defaultfilters import stringfilter from g...
Python
0
@@ -824,125 +824,268 @@ -except AttributeError:%0A return '/conversations/%25s/' %25 (conv.key,)%0A return view_def.get_view_url(view_name, + return view_def.get_view_url(view_name, conversation_key=conv.key)%0A except AttributeError: # If there's not view definition%0A return '/conversat...
0d38b9592fbb63e25b080d2f17b690c478042455
Add comments to Perfect Game solution
google-code-jam-2012/perfect-game/perfect-game.py
google-code-jam-2012/perfect-game/perfect-game.py
#!/usr/bin/env python import sys if len(sys.argv) < 2: sys.exit('Usage: %s file.in' % sys.argv[0]) file = open(sys.argv[1], 'r') T = int(file.readline()) for i in xrange(1, T+1): N = int(file.readline()) L = map(int, file.readline().split(' ')) P = map(int, file.readline().split(' ')) assert N == len(L)...
Python
0
@@ -16,16 +16,252 @@ python%0A%0A +# expected time per attempt is given by equation%0A# time = L%5B0%5D + (1-P%5B0%5D)*L%5B1%5D + (1-P%5B0%5D)*(1-P%5B1%5D)*L%5B2%5D + ...%0A# where L is the expected time and P is the probability of failure, per level%0A# swap two levels if L%5Bi%5D*P%5Bi+1%5D %3E L%5Bi+1%5D*P%5Bi%5D%0...
7be6d6eba2ca0efd2e4c0a18068332e5c6f7dac4
Use generators for async_add_entities in Anthemav (#76587)
homeassistant/components/anthemav/media_player.py
homeassistant/components/anthemav/media_player.py
"""Support for Anthem Network Receivers and Processors.""" from __future__ import annotations import logging from anthemav.connection import Connection from anthemav.protocol import AVR import voluptuous as vol from homeassistant.components.media_player import ( PLATFORM_SCHEMA, MediaPlayerDeviceClass, M...
Python
0
@@ -2708,379 +2708,260 @@ -entities = %5B%5D%0A for zone_number in avr.protocol.zones:%0A _LOGGER.debug(%22Initializing Zone %25s%22, zone_number)%0A entity = AnthemAVR(%0A avr.protocol, name, mac_address, model, zone_number, config_entry.entry_id%0A )%0A entities.append(...
9f9e2db5105eab1f46590a6b8d6a5b5eff4ccb51
Use new BinarySensorDeviceClass enum in egardia (#61378)
homeassistant/components/egardia/binary_sensor.py
homeassistant/components/egardia/binary_sensor.py
"""Interfaces with Egardia/Woonveilig alarm control panel.""" from homeassistant.components.binary_sensor import ( DEVICE_CLASS_MOTION, DEVICE_CLASS_OPENING, BinarySensorEntity, ) from homeassistant.const import STATE_OFF, STATE_ON from . import ATTR_DISCOVER_DEVICES, EGARDIA_DEVICE EGARDIA_TYPE_TO_DEVICE...
Python
0
@@ -116,53 +116,31 @@ -DEVICE_CLASS_MOTION,%0A DEVICE_CLASS_OPENING +BinarySensorDeviceClass ,%0A @@ -319,29 +319,40 @@ ensor%22: -DEVICE_CLASS_ +BinarySensorDeviceClass. MOTION,%0A @@ -375,53 +375,75 @@ t%22: -DEVICE_CLASS_OPENING,%0A %22IR%22: DEVICE_CLASS_ +BinarySensorDeviceClass.OPENING,%0A ...
c3a1193ef9b01529e9f92495fb1c3ae58d822c89
Fix #863 - Added a check for good pull from OWM and return if the object is None
homeassistant/components/sensor/openweathermap.py
homeassistant/components/sensor/openweathermap.py
""" homeassistant.components.sensor.openweathermap ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OpenWeatherMap (OWM) service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.openweathermap/ """ import logging from datetime import timedelta from ...
Python
0.000006
@@ -5587,32 +5587,137 @@ self.longitude)%0A + if obs is None:%0A _LOGGER.warning('Failed to fetch data from OWM')%0A return%0A%0A self.dat
568828287f426bef598c11267b6ee351751671fe
add conf parameters to XPathFetchPage module
feedin/modules/xpathfetchpage.py
feedin/modules/xpathfetchpage.py
from module import Module import urllib2 import urlparse from StringIO import StringIO import gzip from lxml import html from lxml import etree from feedin import util from feedin.dotdict2 import DotDict2 from module import ModuleBuilder class XPathFetchPage(Module): EXTRACT_TYPE_DICT = 'dict' EXTRACT_TYPE_T...
Python
0
@@ -638,32 +638,261 @@ path'%5D%5B'value'%5D%0A + self.html5 = setting%5B'conf'%5D%5B'html'%5D%5B'value'%5D == 'true' if 'html5' in setting%5B'conf'%5D else False%0A self.useAsString = setting%5B'conf'%5D%5B'useAsString'%5D%5B'value'%5D == 'true' if 'useAsString' in setting%5B'conf'%5D else False%0A ...
a4ee7fa5b77b4513ceddcfb0e9be958442d3c792
Use lambdas for api commands
IKEA.py
IKEA.py
import json import uuid from pytradfri import Gateway from pytradfri.api.libcoap_api import APIFactory from time import sleep import numpy CONFIG_FILE = "tradfri_psk.conf" class RGB(numpy.ndarray): @classmethod def from_str(cls, hex): return numpy.array([int(hex[i:i+2], 16) for i in (0, 2, 4)]).view(cls) ...
Python
0.000001
@@ -2913,353 +2913,455 @@ -light_group = self.get_group(group_id)%0A if not light_group:%0A return False%0A self.api(light_group.set_state(new_state))%0A return True%0A%0A def set_dimmer(self, group_id, value):%0A light_group = self.get_group(group_id)%0A if not li...
ead5daf0e631a3482a8510abc36f48b227e862ee
Delete unused variable assignations.
game.py
game.py
# -*- coding: utf-8 -*- import functions.commands as command import functions.database as db prompt = ">>> " view = { '0.0' : "Tutorial. You see a rat attacking you, fight!", '1.0' : "You stand in a start of dungeon. You see a torch." } position = '1.0' f = open('ASCII/otsikko_unicode.asc', 'r') print(f.rea...
Python
0
@@ -92,179 +92,8 @@ db%0A%0A -prompt = %22%3E%3E%3E %22%0Aview = %7B%0A '0.0' : %22Tutorial. You see a rat attacking you, fight!%22,%0A '1.0' : %22You stand in a start of dungeon. You see a torch.%22%0A%7D%0A%0Aposition = '1.0'%0A%0A f =
760bc99c22b6ac66cdd240b29720d0bbfccc4920
Define waf_tools for each class instance separately
glue.py
glue.py
""" Glue code between nsloaders and Mybuild bindings for py/my DSL files. """ __author__ = "Eldar Abusalimov" __date__ = "2013-08-07" from _compat import * from nsloader import myfile from nsloader import pyfile import mybuild from mybuild.binding import pydsl from util.operator import attr from util.namespace im...
Python
0
@@ -869,32 +869,110 @@ core.Tool):%0A +def __init__(self):%0A super(WafBasedTool, self).__init__()%0A self. waf_tools = %5B%5D%0A%0A @@ -1040,16 +1040,17 @@ _tools)%0A +%0A def @@ -1146,40 +1146,8 @@ l):%0A - waf_tools = %5B'compiler_c'%5D%0A%0A @@ -1197,32 +1197,76 @@ elf).__init_...
4e2e4a841d4cdb3efa151601fe5200b0720ffe75
update set
inference/story.py
inference/story.py
# -*- coding: utf-8 -*- # file: song_lyrics.py # author: JinTian # time: 08/03/2017 10:22 PM # Copyright 2017 JinTian. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #...
Python
0.000001
@@ -977,17 +977,18 @@ _size', -6 +10 , 'batch @@ -1491,18 +1491,17 @@ pochs', -10 +3 00, 'tra
5830843f88fc87e8c31f2983413acc16aa0c0711
remove typo
dv_apps/dataverse_auth/models.py
dv_apps/dataverse_auth/models.py
from django.db import models from datetime import datetime from django.utils.encoding import python_2_unicode_compatible class AuthenticatedUser(models.Model): useridentifier = models.CharField(unique=True, max_length=255) affiliation = models.CharField(max_length=255, blank=True, null=True) email = models...
Python
0.999999
@@ -642,18 +642,16 @@ setime = - = models.
0dead7fdb0d28ee29c18884ec4c68a197eca6461
Update tests.py
inspect_model/tests.py
inspect_model/tests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.db import models from django.test import TestCase from django.contrib.contenttypes.models import ContentType from inspect_model import InspectModel class OtherModel(models.Model): name = models.CharField(max_length=10, blank=True) class LinkedModel(mod...
Python
0
@@ -160,16 +160,64 @@ tentType +%0Afrom django.contrib.contenttypes import generic %0A%0Afrom i
f38ecca955782374d2e2d5d740b394a150de8bf2
Remove old comment.
inspectors/commerce.py
inspectors/commerce.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import logging import os from urllib.parse import urljoin, urlparse, urlunparse from bs4 import BeautifulSoup from utils import utils, inspector # http://www.oig.doc.gov/Pages/Audits-Evaluations.aspx?YearStart=01/01/1996&YearEnd=12/31/2014 # Oldest report...
Python
0
@@ -822,46 +822,8 @@ m:%0A# - - The report 'OAE-19846_Announcement' %0A%0ATO
0fd3199f02f305fe0802305d8f4be0f0bed8b5cb
Remove unnecessary base class.
interface/interface.py
interface/interface.py
""" interface --------- """ from functools import wraps import inspect from operator import itemgetter from textwrap import dedent from weakref import WeakKeyDictionary first = itemgetter(0) def compatible(meth_sig, iface_sig): """ Check if ``method``'s signature is compatible with ``signature``. """ ...
Python
0
@@ -442,97 +442,8 @@ g%0A%0A%0A -def strict_issubclass(t, parent):%0A return issubclass(t, parent) and t is not parent%0A%0A%0A clas @@ -3998,98 +3998,8 @@ %22%0A%0A%0A -class Implements:%0A %22%22%22%0A Base class for an implementation of an interface.%0A %22%22%22%0A%0A%0A clas @@ -4775,25 +4775,18 @@...
2d26d92956282be3f08cc3dcdb5fa16433822a1b
Change retry_if_fails to _retry_on_fail
Nyaa.py
Nyaa.py
from bs4 import BeautifulSoup import re import requests import sys def retry_if_fails(req, *args, **kwargs): try: r = req(*args, **kwargs) if r.status_code not in range(100, 399): print('Connection error, retrying... (HTTP {})'.format(r.status_code), file=sys.stderr) return retry_if_fails(req, *args, **kwar...
Python
0.00177
@@ -65,30 +65,30 @@ ys%0A%0Adef +_ retry_ -if +on _fail -s (req, *a @@ -276,38 +276,38 @@ )%0A%09%09%09return +_ retry_ -if +on _fail -s (req, *args, @@ -485,30 +485,30 @@ %09return +_ retry_ -if +on _fail -s (req, *a @@ -1253,38 +1253,38 @@ _id)%0A%0A%09%09r = +_ retry_ -if +on _fail -s (requests.g...
74454b032be96cc34d96fe4eefc2a89c88637532
Version 1.5.2 -> 1.6.0
iprestrict/__init__.py
iprestrict/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .restrictor import IPRestrictor __all__ = ["IPRestrictor"] __version__ = "1.5.2"
Python
0.000001
@@ -145,9 +145,9 @@ %221. -5.2 +6.0 %22%0A
10ceb00e249635868fb55c1ae1668ddb35b03bc3
Update demo
demo.py
demo.py
# -*- coding: utf-8 -*- from taiga import TaigaAPI api = TaigaAPI( host='http://127.0.0.1:8000' ) api.auth( username='admin', password='123123' ) print (api.me()) new_project = api.projects.create('TEST PROJECT', 'TESTING API') new_project.name = 'TEST PROJECT 3' new_project.update() jan_feb_mileston...
Python
0.000001
@@ -44,16 +44,60 @@ TaigaAPI +%0Afrom taiga.exceptions import TaigaException %0A%0Aapi = @@ -1073,57 +1073,8 @@ s)%0A%0A -for user in new_project.users:%0A print (user)%0A%0A stor @@ -1172,16 +1172,25 @@ %5D.id))%0A%0A +try:%0A projects @@ -1199,16 +1199,62 @@ %5D.star() +%0Aexcept TaigaException:%0A ...
fc187d9b8822fe446561dc4724c7f123da3d550f
Fix query for auto-adding to board by domain
hasjob/tagging.py
hasjob/tagging.py
# -*- coding: utf-8 -*- from collections import defaultdict from urlparse import urljoin import requests from flask.ext.rq import job from coaster.utils import text_blocks from coaster.nlp import extract_named_entities from . import app from .models import (db, JobPost, JobLocation, Board, BoardDomain, BoardLocation, ...
Python
0.000031
@@ -2974,32 +2974,98 @@ = JobPost.query. +options(db.load_only('email_domain'), db.joinedload('locations')). get(jobpost_id)%0A @@ -3119,41 +3119,14 @@ in). -join(BoardLocation).filter(db.or_ +filter (%0A @@ -3178,17 +3178,24 @@ l_domain -, +).union( %0A @@ -3212,86 +3212,86 @@ oard -Location.geonameid....
2288fb1f849c6b9948a3ac792daea3f9044d6f37
Fix create index
haystack_redis.py
haystack_redis.py
import os from cStringIO import StringIO from threading import Lock from redis import from_url as redis from whoosh.index import _DEF_INDEX_NAME, EmptyIndexError from whoosh.qparser import QueryParser from whoosh.filedb.structfile import StructFile from whoosh.filedb.filestore import Storage, create_index, open_index...
Python
0
@@ -60,16 +60,32 @@ ort Lock +%0Aimport tempfile %0A%0Afrom r @@ -309,32 +309,55 @@ ge, -create_index, open_index +FileStorage%0Afrom whoosh.util import random_name %0A%0Afr @@ -438,79 +438,8 @@ ne%0A%0A -redis_url = os.environ.get('REDISTOGO_URL', 'redis://localhost:6379')%0A%0A %0Acla @@ -1391,24 +1391,35 @@ ...
abffab17e166f39111f58e37e27af3c963e2fe6a
Add docs for membership operators
sqlalchemy_utils/types/range.py
sqlalchemy_utils/types/range.py
""" SQLAlchemy-Utils provides wide variety of range data types. All range data types return Interval objects of intervals_ package. In order to use range data types you need to install intervals_ with: :: pip install intervals Intervals package provides good chunk of additional interval operators that for examp...
Python
0
@@ -694,40 +694,141 @@ 0)%0A%0A - Car.price_range.in_(%5B%5B300, 5 +%0AMembership operators%0A%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%5E%0A%0A::%0A%0A Car.price_range.in_(%5B%5B300, 500%5D%5D)%0A%0A ~ Car.price_range.in_(%5B%5B300, 400%5D, %5B700, 8 00%5D%5D
7692c4210289af68ad7952ddca89f70d250a26ed
Change base_directory location
great_expectations/data_context/datasource/pandas_source.py
great_expectations/data_context/datasource/pandas_source.py
import pandas as pd import os from .datasource import Datasource from .filesystem_path_generator import FilesystemPathGenerator from ...dataset.pandas_dataset import PandasDataset class PandasCSVDatasource(Datasource): """ A PandasDataSource makes it easy to create, manage and validate expectations on Pan...
Python
0.000002
@@ -474,100 +474,30 @@ ne, -base_directory=%22/data%22, read_csv_kwargs=None):%0A self._base_directory = base_directory +read_csv_kwargs=None): %0A @@ -785,58 +785,8 @@ %7B%0A - %22base_directory%22: base_directory,%0A
b69289c62a5be3a523b4d32aec2b6d790dc95f0d
Add compare functions
amit.py
amit.py
import hashlib, ssdeep def hash_ssdeep(inbytes): return ssdeep.hash(inbytes) def hash_md5(inbytes): m = hashlib.md5() m.update(inbytes) return m.hexdigest() def hash_sha1(inbytes): m = hashlib.sha1() m.update(inbytes) return m.hexdigest() def hash_sha256(inbytes): m = hashlib.sha256() m.update(inbytes) re...
Python
0.000001
@@ -338,30 +338,24 @@ )%0A%0Adef hash_ -print_ all(inbytes) @@ -357,22 +357,33 @@ ytes):%0A%09 -print +a = %5B%5D%0A%09a.append( hash_ssd @@ -390,32 +390,36 @@ eep(inbytes) +) %0A%09 -print +a.append( hash_md5(inb @@ -423,32 +423,66 @@ inbytes) +) %0A%09 -print +a.append(hash_sha1(inbytes))%0A%09a.append( ...
d5e41dfaff393a0649336ef92d7b7917a7e0122d
fix allowed_hosts settings bug
hours/settings.py
hours/settings.py
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ # SECRET_KEY will be automatically generated an...
Python
0.000001
@@ -479,27 +479,8 @@ True -%0AALLOWED_HOSTS = %5B%5D %0A%0A#
91f207c8fc419c773555bec355d0b0da35061044
Version 0.9.82
hsync/_version.py
hsync/_version.py
__version__ = '0.9.81'
Python
0
@@ -18,7 +18,7 @@ .9.8 -1 +2 '%0A
b9bd48ff4d69bde723d30c658f46d5216f01f82f
Update process.py
src/rotest/core/runners/multiprocess/worker/process.py
src/rotest/core/runners/multiprocess/worker/process.py
"""Multiprocess worker process.""" # pylint: disable=invalid-name,too-many-arguments,wrong-import-position # pylint: disable=too-many-locals,too-many-instance-attributes from __future__ import absolute_import from multiprocessing import Process import django import psutil from six.moves import queue if not hasattr(dj...
Python
0.000001
@@ -202,16 +202,90 @@ _import%0A +import django%0Aif not hasattr(django, 'apps'): # noqa%0A django.setup()%0A%0A from mul @@ -313,30 +313,16 @@ rocess%0A%0A -import django%0A import p @@ -360,68 +360,8 @@ ue%0A%0A -if not hasattr(django, 'apps'): # noqa%0A django.setup()%0A%0A from
5a38e5924409e887430ee4366c81ebc2b94152a5
add trackers registration
plenum/server/database_manager.py
plenum/server/database_manager.py
from typing import Dict, Optional from common.exceptions import LogicError from plenum.common.constants import BLS_LABEL, TS_LABEL, IDR_CACHE_LABEL, ATTRIB_LABEL from plenum.common.ledger import Ledger from state.state import State class DatabaseManager(): def __init__(self): self.databases = {} # type:...
Python
0
@@ -359,16 +359,43 @@ es = %7B%7D%0A + self.trackers = %7B%7D%0A @@ -1290,24 +1290,152 @@ lid%5D.state%0A%0A + def get_tracker(self, lid):%0A if lid not in self.trackers:%0A return None%0A return self.trackers%5Blid%5D%0A%0A def regi @@ -1608,16 +1608,208 @@ store%0...
8c4590e19c7b39fe6562671f7d63651e736ffa49
debug print
controllers/admin/admin_migration_controller.py
controllers/admin/admin_migration_controller.py
import os from google.appengine.ext import ndb from google.appengine.ext import deferred from google.appengine.ext.webapp import template from controllers.base_controller import LoggedInHandler from models.event import Event from helpers.match_manipulator import MatchManipulator def add_year(event_key): matches = e...
Python
0.000003
@@ -300,16 +300,42 @@ t_key):%0A + logging.info(event_key)%0A matche
895dfda101665e0f70e96d549443f9fe777de1e7
Add support for multiple urls per method, auto create method routers
hug/decorators.py
hug/decorators.py
from functools import wraps from collections import OrderedDict import sys from hug.run import server import hug.output_format from falcon import HTTP_METHODS, HTTP_BAD_REQUEST def call(url, accept=HTTP_METHODS, output=hug.output_format.json): def decorator(api_function): module = sys.modules[api_functio...
Python
0
@@ -20,16 +20,25 @@ rt wraps +, partial %0Afrom co @@ -194,16 +194,17 @@ call(url +s , accept @@ -247,18 +247,87 @@ mat.json -): +, example=None):%0A if isinstance(urls, str):%0A urls = (urls, )%0A %0A def @@ -1407,24 +1407,19 @@ for -method in accept +url in urls :%0A @@ -1419,32 +1419,43 @@ r...
66dd418d481bfc5d3d910823856bdcea8d304a87
allow to pass a different root-path
hwaf-cmtcompat.py
hwaf-cmtcompat.py
# -*- python -*- # stdlib imports import os import os.path as osp import sys # waf imports --- import waflib.Options import waflib.Utils import waflib.Logs as msg from waflib.Configure import conf _heptooldir = osp.dirname(osp.abspath(__file__)) # add this directory to sys.path to ease the loading of other hepwaf to...
Python
0.000002
@@ -499,19 +499,30 @@ , source +, root=None ):%0A - '''h @@ -574,16 +574,62 @@ iles'''%0A + if root is None:%0A root = self.root%0A if i @@ -751,16 +751,22 @@ cs_lst(s +, root ))%0A @@ -898,33 +898,28 @@ src_node = -self.path +root .find_dir('s @@ -938,25 +938,20 @@ srcs = -self.pat...
18fc60eb591a77180686e905591df8d1ce96d75c
Remove "import pyganim" from `render.py`
hypatia/render.py
hypatia/render.py
# This module is part of Hypatia and is released under the # MIT License: http://opensource.org/licenses/MIT """How stuff is drawn. Very specific rendering stuff. Includes screen and viewport. Mostly a lot of scaffolding. See Also: :mod:`animations` """ import sys import time import itertools ...
Python
0
@@ -333,24 +333,8 @@ me%0D%0A -import pyganim%0D%0A from
70ea214d8e258e4e7c95b9ba7948dde13e28a878
Make screengrab_torture_test test more functions
desktopmagic/scripts/screengrab_torture_test.py
desktopmagic/scripts/screengrab_torture_test.py
from desktopmagic.screengrab_win32 import GrabFailed, getScreenAsImage def main(): print """\ This program helps you test whether screengrab_win32 has memory leaks and other problems. It takes a screenshot repeatedly and discards it. Open Task Manager and make sure Physical Memory % is not ballooning. Memory leaks ...
Python
0.000007
@@ -63,16 +63,53 @@ nAsImage +, getDisplaysAsImages, getRectAsImage %0A%0Adef ma @@ -803,17 +803,188 @@ %09print %22 -. +S%22,%0A%09%09except GrabFailed, e:%0A%09%09%09print e%0A%0A%09%09try:%0A%09%09%09getDisplaysAsImages()%0A%09%09%09print %22D%22,%0A%09%09except GrabFailed, e:%0A%09%09%09print e%0A%0A%09%09try:%0...
b825fd03475855bd3fa89cdd2acf6603032a4497
add request args only if we have data
src/RequestsLibrary/keywords.py
src/RequestsLibrary/keywords.py
import requests import sys import json from urllib import urlencode import robot from robot.libraries.BuiltIn import BuiltIn class RequestsKeywords(object): ROBOT_LIBRARY_SCOPE = 'Global' def __init__(self): ''' TODO: probably can set global proxy here ''' self._cache = rob...
Python
0
@@ -4301,32 +4301,87 @@ e.switch(alias)%0A + args = %22?%25s%22 %25 urlencode(data) if data else ''%0A resp = s @@ -4397,17 +4397,16 @@ lete(%22%25s -? %25s%22 %25(ur @@ -4408,31 +4408,20 @@ %25(uri, -urlencode(data) +args ), heade
9d1dc9c2c649bd117c2cd38cf664e34820f387ea
update docstring in fwhm.py
fwhm.py
fwhm.py
import numpy as np def fwhm(x,y, silence = False): maxVal = np.max(y) maxVal50 = 0.5*maxVal if not silence: print "Max: " + str(maxVal) #this is to detect if there are multiple values biggerCondition = [a > maxVal50 for a in y] changePoints = [] freqPoints = [] for k in ...
Python
0
@@ -823,25 +823,24 @@ ing the -frequency +x values as a fu @@ -857,18 +857,15 @@ the -return los +y value s.%0A @@ -920,43 +920,53 @@ the -frequency at returnloss = threshold +value of x at the threshold, i.e. at maxVal50 .%0A%0A
161a1cdddd79df7126d6adf1117d51e679d1746c
Change --command option in "docker" to a positional argument
dodo_commands/extra/standard_commands/docker.py
dodo_commands/extra/standard_commands/docker.py
"""This command opens a bash shell in the docker container.""" from . import DodoCommand class Command(DodoCommand): # noqa decorators = ["docker", ] def add_arguments_imp(self, parser): # noqa parser.add_argument('--command', default="") def handle_imp(self, command, **kwargs): # noqa ...
Python
0.000001
@@ -234,10 +234,8 @@ nt(' --- comm @@ -244,18 +244,17 @@ d', -default=%22%22 +nargs='?' )%0A%0A
9fb9d55ec55e4f5105de0cd6f19b530786ec91a2
Change personality inject path to /
tempest/api/compute/servers/test_server_personality.py
tempest/api/compute/servers/test_server_personality.py
# Copyright 2012 OpenStack Foundation # 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 requ...
Python
0.000002
@@ -5419,16 +5419,135 @@ imit)):%0A + # NOTE(andreaf) The cirros disk image is blank before boot%0A # so we can only inject safely to /%0A @@ -5559,20 +5559,16 @@ ath = '/ -etc/ test' +
36063d227f7cd3ededdc99b23b0c7911f2233df2
Add available params in metering labels client's comment
tempest/lib/services/network/metering_labels_client.py
tempest/lib/services/network/metering_labels_client.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
Python
0.000016
@@ -726,530 +726,1440 @@ -uri = '/metering/metering-labels'%0A post_data = %7B'metering_label': kwargs%7D%0A return self.create_resource(uri, post_data)%0A%0A def show_metering_label(self, metering_label_id, **fields):%0A uri = '/metering/metering-labels/%25s' %25 metering_label_id%0A ...
1e5644acc64f99e8b4bb88a0428cf75d09143f3c
Fix experiment jobs log handling
polyaxon/events_handlers/tasks.py
polyaxon/events_handlers/tasks.py
import logging from django.conf import settings from django.db import IntegrityError from db.models.build_jobs import BuildJob from db.models.experiment_jobs import ExperimentJob from db.models.experiments import Experiment from db.models.jobs import Job from db.models.nodes import ClusterEvent from db.models.noteboo...
Python
0.000003
@@ -5095,16 +5095,17 @@ lines = +%5B '%7B%7D.%7B%7D - @@ -5155,18 +5155,65 @@ log_line -s ) +%0A for log_line in log_lines%5D %0A%0A sa
3d6c293e60dd8cb69331b8c6337e12e4919a7a55
Fix clang-tidy in vara builder
polyjit/buildbot/builders/vara.py
polyjit/buildbot/builders/vara.py
import sys from collections import OrderedDict from polyjit.buildbot.builders import register from polyjit.buildbot import slaves from polyjit.buildbot.utils import (builder, define, git, ucmd, ucompile, cmd, upload_file, ip, s_sbranch, s_abranch, ...
Python
0.000002
@@ -3153,16 +3153,46 @@ ucmd( +'PATH=/mnt/build/bin/:$PATH', 'python3
93870690f17a4baddeb33549a1f6c67eeee1abe0
Increase cache tile duration from 6 hours to 1 week
src/adhocracy/lib/tiles/util.py
src/adhocracy/lib/tiles/util.py
import logging from time import time from pylons import tmpl_context as c from adhocracy import config from adhocracy.lib.cache import memoize log = logging.getLogger(__name__) class BaseTile(object): ''' Base class for tiles ''' def render_tile(template_name, def_name, tile, cached=False, **kwargs):...
Python
0
@@ -657,18 +657,18 @@ ame, + 7 * 86400 - / 4 )%0A
d5691c8031a32e0cfadc74e9fffad8a9e04bc63c
enable search navbar entry in production
portal/base/context_processors.py
portal/base/context_processors.py
from django.conf import settings def search_disabled(request): """Facility for disabling search functionality. This may be used in the future to automatically disable search if the search backend goes down. """ return dict(SEARCH_DISABLED=not settings.DEBUG)
Python
0
@@ -222,20 +222,60 @@ %22%22%22%0A + return dict(SEARCH_DISABLED=False) %0A + # return
87b9910a30cb915f5b99a17b0b49570b0027e665
load help module
gbot.py
gbot.py
#!/usr/bin/env python # ============================================================================= # file = gbot.py # description = IRC bot # author = GR <https://github.com/shortdudey123> # create_date = 2014-07-09 # mod_date = 2014-07-09 # version = 0.1 # usage = called as a class # notes = # python_ver = 2.7.6 # ...
Python
0.000001
@@ -763,16 +763,24 @@ uleInfo' +, 'help' %5D)%0A g
9f5afd72bf6dbb44ba764f6731c6313f0cb94bce
Use default outputs in shortcuts/utils.py
prompt_toolkit/shortcuts/utils.py
prompt_toolkit/shortcuts/utils.py
from __future__ import unicode_literals from prompt_toolkit.output.defaults import create_output from prompt_toolkit.renderer import print_formatted_text as renderer_print_formatted_text from prompt_toolkit.styles import default_style, BaseStyle import six __all__ = ( 'print_formatted_text', 'clear', 'set_...
Python
0.000001
@@ -76,22 +76,27 @@ import -create +get_default _output%0A @@ -406,30 +406,14 @@ ne, -true_color=False, file +output =Non @@ -1064,158 +1064,8 @@ me.%0A - :param true_color: When True, use 24bit colors instead of 256 colors.%0A :param file: The output file. This can be %60sys.stdout%60 or %60sys.stderr%60...
2c350cbbd90afaab38223fdfe40737f72bf7974a
Set --device-type as required arg for harvest_tracking_email command.
tracking/management/commands/harvest_tracking_email.py
tracking/management/commands/harvest_tracking_email.py
from django.core.management.base import BaseCommand from tracking.harvest import harvest_tracking_email class Command(BaseCommand): help = "Runs harvest_tracking_email to harvest points from emails" def add_arguments(self, parser): parser.add_argument( '--device-type', action='store', des...
Python
0
@@ -329,16 +329,31 @@ e_type', + required=True, default
4b148d5b6fda0a8b44109e2024f61df30b981938
Add docstrings.
HARK/datasets/cpi/us/CPITools.py
HARK/datasets/cpi/us/CPITools.py
# -*- coding: utf-8 -*- """ Created on Wed Jan 20 18:07:41 2021 @author: Mateo """ import urllib.request import pandas as pd import warnings import numpy as np def download_cpi_series(): urllib.request.urlretrieve("https://www.bls.gov/cpi/research-series/r-cpi-u-rs-allitems.xlsx", ...
Python
0
@@ -190,396 +190,2017 @@ -%0A urllib.request.urlretrieve(%22https://www.bls.gov/cpi/research-series/r-cpi-u-rs-allitems.xlsx%22,%0A %22r-cpi-u-rs-allitems.xlsx%22)%0A%0Adef get_cpi_series():%0A %0A cpi = pd.read_excel(%22r-cpi-u-rs-allitems.xlsx%22, skiprows = 5,%0A ...
4d247da1ecd39bcd699a55b5387412a1ac9e1582
Split Energy and Environment, change Civil Liberties to Social Justice
txlege84/topics/management/commands/bootstraptopics.py
txlege84/topics/management/commands/bootstraptopics.py
from django.core.management.base import BaseCommand from topics.models import Topic class Command(BaseCommand): help = u'Bootstrap the topic lists in the database.' def handle(self, *args, **kwargs): self.load_topics() def load_topics(self): self.stdout.write(u'Loading hot list topics.....
Python
0
@@ -410,40 +410,8 @@ y',%0A - u'Civil Liberties',%0A @@ -459,19 +459,33 @@ u'Energy - & +',%0A u' Environm @@ -657,32 +657,63 @@ lic Education',%0A + u'Social Justice',%0A u'Tr
2bf756404700f4c38e2f3895dfa8aba2d8dc13be
Refactor and remove char2int
hash.py
hash.py
class HashTable(object): """docstring for HashTable""" table_size = 0 entries_count = 0 alphabet_size = 52 def __init__(self, size=1024): self.table_size = size self.hashtable = [[] for i in range(size)] def __repr__(self): return "<HashTable: {}>".format(self.hashtab...
Python
0.000002
@@ -479,310 +479,8 @@ nt%0A%0A - def char2int(self, char):%0A %22%22%22Convert a alpha character to an int.%22%22%22%0A # offset for ASCII table%0A # if char %3E= 'A' and char %3C= 'Z':%0A # return ord(char) - 65%0A # elif char %3E= 'a' and char %3C= 'z':%0A # retur...
3af8cfa40a6770e6940ec7140c92ad51532a4e73
improve re usage
IPython/core/magics/packaging.py
IPython/core/magics/packaging.py
"""Implementation of packaging-related magic functions. """ #----------------------------------------------------------------------------- # Copyright (c) 2018 The IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with ...
Python
0
@@ -1197,23 +1197,103 @@ -R = re.compile( +history = Path(sys.prefix, %22conda-meta%22, %22history%22).read_text()%0A match = re.search(%0A r%22%5E# @@ -1345,138 +1345,61 @@ ll%5D%22 -) +, %0A -with open(Path(sys.prefix, %22conda-meta%22, %22history%22)) as f:%0A for line in f:%0A ...
4d71ffaccd7ac2911c17d61c7632115ad09aaedb
Add tests for CMark.should_test
utils/swift_build_support/tests/products/test_cmark.py
utils/swift_build_support/tests/products/test_cmark.py
# tests/products/test_ninja.py ----------------------------------*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2021 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for l...
Python
0.000001
@@ -760,18 +760,16 @@ t shell%0A -# from swi @@ -3833,8 +3833,1081 @@ riant))%0A +%0A def test_should_test(self):%0A cmark = CMark(%0A args=argparse.Namespace(test_cmark=True, cross_compile_hosts=%5B%5D),%0A toolchain=self.toolchain,%0A source_dir=self.workspace.source_roo...
3039149ca20e9c472340495e4130e331d9c546b3
Fix nums assignment properly
calc.py
calc.py
import sys def add_all(nums): return sum(nums) def multiply_all(nums): return reduce(lambda a, b: a*b, nums) if __name__ == '__main__': command =sys.argv[1] nums=map(float(sys.argv[2:])) if command=='add': print add_all(nums) if command=='multiply': print multiply_all(nums)
Python
0.000001
@@ -171,17 +171,18 @@ ap(float -( +, sys.argv @@ -186,17 +186,16 @@ rgv%5B2:%5D) -) %0A%09if com
fd8caec8567178abe09abc810f1e96bfc4bb531b
Fix bug in 'multiply' support
calc.py
calc.py
import sys def add_all(nums): return sum(nums) def multiply_all(nums): return reduce(lambda a, b: a * b, nums) if __name__== '__main__': command = sys.argv[1] nums = map(float, sys.argv[2:]) if command == 'add': print(add_all(nums)) elif command == 'multiply': print(multiply_all(sums))
Python
0.000001
@@ -286,15 +286,15 @@ ply_all( -s +n ums))%0A
c3ba924c5fe3fef3f2dd43a9f43eacdebb8d8c13
Make the new init script executable
init.py
init.py
#!/usr/bin/env python3 """Wurstminebot init script. Usage: init.py start | stop | restart | status init.py -h | --help init.py --version Options: -h, --help Print this message and exit. --version Print version info and exit. """ from docopt import docopt import os import os.path import signal import sub...
Python
0.00001
183448b17cfd910444d3807da80ef8549622fce4
test the urltopath
init.py
init.py
import yumoter yumoter = yumoter.yumoter('config/repos.json', '/home/aarwine/git/yumoter/repos') yumoter.loadRepos("6.4", "wildwest") a = yumoter._returnNewestByNameArch(["openssl"]) a = a[0] print a print "name", a.name print "arch", a.arch print "epoch", a.epoch print "version", a.version print "release", a.release...
Python
0.000018
@@ -369,16 +369,55 @@ te_url%0A%0A +print yumoter._urlToPath(a.remote_url)%0A print yu
e1e7fec43e5303232833caac5df1ed22526b41c3
Fix check of notebook path
IPython/html/services/notebooks/tests/test_nbmanager.py
IPython/html/services/notebooks/tests/test_nbmanager.py
"""Tests for the notebook manager.""" import os from tornado.web import HTTPError from unittest import TestCase from tempfile import NamedTemporaryFile from IPython.utils.tempdir import TemporaryDirectory from IPython.utils.traitlets import TraitError from IPython.html.utils import url_path_join from ..filenbmanage...
Python
0.000001
@@ -3045,17 +3045,16 @@ ath'%5D, ' -/ ')%0A%0A
27543f73244c7312ea511c7e00d9eecf7b7525e9
store model in self.model
cost.py
cost.py
""" Cost classes: classes that encapsulate the cost evaluation for the DAE training criterion. """ # Standard library imports from itertools import izip # Third-party imports from theano import tensor class SupervisedCost(object): """ A cost object is allocated in the same fashion as other objects in this...
Python
0.000001
@@ -624,16 +624,43 @@ or not) +%0A self.model = model %0A%0A de
a04b18b8fbc8626b5592593a2b6ce635921a1e34
Delete text after entered, but this time actually do it
data.py
data.py
from twitter import * from tkinter import * def showTweets(x, num): # display a number of new tweets and usernames for i in range(0, num): line1 = (x[i]['user']['screen_name']) line2 = (x[i]['text']) w = Label(master, text=line1 + "\n" + line2 + "\n\n") w.pack() def getTweets(...
Python
0.000002
@@ -513,17 +513,16 @@ -# t.status @@ -573,17 +573,16 @@ -# entryWid @@ -589,53 +589,20 @@ get. -put().strip()%0A entryWidget.insert(0,'' +delete(0,END )%0A
b0648ee8a64a0ee5a1a605c216d3a88e6e72f083
Fix failing protobuf contentview test
test/test_contentview.py
test/test_contentview.py
from libmproxy.exceptions import ContentViewException from netlib.http import Headers import netlib.utils from netlib import encoding import libmproxy.contentviews as cv import tutils try: import pyamf except ImportError: pyamf = None try: import cssutils except: cssutils = None class TestContentVi...
Python
0.000002
@@ -5972,16 +5972,21 @@ tput -%5B0%5D.text +.next()%5B0%5D%5B1%5D ==
2b12019b0e6b5881e38d48cc7981936fe5e7c81d
Fix a bug with info pages
shortener/links/views.py
shortener/links/views.py
from django.db.models import Q from django.http import Http404 from django.shortcuts import get_object_or_404 from django.utils.baseconv import base64 from django.utils import timezone from django.views.generic import RedirectView, ListView, DetailView from .models import Link from linkmetrics.models import LinkLog ...
Python
0.000002
@@ -681,33 +681,32 @@ '.' in identifi -d er:%0A @@ -1369,17 +1369,16 @@ identifi -d er:%0A
de80ad2bd5915533e990bf1a161fa4079c9a7550
Add a new class for filtering, but not use it yet #67
siebenapp/enumeration.py
siebenapp/enumeration.py
import collections import math from dataclasses import dataclass from typing import List, Dict, Tuple, Any, Set, Iterable from siebenapp.domain import Graph, Command, HoldSelect, Select from siebenapp.goaltree import Goals from siebenapp.zoom import Zoom @dataclass(frozen=True) class ToggleOpenView(Command): """...
Python
0
@@ -1442,16 +1442,472 @@ FOUND%0A%0A%0A +class OpenView(Graph):%0A %22%22%22Non-persistent view layer that allows to switch%0A between only-open and all goals%22%22%22%0A%0A def __init__(self, goaltree: Graph):%0A self.goaltree = goaltree%0A%0A def accept(self, command: Command) -%3E None:%0A ...
2ecdd27d96da12bf44a5751b7d76cedf05c1e620
don't remove all whitespace
scripts/DYKChecker.py
scripts/DYKChecker.py
# -*- coding: utf-8 -*- """DYKChecker!""" __version__ = "1.0.1" __author__ = "Sorawee Porncharoenwase" import json import init import wp import pywikibot from wp import lre def glob(): pass def main(): page = wp.Page(wp.toutf(raw_input())) dic = {} while True: try: text = p...
Python
0.689513
@@ -1111,36 +1111,8 @@ t()%0A - # delete all spaces%0A @@ -1135,11 +1135,14 @@ ((r%22 -%5Cs+ +%5B %5Ct%5D* %22, %22 @@ -1158,36 +1158,36 @@ - # delete all external links +subst.append((r%22%5Cn*%22, %22%5Cn%22)) %0A
82689e758d15aad49c7ca6f9c64eed5ea82760b7
Add PlaceholderField to the south ignore list.
fluent_contents/models/fields.py
fluent_contents/models/fields.py
from django.contrib.contenttypes.generic import GenericRelation, GenericRel from django.contrib.contenttypes.models import ContentType from django.db.models.query_utils import Q from django.utils.functional import lazy from django.utils.text import capfirst from fluent_contents.forms.fields import PlaceholderFormField ...
Python
0
@@ -8613,16 +8613,57 @@ ields((%0A + _name_re + %22%5C.PlaceholderField%22,%0A
e5daf961a0f1c45b1f59193d1e24a6bf0ae47e9d
add store name to pickup history join and leave
foodsaving/stores/serializers.py
foodsaving/stores/serializers.py
from datetime import timedelta import dateutil.rrule from django.db import transaction from django.dispatch import Signal from django.utils import timezone from rest_framework import serializers from django.utils.translation import ugettext as _ from config import settings from foodsaving.history.utils import get_ch...
Python
0
@@ -3401,32 +3401,92 @@ user=user +,%0A payload=%7B'store_name': pickup_date.store.name%7D %0A )%0A @@ -3943,24 +3943,84 @@ user=user +,%0A payload=%7B'store_name': pickup_date.store.name%7D %0A )%0A
5c5de666e86d6f2627df79762b0e3b0f188861d4
Fix timestamp comparison on ciresources
scripts/claim_vlan.py
scripts/claim_vlan.py
import MySQLdb from datetime import datetime, timedelta db = MySQLdb.connect(host="10.0.196.2", user="ciuser", passwd="secret", db="ciresources") cur = db.cursor() f = '%Y-%m-%d %H:%M:%S' three_hours_ago_dt = datetime.utcnow() - timedelta(hours=3) three_...
Python
0.000049
@@ -425,11 +425,9 @@ tamp - %3E +%3C '%25s'
77acb5a79c41ac83bb4eb851682edd248c62462c
Add test for featured nullable
test/test_model/test_model_app.py
test/test_model/test_model_app.py
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
Python
0
@@ -2771,16 +2771,246 @@ back()%0A%0A + # App.featured should not be nullable%0A app.description = 'description'%0A app.featured = None%0A db.session.add(app)%0A assert_raises(IntegrityError, db.session.commit)%0A db.session.rollback()%0A%0A %0A def
995c89c41bc432be5e49fb1c3f5206b0caff13dd
Check for NOPAGE in advanced tests.
tests/test_advanced.py
tests/test_advanced.py
#!/usr/bin/env python # -*- coding:utf-8 -*- """ WPTools tests that use the network """ from __future__ import print_function import argparse import random import unittest import tests.titles as titles import wptools LANG = [ 'en', 'ceb', 'sv', 'de', 'nl', 'fr', 'ru', 'it', 'es', 'war', 'pl', 'vi', 'ja', '...
Python
0
@@ -952,16 +952,42 @@ rz',%0A%5D%0A%0A +NOPAGE = 'aspofinwepobw'%0A%0A WIKIS = @@ -1573,32 +1573,300 @@ %5D is not None)%0A%0A + def test_not_found(self):%0A %22%22%22%0A Try to get a non-existent page%0A %22%22%22%0A try:%0A wptools.page(NOPAGE).get(False)%0A se...
cad938d023f7c41b95846c0ba04b6e92e721e434
Fix flake8
tests/cli/test_config.py
tests/cli/test_config.py
import io from textwrap import dedent import pytest import vdirsyncer.cli.utils from vdirsyncer import cli @pytest.fixture def read_config(tmpdir): def inner(cfg): f = io.StringIO(dedent(cfg.format(base=str(tmpdir)))) return cli.utils.read_config(f) return inner def test_read_config(read_c...
Python
0
@@ -74,16 +74,24 @@ li.utils + # noqa %0Afrom vd
ebdc90e269d9ec85b7e6def2ca0701f04caec6ca
return proper algorithm in KDE
sklearn/neighbors/kde.py
sklearn/neighbors/kde.py
""" Kernel Density Estimation ------------------------- """ # Author: Jake Vanderplas <jakevdp@cs.washington.edu> import numpy as np from ..base import BaseEstimator from ..utils import array2d, check_random_state from .ball_tree import BallTree, DTYPE from .kd_tree import KDTree VALID_KERNELS = ['gaussian', 'tophat...
Python
0.00013
@@ -4007,32 +4007,61 @@ metric))%0A + return algorithm%0A else:%0A
f6b26086155c75a88f8b3481ca7a5fbeb0a225e4
Add empty line between parameter and return value description
sklearn/utils/_ransac.py
sklearn/utils/_ransac.py
import numpy as np def ransac(X, y, estimator, min_n_samples, residual_threshold, is_data_valid=None, is_model_valid=None, max_trials=100, stop_n_inliers=np.inf, stop_score=np.inf): """Fit a model to data with the RANSAC (random sample consensus) algorithm. Parameters ---------- ...
Python
0.000005
@@ -399,24 +399,25 @@ ining data.%0A +%0A y : nump @@ -477,16 +477,18 @@ t values +.%0A %0A est @@ -775,16 +775,17 @@ t data.%0A +%0A resi @@ -881,16 +881,17 @@ inlier.%0A +%0A is_d @@ -1050,16 +1050,17 @@ X, y)%60.%0A +%0A is_m @@ -1221,16 +1221,17 @@ y)%60, .%0A +%0A max_ @@ -1319,...
efc3a2c31a00a2139f55ca5ce9f3cf4dac1dea1f
address comments
tests/debug_nans_test.py
tests/debug_nans_test.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0
@@ -1038,16 +1038,17 @@ tCase):%0A +%0A def se @@ -1145,16 +1145,17 @@ , True)%0A +%0A def te @@ -1308,24 +1308,25 @@ np.tanh(A)%0A +%0A def testMu @@ -1389,24 +1389,24 @@ %5B2., 3.%5D%5D)%0A - D, V = n @@ -1421,16 +1421,17 @@ .eig(A)%0A +%0A def te
eee6dd8f6d7555f97452fb5734e299203b337ace
Fix fast_classifier
tests/fast_classifier.py
tests/fast_classifier.py
import numpy as np class fast_classifier(object): def __init__(self): pass def train(self, features, labels): examples = {} for f,lab in zip(features, labels): if lab not in examples: examples[lab] = f return fast_model(examples) class fast_model(obj...
Python
0
@@ -394,82 +394,61 @@ -%0A -def apply(self, features):%0A res = %5B%5D%0A for f in features +assert len(self.examples)%0A%0A def apply(self, f) :%0A @@ -453,23 +453,20 @@ - - cur +best = None%0A @@ -473,24 +473,24 @@ - best +_val = +np.i @@ -496,28 +496,24...
83a15b47ecac219c2fe4ca1e49cfa9055f9197d2
Add some tests
tests/test_features.py
tests/test_features.py
Python
0.000008
@@ -0,0 +1,2744 @@ +from unittest import mock, TestCase%0A%0Afrom unleash_client import features%0A%0A%0Aclass TestFactory(TestCase):%0A def test_simple_case(self):%0A strategies = %7B'Foo': mock.Mock(return_value='R')%7D%0A feature = %7B'strategies': %5B%7B'name': 'Foo', 'parameters': %7B'x': 0%7D%7D%...
2b8b32605c9d211154f47d228038464ff5df7b56
fix import
tests/test_kernel32.py
tests/test_kernel32.py
import os from pywincffi.core.ffi import ffi from pywincffi.core.testutil import TestCase from pywincffi.exceptions import WindowsAPIError from pywincffi.kernel32 import PROCESS_QUERY_LIMITED_INFORMATION, OpenProcess class TestOpenProcess(TestCase): """ Tests for :func:`pywincffi.kernel32.OpenProcess` ""...
Python
0.000001
@@ -156,24 +156,32 @@ kernel32 +.process import PROCESS_ @@ -172,16 +172,22 @@ import +(%0A PROCESS_ @@ -224,16 +224,17 @@ nProcess +) %0A%0A%0Aclass
b1edd17b647766091eab44d730b79ec52c8cb50d
Add tests for project points
tests/test_projects.py
tests/test_projects.py
from taiga.requestmaker import RequestMaker, RequestMakerException from taiga.models.base import InstanceResource, ListResource from taiga.models import User, Point, UserStoryStatus, Severity, Project, Projects from taiga import TaigaAPI import taiga.exceptions import json import requests import unittest from mock impo...
Python
0
@@ -2819,16 +2819,577 @@ c 1'%7D%0A )%0A + @patch('taiga.models.Points.create')%0A def test_add_point(self, mock_new_point):%0A rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')%0A project = Project(rm, id=1)%0A project.add_point('Point 1', 1.5)%0A mock_new_point.assert_cal...
224abc99becc1683605a6dc5c3460510efef3efb
Comment out the pyserial TestIsCorrectVariant test.
tests/test_pyserial.py
tests/test_pyserial.py
from __future__ import (absolute_import, print_function, unicode_literals) import os import sys lib_path = os.path.abspath('../') sys.path.append(lib_path) import io import struct import unittest import threading import time import serial try: import unittest2 as unittest except ImportError: import unittest ...
Python
0
@@ -569,16 +569,95 @@ id_pid%0A%0A + '''%0A # This test is commented out because it requires an actual serial port. %0A def t @@ -1258,16 +1258,23 @@ ortname) +%0A ''' %0A%0A %0Aif
c9cb5955320a779a7128e082d7ebf347a8f3e5e4
Add missing import
tests/test_add_target.py
tests/test_add_target.py
""" Tests for helper function for adding a target to a Vuforia database. """ import io import pytest from mock_vws import MockVWS from vws import VWS class TestAddTarget: """ Tests for adding a target. """ def test_add_target( self, client: VWS, high_quality_image: io.Bytes...
Python
0.000466
@@ -80,16 +80,44 @@ mport io +%0Afrom typing import Optional %0A%0Aimport
bb89223a7fcc1f2562c55ca432a3c52eec6efd8a
Put everything in one method like we discussed.
tests/test_background.py
tests/test_background.py
import unittest import numpy.testing as testing import numpy as np import fitsio import redmapper class BackgroundTestCase(unittest.TestCase): def test_io(self): pass def test_sigma_g(self): inputs = [()] idl_outputs = [0.32197464, 6.4165196, 0.0032830855, 1.4605126, ...
Python
0
@@ -75,22 +75,20 @@ fitsio%0A%0A -import +from redmapp @@ -89,16 +89,45 @@ edmapper +.background import Background %0A%0Aclass @@ -178,471 +178,76 @@ def -test_io(self): pass%0A%0A%0A def test_sigma_g(self):%0A inputs = %5B()%5D%0A idl_outputs = %5B0.32197464, 6.4165196, 0.0032830855, 1.4605126...
80c1275899045bfd50efa9b436ada7672c09e783
use md5 password hasher to speed up the tests
tests/test_settings.py
tests/test_settings.py
SECRET_KEY = 'fake-key' INSTALLED_APPS = [ 'tests', ] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', } }
Python
0
@@ -140,8 +140,85 @@ %7D%0A%7D%0A +%0APASSWORD_HASHERS = (%0A 'django.contrib.auth.hashers.MD5PasswordHasher',%0A)%0A
f00f4f82ce35f433ecb2ce0e1da2fc9069f33294
Add a test case to trigger this bug without the fix.
tests/test_simplify.py
tests/test_simplify.py
import claripy import nose def test_bool_simplification(): def assert_correct(a, b): nose.tools.assert_true(claripy.backends.z3.identical(claripy.simplify(a), b)) a, b, c = (claripy.BoolS(name) for name in ('a', 'b', 'c')) assert_correct(claripy.And(a, claripy.Not(a)), claripy.false) assert_c...
Python
0
@@ -2778,24 +2778,400 @@ gs%5B2%5D, a)%0A%0A%0A +def test_reverse_concat_reverse_simplification():%0A%0A # Reverse(Concat(Reverse(a), Reverse(b))) = Concat(b, a)%0A%0A a = claripy.BVS('a', 32)%0A b = claripy.BVS('b', 32)%0A x = claripy.Reverse(claripy.Concat(claripy.Reverse(a), claripy.Reverse(b)))%0A%0A ...
0d825461c5c28ce451092783937fe95171c243bd
Add full deprecated test
tests/test_deprecated.py
tests/test_deprecated.py
""" SPDX-FileCopyrightText: 2019 oemof developer group <contact@oemof.org> SPDX-License-Identifier: MIT """ import warnings import pytest from windpowerlib.data import load_turbine_data_from_oedb from windpowerlib.wind_turbine import get_turbine_types def test_old_import(): msg = "Use >>from windpowerlib impor...
Python
0.000001
@@ -454,106 +454,26 @@ edb( -):%0A with warnings.catch_warnings( +recwarn ):%0A - - warnings.simplefilter(%22error%22)%0A msg = %22store +load _tur @@ -495,102 +495,44 @@ oedb -%22 +() %0A - with pytest.raises(FutureWarning, match=msg):%0A load_turbine_data_from_oedb()%0A +assert...
ca40822d7898d02272cdf0a52fa5a8b75b983930
Fix syntax errors in addpost test
tests/tests/addpost.py
tests/tests/addpost.py
import binascii import os import sqlalchemy import selenium from selenium.webdriver.common import keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions from selenium.webdriver.common.by import By from timpani import database LOGIN_TITLE = "Login - Timpa...
Python
0.000004
@@ -549,18 +549,19 @@ st post. + %22%0A - %09%22There @@ -811,16 +811,17 @@ st%22)%09%0A%0A%09 +( WebDrive @@ -893,16 +893,17 @@ mpani%22)) +) %0A%0A%09#Chec @@ -1307,16 +1307,17 @@ mit()%0A%0A%09 +( WebDrive @@ -1389,16 +1389,17 @@ _TITLE)) +) %0A%0A%09#We s @@ -2166,16 +2166,17 @@ %09post = +( databas...
72351a1ebff21777f71d93a1f5647482b98d3448
Fix text.
tests/test_formatters.py
tests/test_formatters.py
import json import random import unittest from exporters.exceptions import ConfigurationError from exporters.export_formatter.base_export_formatter import BaseExportFormatter from exporters.export_formatter.csv_export_formatter import CSVExportFormatter from exporters.export_formatter.json_export_formatter import JsonE...
Python
0.999999
@@ -3362,17 +3362,17 @@ 'key -2 +1 ',%0A @@ -3394,17 +3394,17 @@ 'key -1 +2 '%0A
8288619fcb4aa44cd5d293dd9421d190d6c57e98
Simplify pytest fixture [ci skip]
tests/test_formatting.py
tests/test_formatting.py
"""Test entry formatting and printing.""" import bibpy import pytest @pytest.fixture def test_entries(): entries, _, _, _, _ = bibpy.read_file('tests/data/simple_1.bib', 'biblatex') return entries @pytest.mark.skip def test_formatting(test_entries): print(test_...
Python
0
@@ -109,29 +109,14 @@ -entries, _, _, _, _ = +return bib @@ -158,74 +158,21 @@ ib', -%0A 'biblatex')%0A return + 'biblatex'). entr
a9f2ad660d0b1e4443785cc5fb0c9afd0b1ce660
Update test_ica_lingam.py
tests/test_ica_lingam.py
tests/test_ica_lingam.py
import numpy as np import pandas as pd from lingam.ica_lingam import ICALiNGAM def test_fit_success(): # causal direction: x0 --> x1 --> x3 x0 = np.random.uniform(size=1000) x1 = 2.0 * x0 + np.random.uniform(size=1000) x2 = np.random.uniform(size=1000) x3 = 4.0 * x1 + np.random.uniform(size=1000) ...
Python
0.000001
@@ -619,24 +619,26 @@ _matrix_%0A + # assert am%5B1 @@ -705,24 +705,26 @@ 1%5D = 0.0%0A + # assert np.s
1bfa44cd2f584a4fd9ab973a830ef287c504c6dc
Update tests
tests/test_rate_limit.py
tests/test_rate_limit.py
"""Test for prawcore.Sessions module.""" from copy import copy from mock import patch from prawcore.rate_limit import RateLimiter import unittest class RateLimiterTest(unittest.TestCase): def _headers(self, remaining, used, reset): return { "x-ratelimit-remaining": str(float(remaining)), ...
Python
0.000001
@@ -2687,33 +2687,33 @@ f.assertEqual(10 -1 +0 , self.rate_limi @@ -2954,33 +2954,33 @@ e(self._headers( -6 +5 0, 100, 60))%0A @@ -2993,33 +2993,33 @@ elf.assertEqual( -6 +5 0, self.rate_lim @@ -3115,17 +3115,17 @@ Equal(10 -1 +5 , self.r @@ -3381,34 +3381,34 @@ eaders(60, 100, -60 +72 ))%0A self.
61786f6693086e5b22292ce9c063ffa66657b1aa
Add unit test to validate value returned by mse() function
tests/test_regressors.py
tests/test_regressors.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_regressors --------------- Tests for the `regressors` module. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import pandas as pd import u...
Python
0
@@ -363,16 +363,77 @@ atasets%0A +from sklearn import metrics%0Afrom sklearn import linear_model%0A from skl @@ -6876,16 +6876,292 @@ at(e))%0A%0A + def test_mse(self):%0A ols = linear_model.LinearRegression()%0A ols.fit(X, y)%0A expected_mse = metrics.mean_squared_error(y, ols.predict(X))%0A...
1be562eb115f302bd7fe47c2a90c5d4796a0eb98
make slider example more sophisticated
examples/plotting/file/slider.py
examples/plotting/file/slider.py
from bokeh.plotting import figure, output_file, show, vplot, ColumnDataSource from bokeh.models.actions import Callback from bokeh.models.widgets import Slider import numpy as np x = np.linspace(0, 10, 100) y = np.sin(x) source = ColumnDataSource(data=dict(x=x, y=y, y_orig=y)) plot = figure(y_range=(-20, 20)) plot...
Python
0
@@ -1,20 +1,47 @@ +%0Afrom bokeh.io import vform %0Afrom bokeh.plotting @@ -55,16 +55,23 @@ figure, + hplot, output_ @@ -232,17 +232,17 @@ (0, 10, -1 +5 00)%0Ay = @@ -300,22 +300,13 @@ y=y -, y_orig=y ))%0A%0A +%0A plot @@ -329,15 +329,48 @@ e=(- -20, 2 +10, 1 0) +, plot_width=400, plot_height=400 )%0Ap...
feb095effbe4cd92f253e7d5b68baf5b215056ef
Update views.py
examples/quickhowto/app/views.py
examples/quickhowto/app/views.py
from flask.ext.appbuilder.menu import Menu from flask.ext.appbuilder.baseapp import BaseApp from flask.ext.appbuilder.models.datamodel import SQLAModel from flask.ext.appbuilder.views import GeneralView from flask.ext.appbuilder.charts.views import ChartView, TimeChartView from app import app, db from models import Gr...
Python
0
@@ -591,24 +591,25 @@ thday'%5D%0A +# search_colum @@ -1047,24 +1047,25 @@ 'name'%5D%0A +# search_colum @@ -1110,32 +1110,33 @@ ChartView):%0A +# search_columns = @@ -1371,16 +1371,17 @@ w):%0A +# search_c
db8f189075783bf9c3947cba1be9b846d80b3f13
Update backlog on_feed_abort to api v2
flexget/plugins/input_backlog.py
flexget/plugins/input_backlog.py
import logging from datetime import datetime, timedelta from sqlalchemy import Column, Integer, String, DateTime, PickleType from flexget.manager import Base, Session from flexget.feed import Entry from flexget.plugin import register_plugin, priority, PluginWarning log = logging.getLogger('backlog') class BacklogEnt...
Python
0.000001
@@ -2067,32 +2067,40 @@ abort(self, feed +, config ):%0A %22%22%22Re