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
20ef0133953a5b72475286a3f0c4353089d5cd78
Remove duplicates
python-practice/questions-and-answers.py
python-practice/questions-and-answers.py
########################################## ###### Compare use of 'is' and '==' ###### ########################################## ''' # Create two lists a = [1, 2, 3] c = [1, 2, 3] # Assign one list to a variable b = a # Verify eqivalence of contents print("## Verify eqivalence of contents.") print(f"a ==...
Python
0.999996
@@ -3229,16 +3229,21 @@ ######%0D%0A +'''%0D%0A # map wi @@ -3391,12 +3391,546 @@ , lista)))%0D%0A +'''%0D%0A%0D%0A#####################################%0D%0A###### Remove List Duplicates ######%0D%0A#####################################%0D%0A# If order is not important%0D%0Aa = %5B3, 2, 1, 5, 2, 2%5D%0D%0Anormaliz...
fc79afb66dc625bd00f560f2e56eec945169192c
Move to {:f}.format everywhere
python/ccxt/base/decimal_to_precision.py
python/ccxt/base/decimal_to_precision.py
import re import decimal import numbers import itertools __all__ = [ 'TRUNCATE', 'ROUND', 'DECIMAL_PLACES', 'SIGNIFICANT_DIGITS', 'NO_PADDING', 'PAD_WITH_ZERO', 'decimal_to_precision', ] # rounding mode TRUNCATE = 0 ROUND = 1 # digits counting mode DECIMAL_PLACES = 2 SIGNIFICANT_DIGITS =...
Python
0.000787
@@ -1481,19 +1481,29 @@ return -str +%22%7B:f%7D%22.format (to_near
7d2e3682f2e162c2ca6ddb945f7c1c0301bcf8c3
Address review comment: Remove reference to non-existent attribute.
flocker/node/gear.py
flocker/node/gear.py
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """Client implementation for talking to the geard daemon.""" import json from zope.interface import Interface, implementer from twisted.web.http import OK, NO_CONTENT, NOT_FOUND from twisted.internet.defer import succeed, fail from twisted.internet import...
Python
0
@@ -1948,66 +1948,8 @@ P.%0A%0A - :ivar Agent _agent: HTTP client used to talk to gear.%0A
41d6c18aee851c9b2430d74c51ef51b49948b0f4
raise version
brilws/_version.py
brilws/_version.py
__version__ = "3.4.1"
Python
0
@@ -14,9 +14,9 @@ %223. -4.1 +5.0 %22%0A
fadab627469d008a2bf39a9544a77a3bd6518b20
use the local path in the gui to run stuff.
rp-mt-scripts-graphical.py
rp-mt-scripts-graphical.py
#! /usr/bin/env python """Main module to create GTK interface to the MT scripts.""" import gtk import gobject import subprocess class ScriptsWindow: """Class to manage the demo window for the pile manager.""" def __init__(self): self.builder = gtk.Builder() self.builder.add_from_file("rp-mt-scripts-interfa...
Python
0
@@ -78,16 +78,32 @@ ts.%22%22%22%0A%0A +import os.path%0A%0A import g @@ -105,16 +105,16 @@ ort gtk%0A - import g @@ -809,16 +809,23 @@ :%0A%09%09run( +MTROOT+ %22./confi @@ -923,32 +923,39 @@ ta=None):%0A%09%09run( +MTROOT+ %22scripts/1_mt_sc @@ -1048,32 +1048,39 @@ ta=None):%0A%09%09run( +MTROOT+ %22scripts...
6e2362351d9ccaa46a5a2bc69c4360e4faff166d
Add encoding spec to comply Python 2
iclib/qibla.py
iclib/qibla.py
from . import formula def direction(lat, lng): return formula.qibla(lat, lng) def direction_dms(lat, lng): return _dms(formula.qibla(lat, lng)) def direction_str(lat, lng, prec=0): d, m, s = direction_dms(lat, lng) # negative input might returns wrong result return '{}° {}\' {:.{}f}"'.format(d, m, s, prec) def...
Python
0.000002
@@ -1,8 +1,32 @@ +# -*- coding: utf-8 -*-%0A from . i
9f1913ca658228c2c6551b2c8de1d48ddd73c8aa
raise version to 2
brilws/_version.py
brilws/_version.py
__version__ = "1.0.3"
Python
0.000001
@@ -12,11 +12,11 @@ = %22 -1.0.3 +2.0.0 %22%0A
3c2172419aaec3c0031e4a355b20785a3888ae6f
fix label dict
python/federatedml/util/sample_weight.py
python/federatedml/util/sample_weight.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
Python
0
@@ -1888,32 +1888,36 @@ keys())%0A +res_ class_weight.upd @@ -1916,19 +1916,19 @@ ight -.update((k, + = %7Bstr(k): n_s @@ -1951,17 +1951,16 @@ ses * v) -) for k, @@ -1984,17 +1984,17 @@ .items() -) +%7D %0A%0A @@ -2002,16 +2002,20 @@ return +res_ class_we @@ -2564,16 +2564,20 @@ ght.get( +...
97831652f0d06236d83d0731813ffcdc44a4e190
Update pypi version
fontdump/__init__.py
fontdump/__init__.py
__version__ = '0.1.0'
Python
0
@@ -8,14 +8,14 @@ on__ = ' -0 +1 .1.0'
22461c6ddc1a6bff0ee8637139146b8531b3e0b4
improve python error message when tp fails to start
python/perfetto/trace_processor/shell.py
python/perfetto/trace_processor/shell.py
#!/usr/bin/env python3 # Copyright (C) 2020 The Android Open Source Project # # 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.000001
@@ -1553,18 +1553,43 @@ %0A%0A -while True +success = False%0A for i in range(3) :%0A @@ -1617,10 +1617,10 @@ l() -!= +is Non @@ -1634,172 +1634,157 @@ -if unique_port:%0A raise Exception(%0A %22Random port allocation failed, please file a bug at https://goto.google.com/perfetto-b...
eb7daa8f4ac932782f7016e8fbdfc010999e4c21
support attribute deletion from a row
src/main/python/pyspark_cassandra/types.py
src/main/python/pyspark_cassandra/types.py
from collections import Set, Iterable, Mapping from datetime import datetime from operator import itemgetter from time import mktime def _create_row(fields, values): return _create_struct(Row, fields, values) def _create_udt(fields, values): return _create_struct(UDT, fields, values) def _create_struct(cls, field...
Python
0
@@ -1387,16 +1387,132 @@ = value +%0A%0A%09def __delattr__(self, name):%0A%09%09try:%0A%09%09%09del self.__FIELDS__%5Bname%5D%0A%09%09except KeyError:%0A%09%09%09raise AttributeError(name) %0A%09%09%0A%09%0A%09d
141eafa531c6c09a06efe6a694251a1eea84908d
bump skip version on attrs test
h5py/tests/old/test_attrs.py
h5py/tests/old/test_attrs.py
# This file is part of h5py, a Python interface to the HDF5 library. # # http://www.h5py.org # # Copyright 2008-2013 Andrew Collette and contributors # # License: Standard 3-clause BSD; see "license.txt" for full license terms # and contributor agreement. """ Attributes testing module Covers all op...
Python
0
@@ -5052,17 +5052,17 @@ (1, 10, -5 +6 ), 'HDF5 @@ -5067,17 +5067,17 @@ F5 1.10. -5 +6 require
a713bbb1226863b4417362019431de0266faa2d9
Update automateprojectscript.py
automateprojectscript.py
automateprojectscript.py
#!/usr/bin/python """ This python file just runs all of the terminal commands needed to run the project. It just saves time not having to manually type in these commands every time you want to run the project. At the moment it only works for the example project, as the project later develops this script might be upda...
Python
0
@@ -1527,16 +1527,207 @@ dfile%0A%0A%0A +# This would need to be changed if your project is named something different%0ArosmakePro= Popen('rosmake se306Project',shell=True)%0ArosmakePro.communicate() # Waits until rosmake has finished%0A%0A core = P
0be59cee807ef6167883fe32680f2c177202f2d5
add missing document_types
frappe/model/sync.py
frappe/model/sync.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: MIT. See LICENSE """ Sync's doctype and docfields from txt files to database perms will get synced only if none exist """ import frappe import os from frappe.modules.import_file import import_file_by_path from frappe.modules.patch_handler...
Python
0.00013
@@ -2529,38 +2529,47 @@ = %5B -' +%0A%09%09%22 doctype -', 'page', 'report', ' +%22,%0A%09%09%22page%22,%0A%09%09%22report%22,%0A%09%09%22 dash @@ -2586,20 +2586,22 @@ t_source -', ' +%22,%0A%09%09%22 print_fo @@ -2604,22 +2604,36 @@ t_format -' +%22 ,%0A%09%09 -' +%22web_page%22,%0A%09%09%22 website_ @@ -2641...
252d4212e7952db3d36e0324ba237cc109d62279
Replace . by _ in signal and entity names.
src/dynamic_graph/sot/core/feature_position.py
src/dynamic_graph/sot/core/feature_position.py
# -*- coding: utf-8 -*- # Copyright 2011, Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST # # This file is part of dynamic-graph. # dynamic-graph 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 ...
Python
0.000027
@@ -1869,17 +1869,17 @@ name + ' -. +_ ref')%0A
ae9b94f28b3677be2867bfffb9e1dcec8851aaa0
Fix typo in example usage for extract_variable.py script.
prompt_tuning/scripts/extract_variable.py
prompt_tuning/scripts/extract_variable.py
# Copyright 2022 Google. # # 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, soft...
Python
0.99978
@@ -824,16 +824,17 @@ restore_ +d type=flo
3f1d30c2aeff73bb4863f2d0fd0660a264715739
Tidy up
src/planner.py
src/planner.py
from collections import deque class GamePlan(object): """ initialise the tournament object with an overall list of players' IDs input: a list of players output: a list (len = number of rounds) of lists of tuples with players' names (maybe change to IDs from db) in white, black order ...
Python
0.000001
@@ -1106,17 +1106,21 @@ for -x +stage in xran @@ -1320,17 +1320,21 @@ if -x +stage %25 2 == @@ -1858,122 +1858,64 @@ -if len(self.players) %25 2 == 0:%0A players = self.players%0A else:%0A players = self.players +players = self.players%0A if len(players) %25 2...
856171e4933b872b1537945d3e6033da4313a1cb
enable gzip in django
ses_maker/settings.py
ses_maker/settings.py
""" Django settings for ses_maker project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import ...
Python
0.000001
@@ -1042,24 +1042,69 @@ DLEWARE = %5B%0A + 'django.middleware.gzip.GZipMiddleware',%0A 'django.
d9ee9620e5c018e9869bd9f05a8b4c40659ab068
version 0.1.10
docxtpl/__init__.py
docxtpl/__init__.py
# -*- coding: utf-8 -*- ''' Created : 2015-03-12 @author: Eric Lapouyade ''' __version__ = '0.1.9' from lxml import etree from docx import Document from jinja2 import Template from cgi import escape import re import six class DocxTemplate(object): """ Class for managing docx files as they were jinja2 templates ...
Python
0.000002
@@ -95,9 +95,10 @@ 0.1. -9 +10 '%0A%0Af
65783ec0baac5886232a5334905a748750b3c0c2
fix NameError
sfa/methods/Update.py
sfa/methods/Update.py
### $Id: update.py 16477 2010-01-05 16:31:37Z thierry $ ### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfa/methods/update.py $ import time from sfa.util.faults import * from sfa.util.method import Method from sfa.util.parameter import Parameter, Mixed from sfa.trust.credential import Credential class Update(Metho...
Python
0.000003
@@ -1117,16 +1117,21 @@ n(record +_dict .get('hr
5d8629f2f0e024b08411a1a710ac927f0f02bcfd
remove the 'name' field from the slice record before updateing. Cant allow user to attempt to change the slice name
sfa/methods/update.py
sfa/methods/update.py
### $Id$ ### $URL$ from sfa.util.faults import * from sfa.util.method import Method from sfa.util.parameter import Parameter, Mixed from sfa.trust.auth import Auth from sfa.util.record import GeniRecord from sfa.trust.certificate import Keypair, convert_public_key from sfa.trust.gid import * from sfa.util.debug import...
Python
0
@@ -2299,32 +2299,106 @@ e, hrn, record)%0A + if 'name' in pl_reocrd:%0A pl_record.pop('name')%0A self
6a582b6e2fa852d6a80268c7ddd305d45416c8ef
Fix YUM and DNF usage.
hotness/repository.py
hotness/repository.py
import logging import subprocess import os import ConfigParser from six import StringIO from hotness.cache import cache log = logging.getLogger('fedmsg') thn_section = 'thn' class ThnConfigParser(ConfigParser.ConfigParser): def read(self, filename): try: text = open(filename).read() ...
Python
0
@@ -429,17 +429,8 @@ e = -StringIO. Stri @@ -1362,44 +1362,8 @@ che%0A - pkg_manager = get_pkg_manager()%0A @@ -1398,16 +1398,20 @@ r/bin%22, +get_ pkg_mana @@ -1413,16 +1413,18 @@ _manager +() ),%0A @@ -1897,32 +1897,28 @@ cmdline -.append( + = %5B %22/usr/bin/re @@ -1921,25 +1921,25 @@ ...
559b2fc17d4a28f2d3faa7bd1bf5316fbf11019e
Add magnitude attribute to siem events
siemstress/trigger.py
siemstress/trigger.py
#!/usr/bin/env python #_MIT License #_ #_Copyright (c) 2017 Dan Persons (dpersonsdev@gmail.com) #_ #_Permission is hereby granted, free of charge, to any person obtaining a copy #_of this software and associated documentation files (the "Software"), to deal #_in the Software without restriction, including without limi...
Python
0.000001
@@ -4177,16 +4177,75 @@ %25H%25M%25S') +%0A magnitute = len(rows) // self.rule%5B'Severity'%5D %0A%0A @@ -4482,16 +4482,27 @@ ntCount, + Magnitude, TimeInt @@ -4593,16 +4593,20 @@ %25s, %25s, + %25s, %25s)'%0A%0A @@ -5043,16 +5043,27 @@ n(rows), + magnitude, %0A @@ -5859,24 +5859,112...
d307b65f8bf5f9ae8eaaefa071fd2055304a6725
Remove custom form from admin.
saskatoon/harvest/admin.py
saskatoon/harvest/admin.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.contrib import admin from forms import RFPForm, PropertyForm, HarvestForm, HarvestYieldForm, EquipmentForm from member.models import * from harvest.models import * from harvest.forms import * class PropertyInline(admin.TabularInline): model = Property ...
Python
0
@@ -874,24 +874,25 @@ Admin):%0A +# form = Harve
e28a41e5996651aefdf7966ead73310a5a761040
fix flake8 violation
simphony/cuds/bond.py
simphony/cuds/bond.py
class Bond(object): """ Bond entity """ def __init__(self, id, particles, data=None): self.id = id self.particles = particles if data is None: self.data = {} else: self.data = data def __eq__(self, other): if isinstance(other, self.__...
Python
0
@@ -247,17 +247,16 @@ = data%0A%0A -%0A def
7f34b774d47019a4cd062622396576f4410defed
Fix tempest config
fuel_test/helpers.py
fuel_test/helpers.py
import logging import re from root import root from settings import controllers from keystoneclient.v2_0 import client #from glanceclient import Client def execute(remote, command): chan, stdin, stderr, stdout = execute_async(remote, command) result = { 'stdout': [], 'stderr': [], 'exit...
Python
0.002982
@@ -2062,33 +2062,31 @@ ANT_NAME': ' -openstack +tenant1 ',%0A ' @@ -2170,33 +2170,31 @@ ANT_NAME': ' -openstack +tenant2 ',%0A ' @@ -3484,32 +3484,24 @@ '%5D)) +%5B0%5D %0A -print image_ref%0A +result = exe @@ -3743,32 +3743,11 @@ '%5D)) -%0A print image_ref_any +%5B0%5D %0A
2e2f6d2a6480a4ca43c76e6559cfe6aadc434a8b
change to dumps
functions/webhook.py
functions/webhook.py
#!/usr/bin/python # Written by: Andrew Jackson # This is used to send a JSON payload to a webhook. import json import logging import os import time import uuid import boto3 import requests import decimal #def default(obj): # if isinstance(obj, decimal.Decimal): # return int(obj) # return o.__dict__ def h...
Python
0.000004
@@ -399,20 +399,20 @@ = json. -load +dump s(event) @@ -576,24 +576,25 @@ yload))%0A +# print(r.text
f83369a263fb606a6f92b62a45d72e8faf0f1770
Add RunGM and RunBench steps for Android Review URL: https://codereview.appspot.com/5987049
master/skia_master_scripts/android_factory.py
master/skia_master_scripts/android_factory.py
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility class to build the Skia master BuildFactory's for Android buildbots. Overrides SkiaFactory with any Android-specific steps.""" from skia_mas...
Python
0
@@ -972,16 +972,268 @@ nTests') +%0A self.PushBinaryToDeviceAndRun(binary_name='gm',%0A arguments='--nopdf --noreplay',%0A description='RunGM')%0A self.PushBinaryToDeviceAndRun(binary_name='bench', description='RunBench') %0A%0A re @@ -1301,16...
984422fe3fb0b34a17e42910a9c1b98afa572452
Revert r9607 -- it caused a BuildbotSelfTest failure
master/skia_master_scripts/android_factory.py
master/skia_master_scripts/android_factory.py
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility class to build the Skia master BuildFactory's for Android buildbots. Overrides SkiaFactory with any Android-specific steps.""" from buildb...
Python
0
@@ -1417,25 +1417,26 @@ %0A%0A def -PreRender +CompareGMs (self):%0A @@ -1447,135 +1447,122 @@ %22%22%22 -Before chaining to SkiaFactory.PreRender(), build tools (skdiff,%0A skimage) that we might ne +Run the %22skdiff%22 tool to compare the %22actual%22 GM images we just%0A generat ed +t o -n the b -u...
45ceb7d945208c7c25f21fe6e869155e60c66edf
Remove unused import.
payload/usr/local/sal/checkin_modules/munki_checkin.py
payload/usr/local/sal/checkin_modules/munki_checkin.py
#!/usr/local/sal/Python.framework/Versions/3.8/bin/python3 import datetime import os import pathlib import plistlib import sys import sal sys.path.insert(0, '/usr/local/munki') from munkilib import munkicommon __version__ = '1.1.0' def main(): # If we haven't successfully submitted to Sal, pull the existing ...
Python
0
@@ -74,18 +74,8 @@ ime%0A -import os%0A impo
4b740ddb11fb5c4b2b29bc6eef0a5569349272f8
make random_metadata compliant
datalake_common/tests/conftest.py
datalake_common/tests/conftest.py
import pytest import random import string from datetime import datetime, timedelta @pytest.fixture def basic_metadata(): return { 'version': 0, 'start': 1426809600000, 'end': 1426895999999, 'where': 'nebraska', 'what': 'apache', 'hash': '12345' } def random_wo...
Python
0.000004
@@ -402,16 +402,110 @@ ngth))%0A%0A +def random_hex(length):%0A return ('%250' + str(length) + 'x') %25 random.randrange(16**length)%0A%0A def rand @@ -706,16 +706,155 @@ rmat()%0A%0A +def random_work_id():%0A if random.randint(0, 1):%0A return None%0A return '%7B%7D-%7B%7D'.format(random_word(5), ra...
4507c0cb56ed72253d52c92f621ec33600e5e36b
Add version number for future use
sla_bot.py
sla_bot.py
import asyncio import datetime as dt import math import os import traceback import discord from discord.ext import commands from SLA_bot.config import Config as cf from SLA_bot.schedule import Schedule curr_dir = os.path.dirname(__file__) configs = [ os.path.join(curr_dir, 'docs', 'default_config.ini'), o...
Python
0
@@ -121,17 +121,16 @@ mmands%0A%0A -%0A from SLA @@ -200,16 +200,32 @@ hedule%0A%0A +VERSION = 0.10%0A%0A curr_dir
5d82c2d9f6d2874ae4621edb4dc1e6455652666b
Remove Dropout and unnecessary imports
examples/imdb_fasttext.py
examples/imdb_fasttext.py
'''This example demonstrates the use of fasttext for text classification Based on Joulin et al's paper: Bags of Tricks for Efficient Text Classification https://arxiv.org/abs/1607.01759 Can achieve accuracy around 88% after 5 epochs in 70s. ''' from __future__ import print_function import numpy as np np.random.see...
Python
0
@@ -1599,45 +1599,8 @@ ayer -,%0A# so that we can add a dense layer: %0Amod
20ef3aed661d5b77bedf48df9ed6917e24319c01
Fix typo
factory/glideFactoryLogParser.py
factory/glideFactoryLogParser.py
# # Description: # This module implements classes to track # changes in glidein status logs # # Author: # Igor Sfiligoi (Feb 2nd 2007) # import os, os.path import condorLogParser # for now it is just a constructor wrapper # Further on it will need to implement glidein exit code checks class dirSummaryTimings(c...
Python
0.999999
@@ -338,16 +338,23 @@ rSummary +Timings ):%0A d
12f9217fb1dfd76f57c33340c79769f4bc0f20ee
version update + adding changelog
packages/python-packages/doc-warden/warden/version.py
packages/python-packages/doc-warden/warden/version.py
VERSION = '0.2.5'
Python
0
@@ -12,7 +12,7 @@ 0.2. -5 +6 '%0A
ae38884444be3b3e0f98ca406352fe92037423f1
making the products model abstract
scofield/product/models.py
scofield/product/models.py
from django.db import models from scofield.category.models import * from scofield.manufacturer.models import Manufacturer class Product(models.Model): """ Base class for products """ name = models.CharField(max_length=200, null=False, blank=False, help_text='Product Name') slug = models.SlugFie...
Python
0.999999
@@ -21,16 +21,46 @@ t models +%0Afrom datetime import datetime %0A%0Afrom s @@ -161,16 +161,21 @@ Product +Model (models. @@ -228,16 +228,260 @@ %22%22%22%0A%0A + #timestamps%0A date_added = models.DateTimeField(default=datetime.now)%0A date_updated = models.DateTimeField(default=datetime.now)%0A%0A ...
5f940dc91e2da529ab13b1931db5f52188755a5d
return correct dimension
ichwrapper/cluster.py
ichwrapper/cluster.py
import os import yaml from bcbio import utils from bcbio.install import _get_data_dir from bcbio.distributed import clargs from bcbio.provenance import system import bcbio.distributed.resources as res from bcbio.distributed.ipython import create # from bcbio import log import log from cluster_helper import cluster as ...
Python
0.999999
@@ -1076,16 +1076,17 @@ urn +%5B %5Bj.get() for @@ -1081,16 +1081,17 @@ %5Bj.get() +%5D for j i @@ -1097,16 +1097,17 @@ in jobs%5D + %0A%0A%0Adef i @@ -3565,20 +3565,12 @@ hon%22 -:%0A if + and not @@ -3585,20 +3585,16 @@ (step):%0A - @@ -3645,20 +3645,16 @@ - - for sa...
c47a51db4f7ccc514aa687a1859ed592574d1a58
Change API Endpoint to BzAPI Compatibility Layer
bugzilla/agents.py
bugzilla/agents.py
from bugzilla.models import * from bugzilla.utils import * class InvalidAPI_ROOT(Exception): def __str__(self): return "Invalid API url specified. " + \ "Please set BZ_API_ROOT in your environment " + \ "or pass it to the agent constructor" class BugzillaAgent(object): de...
Python
0
@@ -1451,16 +1451,8 @@ s:// -api-dev. bugz @@ -1472,14 +1472,13 @@ org/ -latest +bzapi /',
22b91d3f58eb9a6c021645a4aea56c864d151bba
Fix get_favorite_for typo in templatetags
favit/templatetags/favit_tags.py
favit/templatetags/favit_tags.py
# -*- coding: utf-8 -*- from django import template from django.db.models import get_model from django.template.loader import render_to_string from ..models import Favorite register = template.Library() @register.simple_tag(takes_context=True) def favorite_button(context, target): user = context['request'].use...
Python
0
@@ -1714,17 +1714,16 @@ Favorite -s .objects
35b5900c156b4c6fca401ab2097879d98761befe
Make all timestamps comparable.
bugzilla2fedmsg.py
bugzilla2fedmsg.py
# -*- coding: utf-8 -*- """ Moksha consumer that listens to BZ over STOMP and reproduces to fedmsg. Authors: Ralph Bean <rbean@redhat.com> """ import datetime import socket import time import bugzilla import dateutil.parser import fedmsg import moksha.hub.api import moksha.hub.reactor # These are bug fields we'...
Python
0.000663
@@ -3746,16 +3746,83 @@ 1139955%0A + timezone_naive_timestamp = msg%5B'timestamp'%5D.rsplit('+')%5B0%5D%0A @@ -3862,21 +3862,31 @@ r.parse( -msg%5B' +timezone_naive_ timestam @@ -3878,34 +3878,32 @@ _naive_timestamp -'%5D )%0A%0A # Fin
66ad5e449b1f28dbde2bc30a37ad3c568ae9166f
Fix bins
examples/plot_dom_hits.py
examples/plot_dom_hits.py
# -*- coding: utf-8 -*- """ ================== DOM hits. ================== Estimate track/DOM distances using the number of hits per DOM. """ from __future__ import absolute_import, print_function, division # Author: Tamas Gal <tgal@km3net.de> # License: BSD-3 from collections import defaultdict, Counter import nu...
Python
0.000001
@@ -2013,16 +2013,20 @@ bins = +(int (max(sdf @@ -2042,14 +2042,19 @@ e'%5D) +) - 1, +int( max( @@ -2072,16 +2072,17 @@ '%5D) - 1) +) %0A
f79342cc30c434033d218d7a3f260afcbdec9e31
Version bump (3.0.0 alpha 2)
euca2ools/__init__.py
euca2ools/__init__.py
# Software License Agreement (BSD License) # # Copyright (c) 2009-2013, Eucalyptus Systems, Inc. # All rights reserved. # # Redistribution and use of this software in source and binary forms, with or # without modification, are permitted provided that the following conditions # are met: # # Redistributions of source ...
Python
0
@@ -1481,17 +1481,17 @@ .0-alpha -1 +2 '%0A%0Aif '_
e17062502af60fecb15bd14315836ae415a84654
use argparse instead of optparse in script/sync_module_docs.py
script/sync_module_docs.py
script/sync_module_docs.py
#!/usr/bin/env python """ Synchronize the documentation files in a given directory ``doc_dir`` with the actual state of the SfePy sources in ``top_dir``. Missing files are created, files with no corresponding source file are removed, other files are left untouched. Notes ----- The developer guide needs to be edited ma...
Python
0.000001
@@ -449,19 +449,19 @@ ch%0Afrom -opt +arg parse im @@ -465,26 +465,57 @@ import -OptionPars +ArgumentParser, RawDescriptionHelpFormatt er%0A%0Afrom @@ -622,72 +622,8 @@ th%0A%0A -usage = '%25prog %5Boptions%5D doc_dir top_dir%5Cn' + __doc__.rstrip()%0A%0A omit @@ -977,32 +977,170 @@ r = -OptionParser(usage=u...
14c31307fd31631ecce0378aedbef95cec8531f2
Fix autodiscovery
gargoyle/__init__.py
gargoyle/__init__.py
""" gargoyle ~~~~~~~~ :copyright: (c) 2010 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ from django.utils.module_loading import autodiscover_modules from gargoyle.manager import gargoyle __version__ = '1.2.0' VERSION = __version__ # old version compat __all__ = ('gargoyle', 'autodiscover...
Python
0
@@ -602,24 +602,61 @@ nt.%0A %22%22%22%0A + import gargoyle.builtins # noqa%0A autodisc
e0def112fda555307cc9d8249056b92c7f86f29a
Pass the amount of values to softmax
eva/models/wavenet.py
eva/models/wavenet.py
from keras.models import Model from keras.layers import Input, Convolution1D, Activation, Merge, Lambda from keras.layers.advanced_activations import PReLU from keras.optimizers import Nadam from eva.layers.causal_atrous_convolution1d import CausalAtrousConvolution1D from eva.layers.wavenet_block import WavenetBlock, ...
Python
0.9994
@@ -383,22 +383,13 @@ s, l -earn_all=False +ast=0 , h= @@ -1271,21 +1271,16 @@ if -not learn_all +last %3E 0 :%0A @@ -1314,19 +1314,20 @@ : x%5B:, - -1, +last :%5D, outp @@ -1336,16 +1336,22 @@ _shape=( +last, out._ker @@ -1363,12 +1363,10 @@ ape%5B --1%5D, +2%5D ), n
f4063d86404adbb5489edefd6c12d855de246dee
test that we can decode all doubly-encoded characters (doesn't pass yet)
ftfy/test_unicode.py
ftfy/test_unicode.py
# -*- coding: utf-8 -*- from ftfy.fixes import fix_text_encoding import unicodedata import sys if sys.hexversion >= 0x03000000: unichr = chr # Most single-character strings which have been misencoded should be restored. def test_all_bmp_characters(): for index in range(0xa0, 0xfffd): char = unichr(ind...
Python
0.000001
@@ -87,16 +87,43 @@ port sys +%0Afrom nose.tools import eq_ %0A%0Aif sys @@ -549,48 +549,189 @@ -assert fix_text_encoding(garble) == +garble2 = char.encode('utf-8').decode('latin-1').encode('utf-8').decode('latin-1')%0A eq_(fix_text_encoding(garble), char)%0A eq_(fix_text_encoding(garble2)...
c9e37f9b241c2bef2ffdb4811cec41c951b21ef9
Update fluid_cat_slim.py
cat_boxing/caged_cat/python/fluid_cat_slim.py
cat_boxing/caged_cat/python/fluid_cat_slim.py
from random import randint def generate_cat(): cat_size = randint(1,100) return cat_size def fill_box(): box_size = 400 empty_room = 400 j = 0 while empty_room > 0: cat = generate_cat() empty_room = empty_room - cat j = j + 1 return j def fill_truck(): tru...
Python
0.000003
@@ -113,27 +113,8 @@ ():%0A - box_size = 400%0A
0e519e2cafc1d384c6e4b2c7d5d3d8687b7896e8
use os.path to concat dirs
etc/scene-viewer.py
etc/scene-viewer.py
# GamePlay 3D Blender Scene Viewer # # Copyright 2013 Ithai Levi # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0
@@ -1778,24 +1778,39 @@ p = -svp+%22/res/ +os.path.join(svp,%22res%22,%22 scene%22 +) %0A @@ -3529,18 +3529,31 @@ ath, +os.path.join( svp -+ +, %22res -/ %22 +) )%0A
bfd0f554ef1a4f18afe3113c53ce20a756109abe
Add nbip
sniffer.py
sniffer.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Author : Oros # # documentations : # http://secdev.org/projects/scapy/doc/usage.html # http://sdz.tdct.org/sdz/manipulez-les-paquets-reseau-avec-scapy.html # # Install : # apt-get install tcpdump graphviz imagemagick python-gnuplot python-crypto python-pyx python-scapy nmap...
Python
0.000181
@@ -2263,89 +2263,17 @@ get_ +nb_ ips(): -%0A%09i=0;%0A%09for ip in get_uniques_ips():%0A%09%09i+=1%0A%09%09print(%22%7B%7D : %7B%7D%22.format(i,ip)) %0A%09pr @@ -2299,17 +2299,38 @@ .format( -i +len(get_uniques_ips()) ))%0A%0Aif l @@ -2471,16 +2471,37 @@ JS file +%0Anbip : number of IPs %0A%0AExempl @@ -2871,2...
b819aa7ad2f390c06fec4b45174f3f001ba48baf
Make sure to check that a summary exists before using it
bcbio/upload/__init__.py
bcbio/upload/__init__.py
"""Handle extraction of final files from processing pipelines into storage. """ import datetime from bcbio.upload import shared, filesystem, galaxy, s3 from bcbio.utils import file_exists _approaches = {"filesystem": filesystem, "galaxy": galaxy, "s3": s3} def from_sample(sample): "...
Python
0
@@ -4203,32 +4203,56 @@ rams%22%5D%7D%5D%0A if +%22summary%22 in sample and sample%5B%22summary%22
605e621d000e38fabb61a347322cb3828dcb136d
update to one import per line
slacksocket/client.py
slacksocket/client.py
import os,json,logging,websocket,requests,time,thread from .config import slackurl,event_types log = logging.getLogger('slacksocket') class SlackSocketEventNameError(NameError): """ Invalid name """ pass class SlackSocketAPIError(RuntimeError): """ Error response from Slack API """ pa...
Python
0
@@ -6,46 +6,88 @@ t os -,json,logging,websocket,requests,time, +%0Aimport json%0Aimport logging%0Aimport websocket%0Aimport requests%0Aimport time%0Aimport thre
56227360ee3f6b94b3c92e1282034c0cddaced07
Add ASCIINEMA_URL
bears/python/MypyBear.py
bears/python/MypyBear.py
from collections import namedtuple import textwrap import sys from coalib.bearlib.abstractions.Linter import linter from coalib.bears.requirements.PipRequirement import PipRequirement from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY from coalib.results.Result import Result class FlagInfo(namedtuple('FlagIn...
Python
0.000001
@@ -3479,16 +3479,68 @@ GPL-3.0' +%0A ASCIINEMA_URL = 'https://asciinema.org/a/90736' %0A%0A #
c958593e1f1c86555c0069e744d9df7f4fe2412f
remove todo
slacksocket/client.py
slacksocket/client.py
import os,json,logging,websocket,requests,time,thread logging.basicConfig(level=logging.INFO) log = logging.getLogger('slacksocket') slackurl = { 'rtm' : 'https://slack.com/api/rtm.start', 'users' : 'https://slack.com/api/users.list' } #TODO: add event_type groups for all channel events, all group eve...
Python
0.000005
@@ -2263,61 +2263,8 @@ t):%0A - #TODO: add method to properly exit, close socket%0A
f9e543f8c84f8a6f9d6ead0d2a1f9979d6a0ab8b
add write timing
humanhive/audio_interface.py
humanhive/audio_interface.py
import pyaudio import time class AudioInterface: """ Manages the sound interface. This manages the main callback for the audio interface and delegates behaviour to the Playback and Recording modules. """ def __init__(self, playback, recording_queue, ...
Python
0.00001
@@ -1548,32 +1548,89 @@ frame_count))%0A%0A + print(%22qsize: %7B%7D%22.format(self.playback.qsize()))%0A # Get ou @@ -1675,24 +1675,25 @@ back.get()%0A%0A +%0A te = @@ -2194,16 +2194,45 @@ , None)%0A + st = time.time()%0A @@ -2307,8 +2307,69 @@ =False)%0A + ...
d1e66c414aac60cc7770ddeff091dedc5c0047f6
Remove debug `print` from feature extraction
feature_extraction/extraction.py
feature_extraction/extraction.py
import numpy as np import skimage.exposure as exposure from .util import AttributeDict def extract_features(image, measurements): """ Given an image as a Numpy array and a set of measurement objects implementing a compute method returning a feature vector, return a combined feature vector. """ # TODO(liam): par...
Python
0.000001
@@ -1148,24 +1148,8 @@ m)%0A%0A -%09print options%0A%0A %09if
15652a0b80b0fa0c87ac9ccd33eaada22859bfa2
Update the_most_numbers.py
checkio/python/elementary/the_most_numbers.py
checkio/python/elementary/the_most_numbers.py
Python
0.998495
@@ -0,0 +1,273 @@ +def distance(*args):%0D%0A if args:%0D%0A min = args%5B0%5D%0D%0A max = args%5B0%5D%0D%0A for x in args:%0D%0A if x %3C min:%0D%0A min = x%0D%0A if x %3E max:%0D%0A max = x%0D%0A else:%0D%0A min = 0%0D%0A max...
2e3341c7e32182cc35f6a658d613c77a72b9b377
Modify comments
src/marketdata/access/remote/google.py
src/marketdata/access/remote/google.py
import urllib2 import urllib from marketdata.utils.transform.google.rawquote_intraday import TranformIntradayQuote def _getUrl(url, urlconditions): url_values = urllib.urlencode(urlconditions) return url + '?' + url_values def _pullQuote(url, urlconditions): req = urllib2.Request(_getUrl(url, urlconditi...
Python
0
@@ -507,36 +507,16 @@ ket data - from Google finance :%0A ht @@ -599,56 +599,27 @@ -Description of abbreviations present in the abov +Abbreviations in th e UR
3577de6383053e0f8e05d531c8a632be12e89ca6
fix for route parser to handle when path=None
python/marvin/utils/general/decorators.py
python/marvin/utils/general/decorators.py
from functools import wraps # General Decorators def parseRoutePath(f): ''' Decorator to parse generic route path ''' @wraps(f) def decorated_function(inst, *args, **kwargs): for kw in kwargs['path'].split('/'): if len(kw) == 0: continue var, value = kw.sp...
Python
0.000106
@@ -184,16 +184,68 @@ wargs):%0A + if 'path' in kwargs and kwargs%5B'path'%5D:%0A @@ -293,16 +293,20 @@ + if len(k @@ -314,16 +314,20 @@ ) == 0:%0A + @@ -355,16 +355,20 @@ + var, val @@ -386,16 +386,20 @@ it('=')%0A +
4c31e94752e635c0826dd6b223201fe7ce0d5220
Fix cache_home to expand path
rplugin/python3/deoplete/sources/jedi.py
rplugin/python3/deoplete/sources/jedi.py
import os import re import sys current_dir = os.path.dirname(os.path.abspath(__file__)) jedi_dir = os.path.join(os.path.dirname(current_dir), 'jedi') sys.path.insert(0, jedi_dir) import jedi from .base import Base class Source(Base): def __init__(self, vim): Base.__init__(self, vim) self.name ...
Python
0
@@ -3540,16 +3540,35 @@ _home = +os.path.expanduser( '~/.cach @@ -3569,16 +3569,17 @@ /.cache' +) %0A
9044018db0a909884ada225af12c7252f85aece8
Remove dead code
examples/tictactoe_td0.py
examples/tictactoe_td0.py
from capstone.environment import Environment from capstone.game import TicTacToe from capstone.mdp import GameMDP from capstone.player import AlphaBeta, RandPlayer from capstone.util import ZobristHashing # class TabularTD0(object): # def __init__(self, env, policy, alpha, gamma, n_episodes): # self.env =...
Python
0.001497
@@ -203,580 +203,8 @@ ng%0A%0A -# class TabularTD0(object):%0A%0A# def __init__(self, env, policy, alpha, gamma, n_episodes):%0A# self.env = env%0A# self.policy = policy%0A# self.alpha = alpha%0A# self.gamma = gamme%0A# self.n_episodes = n_episodes%0A%0A# def learn(self)...
114793d6abce14ece5fbd537cce38230366db365
Fix compilation
rsqueakvm/plugins/immutability_plugin.py
rsqueakvm/plugins/immutability_plugin.py
""" RSqueak/VM plugin which provides support for immutable objects. Immutable objects can be created as copy of existing objects or from a list of arguments. The package `ImmutableObjects`, located in `/repository`, needs to be loaded in the image. """ from rsqueakvm.error import PrimitiveFailedError from rsqueakvm.m...
Python
0.000001
@@ -2927,16 +2927,44 @@ unt)%5B:%5D%0A + w_first_arg = w_args%5B0%5D%0A w_cl @@ -3286,31 +3286,33 @@ sinstance(w_ -args%5B0%5D +first_arg , W_BytesObj @@ -3373,23 +3373,25 @@ _cls, w_ -args%5B0%5D +first_arg .bytes)%0A @@ -3471,23 +3471,25 @@ tance(w_ -args%5B0%5D +first_arg , W_Word @@ -3554,23 +3554,25...
0b67fd158ffc027f8245a8211f4d7a21f3ad486d
refine the display of rest of line. #24
pythonx/cm_sources/cm_keyword_continue.py
pythonx/cm_sources/cm_keyword_continue.py
# -*- coding: utf-8 -*- # For debugging, use this command to start neovim: # # NVIM_PYTHON_LOG_FILE=nvim.log NVIM_PYTHON_LOG_LEVEL=INFO nvim # # # Please register source before executing any other code, this allow cm_core to # read basic information about the source without loading the whole module, and # modules requ...
Python
0.999761
@@ -4258,24 +4258,26 @@ %0A + # e%5B'abbr'%5D = @@ -4307,16 +4307,108 @@ + '...'%0A + e%5B'abbr'%5D = '%3Cthe rest%3E '%0A e%5B'menu'%5D = e%5B'word'%5D + e%5B'menu'%5D + '...'%0A @@ -4467,35 +4467,8 @@ e'%5D%0A - e%5B'menu'%5D = ''%0A
66586d0fa74a7b109305d6330b2448c32a54bd1b
Fix lints
flask_fs/backends/__init__.py
flask_fs/backends/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import six from flask_fs import files __all__ = [i.encode('ascii') for i in ('BaseBackend', 'DEFAULT_BACKEND')] DEFAULT_BACKEND = 'local' class BaseBackend(object): ''' Abstract class to implement backend. ''' root = None DEFAULT...
Python
0.000006
@@ -2677,20 +2677,16 @@ rn meta%0A - %0A def
35399c57d0bc309220d20bcbf443c5483171ca1f
Initialize received queue in test client
flask_socketio/test_client.py
flask_socketio/test_client.py
import uuid from socketio import packet from werkzeug.test import EnvironBuilder class SocketIOTestClient(object): """ This class is useful for testing a Flask-SocketIO server. It works in a similar way to the Flask Test Client, but adapted to the Socket.IO server. :param app: The Flask application ...
Python
0
@@ -1657,16 +1657,50 @@ 4().hex%0A + self.queue%5Bself.sid%5D = %5B%5D%0A
27acea8beae7876159f142add8d3e55b62d61f8f
Add read method to modulators
feder/questionaries/modulator.py
feder/questionaries/modulator.py
from django import forms from django.utils.translation import ugettext as _ class BaseBlobFormModulator(object): description = None def __init__(self, blob=None): self.blob = blob or {} super(BaseBlobFormModulator, self).__init__() def create(self): raise NotImplementedError("") ...
Python
0.000001
@@ -268,24 +268,32 @@ create(self +, fields ):%0A r @@ -314,24 +314,47 @@ entedError(%22 +Provide method 'create' %22)%0A%0A def @@ -364,16 +364,24 @@ wer(self +, fields ):%0A @@ -410,16 +410,133 @@ dError(%22 +Provide method 'answer'%22)%0A%0A def read(self, cleaned_data):%0A raise No...
90e1b254266155abded62bc3155785961acc0ff0
Split filepath and count in credential module
bin/Credential.py
bin/Credential.py
#!/usr/bin/env python2 # -*-coding:UTF-8 -* import time from packages import Paste from pubsublogger import publisher from Helper import Process import re if __name__ == "__main__": publisher.port = 6380 publisher.channel = "Script" config_section = "Credential" p = Process(config_section) publishe...
Python
0
@@ -356,18 +356,17 @@ tical = -10 +8 %0A%0A re @@ -548,24 +548,23 @@ -filepath +message = p.get @@ -586,24 +586,23 @@ if -filepath +message is None @@ -696,16 +696,16 @@ eping')%0A - @@ -737,32 +737,197 @@ continue%0A%0A + filepath, count = message.split()%0A%0A ...
e18047a3cb3c8303bf64dc9ce5fc230e29b25b56
Fix fac-gitall.py
bin/fac-gitall.py
bin/fac-gitall.py
#!/usr/bin/env python3 import sys import os import lnls #import git from termcolor import colored import subprocess git_functions = ('pull','push','status','diff','clone') def run_git_clone(): if not os.path.exists(lnls.folder_code): print('gitall.py: please create ' + lnls.folder_code + ' folder with...
Python
0
@@ -252,16 +252,20 @@ print(' +fac- gitall.p @@ -1589,16 +1589,20 @@ 'usage: +fac- gitall.p
1b172c592bb5efc1a0dcf8f18d6ea6a1037ec9ff
Clean things up a bit
filebutler_upload/filehandler.py
filebutler_upload/filehandler.py
import requests #import os #from ConfigParser import RawConfigParser #from text_table import TextTable class Filemanager: def __init__(self, url, username, password): self.headers = {'Accept': 'application/json'} self.username = username self.password = password self.url = url ...
Python
0.000008
@@ -13,95 +13,8 @@ sts%0A -#import os%0A#from ConfigParser import RawConfigParser%0A#from text_table import TextTable%0A %0A%0Acl @@ -809,36 +809,32 @@ = %7B%0A - 'username': self @@ -836,36 +836,32 @@ self.username,%0A - 'pas @@ -875,36 +875,32 @@ self.password,%0A - ...
31659d51c81390bebeddac44cd3618543dc90c51
Add support for timeout values
googlemaps/common.py
googlemaps/common.py
""" Common functionality for modules in the googlemaps package, such as performing HTTP requests. """ import base64 from datetime import datetime from datetime import timedelta import hashlib import hmac import requests import urllib _VERSION = "0.1" _USER_AGENT = "GoogleGeoApiClientPython/%s" % _VERSION class Cont...
Python
0.000001
@@ -518,16 +518,74 @@ ut=None, + connect_timeout=None, read_timeout=None,%0A retry_t @@ -763,25 +763,204 @@ am timeout: -T +Combined connect and read timeout for HTTP requests, in%0A seconds. Specify %22None%22 for no timeout.%0A :type timeout: int%0A%0A :param connect_time...
9faf6195f0b5418a991c51f820fa446649ba05c0
Clean up formatting. Allow overlap of sections' text.
generate_sections.py
generate_sections.py
import csv import sys class FormatLine: def __init__(self, text, is_start=False): self.text = text self.score = 0 self.is_start = is_start class NormalLine: def __init__(self, row): self.row = row class Character: def __init__(self, row): self.row = row ...
Python
0.000001
@@ -14,16 +14,26 @@ port sys +%0Aimport os %0A%0Aclass @@ -2228,25 +2228,25 @@ tLine(%22%7B0: %3C -2 +1 0%7D %7B1%7D%22.form @@ -2584,17 +2584,17 @@ 0: %3C -2 +1 0%7D %7B1: %3C 60%7D @@ -2593,9 +2593,9 @@ 1: %3C -6 +8 0%7D %7B @@ -3231,18 +3231,18 @@ _size = -7 5 +0 %0A whi @@ -3269,24 +3269,25 @@ te...
3fea731e62653dfc847e82b8185feb029d844fd8
Revert "minifiying doctype json's"
frappe/modules/export_file.py
frappe/modules/export_file.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, os, json import frappe.model from frappe.modules import scrub, get_module_path, lower_case_files_for, scrub_dt_dn def export_doc(doc): export_to_files([[doc.doct...
Python
0
@@ -1025,108 +1025,8 @@ ame%5D -%0A%09%09%09for fieldname in d.keys():%0A%09%09%09%09if d%5Bfieldname%5D == 0 or d%5Bfieldname%5D == %22%22:%0A%09%09%09%09%09del d%5Bfieldname%5D %0A%0A%09m
2f4e0d0b82a12f118cca24efa975d7fa5e09a06d
use splitlines() to get speech moving faster
software/bmbb_fish.py
software/bmbb_fish.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # rpi.gpio documentation at https://sourceforge.net/p/raspberry-gpio-python/wiki/ import RPi.GPIO as GPIO from time import sleep as sleep import logging import threading import sqlite3 # used to write to the tts database import re class BmBB: """ interface with the contr...
Python
0.000002
@@ -4322,16 +4322,93 @@ eToSay)%0A + for aline in phraseToSay.splitlines():%0A aline.strip()%0A @@ -4456,23 +4456,21 @@ Say, -phraseToSay%5D);%0A +aline%5D);%0A
f03ba99cd7c4db064b2ece3d226b30c8e9ca63bf
Add a test for scipy.integrate.newton_cotes. A more comprehensive set of tests would be better, but it's a start.
scipy/integrate/tests/test_quadrature.py
scipy/integrate/tests/test_quadrature.py
import numpy from numpy import cos, sin, pi from numpy.testing import * from scipy.integrate import quadrature, romberg, romb class TestQuadrature(TestCase): def quad(self, x, a, b, args): raise NotImplementedError def test_quadrature(self): # Typical function with two extra arguments: ...
Python
0.996962
@@ -120,16 +120,30 @@ rg, romb +, newton_cotes %0A%0Aclass @@ -1244,16 +1244,829 @@ mal=7)%0A%0A + def test_newton_cotes(self):%0A %22%22%22Test the first few degrees, for evenly spaced points.%22%22%22%0A n = 1%0A wts, errcoff = newton_cotes(n, 1)%0A assert_equal(wts, n*numpy.array(%...
79ae4fccf8bc9856a1b28afb50deabffc70bf432
Add --disable-default-logs option to crawl script
grab/script/crawl.py
grab/script/crawl.py
import logging import os from argparse import ArgumentParser from grab.util.config import build_spider_config, build_root_config from grab.util.module import load_spider_class from grab.tools.logs import default_logging from grab.tools.lock import assert_lock from grab.spider.save_result import save_result from grab.t...
Python
0.000001
@@ -1360,32 +1360,142 @@ default=False)%0A + parser.add_argument('--disable-default-logs', action='store_true',%0A default=False)%0A parser.add_a @@ -3039,26 +3039,226 @@ -*args, **kwargs):%0A +disable_default_logs=False,%0A *args, **kwargs):%0A if disable_default_logs:...
3aa198bc49b32db49abe5653ed82f1ede7081df7
make fix work for both versions of GeoSteiner
geonet/geosteiner.py
geonet/geosteiner.py
''' Wrapper for GeoSteiner program ''' from itertools import dropwhile, takewhile, ifilter import os from subprocess import Popen, PIPE from geonet.network import SteinerTree # TODO: check if GeoSteiner is available def geosteiner(pos): '''Call geosteiner to compute and return''' def parse_ps(output): ...
Python
0
@@ -417,61 +417,130 @@ -no_post = takewhile(lambda l:'Euclidean SMT' not in l +end_kwds = %5B'Euclidean SMT', '(Steiner Minimal'%5D%0A no_post = takewhile(lambda l: all(kw not in l for kw in end_kwds) , no
a9b2b6fe868ab564653f40e611ce6a788f396981
Fix wrong variable replacement
backend/globaleaks/tests/jobs/test_pgp_check_sched.py
backend/globaleaks/tests/jobs/test_pgp_check_sched.py
# -*- coding: utf-8 -*- from twisted.internet.defer import inlineCallbacks from globaleaks.tests import helpers from globaleaks.jobs import secure_file_delete_sched class TestPGPCheckSchedule(helpers.TestGLWithPopulatedDB): encryption_scenario = 'ONE_VALID_ONE_EXPIRED' @inlineCallbacks def test_pgp_chec...
Python
0.000019
@@ -139,26 +139,17 @@ ort -secure_file_delete +pgp_check _sch
6ef76159ab32e454241f7979a1cdf320c463dd9e
add config file option
planetstack/planetstack-backend.py
planetstack/planetstack-backend.py
#!/usr/bin/env python import os import argparse os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings") from observer.backend import Backend from planetstack.config import Config config = Config() # after http://www.erlenstar.demon.co.uk/unix/faq_2.html def daemon(): """Daemonize the current proc...
Python
0.000002
@@ -1162,16 +1162,358 @@ emon.')%0A + # smbaker: util/config.py parses sys.argv%5B%5D directly to get config file name; include the option here to avoid%0A # throwing unrecognized argument exceptions%0A parser.add_argument('-C', '--config', dest='config_file', action='store', default=%22/opt/planetstack/pls...
a5942402fdf8f8013dbe62636ea29582538e33c6
fix argument name
bin/trait_mapping/create_table_for_manual_curation.py
bin/trait_mapping/create_table_for_manual_curation.py
#!/usr/bin/env python3 import argparse from eva_cttv_pipeline.trait_mapping.ols import ( get_ontology_label_from_ols, is_current_and_in_efo, is_in_efo, ) def find_previous_mapping(trait_name, previous_mappings): if trait_name not in previous_mappings: return '' uri = previous_mappings[trait_name...
Python
0.005603
@@ -1436,32 +1436,14 @@ rgs. -final_table_for_curation +output , 'w
662608e6a183810072cb5e9dc7545145c866cf34
Add missing import
byceps/services/shop/order/action_registry_service.py
byceps/services/shop/order/action_registry_service.py
""" byceps.services.shop.order.action_registry_service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2017 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from ...seating.models.category import CategoryID from ...user_badge.models.badge import BadgeID from ..article.mod...
Python
0.000466
@@ -389,16 +389,46 @@ tState%0A%0A +from . import action_service%0A%0A %0Adef reg
5cdf89e64ab9dabf277a867a774a88f12e1ece5e
Fix broken exception `BadHeader`
src/pyload/core/network/http/exceptions.py
src/pyload/core/network/http/exceptions.py
# -*- coding: utf-8 -*- PROPRIETARY_RESPONSES = { 440: "Login Timeout - The client's session has expired and must log in again.", 449: "Retry With - The server cannot honour the request because the user has not provided the required information", 451: "Redirect - Unsupported Redirect Header", 509: "Ban...
Python
0.000001
@@ -1284,28 +1284,24 @@ %22):%0A -int_ code = int(c @@ -1327,45 +1327,8 @@ se = - responses.get(%0A int_code, PRO @@ -1350,20 +1350,16 @@ SES.get( -int_ code, %22u @@ -1382,18 +1382,8 @@ e%22)%0A - )%0A @@ -1446,16 +1446,16 @@ onse%7D%22)%0A + @@ -1470,12 +1470,8 @@ e...
05bd3a42ffb260daddc8051d79ec21f20a23bdde
Improve performance of report case pillow test
testapps/test_pillowtop/tests/test_report_case_pillow.py
testapps/test_pillowtop/tests/test_report_case_pillow.py
import uuid from django.test import TestCase, override_settings from corehq.util.es.elasticsearch import ConnectionError from corehq.apps.es import CaseES from corehq.apps.hqcase.management.commands.ptop_reindexer_v2 import reindex_and_clean from corehq.elastic import get_es_new from corehq.form_processor.tests.utils...
Python
0.001312
@@ -4,16 +4,48 @@ ort uuid +%0Afrom unittest.mock import patch %0A%0Afrom d @@ -94,186 +94,417 @@ ngs%0A -from corehq.util.es.elasticsearch import ConnectionError%0A%0Afrom corehq.apps.es import CaseES%0Afrom corehq.apps.hqcase.management.commands.ptop_reindexer_v2 import reindex_and_clean +%0Afrom pillowtop.es_util...
a23c6132792bd6aff420791cf4b78a955cc0dfad
add headless
inscrawler/browser.py
inscrawler/browser.py
import os from selenium import webdriver from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.chrome.options import Options from time import sleep class Browser: def __init__(self): dir_path = os.path.dirname(os.path.realpath(__f...
Python
0.999995
@@ -419,10 +419,8 @@ - # chr
8d9b5cf8f9e53f28f4a286c2851249757d88a52b
Set LOGIN_URL in settings.py
getaride/settings.py
getaride/settings.py
""" Django settings for getaride project. Generated by 'django-admin startproject' using Django 1.11.3. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import o...
Python
0.000001
@@ -2425,16 +2425,45 @@ .User'%0A%0A +LOGIN_URL = 'planner:login'%0A%0A LOGIN_RE
b44a9dfbf26e07b9db6a31119044b8347907a5a5
disable fid map
examples/fitsdiff2.py
examples/fitsdiff2.py
#! /usr/bin/env python # # This routine can diff images from its neighbors. For a series i=1,N # this can loop over i=2,N to produce N-1 difference images # # B_i = A_i - A_i-1 # from __future__ import print_function import glob import sys import shutil import os from astropy.io import fits import numpy as np i...
Python
0.000001
@@ -687,58 +687,8 @@ d1%0A%0A -fid = np.abs(d2) / np.max(np.abs(diff),std1/1.4)%0A %0A%0Apr @@ -785,16 +785,70 @@ e=True)%0A +#%0A#fid = np.abs(d2) / np.max(np.abs(diff),std1/1.4)%0A# fits.wri
f1ac9c7a41ae066f62f3a93773c08ec08f70b941
Add finally if running processes
coalib/processes/SectionExecutor.py
coalib/processes/SectionExecutor.py
import multiprocessing import queue import threading from coalib.collecting.Collectors import collect_files from coalib.collecting import Dependencies from coalib.output.printers.ConsolePrinter import ConsolePrinter from coalib.processes.BearRunner import BearRunner from coalib.processes.CONTROL_ELEMENT import CONTROL...
Python
0.000001
@@ -2708,24 +2708,41 @@ er.start()%0A%0A + try:%0A self @@ -2790,32 +2790,36 @@ + arg_dict%5B%22contro @@ -2850,32 +2850,36 @@ + + arg_dict%5B%22local_ @@ -2885,32 +2885,36 @@ _result_dict%22%5D,%0A + @@ -2979,32 +2979,36 @@ ...
737a320ff8adbe2a0619087125a0a731c5e2bca8
Bump to v1.1
bindings/python/setup.py
bindings/python/setup.py
import os import sys import shutil import setuptools from distutils import log from distutils.command.build_clib import build_clib VERSION_MAJOR = 1 VERSION_MINOR = 0 VERSION_VBOXBIN = "5-0-18-6667" VERSION = "{major:d}.{minor:d}".format( major = VERSION_MAJOR, minor = VERSION_MINOR, ) BINDING_DIRECTORY = o...
Python
0.000001
@@ -160,17 +160,17 @@ MINOR = -0 +1 %0AVERSION
2c2d2024abf0eaa34b25038d2eb4cd5d8aeb6323
remove defunct test
fsspec/tests/test_registry.py
fsspec/tests/test_registry.py
import sys from unittest.mock import create_autospec, patch import pytest from fsspec.registry import ( ReadOnlyError, _registry, get_filesystem_class, known_implementations, register_implementation, registry, ) from fsspec.spec import AbstractFileSystem try: from importlib.metadata impor...
Python
0.998747
@@ -765,536 +765,8 @@ e%0A%0A%0A -@pytest.mark.parametrize(%0A %22protocol,module,minversion,oldversion%22,%0A %5B(%22s3%22, %22s3fs%22, %220.3.0%22, %220.1.0%22), (%22gs%22, %22gcsfs%22, %220.3.0%22, %220.1.0%22)%5D,%0A)%0Adef test_minversion_s3fs(protocol, module, minversion, oldversion, monkeypatch):%0A _r...
e0663d81c6763ac3e4240acb0812af5b3ef5c7bb
Handle setting breakpoint on no file, as per #12
plugin/python/vdebug/breakpoint.py
plugin/python/vdebug/breakpoint.py
import base64 import vdebug.log class Store: def __init__(self): self.breakpoints = {} self.api = None def link_api(self,api): self.api = api num_bps = len(self.breakpoints) if num_bps > 0: vdebug.log.Log("Registering %i breakpoints with the debugger" % num...
Python
0
@@ -2976,32 +2976,53 @@ t_current_row()%0A + try:%0A file @@ -3038,32 +3038,150 @@ _current_file()%0A + except vdebug.util.FilePathError:%0A raise BreakpointError, 'No file, cannot set breakpoint'%0A retu
7a39c7a433e909b58ad0fdf8adaaa5c944e91e0e
Fix non-array samples in multinomial estimator.
src/python/cargo/statistics/multinomial.py
src/python/cargo/statistics/multinomial.py
""" @author: Bryan Silverthorn <bcs@cargo-cult.org> """ import numpy from cargo.log import get_logger from cargo.statistics.base import ( Estimator, Distribution, ) log = get_logger(__name__) def smooth_multinomial_mixture(mixture, epsilon = 1e-3): """ Apply a smoothing term to the m...
Python
0.000021
@@ -2932,33 +2932,61 @@ -from numpy import newaxis +# parameters%0A samples = numpy.asarray(samples) %0A%0A @@ -3062,16 +3062,94 @@ ape%5B0%5D)%0A + else:%0A weights = numpy.asarray(weights)%0A%0A # estimate %0A @@ -3192,15 +3192,12 @@ %5B:, +No ne -waxis %5D, 0
2319534cecf4ed475469a8ded468b348a21947ce
Fix shape of array returned from Arnoldi matrix exponential
src/WaveBlocksND/MatrixExponential.py
src/WaveBlocksND/MatrixExponential.py
"""The WaveBlocks Project This file contains several different algorithms to compute the matrix exponential. Currently we have an exponential based on Pade approximations and an Arnoldi iteration method. @author: R. Bourquin @copyright: Copyright (C) 2007 V. Gradinaru @copyright: Copyright (C) 2010, 2011, 2012, 2015 ...
Python
0.000008
@@ -2516,16 +2516,26 @@ %0A r = + norm(v) * dot(V%5B: @@ -2566,15 +2566,22 @@ rn r - * norm(v +.reshape(v.shape )%0A
304760823382e72efb8f98ab3b5a98147f98c0e8
Improve userlist liveness guarentees
geventirc/channel.py
geventirc/channel.py
import gevent from geventirc.message import Join, Part, Privmsg from geventirc.replycodes import replies from geventirc.userlist import UserList class Channel(object): """Object representing an IRC channel. This is the reccomended way to do operations like joins, or tracking user lists. A channel may be join()e...
Python
0
@@ -430,81 +430,228 @@ in.%0A -%0A%09Can be used in a with statement to join then part.%0A%09%22%22%22%0A%09joined = False +%09In particular, the user list can be considered up to date iff users_ready is set.%0A%0A%09Can be used in a with statement to join then part.%0A%09%22%22%22%0A%0A%09USERS_READY_TIMEOUT = 10%0A%...
4038357efb3494e796d884b8c5d48506d6f69fcb
Revise inline formset logic to only render formsets whose related managers are in view form's fields.
foundation/forms/views/object.py
foundation/forms/views/object.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import router from django.forms.models import _get_foreign_key from django.utils.encoding import force_text from django.views.generic import edit from django import forms from ...utils import get_deleted_objects from ...backend import vie...
Python
0
@@ -401,16 +401,63 @@ rmMixin%0A +from foundation.utils import flatten_fieldsets%0A %0A%0A__all_ @@ -2170,16 +2170,94 @@ # + we will only generate formsets for the fields specified for this view%0A fields @@ -2412,109 +2412,72 @@ -inline_fk_field = _get_foreign_key(%0A self.mode...
118756c54163d448026dacb531fbad859ece3458
add table as global var
sqlcell.py
sqlcell.py
import re import fileinput from os.path import expanduser from IPython.core.magic import (register_line_magic, register_cell_magic, register_line_cell_magic) import IPython from sqlalchemy import create_engine # from engine_config import driver, username, password, host, port, default_db...
Python
0.000004
@@ -2195,16 +2195,23 @@ port, db +, table %0A %0A
cda111aecdd650d1f08b75e2c92774526bf9e06d
Change Misc to Miscellaneous Utilities
bipy/util/misc.py
bipy/util/misc.py
#!/usr/bin/env python r""" Misc (:mod:`bipy.util.misc`) ============================ .. currentmodule:: bipy.util.misc This module provides miscellaneous useful utility classes and methods that do not fit in any specific module. Functions --------- .. autosummary:: :toctree: generated/ safe_md5 """ from __f...
Python
0
@@ -24,16 +24,35 @@ %22%22%22%0AMisc +ellaneous Utilities (:mod:%60
0a0d55a2a9aa07b0841b2a221e8b7bc9b844b976
update version numbers and project details
butter/__init__.py
butter/__init__.py
#!/usr/bin/env python """Butter: library to give python access to linux's more lower level features""" __author__ = "Da_Blitz" __version__ = "0.1" __email__ = "code@pocketnix.org" __license__ = "BSD (3 Clause)" __url__ = "http://code.pocketnix.org/" __testsuite__ = "tests.testall"
Python
0
@@ -142,9 +142,9 @@ %220. -1 +2 %22%0A__ @@ -246,38 +246,12 @@ org/ -%22%0A__testsuite__ = %22tests.testall +butter %22%0A
39d4f9c0df535c13c6f37eaaccaaeabb0b92b8e0
Bump version number
fabric_colors/_version.py
fabric_colors/_version.py
__version__ = "0.9.41"
Python
0.000002
@@ -17,7 +17,7 @@ .9.4 -1 +2 %22%0A
4e09200b83f986ce333f5b1143e13a4b2d7df2ce
determine site activity on process_view
pykeg/src/pykeg/web/middleware.py
pykeg/src/pykeg/web/middleware.py
# Copyright 2011 Mike Wakerly <opensource@hoho.com> # # This file is part of the Pykeg package of the Kegbot project. # For more information on Pykeg or Kegbot, see http://kegbot.org/ # # Pykeg is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
Python
0.00001
@@ -1676,23 +1676,20 @@ process_ -request +view (self, r @@ -1698,36 +1698,53 @@ uest -):%0A kbsite = None +, view_func, view_args, view_kwargs): %0A if hasa @@ -1739,16 +1739,20 @@ %0A if +not hasattr( @@ -1769,24 +1769,40 @@ kbsite'):%0A + return None%0A kbsite = @@ -1890,26 +1890,15 @@ ...
9346332cb9051ac753c3ee2cccd829d6bcf80b9e
support preflight requests
pyramid_swagger_spec/namespace.py
pyramid_swagger_spec/namespace.py
from collections import defaultdict from pyramid.path import DottedNameResolver import functools import inspect import venusian import zope.interface from zope.interface.declarations import implementer # copied from tomb_routes, modified ACCEPT_RENDERER_MAP = { 'json': 'application/json', 'string': 'text/plai...
Python
0
@@ -3436,24 +3436,198 @@ , **kwargs)%0A + request_method = kwargs.get(%22request_method%22, %22GET%22)%0A if request_method != %22OPTIONS%22:%0A config.add_view(target, *args, **dict(kwargs, request_method=%22OPTIONS%22))%0A config.c @@ -4983,272 +4983,8 @@ %7B%7D)) -%0A if request_me...
7b21270ca893e90790a0a60c8417df12052ea9a0
Add alternate MDP-ID aleph API if the first fails
falcom/api/reject_list.py
falcom/api/reject_list.py
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. from os import environ from urllib.request import urlopen from .uri import URI, APIQuerier from .marc import get_marc_data_from_xml from .wor...
Python
0.000005
@@ -1208,16 +1208,201 @@ xml%22))%0A%0A + if not self.marc:%0A self.marc = get_marc_data_from_xml(aleph_api.get(%0A id=%22mdp.%22 + barcode,%0A schema=%22marcxml%22))%0A%0A
fae13bf07e3b336f52911cb23291c6db029922cb
fix timing issues with new test
selfdrive/controls/tests/test_startup.py
selfdrive/controls/tests/test_startup.py
#!/usr/bin/env python3 import time import unittest from parameterized import parameterized from cereal import log, car import cereal.messaging as messaging from common.params import Params from selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp # pylint: disable=no-name-in-module,import-error from selfdrive...
Python
0.000001
@@ -1406,18 +1406,29 @@ ets%0A -sm +controls_sock = messa @@ -1436,20 +1436,18 @@ ing. -SubMaster(%5B' +sub_sock(%22 cont @@ -1455,18 +1455,17 @@ olsState -'%5D +%22 )%0A pm @@ -2082,17 +2082,17 @@ (0.0 -5 +1 )%0A sm.u @@ -2091,57 +2091,69 @@ -sm.update(0)%0A if sm.updated%5B%22control...