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
d951b11e9991c021e631299f0e22da8eb4c7d850
comment out post-checkout undo demonstration
main.py
main.py
# this is the main file that get called import os import sys import gitTA as git import colorama from colorama import Fore, Back # add color output to terminal: we want anything printed to be VERY visible to user colorama.init() # called so that windows colors work ''' modify this file! When git runs certain commands...
Python
0
@@ -1170,16 +1170,17 @@ kwargs)%0A +# bran @@ -1199,16 +1199,17 @@ ranch()%0A +# bran
1624504bd966eaf47698938e387a58dd14738a76
add warnings about deprecation of compiler specific template tags
static_precompiler/templatetags/compile_static.py
static_precompiler/templatetags/compile_static.py
import six from django.template import Library from django.templatetags.static import static from static_precompiler.settings import PREPEND_STATIC_URL, USE_CACHE, CACHE_TIMEOUT from static_precompiler.utils import compile_static, get_compiler_by_name, get_cache_key, get_hexdigest, get_cache from static_precompiler.te...
Python
0
@@ -3,16 +3,32 @@ port six +%0Aimport warnings %0A%0Afrom d @@ -1345,16 +1345,223 @@ urce)%0A%0A%0A +def _warn(old, new):%0A warnings.warn(%0A %22%7B%25%25 %25s %25%25%7D tag has been deprecated, use %7B%25%25 %25s %25%25%7D %22%0A %22from %60compile_static%60 template tag library instead.%22 %25 (o...
437643d0f0680470b52ce893555df5dac17bdca1
use selenium for loading js content
main.py
main.py
import urllib.request result=urllib.request.urlopen("https://www.expedia.de/Flights-Search?trip=roundtrip&leg1=from:Hamburg,%20Deutschland%20(HAM-Alle%20Flugh%C3%A4fen),to:Amman,%20Jordanien%20(AMM-Queen%20Alia%20Intl.),departure:08.03.2017TANYT&leg2=from:Amman,%20Jordanien%20(AMM-Queen%20Alia%20Intl.),to:Hamburg,%20D...
Python
0
@@ -4,53 +4,132 @@ ort -urllib.request%0A%0Aresult=urllib.request.urlopen +time %0Afrom bs4 import BeautifulSoup%0Afrom selenium import webdriver%0A%0A%0Abrowser = webdriver.Firefox()%0A%0AffResults = browser.get (%22ht @@ -146,18 +146,19 @@ expedia. -de +com /Flights @@ -197,35 +197,31 @@ :Hamburg,%2520 -Deutsc...
1550660e39ded9cbcaf0ad429f01f2803f3c5256
Add a register function prior to enacting reporting
main.py
main.py
#!/usr/bin/python import os import sys import json import time import sched import socket import psutil from lib import cpu, memory, disks, network, system, transport _cache = [] _cache_timer = 0 _cache_keeper = 0 def main(scheduler, config, sock, hostname, callers): global _cache glob...
Python
0
@@ -8,24 +8,49 @@ bin/python%0D%0A +from hashlib import md5%0D%0A import os%0D%0Ai @@ -252,16 +252,30 @@ er = 0%0D%0A +_version = 1.0 %0D%0A%0D%0Adef @@ -394,16 +394,37 @@ _keeper%0D +%0A global _version%0D %0A%0D%0A p @@ -879,15 +879,83 @@ ot() -%0D%0A %7D +,%0D%0A %22version%22: _version%0D%0A...
1cab65aba369263904607738cd69b2ad7d6a8e63
change web framework from wsgi to cgi
main.py
main.py
#!/usr/bin/env python # coding=utf-8 from datetime import date import time from webapp.web import Application, BaseHandler URLS = ( ("/", "Index"), ("/hello/(.*)", "Hello"), ) class Index(BaseHandler): def get(self): header = "Content-type:text/html\r\n\r\n" # self.write(header+"Welco...
Python
0.000016
24d4fee92c1c2ff4bac1fe09d9b436748234a48c
Add argument for execution of defective server.
main.py
main.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 """ Main script. Executes the XML Server implementation with an HTTP connection and default parameters. """ import sys import argparse from server import xml_server from connection import http_connection parser = argparse.ArgumentParser() parser.add...
Python
0
@@ -227,16 +227,35 @@ l_server +, defective_servers %0Afrom co @@ -529,16 +529,73 @@ a file%22) +%0Aparser.add_argument('--randomloss', action='store_true') %0A%0Aif __n @@ -646,16 +646,126 @@ _args()%0A + if args.randomloss:%0A server = defective_servers.RandomLossXMLServer(args.sensordata)%0A else:%...
52c2205804d8dc38447bca1ccbf5599e00cd1d7b
Rename user_id config key to admin_user_id
main.py
main.py
#!/usr/bin/env python3 import requests CONFIG_DIR = "config" class Bot: def __init__(self): self.config = Config(CONFIG_DIR) self.api = TelegramBotApi(self.config.get_auth_token()) def run(self): self.api.send_message(self.config.get_user_id(), "test") class TelegramBotApi: de...
Python
0.005562
@@ -260,24 +260,30 @@ .config.get_ +admin_ user_id(), %22 @@ -841,16 +841,22 @@ def get_ +admin_ user_id( @@ -902,16 +902,22 @@ _value(%22 +admin_ user_id%22
2ffb390ae3fa31a2240d10abd4028c48602e852b
Add docstrings for main module
main.py
main.py
from random import shuffle from res import types from src import ai from src import coordinate from src import historynode from src import interface from settings import (DISPLAYEVALUATION, SEARCHPLY, STANDARD, USERPLAYSFOX) def aPlayerHasWon(game): ...
Python
0
@@ -308,24 +308,80 @@ sWon(game):%0A + %22%22%22 Check game state to see if a player has won %22%22%22%0A if game. @@ -385,32 +385,32 @@ me.geeseWinP():%0A - print(%22G @@ -563,16 +563,67 @@ e, ai):%0A + %22%22%22 Check game state to see if it is drawn %22%22%22%0A if a @@ -781,24 +781,73 @@...
8cbe375b478764f05e67b3d5600ca51bbd5b5c48
enable 'inline_defnode_calls' optimisation for benchmarks (even though they don't benefit currently)
Demos/benchmarks/setup.py
Demos/benchmarks/setup.py
from distutils.core import setup from Cython.Build import cythonize setup( name = 'benchmarks', ext_modules = cythonize("*.py", language_level=3, annotate=True), )
Python
0
@@ -62,16 +62,76 @@ honize%0A%0A +directives = %7B%0A 'optimize.inline_defnode_calls': True%0A%7D%0A%0A setup(%0A @@ -217,13 +217,71 @@ ate=True +,%0A compiler_directives=directives ),%0A)%0A
0389759b9b300c5a0cc807e9d6d154e757abecad
make sentry optional
main.py
main.py
import logging from time import mktime import feedparser import sys import yaml from raven import Client from wallabag_api.wallabag import Wallabag import github_stars import golem_top logger = logging.getLogger() logger.handlers = [] formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') ch = l...
Python
0.000001
@@ -977,16 +977,47 @@ xit(1)%0A%0A +if %22sentry_url%22 in config:%0A client = @@ -1025,16 +1025,20 @@ Client(%0A + dsn= @@ -1055,24 +1055,28 @@ ntry_url%22%5D,%0A + processo @@ -1088,16 +1088,20 @@ + 'raven.p @@ -1143,18 +1143,26 @@ r',%0A -)%0A + )%0A )%0A%0Atoken...
25d67637fafb04bae67033a4deef4bc71fd91ef2
Fix elision of needed path joins.
main.py
main.py
from markdown import Markdown import sys import codecs import os import errno def ensure_output_exists(dir): if not os.path.isdir(dir): try: print("mkdir", dir) os.makedirs(dir) except OSError as e: raise SnabbptException("Unable to create output directory") from...
Python
0
@@ -1745,21 +1745,41 @@ derFile( +os.path.join(path, file) +) %0A%0A de @@ -2096,16 +2096,35 @@ les( +os.path.join(path, file)))) %0A @@ -2119,16 +2119,17 @@ file)))) +) %0A
b110bbd335b87f806e73c4dbace098acfdfc7c6a
move CLIENT_SECRETS variable outside of decorator
main.py
main.py
from flask import Flask, render_template, flash, Markup, json #import urllib #import webapp2 import os from apiclient.discovery import build #from google.appengine.ext import ext import httplib2 import sys import itertools import logging import logging.config import time import MySQLdb from sheepdog import * # fro...
Python
0.000001
@@ -921,16 +921,61 @@ SdJg'%5D%0A%0A +CLIENT_SECRETS_FILE = %22client_secrets.json%22%0A%0A @app.rou @@ -1024,53 +1024,8 @@ %5B%5D%0A -%09CLIENT_SECRETS_FILE = %22client_secrets.json%22%0A
8f1668e8b3e93317f10f2bf6667ec7d9faf3e134
add prefix, globalize
main.py
main.py
#!/usr/bin/python import re import json import boto import requests import speedparser import yaml import calendar import time import PyRSS2Gen import StringIO dthandler = lambda obj: calendar.timegm(obj) if isinstance(obj, time.struct_time) else json.JSONEncoder().default(obj) def do_feed(config): req = requests....
Python
0.017851
@@ -155,16 +155,87 @@ ringIO%0A%0A +S3_OUTPUT_BUCKET = 'dyn.tedder.me'%0AS3_OUTPUT_PREFIX = '/rss_filter/'%0A%0A# dthandle @@ -3961,31 +3961,32 @@ _bucket( -'dyn.tedder.me' +S3_OUTPUT_BUCKET )%0A for @@ -4148,16 +4148,35 @@ dest = + S3_OUTPUT_PREFIX + feedcfg
18d59a1d23cc9021fa388028ab723822e031dc07
Add health check
main.py
main.py
# Copyright 2015, Google, Inc. # 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
@@ -714,16 +714,89 @@ port key +%0A %0A%0A@app.route('/_ah/health')%0Adef health_check():%0A return 'ok', 200 %0A%0A@app.r
788f11632ce085d82be6d90665b9b277f7a60148
Refactor Task function to properly switch if it is a TaskTemplate, and if there is a CloudHarenssTask use CloudHarnessWorkflow.
gbdxtools/interface.py
gbdxtools/interface.py
""" Main Interface to GBDX API. Contact: kostas.stamatiou@digitalglobe.com """ from __future__ import absolute_import from builtins import object from future import standard_library import json import os import logging from gbdx_auth import gbdx_auth from gbdxtools.s3 import S3 from gbdxtools.ordering import Orderi...
Python
0
@@ -488,21 +488,16 @@ dharness -_task import @@ -518,25 +518,72 @@ sk, -TaskCreationError +CloudHarnessWorkflow%0Afrom gbdx_task_template import TaskTemplate %0A%0A%0Ac @@ -2456,12 +2456,8 @@ ness -_obj =Non @@ -2470,24 +2470,25 @@ wargs):%0A +%0A if __tas @@ -2479,16 +2479,24 @@ +# Check...
6ddc63dcb1005ccf6d09f2577faf99566bafced7
fix Log.add_group() use in live_plot.py example
examples/miscellaneous/live_plot.py
examples/miscellaneous/live_plot.py
from __future__ import print_function from __future__ import absolute_import import os import sys sys.path.append( '.' ) import numpy as nm from sfepy.base.base import output, pause from sfepy.base.log import Log def main(): cwd = os.path.split(os.path.join(os.getcwd(), __file__))[0] log = Log((['sin(x)', '...
Python
0.000001
@@ -1162,16 +1162,23 @@ 'x%5E2'%5D, +yscale= 'linear' @@ -1183,16 +1183,23 @@ r', +xlabel= 'new x', 'sq @@ -1198,19 +1198,10 @@ x', - 'square', %0A + @@ -1225,16 +1225,32 @@ +ylabel='square', formats
43a087c69eedd26d3bab699fca08b5a01a06a6a4
Add test to check if InvalidFrequencyException is thrown
skrf/tests/test_frequency.py
skrf/tests/test_frequency.py
import unittest import os import numpy as npy import skrf as rf class FrequencyTestCase(unittest.TestCase): ''' ''' def setUp(self): ''' ''' self.test_dir = os.path.dirname(os.path.abspath(__file__))+'/' def test_create_linear_sweep(self): freq = rf.Frequency(1,10,10...
Python
0
@@ -1,12 +1,65 @@ +from skrf.frequency import InvalidFrequencyException%0A import unitt @@ -2126,16 +2126,155 @@ all())%0A%0A + def test_frequency_check(self):%0A with self.assertRaises(InvalidFrequencyException):%0A a = rf.Frequency.from_f(%5B2,1%5D)%0A%0A suite =
e7a01079e57acfa4486fc6cf786a1012da436d0f
Revise snapshot parsing to not expect multiple samples for contrast
solar_snapshot_name_parse.py
solar_snapshot_name_parse.py
#!/usr/bin/env python3 ################################################################################ # Description: # * Parses names of files in directory containing snapshots of solar # suitcase displays, and formats them for pasting into timestamp column of # solar energy log spreadsheet # * Requi...
Python
0
@@ -3105,17 +3105,8 @@ %7B2%7D) -_c(%5Cd%7B2%7D) %5C.jp @@ -3350,107 +3350,9 @@ (3)%0A - m_contrast = m.group(4)%0A%0A if (m_contrast == %2200%22): # Ignore duplicates%0A +%0A @@ -3410,20 +3410,16 @@ inute))%0A -
653376cf10edb42e6d5c429e61bc9ef23eb51234
fix test for GenomicFilter
solvebio/test/test_filter.py
solvebio/test/test_filter.py
import unittest import solvebio from solvebio import Filter, GenomicFilter class FilterTest(unittest.TestCase): def test_filter_basic(self): f = Filter() self.assertEqual(repr(f), '<Filter []>', 'empty filter') self.assertEqual(repr(~f), '<Filter []>', '"not" of empty filter') #...
Python
0
@@ -2535,17 +2535,17 @@ %5B100, 20 -1 +0 %5D), ('ge @@ -2584,17 +2584,17 @@ %5B100, 20 -1 +0 %5D)%5D%7D, ('
a4ea5f9a6b6de93188a590b918aa122e4fbe437b
Fix jsbox formset usage.
go/apps/jsbox/forms.py
go/apps/jsbox/forms.py
from django import forms from django.forms.formsets import BaseFormSet, DEFAULT_MAX_NUM from go.base.widgets import CodeField, SourceUrlField SOURCE_URL_HELP_TEXT = ( 'HTTP Basic Authentication is supported. If using GitHub ' 'please use ' '<a href="http://developer.github.com/v3/#authentication">' '...
Python
0
@@ -65,31 +65,31 @@ ormSet, -DEFAULT_MAX_NUM +formset_factory %0A%0Afrom g @@ -1386,32 +1386,36 @@ %7D%0A%0A%0Aclass +Base JsboxAppConfigFo @@ -1437,150 +1437,8 @@ et): -%0A form = JsboxAppConfigForm%0A absolute_max = DEFAULT_MAX_NUM%0A extra = 1%0A can_order = False%0A can_delete = True%0A ...
884e17eb92e35ab5a9f4d6bc94f11f49977711a3
Use render() so that we can pass in the request context and thus link to static files correctly (reviewed by @smn).
go/apps/jsbox/views.py
go/apps/jsbox/views.py
import requests from urlparse import urlparse, urlunparse from django.http import HttpResponse from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from django.views.decorators.csrf import csrf_exempt from go.conversation.base import ConversationViews from go.apps....
Python
0
@@ -182,28 +182,16 @@ t render -_to_response %0Afrom dj @@ -1883,21 +1883,18 @@ nder -_to_response( +(request, %22jsb
f10e01a180cca2185862c1f6cf926c2a197536ed
lower the name to be stripped
gozerlib/utils/name.py
gozerlib/utils/name.py
# gozerlib/utils/name.py # # """ name related helper functions. """ ## basic imports import string import os ## defines allowednamechars = string.ascii_letters + string.digits + '!.@-+#' ## stripname function def stripname(name, allowed=""): """ strip all not allowed chars from name. """ res = "" for...
Python
0.999995
@@ -289,24 +289,48 @@ m name. %22%22%22%0A + name = name.lower()%0A res = %22%22
cbfd5f70beffd978fd3ea22ec1146eaa3eb6c104
fix timezone issue
noaa.py
noaa.py
import urllib2 import xml.etree.ElementTree as ET from scipy.interpolate import interp1d import datetime import time def forecast(place, forecast = True): lat,lon = place url = """http://graphical.weather.gov/xml/SOAP_server/ndfdXMLclient.php?whichClient=NDFDgen&lat=%s&lon=%s&Unit=e&temp=temp&wspd=wspd&sky=sky...
Python
0.000015
@@ -1404,16 +1404,48 @@ oat(d):%0A + %22%22%22returns utc timestamp%22%22%22%0A if t @@ -1503,50 +1503,124 @@ -d = datetime.datetime.strptime(d%5B0:19%5D,fmt +lt= d%5B0:19%5D%0A tz = eval(d%5B19:22%5D)%0A d = datetime.datetime.strptime(lt,fmt) - datetime.timedelta(hours=tz )%0A @@ -1632,...
debeefabeb64766b380af42458433a05c2a2f04a
Add F1 score to metrics.
non_semantic_speech_benchmark/eval_embedding/metrics.py
non_semantic_speech_benchmark/eval_embedding/metrics.py
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
Python
0.999995
@@ -724,16 +724,29 @@ curacy.%0A +5) F1 score.%0A %22%22%22%0A%0Aimp @@ -803,16 +803,22 @@ Optional +, Text %0A%0Aimport @@ -2703,16 +2703,54 @@ weight = + None,%0A multi_class = None):%0A @@ -2837,16 +2837,41 @@ e_weight +, multi_class=multi_class )%0A%0A%0Adef @@ -3673,8 +3673,169 @@ ction...
8d2167bc3bc37f68e225ddcd86bc4114d90be87e
Update version number
local_packages.py
local_packages.py
import sublime from .event_handler import EventHandler from .settings import Settings package_control_installed = False LOCAL_PACKAGES_VERSION = "0.1.1" evaluating = False retry_times = 3 def plugin_loaded(): Settings.reset() Settings.startup() EventHandler().register_handler( evaluate_install, ...
Python
0.000002
@@ -144,17 +144,17 @@ = %220.1. -1 +2 %22%0Aevalua
2e3d200ee0511819f3befb146a4ebed22fef80ab
reorder admin menu
local_settings.py
local_settings.py
import os from django.utils.translation import ugettext_lazy as _ DEBUG = True if os.environ.get('DEBUG', 'True') else False # Make these unique, and don't share it with anybody. SECRET_KEY = "j1qa@u$5ktqr^0_kwh@-j@*-80t$)ht!4-=ybz1xc%@3+r(r&tzefoih" NEVERCACHE_KEY = "m)u^%r@uh#r3wu0&$=#$1ogx)uy4hv93^2lt%c3@xi=^gifoj...
Python
0.000001
@@ -2690,16 +2690,46 @@ .Brief', + 'organization-magazine.Topic' )),%0A @@ -2806,24 +2806,18 @@ eam. -OrganizationType +Department ', ' @@ -2856,34 +2856,30 @@ zation-team. -Department +Person ', 'organiza @@ -2880,38 +2880,40 @@ ganization-team. -Person +Activity ', 'organization @@ -2918,24 +2918,32 @@ o...
b67642ce07631ffe621dc94207524c8049141987
calculate vcirc
galpy/potential_src/plotRotcurve.py
galpy/potential_src/plotRotcurve.py
import numpy as nu import galpy.util.bovy_plot as plot def plotRotcurve(Pot,*args,**kwargs): """ NAME: plotRotcurve PURPOSE: plot the rotation curve for this potential (in the z=0 plane for non-spherical potentials) INPUT: Pot - Potential or list of Potential instances ...
Python
0.998805
@@ -2994,8 +2994,405 @@ tcurve%0A%0A +def vcirc(Pot,R):%0A %22%22%22%0A%0A NAME:%0A%0A vcirc%0A%0A PURPOSE:%0A%0A calculate the circular velocity at R in potential Pot%0A%0A INPUT:%0A%0A Pot - Potential instance or list of such instances%0A%0A R - Galactocentric radius%0A%0A OUTP...
d04143f1e3defd27f9c9a9dbf90d3b6c5af44aec
Add exception call to AsyncResult after task failing
huey/contrib/mini.py
huey/contrib/mini.py
# # Minimal huey-like API using gevent and running within the parent process. # import datetime import heapq import logging import time from functools import wraps import gevent from gevent.event import AsyncResult from gevent.event import Event from gevent.pool import Pool from huey.api import crontab logger = log...
Python
0.000004
@@ -2936,32 +2936,76 @@ %25 fn.__name__)%0A + async_result.set_exception(exc)%0A rais
4ca8889396595f9da99becbb88fb7e38ab0ed560
Raise exception if connection not succeed and customize error message
hunter/reviewsapi.py
hunter/reviewsapi.py
import requests import os from .endpoints import * class UnauthorizedToken(Exception): pass class ReviewsAPI: def __init__(self): token = os.environ.get('UDACITY_AUTH_TOKEN') self.headers = {'Authorization': token, 'Content-Length': '0'} def certifications(self): try: ...
Python
0
@@ -429,16 +429,74 @@ .json()%0A + %0A raw_response.raise_for_status()%0A%0A @@ -716,16 +716,57 @@ zedToken +('Maybe it%5C's time to change you token!') %0A%0A de
2ba350d71e8a24471ea80fafa75803eb439c4ea6
add require(internet)
i3pystatus/parcel.py
i3pystatus/parcel.py
from urllib.request import urlopen import webbrowser import lxml.html from lxml.cssselect import CSSSelector from i3pystatus import IntervalModule class TrackerAPI: def __init__(self, idcode): pass def status(self): return {} class DHL(TrackerAPI): URL = "http://nolp.dhl.de/nextt-on...
Python
0.000005
@@ -143,16 +143,67 @@ lModule%0A +from i3pystatus.core.util import internet, require%0A %0A%0Aclass @@ -2789,24 +2789,47 @@ progress%7D%22%0A%0A + @require(internet)%0A def run(
d12cfe8125f9f20023493e4be4cce673cd6c207d
Update package in database
iatidq/dqpackages.py
iatidq/dqpackages.py
# IATI Data Quality, tools for Data QA on IATI-formatted publications # by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith # # Copyright (C) 2013 Publish What You Fund # # This programme is free software; you may redistribute and/or modify # it under the terms of the GNU Affero General Public License v3...
Python
0
@@ -858,32 +858,680 @@ return False%0A%0A +def updatePackage(data):%0A checkP = models.Package.query.filter_by(%0A id=data%5B'package_id'%5D).first()%0A checkOK = models.Package.query.filter_by(package_name=data%5B'package_name'%5D).first()%0A if checkP:%0A if (checkOK and checkOK.id!=chec...
792e46bcd01d2718215a3cb324b8deca5e4e1a7e
bump 1.3.10 release (#160)
icontrol/__init__.py
icontrol/__init__.py
__version__ = "1.3.9"
Python
0
@@ -16,7 +16,8 @@ 1.3. -9 +10 %22%0A
5dde537bec1a4d4ddd89999b0a15d9a90fa2e41d
add NOARP attribute
ifparser/ifconfig.py
ifparser/ifconfig.py
from __future__ import unicode_literals, print_function from .re_scan import ScanEnd, Scanner class Interface(object): _attrs = frozenset([ 'interface', 'itype', 'mtu', 'ip', 'bcast', 'mask', 'hwaddr', 'txbytes', 'rxbytes', 'rxpkts', 'txpkts' ]) _flags = frozenset( ['BROADCAST', 'M...
Python
0.000001
@@ -373,16 +373,25 @@ PROMISC' +, 'NOARP' %5D)%0A%0A
627d5a0a7f8f8886b362ececa5b4bb8029ad7e34
add client and params arguments
library/module_utils/network/f5/common.py
library/module_utils/network/f5/common.py
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type from ansible.module_utils._text import to_text from ansible.module_utils.bas...
Python
0.000001
@@ -4752,35 +4752,39 @@ nit__(self, -params=None +*args, **kwargs ):%0A s @@ -4819,24 +4819,24 @@ mbda: None)%0A - self @@ -4863,16 +4863,109 @@ '%5D = %5B%5D%0A + self.client = kwargs.pop('client', None)%0A params = kwargs.pop('params', None)%0A
3ed9e04b0b3db8c75a030369da56251d258d92db
Refactor lddb_json_shape.py to handle e.g. framed data
librisxl-tools/scripts/lddb_json_shape.py
librisxl-tools/scripts/lddb_json_shape.py
import json MAX_STATS = 512 HARD_MAX_STATS = 8192 STATS_FOR_ALL = { # from auth 008 "marc:subdivision", "marc:romanization", "marc:languageOfCatalog", "marc:kindOfRecord", "descriptionConventions", "marc:subjectHeading", "marc:typeOfSeries", "mar...
Python
0
@@ -738,16 +738,440 @@ t%22,%0A%7D%0A%0A%0A +def reshape(data):%0A if '@graph' in data:%0A graph = data%5B'@graph'%5D%0A thing =graph%5B1%5D%0A thing%5B'meta'%5D = graph%5B0%5D%0A%0A if len(graph) %3E 2 and 'instanceOf' in thing:%0A work = graph%5B2%5D%0A assert th...
a557e46e64fcd1992988fee4cd7a4cfa2da2eb61
add state deregistering
xoinvader/application/__init__.py
xoinvader/application/__init__.py
"""Base class for game application.""" from tornado import ioloop from xoinvader.constants import DEFAULT_FPS, DRIVER_NCURSES, DRIVER_SDL from xoinvader.common import Settings _CURRENT_APPLICATION = None """Current application instance.""" class ApplicationNotInitializedError(Exception): """Raise when try to ...
Python
0
@@ -3787,24 +3787,207 @@ postinit()%0A%0A + def deregister_state(self, name):%0A %22%22%22Remove existing state.%0A%0A :param str name: name of state%0A %22%22%22%0A%0A state = self._states.pop(name)%0A del state%0A%0A @propert
9d20717b39154252109153a6c5936922d28c6511
mark unicode context values as safe
mailviews/utils.py
mailviews/utils.py
import textwrap from collections import namedtuple from django.utils.safestring import mark_safe Docstring = namedtuple('Docstring', ('summary', 'body')) def split_docstring(value): """ Splits the docstring of the given value into it's summary and body. :returns: a 2-tuple of the format ``(summary, bo...
Python
0.999996
@@ -1000,13 +1000,24 @@ %5D) i -s str +n %5Bstr, unicode%5D :%0A
8aa9f5c86a507b238620792686afe30303536bc1
Change benchmark score output to (?) for likely bogus data.
benchmark/scripts/compare_perf_tests.py
benchmark/scripts/compare_perf_tests.py
#!/usr/bin/python # -*- coding: utf-8 -*- # ===--- compare_perf_tests.py --------------------------------------------===// # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Librar...
Python
0.000003
@@ -4053,33 +4053,33 @@ print %22( -! +? )%22,%0A else:%0A @@ -4133,17 +4133,17 @@ print %22( -! +? )%22,%0A
bdca4889442e7d84f8c4e68ecdbee676d46ff264
Fix data provider example file.
examples/test_with_data_provider.py
examples/test_with_data_provider.py
from pytf.dataprovider import DataProvider try: from unittest.mock import call except ImportError: from mock import call @DataProvider([call(max=5), call(max=10), call(max=15)]) class TestCase(object): def __init__(self, max): self.max = max @DataProvider([call(n=3), call(n=7), call(n=12), c...
Python
0
@@ -39,90 +39,9 @@ ider -%0A%0Atry:%0A from unittest.mock import call%0Aexcept ImportError:%0A from mock import +, cal @@ -54,25 +54,30 @@ ataProvider( -%5B +max_5= call(max=5), @@ -77,16 +77,23 @@ max=5), +max_10= call(max @@ -98,16 +98,23 @@ ax=10), +max_15= call(max @@ -117,17 +117,16 @@ (max=15) -...
dafb1fb624e4d816a3c8c504da15469365443473
test assertion fixed
cloudify_cli/tests/test_utils.py
cloudify_cli/tests/test_utils.py
######## # Copyright (c) 2014 GigaSpaces Technologies Ltd. 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...
Python
0.000002
@@ -6682,11 +6682,12 @@ %7B1%7D -can +must be
1b893f2283ee69c6da64c1cfe6f11f932155b5e8
Remove legacy PRF test due to memory usage
photutils/psf/tests/test_sandbox.py
photutils/psf/tests/test_sandbox.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the sandbox module. """ from astropy.convolution.utils import discretize_model from astropy.modeling.models import Gaussian2D from astropy.table import Table import numpy as np from numpy.testing import assert_allclose import pytest from .....
Python
0
@@ -294,22 +294,8 @@ lose -%0Aimport pytest %0A%0Afr @@ -3468,429 +3468,4 @@ -8)%0A -%0A%0Adef test_create_prf_excessive_subsampling():%0A %22%22%22%0A Check if a helpful error is raised if the subsampling parameter is%0A too high.%0A %22%22%22%0A%0A with pytest.raises(ValueError) as exc:%0A Di...
97e2e80b43ba3639e5af9deb6485c28da1a5e7af
change path
make_submission.py
make_submission.py
""" Ensemble by columnwise weighted sum. The weights are determined by scipy.optimize.minimize using validation set predictions. LB Private: 0.40076 LB Public: 0.39773 """ import numpy as np import pandas as pd import sklearn.preprocessing as pp path = '~/' # Neural Networks pred = [np.load(path + 'pred_TRI_kmax_' ...
Python
0.000001
@@ -254,9 +254,9 @@ = ' -~ +. /'%0A%0A
4cc5e7eb48dfdb167359dbeb541a2dbf25c93865
Add missing exchange rates
pipe2py/modules/pipeexchangerate.py
pipe2py/modules/pipeexchangerate.py
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ pipe2py.modules.pipeexchangerate ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import requests from itertools import starmap from twisted.internet.defer import inlineCallbacks, returnValue from twisted.internet.threads import deferToThread from . import ( get_...
Python
0.999141
@@ -778,16 +778,96 @@ .6810%7D,%0A + %7B'name': 'USD/PLN', 'price': 3.76%7D,%0A %7B'name': 'USD/SGD', 'price': 1.34%7D,%0A %5D%0A%0AEXCHA
542ddc0d0bd96c8ff8635f649344f468d7d497d0
bump version to 0.2.3
mallory/version.py
mallory/version.py
Version = "0.2.2"
Python
0.000001
@@ -8,11 +8,11 @@ = %220.2. -2 +3 %22%0A
b4d0c51c0034984026ff9008d826579cdfeaeaa6
comment on how to simplify data retrieval
importer/importer.py
importer/importer.py
from Monument import * from Uploader import * from Logger import * from os import path import argparse import pymysql from importer_utils import * SHORT = 10 MAPPING_DIR = "mappings" MONUMENTS_ALL = "monuments_all" class Mapping(object): """ For a table to be processed, it requires a basic mapping file, ...
Python
0.000001
@@ -1521,16 +1521,453 @@ =%22id%22):%0A + %22%22%22%0A you know what. MONUMENTS_ALL IS NOT EVEN NECESSARY%0A IT WILL SOLVE THIS WHOLE JOINING PROBLEM IF YOU GET RID OF IT%0A THERE IS LITERALLY NOTHING UNIQUE IN IT%0A SERIOUSLY%0A WHY%0A bUT: parent class Monument() relies on consistent attributes ...
3a1471e965798dcf291c89f528c40eb047aa915c
Increase heapsize glm covtype20x pytest
py/testdir_single_jvm/test_GLM2_covtype20x_1.py
py/testdir_single_jvm/test_GLM2_covtype20x_1.py
import unittest, time, sys, random sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_glm, h2o_hosts, h2o_exec as h2e import h2o_browse as h2b, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): gl...
Python
0.000001
@@ -442,17 +442,17 @@ eap_GB=1 -2 +4 )%0A
ff9444ea838bb7ed3efae125d343cee2cec994a9
Improve the level of comments in mysite/base/depends.py
mysite/base/depends.py
mysite/base/depends.py
import os try: import lxml import lxml.etree import lxml.html except: class nothing(object): pass lxml = nothing() lxml.etree = None lxml.html = None import logging if lxml.html is None: logging.warning("Some parts of the OpenHatch site may fail because the lxml" ...
Python
0.000015
@@ -1,14 +1,1279 @@ -import os%0A +# -*- coding: utf-8 -*-%0A%0A# This file is part of OpenHatch.%0A# Copyright (C) 2011 Asheesh Laroia%0A#%0A# This program is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as published by%0A# the Free Software Found...
bf8b29e7d05a7b476198109f1dccfd42da38f73b
Update pack.py: copy directory to destination instead of compressing
pack.py
pack.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ' Generate static webpage files ' import os import sys usage_prompt = '''Usage: python3 pack.py python3 pack.py -H <hostname> python3 pack.py { ? | -h | --help }''' protocal = "http" hostname = 'localhost' filename_host = os.path.join('scripts', 'host.js') dir_site = ...
Python
0
@@ -96,16 +96,30 @@ port sys +%0Aimport shutil %0A%0Ausage_ @@ -131,18 +131,16 @@ t = -'' 'Usage: -%0A + pyth @@ -154,76 +154,43 @@ k.py -%0Apython3 pack.py -H %3Chostname%3E%0Apython3 pack.py %7B ? %7C -h %7C --help %7D'' + %3Cdestination_path%3E %5B-H %3Chostname%3E%5D '%0A%0Ap @@ -222,32 +222,19 @@ = ' -l...
aada38225b0b09e9b8f9752e45ec5a4b1b01dd60
Handle index missing in anon import script
portality/scripts/anon_import.py
portality/scripts/anon_import.py
""" Clear out the index and retrieve new anonymised data, according to a configuration file Configure the target index in your *.cfg override file For now, this import script requires the same index pattern (prefix, 'types', index-per-type setting) as the exporter. """ import esprit, json, gzip, shutil from portality...
Python
0
@@ -298,16 +298,31 @@ , shutil +, elasticsearch %0Afrom po @@ -1677,16 +1677,33 @@ eys()):%0A + try:%0A @@ -1798,16 +1798,20 @@ + es_conne @@ -1884,16 +1884,88 @@ rt_type) +%0A except elasticsearch.exceptions.NotFoundError:%0A pass %0A%0A #
41adb0952aaffa88d1e42634cabb2f252b254472
Add stub for fasttext cross-validation
cocoscore/ml/fasttext_helpers.py
cocoscore/ml/fasttext_helpers.py
from ..tools.file_tools import get_file_handle from gensim import utils import gzip import numpy as np import os def get_uniform(low, high, random_seed): random_state = np.random.RandomState(random_seed) return lambda: float('%.3g' % random_state.uniform(low, high)) def get_uniform_int(low, high, random_see...
Python
0
@@ -5217,24 +5217,54 @@ dictions)%0A%0A%0A +def fasttext_cv():%0A pass%0A%0A%0A def load_fas
0db54aacbb1607e2d1d505bc57864dd421d90529
fix indentation
adhocracy/model/userbadges.py
adhocracy/model/userbadges.py
from datetime import datetime import logging from sqlalchemy import Table, Column, Integer, ForeignKey, DateTime, Unicode from adhocracy.model import meta log = logging.getLogger(__name__) badge_table = Table( 'badge', meta.data, Column('id', Integer, primary_key=True), Column('create_time', DateTime, ...
Python
0.000358
@@ -543,16 +543,21 @@ = Table( +%0A 'user_ba
3027c1ece280bc665f03781203d6b37b1c1bd82c
fix parsing of HTML entities with HTMLParser
weboob/tools/parser.py
weboob/tools/parser.py
# -*- coding: utf-8 -*- """ Copyright(C) 2010 Romain Bignon 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, version 3 of the License. This program is distributed in the hope that it will be useful...
Python
0.000001
@@ -1444,16 +1444,42 @@ MLParser +%0A import htmlentitydefs %0A%0A cl @@ -2033,16 +2033,224 @@ d(tag)%0A%0A + def handle_charref(self, name):%0A self._target.data(unichr(int(name)))%0A%0A def handle_entityref(self, name):%0A self._target.data(unichr(htmlentitydefs.name2codep...
bc2e7d77eb4aaa6d0063951a98de78c462f261ae
Use timezone-aware datetime object
confirmation/models.py
confirmation/models.py
# -*- coding: utf-8 -*- # Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com> __revision__ = '$Id: models.py 28 2009-10-22 15:03:02Z jarek.zgoda $' import os import re import datetime from hashlib import sha1 from django.db import models from django.core.urlresolvers import reverse from django.core.mail import...
Python
0.000001
@@ -173,24 +173,8 @@ re%0A -import datetime%0A from @@ -592,16 +592,54 @@ azy as _ +%0Afrom django.utils.timezone import now %0A%0Afrom c @@ -2779,26 +2779,8 @@ ent= -datetime.datetime. now(
a563e5a9bf7b7bbfba58f60ef1f9139d0f67fcb9
Add data_to_send check
holosocket/wsserver.py
holosocket/wsserver.py
#!/usr/bin/env python3 import argparse import asyncio import functools import logging import struct import yaml try: from yaml import CLoader as Loader except ImportError: from yaml import Loader try: from . import utils from .encrypt import aes_gcm except (ModuleNotFoundError, ImportError): # develo...
Python
0.000001
@@ -1019,24 +1019,45 @@ _send%5B:-16%5D%0A + try:%0A @@ -1089,24 +1089,195 @@ (data, tag)%0A + except ValueError:%0A logging.warn('detect attack')%0A asyncio.sleep(90)%0A writer.close()%0A return None%0A%0A ...
46001060e444272573fbee2abac8ce42b8745985
improve exception messages
src/choo/queries/base.py
src/choo/queries/base.py
from collections import OrderedDict from copy import deepcopy from itertools import chain from types import MappingProxyType from ..models.base import Field, Model class MetaQuery(type): def __new__(mcs, name, bases, attrs): not_field_attrs = {n: v for n, v in attrs.items() if not isinstance(v, Field)} ...
Python
0.000006
@@ -4278,17 +4278,16 @@ settings -! ')%0A%0A @@ -4458,17 +4458,16 @@ .where() -! ')%0A%0A @@ -4581,24 +4581,29 @@ m using +their methods -! ')%0A%0A @@ -4783,17 +4783,16 @@ %25s=None) -! ' %25 name
9fd89a23e55d9b0b393c3975758b9e2c16a3cda1
Set MOOSE_DIR if the user doesn't have it
python/MooseDocs/common/moose_docs_file_tree.py
python/MooseDocs/common/moose_docs_file_tree.py
#pylint: disable=missing-docstring #################################################################################################### # DO NOT MODIFY THIS HEADER # # MOOSE - Multiphysics Object Oriented Simulation Environment ...
Python
0
@@ -3558,24 +3558,229 @@ ion.%0A %22%22%22 +%0A%0A # Set the MOOSE_DIR if it does not exists so that the root_dir can always use it%0A if 'MOOSE_DIR' not in os.environ:%0A os.environ%5B'MOOSE_DIR'%5D = MooseDocs.MOOSE_DIR%0A%0A # Build the file tree %0A node =
346e296872e1ca011eb5e469505de1c15c86732f
Clarify the comment about setting the PYTHON variable for the Doc Makefile.
Doc/tools/sphinx-build.py
Doc/tools/sphinx-build.py
# -*- coding: utf-8 -*- """ Sphinx - Python documentation toolchain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2007 by Georg Brandl. :license: Python license. """ import sys if __name__ == '__main__': if sys.version_info[:3] < (2, 5, 0): print >>sys.stderr, """\ Error: Sphinx ne...
Python
0
@@ -356,17 +356,16 @@ or newer -. %0A(If you @@ -481,10 +481,48 @@ able +, e.g.,%0A%60%60make html PYTHON=python2.5%60%60) . -) %0A%22%22%22
8070b119c11ad18e2c1979afef21503a255dd8d8
Check the number of matches for each query
rockuefort.py
rockuefort.py
#!/usr/bin/python3 """ Usage: rockuefort copy <file> <destination> rockuefort symlink <file> <destination> rockuefort list <file> """ from collections import OrderedDict import subprocess import sys from docopt import docopt def log(*args, **kwargs): print("rockuefort:", *args, file=sys.stderr, **kw...
Python
0.00149
@@ -433,16 +433,33 @@ dDict()%0A + queries = %5B%5D%0A with @@ -493,28 +493,76 @@ %0A + for line in f:%0A try:%0A c, quer -ies +y = -%5B line.str @@ -569,31 +569,186 @@ ip() - for line in f%5D +.split(':', 1)%0A c = int(c)%0A except ValueError:...
6b495cfc31743ab761cd1b9a791bfb4ec7b80d36
Remove __main__ block from container.py.
dockorm/container.py
dockorm/container.py
# encoding: utf-8 """ Container class. """ from __future__ import print_function, unicode_literals from itertools import chain import json from subprocess import call import sys from docker import Client from six import ( iteritems, iterkeys, itervalues, text_type, ) from IPython.utils.py3compat impor...
Python
0
@@ -7340,85 +7340,4 @@ ()%0A%0A -%0Aif __name__ == '__main__':%0A cont = Container(image='busybox')%0A cont.run()%0A
0b39cfbdbfa397be5e428425aedc9ebced62c6ec
Fix reversed lat/lon
projects/tpoafptarbmit/scrape.py
projects/tpoafptarbmit/scrape.py
#!/usr/bin/env python3 from urllib.parse import parse_qsl import json import os import sys import requests from bs4 import BeautifulSoup ROUTE_BASE_URL = 'http://www.thepassageride.com/Routes/' def fetch_text(url): r = requests.get(url) if r.status_code != 200: r.raise_for_status() return r.te...
Python
0.999871
@@ -1773,16 +1773,18 @@ points%5Bi ++1 %5D),%0A @@ -1804,34 +1804,32 @@ : float(points%5Bi -+1 %5D),%0A %7D)%0A%0A
1c785168dcf725a07f5621e95376fcc5e5c9a7c1
Update extension.py
extensions/appdynamics/extension.py
extensions/appdynamics/extension.py
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
Python
0.000001
@@ -3298,17 +3298,16 @@ -# print(%22m @@ -3339,17 +3339,16 @@ -# VCAP_SER @@ -3390,17 +3390,16 @@ -# if bool( @@ -3449,25 +3449,24 @@ )):%0A -# print(%22A @@ -3499,25 +3499,24 @@ d%22)%0A -# return T @@ -3531,22 +3531,19 @@ -#return False%0A +else: %0A ...
02f59b60062004fc23dbfbfc6201b326b08513a8
Add 404 exception
src/client/exceptions.py
src/client/exceptions.py
class HTTP4xx(Exception): pass class HTTP400(HTTP4xx): pass class HTTP409(HTTP4xx): pass
Python
0.000019
@@ -55,32 +55,66 @@ 4xx):%0A pass%0A%0A +class HTTP404(HTTP4xx):%0A pass%0A%0A class HTTP409(HT
ac2339bc1dbac84799eb2effc053b96359e78993
fix missing } and endl
extras/AwesomeMaker/AwesomeMaker.py
extras/AwesomeMaker/AwesomeMaker.py
#!/usr/bin/python import re import urllib endl = "\n" regex_icon_description = re.compile(ur'(.fa-[^{]+:before ){([^}]+)}$', re.MULTILINE) regex_icon_name = re.compile(ur'fa-(.+):before.+', re.MULTILINE) regex_icon_unicode = re.compile(ur'.+content: "\\(.+)";', re.MULTILINE) def get_icon_names(icon_description): ...
Python
0.000116
@@ -2590,32 +2590,60 @@ eMaker%22 + endl)%0A + output_file.write(endl)%0A output_file. @@ -3098,16 +3098,17 @@ .write(%22 +%7D ;%22 + end
c6d710bf8a0bf8ce6c06f380fa7913ef73816d51
Remove seconds from nightbot predicted times
controllers/nightbot_controller.py
controllers/nightbot_controller.py
import pytz from base_controller import CacheableHandler from database.event_query import TeamEventsQuery from database.match_query import TeamEventMatchesQuery from helpers.event_team_status_helper import EventTeamStatusHelper from helpers.match_helper import MatchHelper from helpers.team_helper import TeamHelper fro...
Python
0.000001
@@ -3234,9 +3234,12 @@ %25a %25 -X +H:%25M %25Z%22
8d06ccd7aeefe5945bab44b01764bd62685a2e17
Add missing member to API.
mindbender/api.py
mindbender/api.py
"""Public API Anything that is not defined here is **internal** and unreliable for external use. Motivation for api.py: Storing the API in a module, as opposed to in __init__.py, enables use of it internally. For example, from `pipeline.py`: >> from . import api >> api.do_this() The ...
Python
0
@@ -1762,24 +1762,49 @@ r_plugins%22,%0A + %22deregister_format%22,%0A %22deregis
95b62db08280850bf7232c914dfc1c77372a206f
update parse rule
wechat/wechat/views.py
wechat/wechat/views.py
from django.http import HttpResponse, HttpResponseBadRequest from hashlib import sha1 from lxml import etree import urllib.request import json def _make_post_request(url, post_data): post_encoded = json.dumps(post_data).encode('utf-8') req = urllib.request.Request(url, data=post_encoded, method='POST') r...
Python
0.000001
@@ -2491,17 +2491,9 @@ %5B2:%5D -.strip() %0A + @@ -2615,24 +2615,181 @@ _time, txt)%0A + if bul%5B0%5D != ' ':%0A txt = '%E4%BD%A0%E7%9A%84%E5%BC%B9%E5%B9%95%E6%A0%BC%E5%BC%8F%E4%BC%BC%E4%B9%8E%E4%B8%8D%E5%AF%B9%E5%93%A6%EF%BC%8C%E8%AF%B7%E6%8C%89%5Cn%5C%22%E5%BC%B9%E5%B9%95 %E6%83%B3%E5%8F%91%E9%80...
267f0c72f3d3f89792ab152fb0f2257aa21d9365
fix get_value_from_state()
plenum/server/domain_req_handler.py
plenum/server/domain_req_handler.py
from binascii import hexlify from hashlib import sha256 from common.serializers.serialization import domain_state_serializer, \ proof_nodes_serializer, state_roots_serializer from ledger.util import F from plenum.common.constants import TXN_TYPE, NYM, ROLE, STEWARD, TARGET_NYM, \ VERKEY, TXN_TIME, ROOT_HASH, M...
Python
0
@@ -7382,18 +7382,43 @@ -self.super +return super().get_value_from_state (pat
f68e8612f1e8198a4b300b67536d654e13809eb4
Allow SHA256 hashes in URLs
plinth/modules/monkeysphere/urls.py
plinth/modules/monkeysphere/urls.py
# # This file is part of Plinth. # # 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.000004
@@ -919,13 +919,15 @@ -9A- -Fa-f: +Za-z:+/ %5D+)/
547c9e36255870bcee8a800a3fa95c3806a95c2c
Update links when it starts getting redirected
newsApp/linkManager.py
newsApp/linkManager.py
import os import time from constants import * from dbhelper import * from dbItemManagerV2 import DbItemManagerV2 from link import Link LINK_EXPIRY_TIME_IN_DAYS = 80 class LinkManager(DbItemManagerV2): """ Manage links stored on AWS dynamo db database. Contains functions for CRUD operations on the links ...
Python
0
@@ -781,22 +781,22 @@ -return +link = Link(li @@ -811,24 +811,208 @@ Item.tags)%0A%0A + #handle the case when link starts gettting redirected to new url%0A if link.id != linkId:%0A self.delete(linkId)%0A self.put(link)%0A%0A return link%0A%0A def getS
366ecdd77520004c307cbbf127bb374ab546ce7e
Use windows API to change the AppID and use our icon.
run-quince.py
run-quince.py
#!/usr/bin/env python3 # coding: utf-8 # Raytheon BBN Technologies 2016 # Contributiors: Graham Rowlands # # This file runs the main loop # Use PyQt5 by default import os os.environ["QT_API"] = 'pyqt5' from qtpy.QtWidgets import QApplication import sys import argparse from quince.view import * if __name__ == "__mai...
Python
0
@@ -263,16 +263,30 @@ argparse +%0Aimport ctypes %0A%0Afrom q @@ -660,16 +660,390 @@ path))%0A%0A + # Convince windows that this is a separate application to get the task bar icon working%0A # https://stackoverflow.com/questions/1551605/how-to-set-applications-taskbar-icon-in-windows-7/1552105#1552105%0A if...
976e9b622b66bee30d304a801cc39733cc3e8d58
refactor to reduce size of __init__
wikichatter/section.py
wikichatter/section.py
import mwparserfromhell as mwp class Error(Exception): pass class TooManyHeadingsError(Error): pass EPI_LEVEL = 0 class Section(object): def __init__(self, wikitext): self._subsections = [] self.comments = [] # wikitext can be either a wikicode object or a string if...
Python
0.000005
@@ -239,16 +239,167 @@ ts = %5B%5D%0A + wikicode = self._get_wikicode_from_input(wikitext)%0A self._load_section_info(wikicode)%0A%0A def _get_wikicode_from_input(self, wikitext): %0A @@ -626,16 +626,85 @@ ikitext%0A + return wikicode%0A%0A def _load_section_info(self, wikicode):%0A...
9e6b596aa856e1d50a9c2c2882289cf1a5d8c0c0
Fix up plotting script
plot.py
plot.py
#!/usr/bin/env python """Processing routines for the waveFlapper case.""" import foampy import numpy as np import matplotlib.pyplot as plt width_2d = 0.1 width_3d = 3.66 m_paddle = 1270.0 # Paddle mass in kg, from OMB manual h_piston = 3.3147 I_paddle = 1/3*m_paddle*h_piston**2 def plot_force(): """Plots the ...
Python
0.000095
@@ -183,16 +183,17 @@ 1270.0 + # Paddle @@ -238,18 +238,16 @@ = 3.3147 - %0AI_paddl @@ -357,16 +357,25 @@ ime.%22%22%22%0A + pass%0A %0A%0Adef pl @@ -420,16 +420,8 @@ rces -_moments ()%0A @@ -471,68 +471,11 @@ data -%5B%22moment%22%5D%5B%22pressure%22%5D%5B%22z%22%5D + data%5B%22moment%22%5D%5B%22visc...
6549f68fe7fa2d36babfb2ea0b463cfd213f032c
Use CanonicalRampedSecondOrder by default from now on.
run_config.py
run_config.py
''' run_config.py Configuration settings for a simulation run Created on 30 Jun 2010 @author: Ian Huston ''' import numpy as np import cosmomodels as c from configuration import PROGRAM_NAME, LOGLEVEL from sourceterm import srcequations import os.path fixtures = {"msqphisq": {"potential_func": "msqphisq", ...
Python
0
@@ -2509,16 +2509,55 @@ dSource%0A +soclass = c.CanonicalRampedSecondOrder%0A cq = 50%0A @@ -3398,16 +3398,46 @@ er_tsix%22 +,%0A %22soclass%22: soclass %7D%0A %0A####
5b9b24053eaccc2083184a9ce58699b3765e284c
Add async=False option to AWS core class for easier testing
asyncaws/core.py
asyncaws/core.py
from tornado.httpclient import HTTPRequest, HTTPClient, AsyncHTTPClient from tornado.ioloop import IOLoop from tornado.httputil import url_concat from concurrent.futures import Future from urlparse import urlparse from lxml import objectify import datetime import hashlib import hmac def sign(key, msg): """Make sh...
Python
0.000002
@@ -4296,16 +4296,44 @@ Client() +%0A self._async = async %0A%0A de @@ -4683,16 +4683,239 @@ et_key)%0A + if not self._async:%0A http_response = self._http.fetch(request)%0A xml_root = objectify.fromstring(http_response.body)%0A response = parse_function(xml_root)%0A...
8d6fcc6d318423e87e9942c2551c0d9b3c282e25
Allow TELEGRAM_TEMPLATE to be a string (#208)
plugins/telegram/alerta_telegram.py
plugins/telegram/alerta_telegram.py
import logging import os try: from alerta.plugins import app # alerta >= 5.0 except ImportError: from alerta.app import app # alerta < 5.0 from alerta.plugins import PluginBase import telepot from jinja2 import Template, UndefinedError DEFAULT_TMPL = """ {% if customer %}Customer: `{{customer}}` {% endif %...
Python
0.000002
@@ -1590,20 +1590,32 @@ TEMPLATE - and +:%0A if os.path @@ -1642,16 +1642,20 @@ PLATE):%0A + @@ -1698,16 +1698,20 @@ ) as f:%0A + @@ -1753,16 +1753,94 @@ read())%0A + else:%0A self.template = Template(TELEGRAM_TEMPLATE)%0A
5a6cdb9dc08924dc90a24271dc45f4412250b06a
bump version
src/experimentator/__version__.py
src/experimentator/__version__.py
__version__ = '0.2.0'
Python
0
@@ -12,11 +12,11 @@ = '0.2. -0 +1 '%0A
9a18c20741f1d9b077f6ab992391463e033c53e4
Use assertRaises() instead of try/except/isinstance in test suite
humanfriendly_tests.py
humanfriendly_tests.py
#!/usr/bin/env python # Tests for the 'humanfriendly' module. # # Author: Peter Odding <peter.odding@paylogic.eu> # Last Change: June 27, 2013 # URL: https://humanfriendly.readthedocs.org # Standard library modules. import math import os import unittest # The module we are testing. import humanfriendly class HumanF...
Python
0.000001
@@ -2004,198 +2004,91 @@ -try:%0A humanfriendly.parse_date('2013-06-XY')%0A self.assertTrue(False)%0A except Exception as e:%0A self.assertTrue(isinstance(e, humanfriendly.InvalidDate) +self.assertRaises(humanfriendly.InvalidDate, humanfriendly.parse_date, '2013-06-XY' )%0...
101f8c44ec0b55111f93e7c2a0d8f1710405452f
FIX get_name funtion
addons/nautical_search_by_ni/res_partner.py
addons/nautical_search_by_ni/res_partner.py
# -*- coding: utf-8 -*- import datetime from lxml import etree import math import pytz import re import openerp from openerp import SUPERUSER_ID from openerp import pooler, tools from openerp.osv import osv, fields from openerp.tools.translate import _ from openerp.tools.yaml_import import is_comment class res_partn...
Python
0.000002
@@ -820,16 +820,22 @@ %25s%22 %25 ( +name, national @@ -843,22 +843,16 @@ identity -, name )%0A
df962bc49d9880c2df886213c049bcb8a13bfd7e
Fix error when timezone is set but format is not
willie/modules/tell.py
willie/modules/tell.py
""" tell.py - Willie Tell and Ask Module Copyright 2008, Sean B. Palmer, inamidst.com Licensed under the Eiffel Forum License 2. http://willie.dftba.net """ import os import re import time import datetime import pytz import random import threading from willie.tools import Nick maximum = 4 def loadReminders(fn, lock...
Python
0
@@ -1684,30 +1684,12 @@ t = -'%25Y-%25m-%25d %25H:%25M:%25S %25Z' +None %0A @@ -1976,16 +1976,42 @@ tformat + or '%25Y-%25m-%25d %25H:%25M:%25S %25Z' )%0A%0A%0Adef
7b3f447e7fa83eed97b9d54fe79db01ea325f1d2
Drop cargo-culted pin
application/setup.py
application/setup.py
from setuptools import setup name = 'senic.nuimo_hub' setup( name=name, version_format='{tag}.{commitcount}+{gitsha}', url='https://github.com/getsenic/nuimo-hub-app', author='Senic GmbH', author_email='tom@senic.com', description='...', classifiers=[ "Programming Language :: Pyt...
Python
0
@@ -1356,16 +1356,8 @@ akes - %3C 1.4.0 ',%0A
e44473e7ca381dce379b89c2a17bb79aa917afbd
fix Order.ensure_subprodcts never making a query. closes #1
humblebundle/models.py
humblebundle/models.py
""" Model classes for the Humble Bundle API This module only is guaranteed to only contain model class definitions """ __author__ = "Joel Pedraza" __copyright__ = "Copyright 2014, Joel Pedraza" __license__ = "MIT" class BaseModel(object): def __init__(self, client, data): self._client = client def ...
Python
0.000019
@@ -1205,24 +1205,25 @@ bproducts = +( %5BSubproduct( @@ -1276,16 +1276,25 @@ s', %5B%5D)%5D +) or None %0A%0A de @@ -1435,27 +1435,13 @@ if -not hasattr( self -, ' +. subp @@ -1451,10 +1451,16 @@ ucts -') + is None :%0A
42c80ac7499fbe05a9ddb916b42c56dcd265e5d9
Write while filename in description, not basename
pmap.py
pmap.py
#!/usr/bin/env python2 """Produce parametric maps by fitting one or more diffusion models to imaging data. Multiple input images can be provided in ASCII format. Single input image can be provided as a group of DICOM files. Output is written in ASCII files named by input and model.""" import os.path import sys import...
Python
0.022384
@@ -2398,33 +2398,16 @@ %25s%5Cn' %25 -(os.path.basename (dwi.fil @@ -2415,18 +2415,9 @@ name -),%0A +, rep
52dd018d08e00356218cb2789cee10976eff4359
Disable automatic geocoding for addresses in Django admin
firecares/firecares_core/admin.py
firecares/firecares_core/admin.py
import autocomplete_light from .models import Address, ContactRequest, AccountRequest, RegistrationWhitelist from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.gis import admin from import_export.admin impo...
Python
0
@@ -762,181 +762,8 @@ '%5D%0A%0A - def save_model(self, request, obj, form, change):%0A if change:%0A obj.geocode()%0A super(AddressAdmin, self).save_model(request, obj, form, change)%0A%0A %0Acla
7b3f239964c6663a9b655553202567fccead85c8
Add 'me' to profile IdentifierError
mollie/api/resources/profiles.py
mollie/api/resources/profiles.py
from ..error import IdentifierError from ..objects.profile import Profile from .base import Base class Profiles(Base): RESOURCE_ID_PREFIX = 'pfl_' def get_resource_object(self, result): return Profile(result, self.client) def get(self, profile_id, **params): if not profile_id or \ ...
Python
0.000003
@@ -542,16 +542,56 @@ prefix%7D' + %22%0A %22or it should be 'me' .%22.forma @@ -627,16 +627,36 @@ file_id, +%0A prefix=
b000bef2ec323dc9b7862a828ab1fd2e9574f3b0
allow networks to be read from Document objects as well as filenames
nineml/user/network.py
nineml/user/network.py
from itertools import chain from .population import Population from .projection import Projection from .selection import Selection from ..document import Document from . import BaseULObject from .component import write_reference, resolve_reference from nineml.annotations import annotate_xml, read_annotations from ninem...
Python
0
@@ -438,16 +438,36 @@ ceptions +, NineMLRuntimeError %0A%0A%0Aclass @@ -3813,39 +3813,338 @@ -document = nineml.read(filename +if isinstance(filename, basestring):%0A document = nineml.read(filename)%0A elif isinstance(filename, Document):%0A document = filename%0A else:%0A ...
5efdd29804249b40c9b9e589cb00cf10c56decb0
Add the standard imports
conveyor/tasks/bulk.py
conveyor/tasks/bulk.py
import datetime import logging import time from requests.exceptions import ConnectionError, HTTPError from ..core import Conveyor logger = logging.getLogger(__name__) # We ignore the last component as we cannot properly handle it def get_jobs(last=0): current = time.mktime(datetime.datetime.utcnow().timetuple...
Python
0.000378
@@ -1,12 +1,124 @@ +from __future__ import absolute_import%0Afrom __future__ import division%0Afrom __future__ import unicode_literals%0A%0A import datet
00203b7fbf8ed8f8728ce18838acb21eb6224723
Disable unused code
flumotion/test/test_common_vfs.py
flumotion/test/test_common_vfs.py
# -*- Mode: Python; test-case-name: flumotion.test.test_common_planet -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2008 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General Public License v...
Python
0.000003
@@ -1172,262 +1172,8 @@ e__) -%0A try:%0A os.mkdir(os.path.join(self.path, 'access-denied'), 000)%0A except OSError, e:%0A if e.errno != errno.EEXIST:%0A raise%0A%0A def tearDown(self):%0A os.rmdir(os.path.join(self.path, 'access-denied')) %0A%0A
6f10678e98101f3514db58f55923959eb41c6988
Make :baseclass: actually work
docs/sphinx_qtile.py
docs/sphinx_qtile.py
# Copyright (c) 2015 dmpayton # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute...
Python
0.000001
@@ -6182,19 +6182,18 @@ ss(obj) -and +or (BaseCl @@ -6222,24 +6222,24 @@ not is -instance +subclass (obj, Ba
b6bc77d6437f5fc9e9c2e793226960fe29841724
Remove unused code
ponyexpress/api/lib/repositories.py
ponyexpress/api/lib/repositories.py
## Handle configured repositores and query for outdated package data from datetime import date import re from ponyexpress.database import db from ponyexpress.api.lib.providers import * from ponyexpress.models.repository import Repository from ponyexpress.models.repo_history import RepoHistory from ponyexpress.models.p...
Python
0
@@ -5805,258 +5805,8 @@ ne:%0A - #self.pattern = re.compile(%22(%5B0-9%5D+)%5C.(%5B0-9%5D+)%5C.?(%5B0-9%5D*)%5B%5C-%5C+%5C~%5D?(%5B0-9%5D%7C%5B%5C+%5C-%5C~a-z0-9%5D*)%5Ba-z%5D*(%5B0-9%5C.%5D+)%22)%0A #self.pattern = re.compile(%22(%5B0-9%5D+)%5C.(%5B0-9%5D+)%5C.?(%5B0-9%5D*)%5B%5C-%5C+%5C~%5D?(%5...
c325ebfc98555ef8c134a5ec2bff94f3bbcb54d0
fix sorting issues with OrderedDict
autodiff/utils.py
autodiff/utils.py
import gc import opcode import inspect from autodiff.compat import OrderedDict, getcallargs #import theano #from theano.sandbox.cuda import cuda_ndarray #cuda_ndarray = cuda_ndarray.cuda_ndarray def orderedcallargs(fn, *args, **kwargs): """ Returns an OrderedDictionary containing the names and values of a ...
Python
0
@@ -3237,39 +3237,170 @@ -for k in sorted(doc.iterkeys()) +if isinstance(doc, OrderedDict):%0A sortedkeys = doc.iterkeys()%0A else:%0A sortedkeys = sorted(doc.iterkeys())%0A for k in sortedkeys :%0A @@ -4343,39 +4343,186 @@ -for k in sorted(doc.iterkeys()) +if isinstan...
ce5f152a5769e90cb87a05a2bcc1beb837d6cdb4
Simplify code
chainer/functions/pooling/pooling_2d.py
chainer/functions/pooling/pooling_2d.py
import collections import numpy from chainer import cuda from chainer import function from chainer.utils import conv from chainer.utils import type_check if cuda.cudnn_enabled: cudnn = cuda.cudnn libcudnn = cudnn.cudnn _cudnn_version = libcudnn.getVersion() def _check_cudnn_acceptable_type(x_dtype): ...
Python
0.041259
@@ -1171,32 +1171,49 @@ ion using cudnn%0A + x = x%5B0%5D%0A n, c, h, @@ -1218,19 +1218,16 @@ h, w = x -%5B0%5D .shape%0A @@ -1419,35 +1419,8 @@ ll)%0A - dtype = x%5B0%5D.dtype%0A @@ -1467,16 +1467,18 @@ , dtype= +x. dtype)%0A%0A @@ -1598,35 +1598,32 @@ sor_descriptor(x -%5B0%5D )%...
b3448aef6f42b1a8825fc7c434a2c5eefb5bc0e5
Replace OSError with LookupError when SENNA executable is not found
nltk/classify/senna.py
nltk/classify/senna.py
# Natural Language Toolkit: Senna Interface # # Copyright (C) 2001-2022 NLTK Project # Author: Rami Al-Rfou' <ralrfou@cs.stonybrook.edu> # URL: <https://www.nltk.org/> # For license information, see LICENSE.TXT """ A general interface to the SENNA pipeline that supports any of the operations specified in SUPPORTED_OPE...
Python
0
@@ -2695,34 +2695,38 @@ raise -OS +Lookup Error(%0A @@ -4562,18 +4562,22 @@ raise -OS +Lookup Error(%0A
19ea8f4fed70d96a5a2bc6a81b32bdaa65583f5c
throw user error on unknown command and show existing commands
i3configger/message.py
i3configger/message.py
import logging from pathlib import Path from i3configger import base, config, exc, partials, context log = logging.getLogger(__name__) I3STATUS = "i3status" """reserved key for status bar setting files""" DEL = 'del' """signal to delete a key in shadow or set""" class CMD: SELECT_NEXT = "select-next" SELE...
Python
0
@@ -446,16 +446,167 @@ hadow%22%0A%0A + @classmethod%0A def get_all_commands(cls):%0A return %5Bv for k, v in cls.__dict__.items()%0A if k%5B0%5D.isupper() and k%5B0%5D != '_'%5D%0A%0A %0Adef pro @@ -1366,10 +1366,31 @@ -%7B%0A +try:%0A %7B%0A @@ -1437,24 +1437,2...
8a010b6601ecf2eed216b3aa0b604a0985d06544
Update chainer/training/extensions/__init__.py
chainer/training/extensions/__init__.py
chainer/training/extensions/__init__.py
# import classes and functions from chainer.training.extensions._snapshot import snapshot # NOQA from chainer.training.extensions._snapshot import snapshot_object # NOQA from chainer.training.extensions.computational_graph import DumpGraph # NOQA from chainer.training.extensions.evaluator import Evaluator # NOQA fr...
Python
0
@@ -1637,17 +1637,16 @@ %0A# Alias -e %0Afrom ch
105dc001e5e0f2e1e02409cf77e5b31f0df30ffe
put on two lines
core/dbt/task/clean.py
core/dbt/task/clean.py
import os.path import os import shutil from dbt.task.base import ProjectOnlyTask from dbt.logger import GLOBAL_LOGGER as logger class CleanTask(ProjectOnlyTask): def __is_project_path(self, path): proj_path = os.path.abspath('.') return not os.path.commonprefix( [proj_path, os.path.a...
Python
0.000006
@@ -1309,16 +1309,47 @@ e it is +%22%0A %22 protecte
5860d28e0f8f08f1bf4ca2426c08a83b687f33f8
Fix Python3 issue (#173)
mod/tools/node.py
mod/tools/node.py
"""wrapper for node.js, only check_exists""" import subprocess name = 'node' platforms = ['linux'] optional = True not_found = 'node.js required for emscripten cross-compiling' #------------------------------------------------------------------------------ def check_exists(fips_dir) : try : out = subproce...
Python
0
@@ -382,16 +382,17 @@ rtswith( +b 'v') :%0A
046bd8d310289ff71dd6b95422927dadb86637ec
Fix method override.
model/rtorrent.py
model/rtorrent.py
""" .. _rtorrent-class: RTorrent ======== The RTorrent class serves as an interface to a remote RTorrent instance. It implements a lot of the functionality that RTorrent exposes over XMLRPC; currently only XMLRPC over HTTP is supported; but support for direct SCGI is planned. Basically, HTTP support requires a web se...
Python
0
@@ -5494,32 +5494,38 @@ 'add_torrent_raw +_start ' : ('load_raw_s
1794fb8865241e22a5af30020111471ea00a6250
check if you the plugins really need to be reloaded
InvenTree/plugin/admin.py
InvenTree/plugin/admin.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from django.apps import apps import plugin.models as models def plugin_update(queryset, new_status: bool): """general function for bulk changing plugins""" for model in queryset: model.active = new_statu...
Python
0
@@ -262,101 +262,356 @@ -for model in queryset:%0A model.active = new_status%0A model.save(no_reload=True)%0A%0A +apps_changed = False%0A%0A # run through all plugins in the queryset as the save method needs to be overridden%0A for model in queryset:%0A if model.active is not new_status...
0682e3b4ce5a23683ac1bd7d68cb69e3df92cc99
Fix bug when hyp_length == 0
nematus/metrics/sentence_bleu.py
nematus/metrics/sentence_bleu.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division from math import exp from operator import mul from collections import defaultdict from scorer import Scorer from reference import Reference class SentenceBleuScorer(Scorer): """ Scores SmoothedBleuReference objects. """ d...
Python
0.00033
@@ -2987,24 +2987,51 @@ p/hyp_length + if hyp_length %3E 0 else 0.0 )%0A
3e57219677fad5e3127c46843771978b1ff8bb20
Add profilegate endpoint
resources/lib/services/nfsession/nfsession_endpoints.py
resources/lib/services/nfsession/nfsession_endpoints.py
# -*- coding: utf-8 -*- """ Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix) Copyright (C) 2020 Stefano Gottardo - @CastagnaIT (original implementation module) Netflix API endpoints SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ # Secure Netflix url BASE_URL ...
Python
0
@@ -2214,24 +2214,327 @@ t': '*/*'%7D,%0A + 'profiles_gate':%0A # This endpoint is used after ending editing profiles page, i think to force close an active profile session%0A %7B'address': '/ProfilesGate',%0A 'is_api_call': False,%0A 'use_default_params': False,%0A 'add_auth_url':...