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
87dd116aea6e3c8d9d436ce6b5bf1fbbe0ff0788
Fix incorrect role assignment in migration.
keystone/common/sql/migrate_repo/versions/020_migrate_metadata_table_roles.py
keystone/common/sql/migrate_repo/versions/020_migrate_metadata_table_roles.py
import json import sqlalchemy as sql from keystone import config CONF = config.CONF def upgrade(migrate_engine): meta = sql.MetaData() meta.bind = migrate_engine sql.Table('user', meta, autoload=True) sql.Table('role', meta, autoload=True) sql.Table('project', meta, autoload=True) new_met...
Python
0.000729
@@ -458,45 +458,8 @@ e)%0A%0A - conn = migrate_engine.connect()%0A%0A @@ -1360,13 +1360,21 @@ r_id - and%0A +).where(%0A @@ -1415,24 +1415,44 @@ roject_id == +%0A metadata.te @@ -1467,37 +1467,16 @@ .values( -%0A data=jso @@ -1693,19 +1693,22 @@ ...
d4655d2b84154da76c6b8e4c2517577b70f16ce7
Complete iter sol
lc0198_house_robber.py
lc0198_house_robber.py
"""Leetcode 198. House Robber Easy URL: https://leetcode.com/problems/house-robber/ You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected a...
Python
0.999986
@@ -2946,16 +2946,573 @@ T%5B-1%5D%0A%0A%0A +class SolutionIter(object):%0A def rob(self, nums):%0A %22%22%22%0A :type nums: List%5Bint%5D%0A :rtype: int%0A%0A Time complexity: O(n).%0A Space complexity: O(1).%0A %22%22%22%0A # Apply bottom-up dynamic programming w/ ...
00ca89242b64d29a034aa03b1e76abef617f1b26
put validation back
application/frontend/forms.py
application/frontend/forms.py
from datetime import date from flask import request from flask_wtf import Form from wtforms import ( StringField, HiddenField, BooleanField, DateField, PasswordField, SubmitField, SelectField, RadioField, TextAreaField ) from wtforms.validators import DataRequired, ValidationError,...
Python
0
@@ -3910,12 +3910,8 @@ %0A - # # num @@ -3974,25 +3974,24 @@ for?',%0A -# @@ -3999,33 +3999,32 @@ - validators=%5BData @@ -4042,10 +4042,8 @@ %0A - # @@ -4150,132 +4150,4 @@ )%5D)%0A - num_of_clients = StringField('How many clients will you act for?',%0A ...
4197a102be1d832d418888178264e00f819febef
Add test_return_codes check for valid subunit output
stestr/tests/test_return_codes.py
stestr/tests/test_return_codes.py
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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 requir...
Python
0.000001
@@ -627,16 +627,43 @@ cense.%0A%0A +import functools%0Aimport io%0A import o @@ -758,16 +758,63 @@ StringIO +%0Aimport subunit as subunit_lib%0Aimport testtools %0A%0Afrom s @@ -2918,16 +2918,692 @@ rncode)) +%0A output_stream = io.BytesIO(out)%0A stream = subunit_lib.ByteStreamToStreamResult...
48a4303f5940989ee92fbcab00a7889ef8a4f237
Update model_sim.py
TrecQA_CNN+Sim/model_sim.py
TrecQA_CNN+Sim/model_sim.py
# -*- coding: utf-8 -*- from keras import backend as K from keras.models import Model from keras import regularizers from keras.engine.topology import Layer from keras.layers.core import Dense, Reshape, Permute from keras.layers import Input, Embedding, GlobalAveragePooling2D, GlobalMaxPooling2D,GlobalMaxPooling1D, Bi...
Python
0.000001
@@ -490,16 +490,56 @@ ng_layer +%0Afrom dl_layers.layers import Similarity %0A%0Adef cn @@ -5208,898 +5208,4 @@ del%0A -%0Aclass Similarity(Layer):%0A %0A def __init__(self, v_dim, kernel_regularizer=None, **kwargs):%0A self.v_dim = v_dim%0A self.kernel_regularizer = regularizers.get(kernel_regul...
21ec9335fc10d6b7d936ce11b59f44ea47c33d7c
Add support for Galician language in Subtitulos
subliminal/services/subtitulos.py
subliminal/services/subtitulos.py
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of...
Python
0
@@ -1628,16 +1628,43 @@ eng-GB') +, 'Galego': Language('glg') %7D%0A la
c9187cecbdb196343586378ca637d76079ff058f
Improve sub-package imports
src/minerva/storage/notification/__init__.py
src/minerva/storage/notification/__init__.py
# -*- coding: utf-8 -*- __docformat__ = "restructuredtext en" __copyright__ = """ Copyright (C) 2011-2013 Hendrikx-ITC B.V. Distributed under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. The full license is in the f...
Python
0.000017
@@ -377,37 +377,310 @@ rom -engine import NotificationEngine%0A +minerva.storage.notification.notificationstore import NotificationStore, %5C%0A NotificationStoreDescriptor%0Afrom minerva.storage.notification.attribute import Attribute, %5C%0A AttributeDescriptor%0Afrom minerva.storage.notification.package impo...
2c17f8997bbfb5f6a943b29bb9ef024fff304302
hard-negative-mine
4_hard_negative_mine.py
4_hard_negative_mine.py
import object_detector.file_io as file_io import object_detector.detector as detector import object_detector.factory as factory import argparse as ap DEFAULT_CONFIG_FILE = "conf/car_side.json" if __name__ == "__main__": parser = ap.ArgumentParser() parser.add_argument('-c', "--config", help="Config...
Python
0.999416
@@ -183,16 +183,12 @@ onf/ -car_side +svhn .jso
334334c95a543de3e92c96ef807b2cad684f4362
Update URL construction from FPLX db_refs
indra/databases/__init__.py
indra/databases/__init__.py
import logging logger = logging.getLogger('databases') def get_identifiers_url(db_name, db_id): """Return an identifiers.org URL for a given database name and ID. Parameters ---------- db_name : str An internal database name: HGNC, UP, CHEBI, etc. db_id : str An identifier in the ...
Python
0
@@ -1648,45 +1648,28 @@ p:// -sorger.med.harvard.edu/indra/ +id enti -ties +fiers.org/fplx /%25s'
e8293bd1365c759d940297e48609ee69251b0d62
split grant code for better suggestion
invenio_openaire/indexer.py
invenio_openaire/indexer.py
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2019 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Record modification prior to indexing.""" from __future__ import absolute_import,...
Python
0
@@ -617,72 +617,32 @@ -if ES_VERSION%5B0%5D == 2:%0A # Generate suggest field%0A +code = json.get('code')%0A @@ -677,32 +677,20 @@ -json.get(' code -') ,%0A @@ -760,32 +760,181 @@ )%0A %5D%0A + if code and %22_%22 in code:%0A suggestions.extend(...
d60dea7b7b1fb073eef2c350177b3920f32de748
Add comments indicating source of formulae..
6/e6.py
6/e6.py
#!/usr/bin/env python def sum_seq_squares(n): return (n * (n+1) * ((2*n)+1)) / 6 def sum_seq(n): return (n * (n + 1)) / 2 def main(): sum_seq_sq_100 = sum_seq_squares(100) sum_seq_100 = sum_seq(100) sq_sum_seq_100 = sum_seq_100**2 diff = sq_sum_seq_100 - sum_seq_sq_100 print('diff is {0}'.format(diff)) ...
Python
0
@@ -16,16 +16,75 @@ python%0A%0A +# http://www.proofwiki.org/wiki/Sum_of_Sequence_of_Squares%0A def sum_ @@ -139,16 +139,84 @@ )) / 6%0A%0A +# http://www.regentsprep.org/regents/math/algtrig/ATP2/ArithSeq.htm%0A def sum_
2deae29d9724c82b70eef60037bd477ad083691d
fix eq -> exists
app.py
app.py
from chalice import Chalice import boto3 import json from botocore.exceptions import ClientError from chalice import NotFoundError from boto3.dynamodb.conditions import Key, Attr REGION = 'us-east-1' ITEMS = 'Items' SENSORS_TABLE = 'sensors' SENSORS_PARTITION_KEY = 'source' SENSORS_SORT_KEY = 'timestamp' SENSORS_PAYLO...
Python
0.000004
@@ -2361,17 +2361,21 @@ ibute).e -q +xists (),%0A
36e8549053d28f51cc1e846e86bbdc8b32527cbe
Make app.py localhost only
app.py
app.py
#!/usr/bin/python3 from json import dumps from datetime import datetime import os from bottle import app as bottleapp from bottle import route, run, static_file, template from pymongo import MongoClient import sprout os.chdir(os.path.dirname(os.path.abspath(__file__))) mongo = MongoClient('localhost', 27017) col = mo...
Python
0.000004
@@ -1974,15 +1974,17 @@ st=%22 -0 +127 .0.0. -0 +1 %22, d
c4cdbc18b860cf899aa452e4d1f39afd9e4d6f4c
comment out APP_SETTINGS in app.py
app.py
app.py
#!/usr/bin/python3 import sys, os from flask import Flask, redirect, session, url_for, render_template, request, send_from_directory from flask_sqlalchemy import SQLAlchemy from urllib.parse import urlparse, urljoin, urlencode CLIENT_ID = "omNihUKDY7L8XXLh41WTTY9Pda21T2SRqAmJO86C" CLIENT_SECRET = "fmdfCpUwDIu0E5FExHud...
Python
0
@@ -684,16 +684,17 @@ name__)%0A +# app.conf
25fab7f2c289d9b1bc6098ef33524bbc627c5e75
Fix broken test in client.cli.job
src/test/python/apache/aurora/client/cli/test_status.py
src/test/python/apache/aurora/client/cli/test_status.py
import contextlib from gen.apache.aurora.ttypes import ( AssignedTask, Identity, JobKey, ResponseCode, ScheduleStatus, ScheduleStatusResult, TaskConfig, TaskEvent, TaskQuery, ) from apache.aurora.client.cli import ( AuroraCommandLine, EXIT_INVALID_PARAMETER ) from apache.au...
Python
0
@@ -4920,31 +4920,28 @@ roraJobKey(' -example +west ', 'RoleA', @@ -5032,39 +5032,36 @@ l(AuroraJobKey(' -example +west ', 'bozo', 'test
91ff11cde50ce2485c0a6725651931f88a085ca7
Update get_time to handle timeout errors.
app.py
app.py
""" app.py """ from flask import Flask, render_template import requests app = Flask(__name__) def get_time(): try: response = requests.get('http://localhost:3001/time') except requests.exceptions.ConnectionError: return 'Unavailable' return response.json().get('datetime') def get_user...
Python
0
@@ -177,16 +177,29 @@ 01/time' +, timeout=3.0 )%0A ex @@ -203,16 +203,17 @@ except +( requests @@ -239,16 +239,58 @@ ionError +,%0A requests.exceptions.Timeout) :%0A
b2a1dcd25ecc9d50a975a41330a1620b52312857
add docstring
letmecreate/click/motion.py
letmecreate/click/motion.py
#!/usr/bin/env python3 import ctypes _lib = ctypes.CDLL('libletmecreate_click.so') callback_type = ctypes.CFUNCTYPE(None, ctypes.c_uint8) callbacks = [None, None] def enable(mikrobus_index): ret = _lib.motion_click_enable(mikrobus_index) if ret < 0: raise Exception("motion click enable failed") de...
Python
0
@@ -15,16 +15,85 @@ python3 +%0A%22%22%22Python binding of Motion Click wrapper of LetMeCreate library.%22%22%22 %0A%0Aimport @@ -265,173 +265,997 @@ -ret = _lib.motion_click_enable(mikrobus_index)%0A if ret %3C 0:%0A raise Exception(%22motion click enable failed%22)%0A%0A%0Adef attach_callback(mikro...
460b48c10461df264a30ac26630d7299370988cd
Support alternative URLs
gsl.py
gsl.py
#!/usr/bin/python from urlparse import urlparse import urllib import urllib2 import click import os import hashlib PACKAGE_SERVER = 'https://server-to-be-determined/' @click.command() @click.option('--package_id', help='Package ID', required=True) @click.option('--download_location', default='./', help=...
Python
0.000001
@@ -570,16 +570,31 @@ checksum +, alternate_url = line. @@ -623,24 +623,16 @@ if iid -.strip() == pack @@ -912,24 +912,132 @@ , pkg_name)%0A + if alternate_url.strip():%0A url = alternate_url%0A else:%0A @@ -1249,24 +1249,16 @@ checksum -.stri...
9c012f3b5609b557b9d14059f2b2a6412283e0ed
support option ax='new'
src/pyquickhelper/helpgen/graphviz_helper.py
src/pyquickhelper/helpgen/graphviz_helper.py
""" @file @brief Helper about graphviz. """ import os from ..loghelper import run_cmd from .conf_path_tools import find_graphviz_dot def plot_graphviz(dot, ax=None, temp_dot=None, temp_img=None, dpi=300): """ Plots a dot graph into a :epkg:`matplotlib` plot. @param dot dot language @param a...
Python
0.000036
@@ -1587,16 +1587,137 @@ t.gca()%0A + elif isinstance(ax, str) and ax == 'new':%0A import matplotlib.pyplot as plt%0A _, ax = plt.subplots(1, 1)%0A
680f738739393f14a44fbb0d9093d08a0e520f65
Print error message if unknown generate command
src/hades/config/generate.py
src/hades/config/generate.py
import collections from functools import partial import os import os.path import shutil import sys import jinja2 import netaddr import pkg_resources from hades.config.loader import get_config class ConfigGenerator(object): TEMPLATE_SUFFIX = ".j2" def __init__(self, template_dir, config): self.config...
Python
0.000101
@@ -4476,22 +4476,25 @@ ig)%0A -return +command = command @@ -4510,35 +4510,180 @@ s%5B1%5D -, lambda g, a: os.EX_USAGE) +)%0A if command is None:%0A print(%22Unknown config generation command %7B%7D%22.format(args%5B1%5D),%0A file=sys.stderr)%0A return os.EX_USAGE%0A return com...
cbe379efeb7592e9c918fc4d092098b74a3b8c1a
Update Deck.py - Add shuffle method to shuffle the deck and then return the shuffled cards.
Deck.py
Deck.py
#Deck class Deck: '''Definition of a card deck.''' def __init__(self,hasJoker=False): self.suits = ['H','D','S','C'] self.values = [str(x) for x in range(2,10)] #2-9 cards self.values.extend(['T','J','Q','K','A']) #Face cards (including the 10s) #Assemble deck self.cards = [(v,s) for v in self.values for ...
Python
0
@@ -44,16 +44,56 @@ deck.''' +%0A%09from random import shuffle as rShuffle %0A%0A%09def _ @@ -781,8 +781,154 @@ f.cards) +%0A%0A%09#Shuffle deck and return the newly shuffled deck%0A%09def shuffle(self):%0A%09%09#Use random.shuffle() method%0A%09%09rShuffle(self.cards)%0A%09%09return self.cards%0A
3bd37ff8b91787da22f925ab858157bffa5698d7
Remove unnecessary import
Fibo.py
Fibo.py
import math import sys def Fibo(num): if num <= 2: return 1 else: return Fibo(num-1)+Fibo(num-2) print(Fibo(int(sys.argv[1])))
Python
0
@@ -1,16 +1,4 @@ -import math%0A impo
6855564716827546a5b68c154b0d95daba969119
add more user tests
src/inventory/tests/tests.py
src/inventory/tests/tests.py
from django.test import TestCase from inventory.models import * class UserTests(TestCase): def test_for_fields(self): """ saving and loading users""" initial_user = User(username="user", password="pass", email="email", f_name="fname", l_name="lname", active=True).save() loaded...
Python
0
@@ -185,16 +185,23 @@ = User( +id=10, username @@ -263,16 +263,17 @@ _name=%22f +_ name%22, l @@ -280,16 +280,17 @@ _name=%22l +_ name%22, a @@ -351,25 +351,60 @@ get( -username=%22user%22)%0A +id=10)%0A%0A self.assertEqual(loaded_user.id, 10) %0A @@ -610,16 +610,17 @@ name, %22f +_ name%22)%0A @...
237b9d4577f004401c2385163b060c785692c8b6
add when_over and when_over_guessed fields to Event (db change)
src/knesset/events/models.py
src/knesset/events/models.py
from datetime import datetime from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.utils.translation import ugettext_lazy as _ from knesset.persons.models import Person class Event(models.Model): ''' hold the when, who, ...
Python
0
@@ -496,24 +496,241 @@ TimeField()%0A + when_over = models.DateTimeField(null=True)%0A # KNESSET_TODO the end time of a committee meeting is not recorded anywhere,%0A # so we are left to guess%0A when_over_guessed = models.BooleanField(default=True)%0A who = mo
ad8fd4ca9947716cf24fd9dd5f6427e390ec9cc7
change file dowload file
Main.py
Main.py
import json import os import re import subprocess import urllib2 import zipfile def get_last_release(http_address): http_stream = urllib2.urlopen(http_address) res = http_stream.read() res_json = json.loads(res) print res_json["tag_name"], res_json["zipball_url"] return res_json["tag_name"], res_j...
Python
0.000001
@@ -74,16 +74,41 @@ ipfile%0A%0A +file_path = os.getcwd()%0A%0A %0Adef get @@ -419,13 +419,17 @@ h = -r'F:' +file_path %0A @@ -2229,36 +2229,8 @@ e):%0A - file_path = os.getcwd()%0A
d53dc67fc002448c7b94758843223a17d4623483
Allow IP to be blank
lingcod/bookmarks/models.py
lingcod/bookmarks/models.py
from django.contrib.gis.db import models from lingcod.features import register from lingcod.features.models import Feature from django.utils.html import escape from django.conf import settings class Bookmark(Feature): description = models.TextField(default="", null=True, blank=True) latitude = models.FloatFiel...
Python
0.000009
@@ -607,16 +607,39 @@ 0.0.0.0%22 +, null=True, blank=True )%0A pu
b293abaa52bffa705f4012d9726296c21db482c8
check if 'enabled' field exist in the Identity document
src/leap/mx/couchdbhelper.py
src/leap/mx/couchdbhelper.py
# -*- encoding: utf-8 -*- # couchdb.py # Copyright (C) 2013 LEAP # # This program 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. # # T...
Python
0
@@ -3520,16 +3520,40 @@ if +%22enabled%22 not in doc or doc%5B%22ena @@ -3769,24 +3769,69 @@ pubkey_cbk)%0A + d.addErrback(lambda _: (None, None))%0A retu
a77f7028b326aaa52a3b159206ecb57356f05b7f
Replace assertEqual(None, *) with assertIsNone in tests
tempest/tests/test_glance_http.py
tempest/tests/test_glance_http.py
# Copyright 2014 IBM Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
Python
0.000002
@@ -5631,36 +5631,31 @@ self.assert -Equal( +Is None -, +( kwargs%5B'ca_c @@ -5677,36 +5677,31 @@ self.assert -Equal( +Is None -, +( kwargs%5B'cert @@ -5732,20 +5732,15 @@ sert -Equal( +Is None -, +( kwar
d8d6ce50c6fef9157f76e1dfefef24d15532a4d9
Add missing contexts to integration tests
test/integration/ggrc/__init__.py
test/integration/ggrc/__init__.py
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Base test case for all ggrc integration tests.""" import logging from sqlalchemy import exc from flask.ext.testing import TestCase as BaseTestCase from ggrc import db from ggrc.app import app # Hide err...
Python
0.000057
@@ -937,16 +937,316 @@ tions.%0A%0A + This function is used to speed up resetting of the database for each test.%0A the proper way would be to run all migrations on a fresh database, but that%0A would take too much time. This function should act as if the database was%0A just created, with the exception of...
7ca1b61cbe391093b1ffe1825d79b3e49fe9b989
handle exceptions during mapping to skip other tests
scripts/automation/regression/stateless_tests/stl_general_test.py
scripts/automation/regression/stateless_tests/stl_general_test.py
import os, sys import unittest from trex import CTRexScenario from stateful_tests.trex_general_test import CTRexGeneral_Test from trex_stl_lib.api import * import time from nose.tools import nottest class CStlGeneral_Test(CTRexGeneral_Test): """This class defines the general stateless testcase of the TRex traffic ...
Python
0
@@ -681,36 +681,33 @@ nect(self, t -imeout +ries = 10 -0 ):%0A # @@ -833,38 +833,36 @@ for i in range(t -imeout +ries ):%0A t @@ -1073,33 +1073,33 @@ time.sleep(0. -1 +5 )%0A print( @@ -1153,20 +1153,17 @@ f, t -imeout +ries = 10 -0 ):%0A @@ -1231,14 +1231,12 @@ ge(t -imeout +r...
d137005229e180b509f0a2f83f5d2472b40d8890
Set up Sentry if we're configured for it (so I don't lose this code again)
run.py
run.py
import os from os.path import abspath, dirname, join from makerbase import app if 'MAKERBASE_SETTINGS' not in os.environ: os.environ['MAKERBASE_SETTINGS'] = join(dirname(abspath(__file__)), 'settings.py') app.config.from_envvar('MAKERBASE_SETTINGS') if __name__ == '__main__': app.run(debug=True)
Python
0
@@ -252,16 +252,146 @@ INGS')%0A%0A +if 'SENTRY_DSN' in app.config:%0A from raven.contrib.flask import Sentry%0A sentry = Sentry(app, dsn=app.config%5B'SENTRY_DSN'%5D)%0A%0A if __nam
a4656021f6a97bf5ffccb3d6e522515769ba0d21
Remove unnecessary calls to disable_continuous_mode
run.py
run.py
import argparse import serial import threading from io import BufferedRWPair, TextIOWrapper from time import sleep temp_usb = '/dev/ttyAMA0' BAUD_RATE = 9600 parser = argparse.ArgumentParser() parser.add_argument('oxygen', help='The USB port of the oxygen sensor.') parser.add_argument('salinity', help='The USB port o...
Python
0.000003
@@ -1765,115 +1765,8 @@ b)%0A%0A -%09disable_continuous_mode(temp_conn)%0A%09disable_continuous_mode(sal_conn)%0A%09disable_continuous_mode(oxy_conn)%0A%0A %09ret
68d465988378f24e74f8dd098919031d3fcfa2f4
fix source reinsertion bug
run.py
run.py
import spider import sys import os import json ''' requires spider.py be in the same directory as this module spider.py can be found at http://github.com/shariq/notion-on-firebase ''' def get_firebase_json_path(firebase_path): return os.path.abspath(os.path.join(firebase_path, 'firebase.json')) def add_to_fir...
Python
0
@@ -847,109 +847,8 @@ '%5D:%0A - if existing_rewrite%5B'source'%5D == new_rewrite%5B'source'%5D:%0A continue%0A
1c8a1bfeef8206267a45562d4932cece1cbea1b4
Fix some pylint issues
Trie.py
Trie.py
#! /usr/bin/env python # vim: set encoding=utf-8 from ctypes import * libtrie = cdll.LoadLibrary("./libtrie.so") libtrie.trie_load.argtypes = [c_char_p] libtrie.trie_load.restype = c_void_p libtrie.trie_lookup.argtypes = [ c_void_p, c_char_p, c_char_p ] libtrie.trie_lookup.restype = c_void_p libtrie.trie_get_last_err...
Python
0.000077
@@ -62,17 +62,62 @@ import -* +cdll, c_char_p, c_void_p, create_string_buffer %0A%0Alibtri @@ -262,17 +262,16 @@ ypes = %5B - c_void_p @@ -290,17 +290,16 @@ c_char_p - %5D%0Alibtri
e62db9661295ff3912dbaaaff0d9f267f0b7ffe1
Add url callback on custom login
auth.py
auth.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from bottle.ext import auth from utils import conf try: auth_import = conf('auth')['engine'].split('.')[-1] auth_from = u".".join(conf('auth')['engine'].split('.')[:-1]) auth_engine = getattr(__import__(auth_from, fromlist=[auth_import]), ...
Python
0
@@ -957,16 +957,37 @@ _engine( +callback_url=callback )%0A%0Aauth
f0681b5dbe576e9a3cf3c1f5d448ffd97b4a7bba
Correct ID qry for put.
src/devilry_subjectadmin/devilry_subjectadmin/rest/relateduser.py
src/devilry_subjectadmin/devilry_subjectadmin/rest/relateduser.py
""" Manage related users. """ from django.db.models import Q from djangorestframework.resources import ModelResource from djangorestframework.views import ListOrCreateModelView from djangorestframework.views import InstanceModelView from djangorestframework.permissions import IsAuthenticated from devilry.apps.core.mod...
Python
0
@@ -4730,16 +4730,19 @@ equest, +id= id)%0A
95723719050aa08119ed2478c0bb40253a2b0b3e
Remove methods with unnecessary super delegation.
libqtile/layout/max.py
libqtile/layout/max.py
# Copyright (c) 2008, Aldo Cortesi. All rights reserved. # Copyright (c) 2017, Dirk Hartmann. # # 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 limitati...
Python
0
@@ -1723,73 +1723,8 @@ s)%0A%0A - def clone(self, group):%0A return super().clone(group)%0A%0A
d57bddf609ad84131b2f1e5cd46ebcc8798a1075
Version 0.12.2
starlette/__init__.py
starlette/__init__.py
__version__ = "0.12.1"
Python
0
@@ -13,11 +13,11 @@ = %220.12. -1 +2 %22%0A
b5ee1f3dfccd3a18698ada03442854479e406d37
Update expression-add-operators.py
Python/expression-add-operators.py
Python/expression-add-operators.py
# Time: O(3^n) # Space: O(n) # # Given a string that contains only digits 0-9 # and a target value, return all possibilities # to add operators +, -, or * between the digits # so they evaluate to the target value. # # Examples: # "123", 6 -> ["1+2+3", "1*2*3"] # "232", 8 -> ["2*3+2", "2+3*2"] # "00", 0 -> ["0+0", ...
Python
0.000002
@@ -1333,29 +1333,16 @@ pr.pop() -%0A %0A%0A
5ebf34e1c572e5db9012af4228eaca2a8461b8d9
add some extra debug logging to smr-reduce
smr/reduce.py
smr/reduce.py
#!/usr/bin/env python import sys from .shared import get_config, configure_logging def main(): if len(sys.argv) < 2: sys.stderr.write("usage: smr-reduce config.py\n") sys.exit(1) config = get_config(sys.argv[1]) configure_logging(config) try: for result in iter(sys.stdin.read...
Python
0
@@ -340,27 +340,17 @@ -config.REDUCE_FUNC( +result = resu @@ -360,17 +360,16 @@ rstrip() -) # remov @@ -389,16 +389,110 @@ nebreak%0A + logging.debug(%22smr-reduce got %25s%22, result)%0A config.REDUCE_FUNC(result)%0A exce
af4d3317bc9af09a5ea7feb069aff3a05cc32c67
Version bump to 0.4.0b9
navbar/__init__.py
navbar/__init__.py
VERSION = (0, 4, 0, "b8") def get_version(): if VERSION[3] != "final": return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3]) else: return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2]) __version__ = get_version()
Python
0
@@ -19,9 +19,9 @@ , %22b -8 +9 %22)%0A%0A @@ -239,20 +239,21 @@ on__ = get_version() +%0A
dd020b279f011ff78a6a41571a839e4c57333e93
Rename username field to userspec (#196).
devilry/apps/core/models/relateduser.py
devilry/apps/core/models/relateduser.py
import re from django.db import models from django.db.models import Q from django.core.exceptions import ValidationError from period import Period from node import Node from abstract_is_admin import AbstractIsAdmin class RelatedUserBase(models.Model, AbstractIsAdmin): """ Base class for :cls:`RelatedExamine...
Python
0
@@ -417,20 +417,20 @@ e:: user -name +spec %0A%0A @@ -696,20 +696,20 @@ user -name +spec = model @@ -1207,20 +1207,20 @@ ', 'user -name +spec ')%0A @@ -1638,20 +1638,20 @@ elf.user -name +spec ):%0A @@ -1785,20 +1785,20 @@ elf.user -name +spec )%0A%0A%0Aclas
4b330755edab7a57de6d39a7e365c5f79df81065
Update config.py
blaspy/config.py
blaspy/config.py
""" Copyright (c) 2014, The University of Texas at Austin. All rights reserved. This file is part of BLASpy and is available under the 3-Clause BSD License, which can be found in the LICENSE file at the top-level directory or at http://opensource.org/licenses/BSD-3-Clause """ from .errors import...
Python
0
@@ -1073,16 +1073,72 @@ penBLAS%0A + PREPEND = str(path.dirname(__file__))%5B:-6%5D + %22lib/%22%0A if s @@ -1159,16 +1159,16 @@ ndows%22:%0A - @@ -1277,31 +1277,31 @@ -SUB_DIRECTORY = +chdir(PREPEND + %22win64%22 %0A @@ -1296,16 +1296,17 @@ %22win64%22 +) %0A @@ -1393,30 +1393...
7549ba00495ec3d2561cf8fbc02f55728d6020ac
Bump version number
VMEncryption/main/Common.py
VMEncryption/main/Common.py
#!/usr/bin/env python # # VM Backup extension # # Copyright 2015 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
Python
0.000002
@@ -794,17 +794,17 @@ .0.99911 -1 +2 '%0A ex
290a1f0cb301a6a4f4be2e218e8d97a5644cc2d3
Remove old Ensembl domain
rnacentral_pipeline/databases/ensembl/metadata/karyotypes.py
rnacentral_pipeline/databases/ensembl/metadata/karyotypes.py
# -*- coding: utf-8 -*- """ Copyright [2009-2018] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by...
Python
0
@@ -858,30 +858,8 @@ = %7B%0A - 'ensemblgenomes',%0A
34b5739216f5145ca0e6707bc4666138e2493308
Remove the executable flag from uploadhandler.py, it wasn't. Thanks to Florian for the report.
django/core/files/uploadhandler.py
django/core/files/uploadhandler.py
""" Base file upload handler classes, and the built-in concrete subclasses """ try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files.uploadedfile import TemporaryUplo...
Python
0.000003
e4b2f5eed4c169792812ee82fa1f65cdc9516fb0
Add first/lastname to project search
lims/projects/views.py
lims/projects/views.py
import django_filters from rest_framework import viewsets from rest_framework.validators import ValidationError from rest_framework.filters import (OrderingFilter, SearchFilter, DjangoFilterBackend) from guardian.shortcuts import get_group_perms ...
Python
0
@@ -1457,16 +1457,142 @@ sername' +,%0A 'crm_project__account__user__first_name',%0A 'crm_project__account__user__last_name', )%0A%0A d
1809df6d5886ac6c0c35c8e879d9eda334606f4e
Simplify handling from_db_value across django versions
django_unixdatetimefield/fields.py
django_unixdatetimefield/fields.py
import datetime import time import django import django.db.models as models class UnixDateTimeField(models.DateTimeField): # TODO(niklas9): # * should we take care of transforming between time zones in any way here ? # * get default datetime format from settings ? DEFAULT_DATETIME_FMT = '%Y-%m-%d %H...
Python
0.000017
@@ -26,22 +26,8 @@ me%0A%0A -import django%0A impo @@ -1742,404 +1742,55 @@ -# Django 2.0 updates the signature of from_db_value.%0A # https://docs.djangoproject.com/en/2.0/releases/2.0/#context-argument-of-field-from-db-value-and-expression-convert-value%0A if django.VERSION %3C (2,):%0A def from_...
20053951b3036d0ae49f7f1ae25d600848872c82
Bump version
lintreview/__init__.py
lintreview/__init__.py
__version__ = '2.36.1'
Python
0
@@ -17,7 +17,7 @@ .36. -1 +2 '%0A
f426d44f82a4f1855cb180b5aff98221c14537f1
Update version.py
nltools/version.py
nltools/version.py
"""Specifies current version of nltools to be used by setup.py and __init__.py """ __version__ = '0.3.6'
Python
0.000001
@@ -100,7 +100,7 @@ 0.3. -6 +7 '%0A
eb9a370dc361caff7e1917c07f1711fb8ad60cf2
Create article link admin
opps/articles/admin.py
opps/articles/admin.py
# -*- coding: utf-8 -*- from django.contrib import admin from django import forms from django.utils.translation import ugettext_lazy as _ from .models import Post, Album, Article, ArticleSource, ArticleImage from .models import ArticleBox, ArticleBoxArticles, ArticleConfig from opps.core.admin import PublishableAdmin ...
Python
0
@@ -173,16 +173,22 @@ Article, + Link, Article @@ -2790,24 +2790,517 @@ %7D),%0A )%0A%0A%0A +class LinkAdmin(ArticleAdmin):%0A fieldsets = (%0A (_(u'Identification'), %7B%0A 'fields': ('title', 'slug', 'get_http_absolute_url',%0A 'short_url',)%7D),%0A (_(u'Conten...
fcf5d1f33026069d69690c67f7ddcc8c77f15626
add exception handingling for debug
opreturnninja/views.py
opreturnninja/views.py
import json import random from pyramid.view import view_config from .constants import ELECTRUM_SERVERS from bitcoin.rpc import RawProxy, DEFAULT_USER_AGENT import socket @view_config(route_name='api', renderer='json') def api_view(request): global rpc assert hasattr(request, 'json_body') assert 'meth...
Python
0
@@ -640,36 +640,16 @@ s - = socket.create_connection( +erver = rand @@ -689,16 +689,68 @@ tems())) +%0A s = socket.create_connection(server )%0A @@ -1140,24 +1140,32 @@ print(e +, server )%0A @@ -1218,16 +1218,92 @@ print(e +, server)%0A except Exception as e:%...
7b62f43f0a286c2aa40abb3f383d7cbecc45f242
Fix flaky failure: TestHuberLoss
tests/chainer_tests/functions_tests/loss_tests/test_huber_loss.py
tests/chainer_tests/functions_tests/loss_tests/test_huber_loss.py
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer import utils @testing.parameterize(*testing.product_dict( [{'dtype': numpy.float16, 'forw...
Python
0.999961
@@ -1390,17 +1390,17 @@ 0.5) * -4 +3 , self.d @@ -1432,32 +1432,46 @@ ils.force_array( +%0A ( numpy.random.ran @@ -1481,24 +1481,31 @@ (self.shape) + - 0.5) , self.dtype
43d7850403e1e98951909bcb0c441098c3221bde
Update ipc_lista1.4.py
lista1/ipc_lista1.4.py
lista1/ipc_lista1.4.py
#ipc_lista1.4 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um Programa que peça as 4 notas bimestrais e mostre a media nota1 = int(input("Digite a primeira nota do bimestre: ")) nota2 = int(input("Digite a segunda nota do bimestre: ")) nota3 = int(input("Digite a terceira nota do bismestr...
Python
0
@@ -421,16 +421,17 @@ +nota4)/ + 4.0%0A%0Apri
fb772e5e597082a119348efa68f70e60c11506cd
clean up
lists/gift_exchange.py
lists/gift_exchange.py
import random import itertools givers = [('tim', 'shirt'), ('jim', 'shoe'), ('joe', 'fruit'), ('john', 'ball')] def valid(a, b): if a == b: return False else: return True if len(givers) < 2: print "must have more than 1 givers" else: a = list(givers) b = list(givers) whi...
Python
0.000001
@@ -79,26 +79,26 @@ ('jo -e +hn ', ' -fruit +ball '), ('jo hn', @@ -97,105 +97,21 @@ ('jo -hn +e ', ' -ball')%5D%0A%0Adef valid(a, b):%0A if a == b:%0A return False%0A else:%0A return True +fruit')%5D %0A%0Aif @@ -236,23 +236,14 @@ ile -not valid(a, +a == b -) :%0A
e3d148aec20b8a496ae353916597040c9fa237af
add support for mode bits
litespi/phy/generic.py
litespi/phy/generic.py
from migen import * from migen.genlib.fsm import FSM, NextState from litespi.clkgen import LiteSPIClkGen from litespi.common import * from litex.soc.interconnect import stream # Output enable masks for the tri-state buffers, data mode mask is not included as oe pins default to 0 cmd_oe_mask = 0b00000001 soft_oe_mas...
Python
0
@@ -4343,16 +4343,124 @@ DUMMY%22,%0A + If(self.fsm_cnt %3C 8, dq_oe.eq(addr_oe_mask%5Baddr_width%5D)), # output 0's for the first dummy byte%0A
93db6df0b89d3fa5ff248ffc9d48040c795dde4d
update info
framework/SupervisedLearning/ScikitLearn/Ensemble/VotingRegressor.py
framework/SupervisedLearning/ScikitLearn/Ensemble/VotingRegressor.py
# Copyright 2017 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
Python
0
@@ -603,20 +603,21 @@ on -Jan 21 +Nov. 16 , 202 -0 +1 %0A%0A @@ -628,15 +628,8 @@ hor: - alfoa, wan @@ -637,17 +637,14 @@ c%0A -ExtraTree +Voting Regr @@ -656,34 +656,77 @@ %0A A -n extremely randomized tre + voting regressor is an ensemble meta-estimator that fits several bas e re @@ -732,17 +732,17 @...
b76e1697b92565ca3fc8a7ee2961adf894095e04
Add User as foreign key in Bill
billing/models.py
billing/models.py
from django.db import models from django.dispatch import receiver from django.contrib.auth.models import User from django.db.models.signals import pre_save, pre_init import datetime class Bill(models.Model): number = models.CharField(max_length=10, unique=True, blank=True) isPaid = models.BooleanField(defaul...
Python
0.000001
@@ -200,24 +200,59 @@ ls.Model):%0A%0A + user = models.ForeignKey(User)%0A number =
17d3d63564798cd03788ce579227d5425cd866c0
Make fake uploader use zlib compression
bin/fake_order.py
bin/fake_order.py
#!/usr/bin/env python """ A fake order upload script, used to manually test the whole stack. """ import simplejson import requests data = """ { "resultType" : "orders", "version" : "0.1alpha", "uploadKeys" : [ { "name" : "emk", "key" : "abc" }, { "name" : "ec" , "key" : "def" } ], "generator" : { "na...
Python
0.000003
@@ -123,16 +123,28 @@ requests +%0Aimport zlib %0A%0Adata = @@ -1463,32 +1463,46 @@ ds(data)%0Adata = +zlib.compress( simplejson.dumps @@ -1511,116 +1511,226 @@ ata) -%0A%0Ar = requests.post(%0A 'http://localhost:8080/upload/unified/',%0A data=data,%0A)%0Aprint %22RESPONSE%22%0Aprint r.text +)%0Aheaders = %...
f7a86cec72e4b5ff017013561f4fd3f3f59bfde5
Fix typos
AutoSetNewFileSyntax.py
AutoSetNewFileSyntax.py
import sublime import sublime_plugin import sys import os import logging sys.path.insert(0, os.path.dirname(__file__)) from SyntaxMappings import * PLUGIN_NAME = 'AutoSetNewFileSyntax' LOG_LEVEL = logging.INFO LOG_FORMAT = "%(name)s: [%(levelname)s] %(message)s" settings = None syntaxMappings = None loggingStreamHa...
Python
0.999999
@@ -2329,105 +2329,8 @@ and%0A - self.isOnlyOneCursor(view) and%0A self.isFirstCursorNearBeginning(view) and%0A
348896e6f9318755d9bbefdf94de18ed32b17d1d
Update item.py
item.py
item.py
import pygame class Item(pygame.sprite.Sprite): def __init__(self, level, *groups): super(Item, self).__init__(*groups) #the game level self.level = level #base image self.level.animator.set_Img(6,0) self.image = self.level.animator.get_Img().convert() self.image.set_colorkey((255,0,0)) #type sel...
Python
0
@@ -204,11 +204,11 @@ Img( -6,0 +0,5 )%0A%09%09 @@ -297,16 +297,155 @@ 5,0,0))%0A +%09%09self.level.animator.set_Img(6,0)%0A%09%09self.secretimage = self.level.animator.get_Img().convert()%0A%09%09self.secretimage.set_colorkey((255,0,0))%0A %09%09%0A%09%09#ty @@ -493,16 +493,29 @@ sammich' +, 'telescope' %5D%0A%0...
e74420b90e83ade7956023eaf4ef2613e441a9ca
Fix linter error with ambiguous variable name 'l'.
bitfield/forms.py
bitfield/forms.py
from __future__ import absolute_import from django.forms import CheckboxSelectMultiple, IntegerField, ValidationError try: from django.utils.encoding import force_text except ImportError: from django.utils.encoding import force_unicode as force_text from bitfield.types import BitHandler class BitFieldCheck...
Python
0
@@ -1499,17 +1499,23 @@ -l +iv_list = %5B%5D%0A @@ -1624,17 +1624,23 @@ -l +iv_list += %5Bcho @@ -1683,17 +1683,23 @@ ial'%5D = -l +iv_list %0A
5fc8258c4d3819b6a4b23819fd3c4578510dd633
Allow www.lunahealing.ca as a domain
lunahealing/site_settings/prod.py
lunahealing/site_settings/prod.py
# Django settings for quotations project. import os from lunahealing.site_settings.common import * # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY') # Parse database configuration from $DATABASE_URL import dj_database_url DATABASES = { 'default': ...
Python
0
@@ -1403,17 +1403,19 @@ .com', ' -* +www .lunahea
ed472902f71f39cf09eca5ee9193bcf99283b566
Remove unused code
room.py
room.py
# Each PS room joined creates an object here. # Objects control settings on a room-per-room basis, meaning every room can # be treated differently. from plugins.tournaments import Tournament class Room: def __init__(self, room, data): if not data: # This is a hack to support both strings and di...
Python
0.000006
@@ -1075,70 +1075,8 @@ %5D)%0A%0A - def allowGames(self, yesNo):%0A %09self.allowGames = yesNo%0A
bd313ff4ce69e7b9a9765672442ef6cf9fa00dba
Fix parameter validation tests
tests/core/parameter_validation/test_parameter_clone.py
tests/core/parameter_validation/test_parameter_clone.py
# -*- coding: utf-8 -*- from ..test_countries import tax_benefit_system import os from openfisca_core.parameters import ParameterNode BASE_DIR = os.path.dirname(os.path.abspath(__file__)) year = 2016 def test_clone(): path = os.path.join(BASE_DIR, 'filesystem_hierarchy') parameters = ParameterNode('', direct...
Python
0.000003
@@ -1,77 +1,4 @@ -# -*- coding: utf-8 -*-%0Afrom ..test_countries import tax_benefit_system%0A%0A impo @@ -3,16 +3,17 @@ port os%0A +%0A from ope @@ -56,16 +56,17 @@ terNode%0A +%0A BASE_DIR @@ -665,16 +665,34 @@ rameter( +tax_benefit_system ):%0A%0A @@ -1005,16 +1005,34 @@ er_node( +tax_benefit_system ):%...
9bbef1ca463f0f83841c6b61ea8aa56c5454dadc
increment stop_id.....
ipa_db.py
ipa_db.py
import sqlite3 class Db: def __init__(self, db_name): self.conn = sqlite3.connect(db_name) def __del__(self): self.conn.close() def __execute(self, sql, args = tuple()): c = self.conn.cursor() c.execute(sql, args) return c def __commit(self): self.conn...
Python
0
@@ -1848,32 +1848,57 @@ %5D)%0A ) +%0A stop_id += 1 %0A%0A self._
cdcb0fc8104646e96e20b62e4333d805cddeb704
Update test_cygwinccompiler.py
distutils/tests/test_cygwinccompiler.py
distutils/tests/test_cygwinccompiler.py
"""Tests for distutils.cygwinccompiler.""" import unittest import sys import os from io import BytesIO from test.support import run_unittest from distutils import cygwinccompiler from distutils.cygwinccompiler import (check_config_h, CONFIG_H_OK, CONFIG_H_NOTOK, ...
Python
0.000002
@@ -5605,12 +5605,12 @@ C v. -1999 +2000 32
5e1fd7769a8911415824ce29177b057d33ab789a
update to latest dials.integrate interface
Wrappers/Dials/Integrate.py
Wrappers/Dials/Integrate.py
#!/usr/bin/env python # Integrate.py # # Copyright (C) 2014 Diamond Light Source, Richard Gildea, Graeme Winter # # This code is distributed under the BSD license, a copy of which is # included in the root directory of this package. # # Integration using DIALS. from __future__ import division from __init__ impo...
Python
0
@@ -2435,13 +2435,23 @@ e((%22 --r%22, +reference=%25s%22 %25 self
f00b60342c82f30670dde60f42df53f165f08270
tweak Selector to be more ascii and close on escape
subiquitycore/ui/interactive.py
subiquitycore/ui/interactive.py
# Copyright 2015 Canonical, Ltd. # # 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 # License, or (at your option) any later version. # # This program is distribute...
Python
0
@@ -3778,16 +3778,22 @@ t looks +a bit like a r @@ -3909,10 +3909,11 @@ e: %22 - %E2%96%B8 +(+) %22,%0A @@ -3928,18 +3928,19 @@ False: %22 - +( ) %22,%0A @@ -4881,24 +4881,184 @@ e_pop_up()%0A%0A + def keypress(self, size, key):%0A if key == 'esc':%0A self.parent.close_pop_up()%0A ...
175a8007ef06bbf3a01943c161a162adbf23d7fd
Use tf.gfile instead of os.path in sequence_generator.py for internal compatibility. (#178)
magenta/lib/sequence_generator.py
magenta/lib/sequence_generator.py
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
Python
0
@@ -727,18 +727,8 @@ abc -%0Aimport os %0A%0A# @@ -2563,17 +2563,18 @@ not -os.path.e +tf.gfile.E xist @@ -2839,21 +2839,28 @@ if -os.path.isdir +tf.gfile.IsDirectory (che @@ -2957,26 +2957,231 @@ if -not os.path.isfile +checkpoint_file is None:%0A raise SequenceGeneratorException(%0A 'N...
1f752237d83c486b94ddcc7f5e3b42eb5951a60b
remove unused imports
pabot/SharedLibrary.py
pabot/SharedLibrary.py
from robot.libraries.BuiltIn import BuiltIn from robot.libraries.Remote import Remote from robot.api import logger from robot.running.testlibraries import TestLibrary from robot.running.context import EXECUTION_CONTEXTS from robot.running.model import Keyword from robotremoteserver import RemoteLibraryFactory from .pab...
Python
0.000001
@@ -164,101 +164,8 @@ ary%0A -from robot.running.context import EXECUTION_CONTEXTS%0Afrom robot.running.model import Keyword%0A from
1f4ef496f932ec2a12d348b0c90b1f57d6ef9e20
update version number
nutils/__init__.py
nutils/__init__.py
import numpy from distutils.version import LooseVersion assert LooseVersion(numpy.version.version) >= LooseVersion('1.8'), 'nutils requires numpy 1.8 or higher, got %s' % numpy.version.version version = '1.dev' _ = numpy.newaxis __all__ = [ '_', 'numpy', 'core', 'numeric', 'element', 'function', 'mesh', 'plot', 'l...
Python
0.000002
@@ -203,13 +203,15 @@ = ' -1.dev +2.0beta '%0A%0A_
4659be5638ba4f3a898da16df805254dfab0986e
Fix backed-out subclassing foul
comment_utils/templatetags/comment_utils.py
comment_utils/templatetags/comment_utils.py
""" Template tags designed to work with applications which use comment moderation. """ from django import template from django.core.exceptions import ObjectDoesNotExist from django.db.models import get_model from django.contrib.comments.models import Comment, FreeComment from django.contrib.comments.templatetags imp...
Python
0.002044
@@ -456,13 +456,8 @@ def -iter_ rend
577697301f8682293a00a793807687df9d0ce679
Fix fetch_ceph_keys to run in python3
docker/ceph/ceph-mon/fetch_ceph_keys.py
docker/ceph/ceph-mon/fetch_ceph_keys.py
#!/usr/bin/python # Copyright 2015 Sam Yaple # # 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 agree...
Python
0.000016
@@ -1780,16 +1780,17 @@ ntent': +( base64.b @@ -1822,16 +1822,26 @@ w_data)) +).decode() ,%0A
b4acd028b613a721ffbe5a3136700f190635f7c9
Fix import.
tests/basics/class_store_class.py
tests/basics/class_store_class.py
# Inspired by urlparse.py from CPython 3.3 stdlib # There was a bug in MicroPython that under some conditions class stored # in instance attribute later was returned "bound" as if it was a method, # which caused class constructor to receive extra argument. from collections import namedtuple _DefragResultBase = namedtu...
Python
0
@@ -255,16 +255,17 @@ t.%0Afrom +_ collecti
1a80097aeb00d13c878bc9563e880287602c5833
Fix PEP8: E112 expected an indented block
pavelib/paver_tests/test_paver_quality.py
pavelib/paver_tests/test_paver_quality.py
import os import tempfile import unittest from mock import patch from ddt import ddt, file_data import pavelib.quality import paver.easy from paver.easy import BuildFailure @ddt class TestPaverQualityViolations(unittest.TestCase): def setUp(self): self.f = tempfile.NamedTemporaryFile(delete=False) ...
Python
0.000001
@@ -944,25 +944,39 @@ value):%0A -# + %22%22%22%0A Tests:%0A @@ -974,24 +974,22 @@ sts:%0A - # -* +- Differe @@ -1018,16 +1018,14 @@ %0A - # -* +- One @@ -1059,16 +1059,28 @@ e lines%0A + %22%22%22%0A
5b5e00aaa9563e1d0a6fc1825e7f4dc05bac1c5e
add verson 3.11.0 (#11186)
var/spack/repos/builtin/packages/py-petsc4py/package.py
var/spack/repos/builtin/packages/py-petsc4py/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyPetsc4py(PythonPackage): """This package provides Python bindings for the PETSc package....
Python
0
@@ -516,41 +516,177 @@ -version('develop', branch='master +maintainers = %5B'dalcin', 'balay'%5D%0A%0A version('develop', branch='master')%0A version('3.11.0', sha256='50a7bbca76000da287d5b18969ddf4743b360bda1f6ee3b43b5829095569cc46 ')%0A @@ -1705,32 +1705,95 @@ hen='@develop')%0A + depends_on('petsc@...
7a331edf955d914c82751eb7ec1dd20896e25f83
Use SequenceEqual because we care about maintaining order.
tests/cases/stats/tests/kmeans.py
tests/cases/stats/tests/kmeans.py
import os from django.test import TestCase from avocado.stats import cluster, kmeans from scipy.cluster import vq import numpy from itertools import chain __all__ = ('KmeansTestCase',) random_points_file = open(os.path.join(os.path.dirname(__file__), '../fixtures/random_points.txt')) random_points_3d_file = open(os.p...
Python
0
@@ -1392,12 +1392,16 @@ sert -List +Sequence Equa
268914e7a29231da882457a6e4744c9661526a73
Add latest version of py-tabulate (#14138)
var/spack/repos/builtin/packages/py-tabulate/package.py
var/spack/repos/builtin/packages/py-tabulate/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyTabulate(PythonPackage): """Pretty-print tabular data""" homepage = "https://bitbuc...
Python
0
@@ -416,19 +416,19 @@ ulate-0. -7.7 +8.6 .tar.gz%22 @@ -429,16 +429,208 @@ ar.gz%22%0A%0A + version('0.8.6', sha256='5470cc6687a091c7042cee89b2946d9235fe9f6d49c193a4ae2ac7bf386737c8')%0A version('0.8.3', sha256='8af07a39377cee1103a5c8b3330a421c2d99b9141e9cc5ddd2e3263fea416943')%0A vers
11c6d99285946a4558cad642c5298982776acba1
Fix int division in docs.
docs/_scripts/generate_dynamic_pages.py
docs/_scripts/generate_dynamic_pages.py
#!/usr/bin/env python # coding: utf-8 """ Script for creating dynamic documentation pages. """ import os import re import sys from collections import OrderedDict thisdir = os.path.dirname(os.path.abspath(__file__)) docsdir = os.path.dirname(thisdir) basedir = os.path.dirname(docsdir) sys.path.insert(0, basedir) i...
Python
0
@@ -4983,16 +4983,19 @@ %22 %22 * +int (n_inden
b286e10d7d7c43ceea80cd4025105851ebb9bd8f
Comment out save statement
s4v3.py
s4v3.py
from s4v2 import * import openpyxl from openpyxl import Workbook from openpyxl.writer.excel import ExcelWriter from openpyxl.cell import get_column_letter def save_spreadsheet(filename, data_sample): wb = Workbook() # shortcut for typing Workbook function ws = wb.active # shortcut for typing active workbook function...
Python
0
@@ -1297,16 +1297,18 @@ Kiton%22)%0A +# save_spr
5dd61d20f14ecbe1bc20fe8db3fd73a78707485a
Refactor partition.
lazy.py
lazy.py
import operator as op import itertools as it from functools import partial class Wrapper(object): def __init__(self, data): self.data = data def __lt__(self, other): print 'comparing', self.data, other.data return self.data < other.data def partition(predicate, iterable): pack = ...
Python
0
@@ -67,16 +67,46 @@ partial +%0Afrom collections import deque %0A%0Aclass @@ -342,320 +342,371 @@ pa -ck = partial(it.imap, lambda i: (predicat +ssing, failing = dequ e( -i ), -i) +deque( )%0A%0A -new_pred = op.itemgetter(0)%0A unpack = partial(it.imap, op.itemgetter(1))%0A%0A packed = pack(iterabl...
14f0afc20c9d6c200c6e9fa52a4121c98d349be7
Set version 0.2.5
pages/__init__.py
pages/__init__.py
# -*- coding: utf-8 -*- VERSION = (0, 2, 4) __version__ = '.'.join(map(str, VERSION))
Python
0.000001
@@ -38,9 +38,9 @@ 2, -4 +5 )%0A__
d282d5525c4d965dbe0a6ee4967a14f1f412f2b4
update version number from 1.4 to 1.5
oauth2/_version.py
oauth2/_version.py
# This is the version of this source code. manual_verstr = "1.4" auto_build_num = "143" verstr = manual_verstr + "." + auto_build_num try: from pyutil.version_class import Version as pyutil_Version __version__ = pyutil_Version(verstr) except (ImportError, ValueError): # Maybe there is no pyutil insta...
Python
0.000009
@@ -56,17 +56,17 @@ tr = %221. -4 +5 %22%0A%0A%0A%0Aaut
7bfc2287d15198d9e37b4def4632481c8446a932
bump version
bread/__init__.py
bread/__init__.py
VERSION = '0.5.1'
Python
0
@@ -10,9 +10,9 @@ '0. -5.1 +6.0 '%0A
928c3bb38f4fa24d082ea18db09ff4542b78466c
remove units from x gt 1 example
docs/source/examples/x_greaterthan_1.py
docs/source/examples/x_greaterthan_1.py
from gpkit import Variable, GP # Decision variable x = Variable("x", "m", "A really useful variable called x with units of meters") # Constraint constraint = [1/x <= 1] # Objective (to minimize) objective = x # Formulate the GP gp = GP(objective, constraint) # Solve the GP sol = gp.solve() # Print results table p...
Python
0
@@ -62,74 +62,11 @@ ble( -%22x%22, %22m%22, %22A really useful variable called x with units of meters%22 +'x' )%0A%0A# @@ -91,17 +91,16 @@ aint +s = %5B -1/ x -%3C +%3E = 1%5D @@ -190,16 +190,17 @@ nstraint +s )%0A%0A# Sol @@ -266,8 +266,9 @@ .table() +%0A
5d30c02f9adb7de3ce9eebef5178466711d96c64
Remove unused import: `RelatedField`
rest_framework_json_api/utils.py
rest_framework_json_api/utils.py
from django.utils.encoding import force_text from django.utils.text import slugify from rest_framework.serializers import RelatedField try: from rest_framework.serializers import ManyRelatedField except ImportError: ManyRelatedField = type(None) try: from rest_framework.serializers import ListSerializer ...
Python
0
@@ -81,61 +81,8 @@ fy%0A%0A -from rest_framework.serializers import RelatedField%0A%0A try:
07ac69ef3f722ae57bc0cc61c30a2378c8c53c2e
Fix mutable default argument problem
live.py
live.py
""" Parses http://www.live-footballontv.com for info about live matches """ import re import requests from bs4 import BeautifulSoup from datetime import datetime, timedelta url = 'http://www.live-footballontv.com' headers = {'User-Agent': 'Football Push Notifications'} def convert_date(date): """Returns datetime...
Python
0.000007
@@ -1448,18 +1448,20 @@ re_list= -%5B%5D +None ):%0A %22 @@ -1514,16 +1514,69 @@ earch%22%22%22 +%0A if ignore_list is None:%0A ignore_list = %5B%5D %0A%0A se
8157af3da0e535074b18c76f0e5391d8cac806e8
Add error field to expected JSON
whats_fresh/whats_fresh_api/tests/views/test_stories.py
whats_fresh/whats_fresh_api/tests/views/test_stories.py
from django.test import TestCase from django.test.client import Client from django.core.urlresolvers import reverse from whats_fresh_api.models import * from django.contrib.gis.db import models import json class StoriesTestCase(TestCase): fixtures = ['whats_fresh_api/tests/testdata/test_fixtures.json'] def s...
Python
0.000001
@@ -361,11 +361,158 @@ %22%22%22 +%22 %0A%7B%0A + error%22: %7B%0A %22error_status%22: false,%0A %22error_name%22: null,%0A %22error_text%22: null,%0A %22error_level%22: null%0A %7D,%0A %7B%0A @@ -647,14 +647,21 @@ ..%22%0A + %7D%0A %7D%22%22%22%0A%0A +%0A
549fd62e94080dc1f0e83c1777440c47fcc0c8a1
Update to released F19
broot/builder.py
broot/builder.py
# Copyright 2013 Daniel Narvaez # # 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 writi...
Python
0
@@ -2448,32 +2448,139 @@ sponse.read())%0A%0A + base_url = %22ftp://mirrors.kernel.org/fedora/releases/19/Fedora/%22 %5C%0A %22x86_64/os%22%0A%0A repo_con @@ -2585,24 +2585,24 @@ onfig = %22%22%22%0A - @@ -2704,61 +2704,9 @@ url= -ftp://mirrors.kernel.org/fedora/develo...
feab9b1067a42a6d5d8586361ab1d02f1844aa7e
Remove unused imports
tests/integration/api/conftest.py
tests/integration/api/conftest.py
""" :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) API-specific fixtures """ import pytest from tests.conftest import CONFIG_PATH_DATA_KEY from tests.helpers import create_admin_app from .helpers import assemble_authorization_header API_TOKEN = 'just-say-PLEASE!'...
Python
0.000001
@@ -142,100 +142,8 @@ st%0A%0A -from tests.conftest import CONFIG_PATH_DATA_KEY%0Afrom tests.helpers import create_admin_app%0A%0A from
f2139cad673ee50f027164bda80d86979d5ce7a0
Add more imports for further functionality
passenger_wsgi.py
passenger_wsgi.py
import os import sys try: from flask import Flask, render_template, send_file, Response import requests except ImportError: INTERP = "venv/bin/python" if os.path.relpath(sys.executable, os.getcwd()) != INTERP: try: os.execl(INTERP, INTERP, *sys.argv) except OSError: ...
Python
0
@@ -51,50 +51,117 @@ lask -, render_template, send_file, Response +%0A import flask_login%0A from flask_restless import APIManager%0A from flask_sqlalchemy import SQLAlchemy %0A
62ec46d6dddf1eb0054861d886ab6493d56670d5
Switch `open()` for `salt.utils.fopen()`
tests/integration/shell/syndic.py
tests/integration/shell/syndic.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` tests.integration.shell.syndic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' # Import python libs import os import yaml import signal import shutil # Import Salt Testing libs from salttesting.helpers import ensure_in_syspath ensur...
Python
0
@@ -1893,16 +1893,72 @@ _path):%0A + with salt.utils.fopen(pid_path) as fhr:%0A @@ -1958,32 +1958,36 @@ try:%0A + @@ -1998,30 +1998,19 @@ ill(int( -open(pid_path) +fhr .read()) @@ -2039,16 +2039,20 @@ + except O @@ -2059,16 +2059,20 @@ SError...
e019a2b5de66dbbc0ed76942824ec3d33bcac6fd
Add integration test for @returns
tests/integration/test_returns.py
tests/integration/test_returns.py
# Standard library imports import collections # Local imports. import uplink # Constants BASE_URL = "https://api.github.com/" # Schemas Repo = collections.namedtuple("Repo", "owner name") # Converters @uplink.loads.from_json(Repo) def repo_loader(cls, json): return cls(**json) @uplink.dumps.to_json(Repo) de...
Python
0
@@ -132,16 +132,65 @@ Schemas%0A +User = collections.namedtuple(%22User%22, %22id name%22)%0A Repo = c @@ -249,16 +249,104 @@ rters%0A%0A%0A +@uplink.loads(User)%0Adef user_reader(cls, response):%0A return cls(**response.json())%0A%0A%0A @uplink. @@ -372,26 +372,31 @@ o)%0Adef repo_ -lo +json_re ader(cls, js @...
f4e6f2c6eb77876b646da14805ee496b0b25f0bc
Support PortOpt from oslo.cfg
dragonflow/common/common_params.py
dragonflow/common/common_params.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.000001
@@ -773,10 +773,11 @@ cfg. -In +Por tOpt @@ -802,32 +802,33 @@ %0A + default=4001,%0A @@ -825,16 +825,17 @@ t=4001,%0A +
4ec09eb10aa352175769cc00f189ece719802ea6
remove temperature for now
lled.py
lled.py
#!/usr/bin/env python """Mookfist LimitlessLED Control This tool can be used to control your LimitlessLED based lights. Usage: lled.py fade <start> <end> (--group=<GROUP>)... [options] lled.py fadec <start> <end> (--group=<GROUP>)... [options] lled.py fadeb <startb> <endb> <startc> <endc> (--group=<GROUP>...
Python
0
@@ -711,70 +711,8 @@ ns%5D%0A - lled.py temperature %3Ctemp%3E (--group=%3CGROUP%3E)... %5Boptions%5D%0A
a324e8de7dc0bcb1676a8ae506d139f05751b233
fix lint for tests
tests/test_relation_identifier.py
tests/test_relation_identifier.py
from __future__ import absolute_import import pytest from catpy.client import ConnectorRelation, CatmaidClient from catpy.applications import RelationIdentifier from tests.common import relation_identifier, connectors_types # noqa def test_from_id(relation_identifier): # noqa assert relation_identifier.from_...
Python
0.000001
@@ -627,50 +627,22 @@ (rel -ation_identifier):%0A relation_identifier +id):%0A relid ._ge @@ -668,32 +668,18 @@ %0A rel -ation_identifier +id ._get_di
a9119708d93b1aaf046ec65d8a077e5314820b45
fix test cond
rsqueakvm/test/test_squeakssl.py
rsqueakvm/test/test_squeakssl.py
import os import py import time import base64 import socket as pysocket import sys from rsqueakvm import constants from rsqueakvm.model.compiled_methods import W_PreSpurCompiledMethod from rsqueakvm.model.variable import W_BytesObject from rsqueakvm.primitives import prim_table from rsqueakvm.primitives.constants impo...
Python
0.000001
@@ -2512,32 +2512,62 @@ form == 'darwin' +, reason=%22Only works on Linux%22 )%0Adef test_https @@ -3660,16 +3660,48 @@ 'darwin' +, reason=%22Not working on darwin%22 )%0Adef te
e0cf4deb8d2cc07db5781b1a25b58132551027d1
Clean up unused imports, use explicit imports
openelex/models.py
openelex/models.py
import datetime from mongoengine import * from mongoengine.fields import ( BooleanField, DateTimeField, DictField, EmbeddedDocumentField, IntField, ListField, StringField, ) from openelex.us import STATE_POSTALS class Office(EmbeddedDocument): state = StringField(choices=STATE_POSTALS)...
Python
0.000001
@@ -1,20 +1,4 @@ -import datetime%0A from @@ -21,9 +21,41 @@ ort -* +EmbeddedDocument, DynamicDocument %0Afro @@ -209,17 +209,79 @@ gField,%0A -) + ReferenceField,%0A)%0Afrom mongoengine.queryset import CASCADE%0A %0Afrom op
ad4b9ffb7292a5b810df033088008cd503bc1169
Add pre-fabricated fake PyPI envs at the top.
tests/unit/test_spec_resolving.py
tests/unit/test_spec_resolving.py
import unittest from piptools.datastructures import SpecSet from piptools.package_manager import FakePackageManager def print_specset(specset, round): print('After round #%s:' % (round,)) for spec in specset: print(' - %s' % (spec.description(),)) class TestDependencyResolving(unittest.TestCase): ...
Python
0
@@ -266,189 +266,19 @@ )%0A%0A%0A -class TestDependencyResolving(unittest.TestCase):%0A def test_find_dependencies_simple(self):%0A %22%22%22A simple scenario for finding dependencies.%22%22%22%0A content = %7B%0A +simple = %7B%0A @@ -293,32 +293,24 @@ ': %5B'bar'%5D,%0A - ...