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
498b3e6fc1f2d0cb45b44904f0b4cf5fde78d31d
Add comments for the directory monitor.
API/directorymonitor.py
API/directorymonitor.py
import os import logging from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler, FileCreatedEvent from API.pubsub import send_message from API.directoryscanner import find_runs_in_directory class DirectoryMonitorTopics(object): new_run_observed = "new_run_observed" finishe...
Python
0
@@ -256,24 +256,82 @@ cs(object):%0A + %22%22%22Topics for monitoring directories for new runs.%22%22%22%0A new_run_ @@ -360,16 +360,16 @@ served%22%0A - fini @@ -487,36 +487,405 @@ -def on_created(self, event): +%22%22%22A subclass of watchdog.events.FileSystemEventHandler that will run%0A a di...
4ffaa730bde8fae1bc46b692ee7b5d1c6e922a0e
bump version 2.5
pylatexenc/version.py
pylatexenc/version.py
# # The MIT License (MIT) # # Copyright (c) 2019 Philippe Faist # # 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...
Python
0
@@ -1528,11 +1528,11 @@ tr = %222. -4 +5 %22%0A
d3f9cfa4f59710dede0844f3f49ce0a1cc2cf1c3
Fix #2401: Github integration error
taiga/hooks/github/services.py
taiga/hooks/github/services.py
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
Python
0.00002
@@ -908,16 +908,56 @@ rt User%0A +from taiga.users.models import AuthData%0A from tai @@ -1430,20 +1430,22 @@ ub_user( -user +github _id):%0A @@ -1466,20 +1466,22 @@ %0A if -user +github _id:%0A @@ -1501,36 +1501,40 @@ user = -User +AuthData .objects.get(git @@ -1530,16 +1530,36 @@ cts.get( ...
7d6018e5f2010d6a79fe71bc972bd29c61a113bc
Fix exit on installation on Windows
pysparkle/__init__.py
pysparkle/__init__.py
# Copyright (c) 2015-2016 Maciej Dems <maciej.dems@p.lodz.pl> # See LICENSE file for copyright information. import sys import os import shlex import importlib import webbrowser import tempfile try: from urllib2 import urlretrieve except ImportError: from urllib.request import urlretrieve from .backend import...
Python
0.000001
@@ -7297,32 +7297,42 @@ except + Exception :%0A
d2b61ce5c0aeaaa3234023c11196a50e95bc0408
Improve error message
AutoSetNewFileSyntax.py
AutoSetNewFileSyntax.py
import sublime import sublime_plugin import sys import os import re sys.path.insert(0, os.path.dirname(__file__)) import yaml # key = path of a syntax file # value = compiled first_line_match regex syntaxMapping = {} def plugin_loaded(): global syntaxMapping syntaxMapping = {} syntaxFiles = sublime....
Python
0.000015
@@ -122,16 +122,49 @@ yaml%0A%0A%0A +PLUGIN = 'AutoSetNewFileSyntax'%0A%0A # key @@ -730,27 +730,95 @@ p -ass +rint(%22%7B0%7D: regex compilation failed in %7B1%7D%22.format(PLUGIN, syntaxFile)) %0A syntaxM
8bdf22ddfeaf95d087c4bc7ff54dff6a882f95d2
Add __version__ string to the plugin module
pytest_travis_fold.py
pytest_travis_fold.py
# -*- coding: utf-8 -*- """ Pytest plugin that folds captured output sections in Travis CI build log. """ from __future__ import absolute_import, division, print_function import os import re from collections import defaultdict from contextlib import contextmanager from functools import partial, update_wrapper import...
Python
0.000072
@@ -355,16 +355,38 @@ alimov%22%0A +__version__ = %221.0.0%22%0A %0A%0APUNCT_
948a64783fdc05c3e67c5fd63bf08bb7b1bdbc40
is no sentence is found, answer something
python/CommandTalk.py
python/CommandTalk.py
# -*- coding: utf8 -*- from CommandAbstract import CommandAbstract from CommandException import CommandException from CharacterException import CharacterException from Character import Character from Sentence import Sentence class CommandTalk(CommandAbstract): def run(self): if len(self._args) == 0: ...
Python
1
@@ -533,17 +533,16 @@ args%5B1%5D%0A -%0A @@ -808,19 +808,20 @@ -print +if len( sentence %0A @@ -815,13 +815,67 @@ len(sentence +) is 0:%0A print %22What ?%22%0A return%0A %0A
6fe48fc7499327d27f69204b7f8ec927fc975177
Implement python lexer ZMQ service.
python/lexPythonMQ.py
python/lexPythonMQ.py
#!/usr/bin/python import tokenize; import zmq; context = zmq.Context() socket = context.socket(zmq.REP) socket.bind("tcp://lo:32132") while True: # Wait for next request from client message = socket.recv()
Python
0.000001
@@ -23,38 +23,167 @@ ort -tokenize;%0Aimport zmq;%0A%0Acontext +re, sys, tokenize, zmq;%0Afrom StringIO import StringIO%0A%0Adef err(msg):%0A%09sys.err.write(str(msg) + '%5Cn')%0A%09%0A%0Aclass LexPyMQ(object):%0A%09def __init__(self):%0A%09%09self.zctx = z @@ -195,16 +195,23 @@ ntext()%0A +%09%09self. socket = @...
45a48126246ee7d82d0a881923d1f78a4d807004
fix #168
pythonx/cm_default.py
pythonx/cm_default.py
# sane default for programming languages _patterns = {} _patterns['*'] = r'(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)' _patterns['css'] = r'(-?\d*\.\d[\w-]*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)' _patterns['php'] = r'(-?\d*\.\d\w*)|([^\-\...
Python
0
@@ -263,32 +263,70 @@ .%5C%3C%5C%3E%5C/%5C?%5Cs%5D+)'%0A +_patterns%5B'css'%5D = _patterns%5B'css'%5D%0A _patterns%5B'php'%5D
659d2262dcbe64d2415dfe9dbdd0e04ebeac79f0
Update utils.py
tyrion/utils.py
tyrion/utils.py
import heapq,random from compatibility import range, pickle import numpy as np from scipy.spatial.distance import cosine def gen_embedding(word): ''' Generates embedding of the word from the model trained. ''' try: f = open('./embeddings.pickle') embeddings = pickle.load(f) retu...
Python
0.000001
@@ -237,11 +237,12 @@ -f = +with ope @@ -264,18 +264,34 @@ .pickle' -)%0A +, 'rb') as f:%0A
778cb1a9f9fbb7e260d9a17f07d412d4fa12930a
Add "all" to the queryset in DepartmentForm
ubigeo/forms.py
ubigeo/forms.py
from django import forms from .models import Department, Province, District class DepartmentForm(forms.Form): department = forms.ModelChoiceField( queryset=Department.objects ) class ProvinceForm(DepartmentForm): province = forms.ModelChoiceField( queryset=Province.objects.none() ) ...
Python
0.000331
@@ -181,16 +181,22 @@ .objects +.all() %0A )%0A%0A
646f67446decbab7f857503f560c148760db05fe
Delete debug assignment
pyxserver_pullonce.py
pyxserver_pullonce.py
#!/usr/bin/python import json import sys import requests #------------------------------------------------------------ # Simple demo of the (asynchronous) external grading interface, # and uploaded file access # # Xqueue API consists of: # 0) login: Log in # 1) get_queuelen: Get length of specific q...
Python
0.000001
@@ -523,17 +523,16 @@ ():%0A -# xqueue_u @@ -565,75 +565,8 @@ g/'%0A - xqueue_url = 'http://ec2-50-17-47-60.compute-1.amazonaws.com/'%0A
22476992066ba086a3c27b248be3c491ed91cf3c
fix a bug in operator test.
raco/operator_test.py
raco/operator_test.py
import unittest import collections import raco.fakedb import raco.scheme as scheme from raco.algebra import * from raco.expression import * import raco.relation_key as relation_key class TestQueryFunctions(): emp_table = collections.Counter([ # id dept_id name salary (1, 2, "Bill Howe", 25000), ...
Python
0
@@ -2997,17 +2997,16 @@ apply)%5D, - MyriaAl
8118b1944cd711a2ef0ac24cf6907ef4eee52937
make memoize decorator memoize kwargs as well.
spyne/util/__init__.py
spyne/util/__init__.py
# # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libra...
Python
0
@@ -2572,16 +2572,26 @@ f, *args +, **kwargs ):%0A @@ -2599,16 +2599,17 @@ key = +( tuple(ar @@ -2610,20 +2610,40 @@ ple(args -%5B1:%5D +), tuple(kwargs.items()) )%0A @@ -2713,16 +2713,26 @@ nc(*args +, **kwargs )%0A
3adc7f40553459aa7af1a444782d08c243a9d736
Tweak Marathon object __repr__
marathon/models/base.py
marathon/models/base.py
import json from marathon.util import to_camel_case, to_snake_case, MarathonJsonEncoder class MarathonObject(object): """Base Marathon object.""" def json_repr(self): """Construct a JSON-friendly representation of the object. :rtype: dict """ return {to_camel_case(k):v for k...
Python
0
@@ -143,24 +143,139 @@ object.%22%22%22%0A%0A + def __repr__(self):%0A return %22%7Bclazz%7D::%7Bobj%7D%22.format(clazz=self.__class__.__name__, obj=self.to_json())%0A%0A def json @@ -279,32 +279,32 @@ son_repr(self):%0A - %22%22%22Const @@ -730,16 +730,204 @@ ms()%7D)%0A%0A + def to_json(...
5a5f703c51fd46ca8a22acebcac78925d6d52984
Comment out some print statements that were making life hard to work with
CFC_WebApp/clients/commontrips/commontrips.py
CFC_WebApp/clients/commontrips/commontrips.py
from dao.user import User import json import sys, os, random # This is in here so the pygmaps associated functions can be imported # from the webapp # sys.path.append("%s/../../CFC_WebApp/" % os.getcwd()) from uuid import UUID def getUserTour(user_uuid): """ Gets a users "tour" """ # This is i...
Python
0
@@ -781,24 +781,26 @@ ips:%0A + # print(clust @@ -1107,16 +1107,18 @@ ())%0A%0A + # print %22 @@ -1761,24 +1761,26 @@ r())%0A + # print secti
22e6519f04c4d912dcec669b90009fbb6392145d
remove redundant parameter in migrate-episodes.py
mygpo/core/management/commands/migrate-episodes.py
mygpo/core/management/commands/migrate-episodes.py
from optparse import make_option from django.core.management.base import BaseCommand from mygpo import migrate from mygpo.utils import iterate_together, progress from mygpo.api import models as oldmodels from mygpo.core import models as newmodels class Command(BaseCommand): option_list = BaseCommand.option_li...
Python
0.000003
@@ -1394,17 +1394,8 @@ newe -, podcast )%0A%0A
b20919759a6b63a6312d0fad726dd18f7e7f5ae8
-vvv should do the same as -vv
sfa/util/sfalogging.py
sfa/util/sfalogging.py
#!/usr/bin/python import os, sys import traceback import logging, logging.handlers CRITICAL=logging.CRITICAL ERROR=logging.ERROR WARNING=logging.WARNING INFO=logging.INFO DEBUG=logging.DEBUG # a logger that can handle tracebacks class _SfaLogger: def __init__ (self,logfile=None,loggername=None,level=logging.INF...
Python
0.999989
@@ -2873,17 +2873,17 @@ verbose -= +%3E =2:%0A
15de2fe886c52f0900deeb519f944d22bb5c6db4
Use the @view decorator to ensure that the project page gets user data.
mysite/project/views.py
mysite/project/views.py
from mysite.search.models import Project from django.http import HttpResponse, HttpResponseRedirect, HttpResponseServerError from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404 def project(request, project__name = None): p = Project.objects.get(name=project__name) return render...
Python
0
@@ -33,16 +33,69 @@ Project +%0Aimport django.template%0Aimport mysite.base.decorators %0A%0Afrom d @@ -257,16 +257,45 @@ or_404%0A%0A +@mysite.base.decorators.view%0A def proj @@ -393,27 +393,30 @@ urn +( re -nder_to_response( +quest,%0A 'pro @@ -453,50 +453,8 @@ %7B%0A - 'the_us...
fdf39438a3dd4d08979fbbb76c27ad05bee1ccef
Add noisify to augmentation processing functions
neukrill_net/augment.py
neukrill_net/augment.py
#!/usr/bin/env python """ Data Augmentation wrappers and functions. Functions to be used as "processing" arguments are here. """ import neukrill_net.image_processing as image_processing import numpy as np import itertools def augmentation_wrapper(augment_settings): """ Takes settings for augmentation as a dic...
Python
0.000002
@@ -3104,24 +3104,293 @@ images%0A %0A + # Add pixel noise%0A if 'noise' in augment_settings:%0A noisify = lambda images: %5Bimage_processing.noisify_image(image, augment_settings%5B'noise'%5D)%0A for image in images%5D%0A else:%0A noisify = lambda images: i...
dee8c17f78989c2f508eca5a2771a1d63a60d9c6
Bump version number to 0.1
recursely/__init__.py
recursely/__init__.py
""" recursely """ __version__ = "0.0.3" __description__ = "Recursive importer for Python submodules" __author__ = "Karol Kuczmarski" __license__ = "Simplified BSD" import sys from recursely._compat import IS_PY3 from recursely.importer import RecursiveImporter from recursely.utils import SentinelList __all__ = ['i...
Python
0.000472
@@ -32,11 +32,9 @@ %220. -0.3 +1 %22%0A__
d2a040618a1e816b97f60aa66f5b4c9ab4a3e6b9
Add method to handle files args from cli
refmanage/fs_utils.py
refmanage/fs_utils.py
# -*- coding: utf-8 -*-
Python
0.000001
@@ -17,8 +17,774 @@ f-8 -*-%0A +import os%0Aimport glob%0Aimport pathlib2 as pathlib%0A%0A%0Adef handle_files_args(paths_args):%0A %22%22%22%0A Handle files arguments from command line%0A%0A This method takes a list of strings representing paths passed to the cli. It expands the path arguments and creates a l...
4ff69bb44fbac177b4ed2649a3f045a81ff4b427
clean up invalid_multibyte test
tempest/api/compute/images/test_images_oneserver_negative.py
tempest/api/compute/images/test_images_oneserver_negative.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # Copyright 2013 IBM Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at #...
Python
0.000008
@@ -3448,86 +3448,261 @@ -# Return an error if the image name has +if self.__class__._interface == %22xml%22:%0A raise self.skipException(%22Not testable in XML%22)%0A # invalid multi -- byte -characters%0A snapshot +sequence from:%0A # http://stackoverflow.com/questions/130140...
85f471a63238815b3506f464f9261d2b96751aae
Use cog check for duelyst cog
Discord/cogs/duelyst.py
Discord/cogs/duelyst.py
from discord.ext import commands from utilities import checks def setup(bot): bot.add_cog(Duelyst(bot)) class Duelyst(commands.Cog): def __init__(self, bot): self.bot = bot @commands.group(invoke_without_command = True, case_insensitive = True) @checks.not_forbidden() async def duelyst(self, ctx): '''D...
Python
0
@@ -178,16 +178,90 @@ = bot%0A%09%0A +%09def cog_check(self, ctx):%0A%09%09return checks.not_forbidden_predicate(ctx)%0A%09%0A %09@comman @@ -329,33 +329,8 @@ ue)%0A -%09@checks.not_forbidden()%0A %09asy @@ -409,16 +409,16 @@ mand)%0A%09%0A + %09@duelys @@ -454,33 +454,8 @@ ue)%0A -%09@checks.not_forbidden()%0A ...
abdfdfb6a28e6ce4700b50ebeed12f8b241b5123
Update example push command
share/examples/push.py
share/examples/push.py
import sys import zmq from zmq.utils.strtypes import b def main(): # Get the arguments if len(sys.argv) != 4: print("Usage: push.py url topic num_messages") sys.exit(1) url = sys.argv[1] topic = sys.argv[2] num_messages = int(sys.argv[3]) # Create the socket context = zmq....
Python
0.000001
@@ -1,18 +1,42 @@ import -sys +json%0Aimport sys%0Aimport uuid %0Aimport @@ -485,25 +485,111 @@ ic), - b(%22id%22), b(str(i +%0A b(str(uuid.uuid1())),%0A b(json.dumps(%7B'id': i%7D ))%5D)
fa9d67455cf171a32beea2075e2f2d4f71877c90
add google
picasso/picasso/settings/production.py
picasso/picasso/settings/production.py
"""Production settings and globals.""" from __future__ import absolute_import from os import environ from .base import * # Normally you should not import ANYTHING from Django directly # into your settings, but ImproperlyConfigured is an exception. from django.core.exceptions import ImproperlyConfigured def get_en...
Python
0.000001
@@ -785,16 +785,74 @@ 0.8.124' +,%0A 'www.findpicasso.com', 'www.google.com' %5D%0A# #### @@ -4148,16 +4148,17 @@ zcud1%22%0A# + ########
b310aa4ed1fefd542dd956cd4e1bd26344dd2bc6
improve handling of boolean arguments and logging
templates/script-template-3.py
templates/script-template-3.py
""" Python 3 script template (changeme) """ import argparse from functools import wraps import inspect import logging import os import re import sys import traceback DEFAULT_LOG_LEVEL = logging.INFO POSITIONAL_ARGUMENTS = [ ['-l', '--loglevel', logging.getLevelName(DEFAULT_LOG_LEVEL), 'desired logging lev...
Python
0
@@ -189,20 +189,23 @@ logging. -INFO +WARNING %0APOSITIO @@ -1170,176 +1170,8 @@ vel) -%0A%0A # report script name and docstring%0A fn_this = inspect.stack()%5B0%5D%5B1%5D.strip()%0A title_this = __doc__.strip()%0A logging.info(': '.join((fn_this, title_this))) %0A @@ -1380,41 +1380,8 @@ = %7B%0A - ...
4268053d9ee64a02b723a78c6d1ee50944b09994
Make Tampa migration meta code lookup more robust
opentreemap/otm1_migrator/migration_rules/tampa.py
opentreemap/otm1_migrator/migration_rules/tampa.py
from otm1_migrator.migration_rules.standard_otm1 import MIGRATION_RULES from treemap.models import ITreeCodeOverride, ITreeRegion, User TAMPA_ITREE_REGION_CODE = 'CenFlaXXX' # The Tampa species fixture does not include family MIGRATION_RULES['species']['removed_fields'].remove('family') # The Tampa species fixtue d...
Python
0
@@ -2471,73 +2471,8 @@ t):%0A - sci_name = species_dict%5B'fields'%5D%5B'scientific_name'%5D.lower()%0A @@ -2554,16 +2554,93 @@ e_code:%0A + sci_name = species_dict%5B'fields'%5D.get('scientific_name', '').lower()%0A
4388492a52885fac4331f5689581e628955f8ace
Update services.py
shields_io/services.py
shields_io/services.py
"""This module contains service definions for Shields.io. Service functions should take three strings (first, second, color) and return three strings (first, second, and color). first - the first path part => the first word on the shield second - the second path part => the second word on the shield color...
Python
0
@@ -2076,16 +2076,27 @@ epos -?slug=%25s +/%25s/branches/master ' %25 @@ -2214,25 +2214,20 @@ et(' -last_build_ +branch. stat -us +e ', ' @@ -2274,177 +2274,25 @@ -second +color = %7B - 0: 'pass -ing'%0A , 1: 'failing'%0A , None: 'pending'%0A , 'n/a': 'n/a'%0A ...
77dc0b3b7dcd7c03a9c23c0f2c95d8f7f7ae26c6
update init file
plantcv/plantcv/morphology/__init__.py
plantcv/plantcv/morphology/__init__.py
from plantcv.plantcv.morphology.find_branch_pts import find_branch_pts from plantcv.plantcv.morphology.segment_skeleton import segment_skeleton from plantcv.plantcv.morphology.find_tips import find_tips from plantcv.plantcv.morphology.segment_sort import segment_sort from plantcv.plantcv.morphology.prune import prune f...
Python
0
@@ -100,107 +100,180 @@ ogy. -segment_skeleton import segment_skeleton%0Afrom plantcv.plantcv.morphology.find_tips import find_tips +find_tips import find_tips%0Afrom plantcv.plantcv.morphology._iterative_prune import _iterative_prune%0Afrom plantcv.plantcv.morphology.segment_skeleton import segment_skeleton %0Afro @...
b6cae9dd657f79b84a9ac622b9a888d372ca9077
Build mono with -O2.
packages/mono-master.py
packages/mono-master.py
import os class MonoMasterPackage(Package): def __init__(self): Package.__init__(self, 'mono', '3.0.7', sources = ['git://github.com/mono/mono'], revision = os.getenv('MONO_BUILD_REVISION'), configure_flags = [ '--enable-nls=no', '--prefix=' + Package.profile.prefix, '--with-ikvm=yes', '--...
Python
0.000002
@@ -684,16 +684,27 @@ gure = ' +CFLAGS=-O2 ./autoge
9532439819db125429d70d554341bd7c8af162b1
Add error on import
panoptes/observatory.py
panoptes/observatory.py
import os import time import astropy.units as u from astropy.coordinates import EarthLocation from . import scheduler as scheduler from .utils.logger import has_logger from .utils.modules import load_module @has_logger class Observatory(object): """ Main Observatory class """ def __init__(self, c...
Python
0.000001
@@ -203,16 +203,41 @@ _module%0A +from .utils import error%0A %0A%0A@has_l
ae2a5f103e155578319a6cb494150939dd25b028
add z sensor
simulator/num_model.py
simulator/num_model.py
import numpy as np import scipy.linalg class Drone: def __init__(self): self.dt = 2E-4 self.time = 0.0 self.g = 9.80 self.gvec = np.array([0., 0., -self.g]) self.M = 1.250 self.R = 0.23 self.Iz = 0.25 * self.M * self.R**2 self.Ixy = self.Iz * 0.5 ...
Python
0
@@ -507,16 +507,43 @@ a = 0.02 +%0A self.noise_z = 0.5 %0A%0A @@ -3099,24 +3099,87 @@ oise_omega)%0A + z = self.pos%5B2%5D + np.random.normal(scale=self.noise_z)%0A retu @@ -3187,24 +3187,27 @@ n acc, omega +, z %0A%0A def ge @@ -3336,20 +3336,16 @@ , 1.%5D))%0A - %0A def
8c5576750418eeb83a41f4a67f1c24a8bef44d4e
Update otx_alienvault.py
plugins/feeds/public/otx_alienvault.py
plugins/feeds/public/otx_alienvault.py
import logging import time from datetime import datetime, timedelta from core import Feed from core.config.config import yeti_config from core.entities import Exploit, Entity from core.errors import ObservableValidationError from core.indicators import Yara, Indicator from core.observables import Hash, Hostname, Url, ...
Python
0
@@ -1130,16 +1130,65 @@ ber_page +, %22OTX key and pages not configured in yeti.conf%22 %0A%0A
9aeede2ac168e151d046d1c18c8d7f4b3cc33c43
Use view to generate OPTIONS response instead of default flask response; attempt to debug CORS issue
portal/views/truenth.py
portal/views/truenth.py
"""TrueNTH API view functions""" from flask import ( Blueprint, current_app, jsonify, make_response, render_template, request, session, url_for, ) from werkzeug.exceptions import Unauthorized from ..audit import auditable_event from ..csrf import csrf from ..extensions import oauth from...
Python
0
@@ -579,24 +579,34 @@ ods=('POST', + 'OPTIONS' ))%0A@csrf.por
a8d78b337dbecb8e503faae4f849ad354b2ba096
Implement `traffic_history` in `User`
sipa/model/hss/user.py
sipa/model/hss/user.py
import logging from flask.ext.login import AnonymousUserMixin from ..default import BaseUser from sipa.model.property import active_prop, unsupported_prop from sipa.model.sqlalchemy import db from sipa.model.hss.ldap import HssLdapConnector from sipa.model.hss.schema import Account, IP from sipa.utils import argstr f...
Python
0.999892
@@ -7,16 +7,57 @@ logging +%0Afrom datetime import datetime, timedelta %0A%0Afrom f @@ -3313,34 +3313,834 @@ -# TODO: return useful data +log = self._pg_account.traffic_log%0A history = %5B%5D%0A%0A for date_delta in range(-6, 1):%0A expected_date = datetime.today() + timedelta(date_de...
ba0ceb3ffb2cd4b73b461afd57c197aefbb48949
Remove custom logging from dev
project/settings/dev.py
project/settings/dev.py
from .base import * ALLOWED_HOSTS = [ 'localhost', ] # Static Server Config STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static') STATIC_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' STATIC_URL = '/static/' # Media (aka File Upload) Server Config MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media') ...
Python
0
@@ -591,787 +591,8 @@ %0A%5D%0A%0A -LOGGING = %7B%0A 'version': 1,%0A %22disable_existing_loggers%22: True,%0A 'handlers': %7B%0A 'console': %7B%0A 'level': 'DEBUG',%0A 'class': 'logging.StreamHandler',%0A 'formatter': 'simple'%0A %7D,%0A %7D,%0A 'formatter...
a028c7234a4fc74b725780014e3f840078e6fedb
Fix typo
protoplot/model/axis.py
protoplot/model/axis.py
from protoplot.engine import Item class Axis(Item): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.options.register("log", False, False) self.options.register("logBase", False, 10) self.options.register("min", False, None) self.options.r...
Python
0.999999
@@ -414,32 +414,33 @@ self.option +s .register(%22major @@ -482,16 +482,17 @@ f.option +s .registe
079f61dbfd73d2fef8ac5cd3ba4fb10b730e0410
Switch try to use its copy of favicon.ico .
site/try/build_try.gyp
site/try/build_try.gyp
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE { 'targets': [ { 'target_name': 'try_site', 'type': 'none', 'dependencies': [ '....
Python
0.000001
@@ -982,47 +982,8 @@ ' -../../sdk/lib/_internal/dartdoc/static/ favi
2bd443655529527a64e46872cd1dbf8142be8dc3
change session name to identifier
pupa/importers/votes.py
pupa/importers/votes.py
from .base import BaseImporter from opencivicdata.models import VoteEvent, LegislativeSession class VoteImporter(BaseImporter): _type = 'vote' model_class = VoteEvent related_models = {'counts': {}, 'votes': {}, 'sources': {}} def __init__(self, jurisdiction_id, person_importer, org_...
Python
0.000011
@@ -1002,12 +1002,18 @@ -name +identifier =dat
a2763d0c85a90706fda4d7468bcfd6cb5f192ad7
Fix error messages
softkbdgen/gen/base.py
softkbdgen/gen/base.py
import itertools import os import os.path import random import re import subprocess from collections import OrderedDict from ..base import ISO_KEYS class MissingApplicationException(Exception): pass def bind_iso_keys(other): return OrderedDict(((k, v) for k, v in zip(ISO_KEYS, other))) class Generator: def...
Python
0.000021
@@ -1160,32 +1160,39 @@ aise Exception(%22 +Layout '%25s' has a requi @@ -1195,33 +1195,49 @@ equired mode -.%22 %25 +: '%25s'.%22 %25 (layout, key) +) %0A ret @@ -1457,16 +1457,23 @@ eption(%22 +Layout '%25s' has @@ -1492,17 +1492,33 @@ mode -.%22 %25 +: '%25s'.%22 %25 (layout, key) +) %0A
46338d8ea16cbc801df1791b8467ec9268ad8d2e
convert do_spec to klk
unit/do_spec.py
unit/do_spec.py
from typing import Generator from amino.test.spec_spec import Spec from amino import Just, Nothing, Maybe, do from amino.state import EvalState, StateT class DoSpec(Spec): def just(self) -> None: @do def run(i: int) -> Generator[Maybe[int], int, Maybe[int]]: a = yield Just(i) ...
Python
0.999999
@@ -21,16 +21,21 @@ enerator +, Any %0A%0Afrom a @@ -65,16 +65,117 @@ ort Spec +%0A%0Afrom kallikrein import kf, Expectation, k%0Afrom kallikrein.matchers.maybe import be_just, be_nothing %0Afrom am @@ -209,16 +209,22 @@ aybe, do +, Eval %0Afrom am @@ -279,16 +279,130 @@ c(Spec): +%0A '''do notation%0A yie...
4e91b5965c047cad5059e70e314612f3100f6d4c
Fix one, call the database update function.
util/db-util.py
util/db-util.py
#!/usr/bin/env python3 # seed-node-monitor: a monitor system for cryptocurrency seed nodes # Copyright (C) 2015 Myckel Habets # # 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 Founda...
Python
0
@@ -3680,16 +3680,65 @@ tabase)%0A + # Update the database%0A db.update_database()%0A db.ge @@ -4175,16 +4175,17 @@ xit()%0A%0A# + start th
e79949dbb639a4818fc7b509b03bc6f94db458e4
create test to load all passbands listed in pbzptmag file
source_synphot/main.py
source_synphot/main.py
# -*- coding: UTF-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import numpy as np from . import io from . import passband import pysynphot as S def main(inargs=None): args = io.get_options(args=inargs) sourcepb, sourcepbzp = io.get_...
Python
0
@@ -134,16 +134,26 @@ iterals%0A +import os%0A import n @@ -206,30 +206,8 @@ band -%0Aimport pysynphot as S %0A%0Ade @@ -235,569 +235,242 @@ -args = io.get_options(args=inargs +pbzptfile = os.path.join('passbands','pbzptmag.txt' )%0A -%0A -sourcepb, sourcepbzp = io.get_passband(args.sourcepb)%0A if ...
fd12afb076b984fa485fb20f6b9603d69c4c8273
Disable gap statistic - too slow for regular testing. Not officially supported anyway.
py/testdir_multi_jvm/test_KMeans_sphere3_fvec.py
py/testdir_multi_jvm/test_KMeans_sphere3_fvec.py
import unittest, time, sys, random, math sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_kmeans, h2o_hosts, h2o_import as h2i # a truly uniform sphere # http://stackoverflow.com/questions/5408276/python-uniform-spherical-distribution # While the author prefers the discarding method for spheres, for completen...
Python
0
@@ -4366,16 +4366,39 @@ +#too slow%0A # gs = h2o @@ -4472,24 +4472,25 @@ +# print %22gap_s
d7e0f8217dd7002689ffc15e1353117338569795
Check environment variable/sys.path when adding (#241)
python/dllib/src/bigdl/dllib/utils/zoo_engine.py
python/dllib/src/bigdl/dllib/utils/zoo_engine.py
# # Copyright 2018 Analytics Zoo 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 applicable law or agreed to...
Python
0
@@ -2309,33 +2309,110 @@ -sys.path.insert(0, py4j)%0A +if py4j not in sys.path:%0A sys.path.insert(0, py4j)%0A if pyspark not in sys.path:%0A @@ -2798,32 +2798,89 @@ ):%0A try:%0A + if path not in os.environ%5Benv_var_name%5D:%0A prin @@ -2923,16 +29...
8714d136cea7fe54f3ae8cbf97da14a142b88db8
Handle IntegrityError when creating transactions
shopify/product/models.py
shopify/product/models.py
from __future__ import unicode_literals from decimal import Decimal from django.db import models from django.db.models import Sum from django.utils.encoding import python_2_unicode_compatible from django.utils.timezone import now @python_2_unicode_compatible class Product(models.Model): # Unique Shopify product...
Python
0
@@ -63,16 +63,53 @@ ecimal%0A%0A +from django.db import IntegrityError%0A from dja @@ -1133,16 +1133,37 @@ antity)%0A + try:%0A @@ -1248,24 +1248,28 @@ + created_at=n @@ -1283,16 +1283,72 @@ *kwargs) +%0A except IntegrityError:%0A pass %0A%0A ...
711d32119d3b6b838d25e0eda23aaaf5261ab85b
Move imports onto separate lines
sha2/sha256.py
sha2/sha256.py
#!/usr/bin/python __author__ = 'Thomas Dixon' __license__ = 'MIT' import copy, struct, sys def new(m=None): return sha256(m) class sha256(object): _k = (0x428a2f98L, 0x71374491L, 0xb5c0fbcfL, 0xe9b5dba5L, 0x3956c25bL, 0x59f111f1L, 0x923f82a4L, 0xab1c5ed5L, 0xd807aa98L, 0x12835b01L, 0x2431...
Python
0.000012
@@ -75,23 +75,36 @@ copy -, struct, +%0Aimport struct%0Aimport sys%0A%0A +%0A def
6483a641388b2b391d051e79b5bcffd0d82571e6
return 201 on added task
webapp/tasks.py
webapp/tasks.py
#!/usr/bin/env python import json from pprint import pprint from time import time from flask import Blueprint, Flask, Response, request from flask import session, jsonify, url_for, current_app from sqlalchemy.exc import IntegrityError from sqlalchemy.orm.exc import UnmappedInstanceError from sqlalchemy import or_ fr...
Python
0.000425
@@ -1069,24 +1069,83 @@ n.add(task)%0A + msg = %7B'status': 500, 'message': 'Internal Error'%7D%0A try: @@ -1526,30 +1526,20 @@ p = -'%7B %22smokeyou%22: true %7D' +jsonify(msg) %0A
50e7a52f1a481ee086fdc23851fa01c8c9838137
Fix agent tests
simulations/test_agent.py
simulations/test_agent.py
import pytest from hippiehug import Chain from claimchain import View, State, LocalParams from .agent import * @pytest.fixture def global_state(context): return GlobalState(context) def test_agent_send_and_receive_email(): alice = Agent('alice') bob = Agent('bob') message_metadata = alice.send_me...
Python
0.000003
@@ -2168,24 +2168,87 @@ , 'carol'%5D)%0A + # Alice updates her chain, because she learned about Carol%0A assert a @@ -2391,88 +2391,36 @@ Bob -has learned about +-%3E Alice -... %0A -assert bob.get_latest_view('alice'). +bob_ head +0 = -= alice + bob .hea @@ -2429,151 +2429,118 @@ -# ...but ...
b57499cb00012ffb364ca0cb3095ec572ce85d4d
Use HTML5 output for Markdown.
sigal/utils.py
sigal/utils.py
# -*- coding: utf-8 -*- # Copyright (c) 2011-2014 - Simon Conseil # 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...
Python
0
@@ -1994,16 +1994,39 @@ %5B'meta'%5D +, output_format='html5' )%0A ht
f71716c41b6c430569c2286af023787e814dcb20
fix reset_timeout
skitai/corequest/tasks.py
skitai/corequest/tasks.py
import sys from ..utility import make_pushables from ..exceptions import HTTPError from . import corequest, response from .httpbase.task import DEFAULT_TIMEOUT, Task from skitai import was from rs4.attrdict import AttrDict import time class TaskBase (corequest): def __init__ (self, reqs, timeout = DEFAULT_TIMEOUT,...
Python
0.000002
@@ -1495,29 +1495,37 @@ if -isinstance (req, Task +hasattr (req, 'reset_timeout' ):%0A
8eaef068757b23361c4c71b5057ec13aa7e916d5
make generate_md5_signature work as standalone
skrill/tests/factories.py
skrill/tests/factories.py
from decimal import Decimal import hashlib import random from django.contrib.auth.models import User import factory from skrill.settings import get_secret_word_as_md5 from skrill.models import PaymentRequest, StatusReport from skrill.settings import * class UserFactory(factory.DjangoModelFactory): FACTORY_FOR ...
Python
0.000011
@@ -1050,17 +1050,13 @@ cy%0A%0A - +%0A def -_ gene @@ -1079,18 +1079,23 @@ re(s -elf):%0A +tatus_report):%0A @@ -1112,20 +1112,16 @@ b.md5()%0A - m.up @@ -1130,19 +1130,28 @@ te(str(s -elf +tatus_report .merchan @@ -1153,36 +1153,32 @@ rchant_id))%0A - - m.update(str(sel @@ -11...
bdf3d07adf62cca331a4f1aaa67b95384871dcb0
Refactor result merging code
src/robot/result/merger.py
src/robot/result/merger.py
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
Python
0
@@ -1104,35 +1104,55 @@ suite):%0A -try +if self.current is None :%0A se @@ -1145,36 +1145,27 @@ -self.current +old = self._fin @@ -1170,28 +1170,13 @@ ind_ -suite(self.current, +root( suit @@ -1196,275 +1196,180 @@ e -xcept IndexError:%0A suite.message = self._cre...
75ea1c11dfa136c1c8abd03fc378a803567a9abc
Convert python3 code
smt/ibmmodel/ibmmodel2.py
smt/ibmmodel/ibmmodel2.py
#! /usr/bin/env python # coding:utf-8 from __future__ import division, print_function import collections import ibmmodel1 from smt.utils import utility import decimal from decimal import Decimal as D # set deciaml context decimal.getcontext().prec = 4 decimal.getcontext().rounding = decimal.ROUND_HALF_UP class _key...
Python
0.999999
@@ -36,56 +36,8 @@ -8%0A%0A -from __future__ import division, print_function%0A impo @@ -51,16 +51,34 @@ ections%0A +from smt.ibmmodel import i @@ -1090,17 +1090,16 @@ r _i in -x range(lo
82194829893309fe0181c2450dfe69dcf517cf2d
add warning
sip.py
sip.py
from __future__ import division from numpy.testing.utils import assert_almost_equal # transform lensfun distortion terms into equivalent SIP distortion terms def scale(w, h): return h/2 if h<w else w/2 def poly3(k1, w, h): s = scale(w, h) order = 3 # f(u,v) = -k1*u + k1/s^2*u*v^2 + k1/s^2*...
Python
0.000001
@@ -154,24 +154,145 @@ on terms%0D%0A%0D%0A +# WARNING: THE BELOW CODE IS INCORRECT!! THE FORMULAS USED ARE FOR THE%0D%0A# OPPOSITE TRANSFORMATION DIRECTION!%0D%0A%0D%0A def scale(w,
4cc3f7c40317afb3f13d682cde290d21ed98e654
Remove unused stuff
soap/program/generator.py
soap/program/generator.py
from pprint import pprint import collections from soap.expression import ( is_variable, is_expression, expression_factory, InputVariableTuple, OutputVariableTuple, SelectExpr ) from soap.label import Label from soap.program.flow import ( IdentityFlow, AssignFlow, IfFlow, CompositionalFlow ) from soap.progr...
Python
0.000001
@@ -1,30 +1,4 @@ -from pprint import pprint%0A impo @@ -78,28 +78,8 @@ ion, - expression_factory, %0A @@ -198,25 +198,11 @@ t (%0A + - IdentityFlow, Ass
2e2ae20727a821b688b525df8f3705877aea677c
set docs language
docs/source/conf.py
docs/source/conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ OSMnx documentation build configuration file. Created by sphinx-quickstart on Sun Feb 4 13:53:34 2018. This file is execfile()d with the current directory set to its containing dir. Note that not all possible configuration values are present in this autogenerated fi...
Python
0.000002
@@ -2566,12 +2566,12 @@ e = -None +%22en%22 %0A%0A#
9c0863be1f51d3ef096899fa509b6bedf87b7b42
fix doc - maybe
docs/source/conf.py
docs/source/conf.py
# -*- coding: utf-8 -*- # # mps documentation build configuration file, created by # sphinx-quickstart on Sun Apr 30 13:51:41 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
Python
0
@@ -649,18 +649,16 @@ here.%0A#%0A -# import o @@ -659,18 +659,16 @@ port os%0A -# import s @@ -670,18 +670,16 @@ ort sys%0A -# sys.path @@ -707,16 +707,17 @@ spath('. +. '))%0A%0A%0A#
ccdd12318753ce92be0b94fb83a3b6dd95e993e7
Allow storing non-field values into a ShopifyElement instance
src/shopipy/data/models.py
src/shopipy/data/models.py
import re from StringIO import StringIO from shopipy.data.fields import Field from shopipy.util import SortedDict, etree def get_declared_fields(bases, attrs, with_base_fields=True): """ Create a list of form field instances from the passed in 'attrs', plus any similar fields on the base classes (in 'bases...
Python
0.000001
@@ -2749,24 +2749,61 @@ me, value):%0A + if name in self._fields:%0A fiel @@ -2825,16 +2825,20 @@ s%5Bname%5D%0A + @@ -2860,32 +2860,36 @@ o_python(value)%0A + field.va
cc8d918d368c52ffc09915e7b4a0f5c63af2f3d5
Use rules_pkg-0.2.6
dreal/workspace.bzl
dreal/workspace.bzl
load( "//third_party/com_github_robotlocomotion_drake:tools/workspace/github.bzl", "github_archive", ) load( "//third_party/com_github_robotlocomotion_drake:tools/workspace/pkg_config.bzl", "pkg_config_repository", ) load( "//third_party/com_github_tensorflow_tensorflow/py:python_configure.bzl", ...
Python
0.000001
@@ -1118,72 +1118,72 @@ = %22 -352c090cc3d3f9a6b4e676cf42a6047c16824959b438895a76c2989c6d7c246a +a5cca9cf01c7fcfe4aab8ef54ce590e49c4921fa0d4d194b5f0ad732a8b207c4 %22,%0A @@ -1258,17 +1258,17 @@ oad/0.2. -5 +6 /rules_p @@ -1274,17 +1274,17 @@ pkg-0.2. -5 +6 .tar.gz%22
9f1bc3f24c6c9f0412f815abe044274d3840fa23
Fix augment
spacy/training/augment.py
spacy/training/augment.py
from typing import Callable, Iterator, Dict, List, Tuple, TYPE_CHECKING import random import itertools import copy from functools import partial from pydantic import BaseModel, StrictStr from ..util import registry from ..tokens import Doc from .example import Example if TYPE_CHECKING: from ..language import Lang...
Python
0.000001
@@ -4448,19 +4448,20 @@ t_idx%5D%5B%22 -TAG +tags %22%5D%0A
7406975f2a0484c76bb2998c7f6ae064434ad4a3
Build function working!
wow/__main__.py
wow/__main__.py
""" Wow Usage: wow wow install <application>... wow uninstall <application>... wow build wow push wow compile wow (-h | --help) wow --version Action Options: -h --help Show this screen. --version Show version. """ from lib.wow import Wow from docopt import docopt if __na...
Python
0.000001
@@ -97,13 +97,54 @@ wow -build +unpack %3Cfile%3E...%0A wow build %5B%3Cconfig_file%3E%5D %0A @@ -345,16 +345,133 @@ docopt%0A +from lib.exception import WowException%0Aimport logging%0A%0Alogging.basicConfig(format='%25(message)s', level=logging.DEBUG) %0A%0Aif __n @@ -559,16 +559,29 @@ = Wow()%0A + tr...
1312534adb7807b7721942e3c2bcff13572d326e
Fix context processor module location
www/settings.py
www/settings.py
# coding: utf-8 # maposmatic, the web front-end of the MapOSMatic city map generation system # Copyright (C) 2009 David Decotigny # Copyright (C) 2009 Frédéric Lehobey # Copyright (C) 2009 David Mentré # Copyright (C) 2009 Maxime Petazzoni # Copyright (C) 2009 Thomas Petazzoni # Copyright (C) 2009 Gaël Utard # ...
Python
0.000033
@@ -2778,16 +2778,20 @@ ,%0A ' +www. maposmat
e826943e0b59511ec6bbcda89e94f0a5bb099097
change metavars
xdist/plugin.py
xdist/plugin.py
import py import pytest def pytest_addoption(parser): group = parser.getgroup("xdist", "distributed and subprocess testing") group._addoption('-f', '--looponfail', action="store_true", dest="looponfail", default=False, help="run tests in subprocess, wait for modified files " ...
Python
0.000001
@@ -1694,25 +1694,19 @@ etavar=%22 -rsyncdirs +DIR %22,%0A @@ -1845,20 +1845,12 @@ ar=%22 -rsyncignores +GLOB %22,%0A
bb2926591dcab344c330c931286ab65d31336736
fix sklearn tests with the correct model_dir (#98)
python/sklearnserver/sklearnserver/test_model.py
python/sklearnserver/sklearnserver/test_model.py
from sklearn import svm from sklearn import datasets from sklearnserver import SKLearnModel import joblib import os model_dir = "/path/to/kfserving/docs/samples/sklearn" JOBLIB_FILE = "model.joblib" def test_model(): iris = datasets.load_iris() X, y = iris.data, iris.target sklearn_model = svm.SVC(gamm...
Python
0
@@ -127,26 +127,13 @@ = %22 -/path/to/kfserving +../.. /doc @@ -626,8 +626,9 @@ e == %5B0%5D +%0A
a852ccfa5fd78c4e7fb61b1c2685dca7468f3cef
Rename FIWARE_API_SECRET to FIWARE_APP_SECRET
src/wirecloud/fiware/social_auth_backend.py
src/wirecloud/fiware/social_auth_backend.py
# -*- coding: utf-8 -*- # Copyright (c) 2013 Conwet Lab., Universidad Politécnica de Madrid # This file is part of Wirecloud. # Wirecloud 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 versio...
Python
0.999999
@@ -3152,25 +3152,25 @@ = 'FIWARE_AP -I +P _SECRET'%0A
9c5bd69391ad1dad03b58371ee24fcea00b58220
use assemble_output in in-process kernel test
IPython/kernel/inprocess/tests/test_kernel.py
IPython/kernel/inprocess/tests/test_kernel.py
# Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function import sys import unittest from IPython.kernel.inprocess.blocking import BlockingInProcessKernelClient from IPython.kernel.inprocess.manager import InProcessKernelManager from IP...
Python
0
@@ -368,16 +368,71 @@ sKernel%0A +from IPython.kernel.tests.utils import assemble_output%0A from IPy @@ -484,16 +484,16 @@ plotlib%0A - from IPy @@ -1109,35 +1109,51 @@ -msg = get_stream_message(kc +out, err = assemble_output(kc.iopub_channel )%0A @@ -1186,38 +1186,19 @@ otlib', -msg%5B'content'%5D%5B'te...
0eeaf0f6b49dcc39139e596a2237a31646b0b5ee
Add missing import, remove star import
src/spz/test/test_views.py
src/spz/test/test_views.py
# -*- coding: utf-8 -*- """Tests the application views. """ from test.fixtures import * # noqa from . import login, logout, get_text from spz.models import Course, Origin, Degree, Graduation def test_startpage(client): response = client.get('/') response_text = get_text(response) assert 'Anmeldung' in r...
Python
0.000013
@@ -64,52 +64,107 @@ rom -test.fixtures import * # noqa +. import login, logout, get_text%0Afrom test.fixtures import client, user, superuser %0Afrom -. +spz import logi @@ -159,39 +159,19 @@ import -login, logout, get_text +app %0Afrom sp
43315638e6131a8b0926b15473d842ed7e9f9c42
fix unicode
sqlalchemy_mptt/mixins.py
sqlalchemy_mptt/mixins.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2014 uralbash <root@uralbash.ru> # # Distributed under terms of the MIT license. """ SQLAlchemy nested sets mixin """ from sqlalchemy import Column, event, ForeignKey, Index, Integer from sqlalchemy.ext.declarative import declared_attr fr...
Python
0.999956
@@ -2735,16 +2735,22 @@ l': -str( node +.__repr__( )%7D%0A
75138535e2975abfdf7ce39f9063a69ca6db51ad
change ellipsis to pass
benchbuild/environments/service_layer/ensure.py
benchbuild/environments/service_layer/ensure.py
import sys from . import unit_of_work if sys.version_info <= (3, 8): from typing_extensions import Protocol else: from typing import Protocol class ImageNotFound(Exception): ... class NamedCommand(Protocol): @property def name(self) -> str: ... def image_exists( cmd: NamedComman...
Python
0
@@ -183,19 +183,20 @@ n):%0A -... +pass %0A%0A%0Aclass
7be716594897d322358ee56655f3593f8842ceff
Fix license repr methid
slim/models.py
slim/models.py
# -*- coding: utf-8 -*- import datetime from flask_sqlalchemy import SQLAlchemy from flask_security import UserMixin, RoleMixin db = SQLAlchemy() # Secutiry roles_users = db.Table( 'roles_users', db.Column('user_id', db.Integer(), db.ForeignKey('users.id')), db.Column('role_id', db.Integer(), db.Forei...
Python
0.000001
@@ -4656,16 +4656,24 @@ self. +request_ date.iso
b4d521d030e37999c94e70bcb0726e2d8d3a3508
Fix docstrings.
ecpy/utils/flags.py
ecpy/utils/flags.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015 by Ecpy Authors, see AUTHORS for more details. # # Distributed under the terms of the BSD license. # # The full license is in the file LICENCE, distributed with this software. # ---------------------...
Python
0.000001
@@ -2370,17 +2370,17 @@ False -o +i f the me
5c25415d619483db6596ddbc8dbb29dde1f3a0a0
Remove BehaviorialUtils.list_duplicates_of()
drupdates/tests/behavioral/behavioral_utils.py
drupdates/tests/behavioral/behavioral_utils.py
""" Parent class for behavioral tests, help build the test repos etc... """ import os, shutil, yaml, subprocess from git import Repo from os.path import expanduser from os.path import basename from drupdates.tests import Setup class BehavioralException(Exception): 'exception to demostrate fixture/test failures' ...
Python
0
@@ -5766,406 +5766,8 @@ ts%0A%0A - @staticmethod%0A def list_duplicates_of(seq, item):%0A %22%22%22 Get a list of occuurance of seq in item. %22%22%22%0A%0A start_at = -1%0A locs = %5B%5D%0A while True:%0A try:%0A loc = seq.index(item, start_at+1)%0A ...
c3605b7d7c5076478764c536992d3dbcf26ac07d
Add @api.one warning
button_action_demo/models/button_action_demo.py
button_action_demo/models/button_action_demo.py
# -*- coding: utf-8 -*- from openerp import models, fields, api #Non-odoo library import random from random import randint import string class button_action_demo(models.Model): _name = 'button.demo' name = fields.Char(required=True,default='Click on generate name!') password = fields.Char() @api.one ...
Python
0.000003
@@ -299,17 +299,110 @@ .Char()%0A + %0A # WARNING! @api.one is deprecated in Odoo 9, use @api.multi with ensure_one instead! %0A - @api @@ -654,32 +654,121 @@ dint(9,15)))%7D)%0A%0A + # WARNING! @api.one is deprecated in Odoo 9, use @api.multi with ensure_one instead!%0A @api.one%0A @@ -1030,24...
205b0e3d21e0d7582faa0ab9ad5a09cb1a351d05
Add boundary checks for states
pymoskito/examples/tanksystem/model.py
pymoskito/examples/tanksystem/model.py
import numpy as np from collections import OrderedDict import pymoskito as pm from . import settings as st class TwoTankSystem(pm.Model): public_settings = OrderedDict([('initial state', [0, 0]), ("AT", st.AT), ("hT", st.hT), ...
Python
0
@@ -1122,16 +1122,93 @@ rgs%5B0%5D%0A%0A + if x1 %3C 0:%0A x1 = 0%0A if x2 %3C 0:%0A x2 = 0%0A%0A
5f8e1365d82bb2cd9395547124bf9b905ddc3a81
add try/except to date parsing (bug with no date was crashing site).
gcal.py
gcal.py
import logging import datetime from google.appengine.api import memcache import gdata.alt.appengine import gdata.calendar.service import settings def _nth(num): """ Returns the 'th' suffix to the given num. What's that thing called? """ sn = str(num) ld = sn[-1] if len(sn) == 1 or sn[-2] != '1':...
Python
0
@@ -143,16 +143,17 @@ ttings%0A%0A +%0A def _nth @@ -474,16 +474,17 @@ n 'th'%0A%0A +%0A class Ca @@ -650,16 +650,33 @@ '.')%5B0%5D%0A + try:%0A @@ -740,16 +740,70 @@ %25M:%25S')%0A + except ValueError:%0A self.when = %22%22%0A @@ -865,32 +865,58 @@ e_string(self)...
349c3ec86bd318d6e64bda8ad6382ca6b41339db
Remove errant "self" argument to NodeProvider static method
python/ray/autoscaler/node_provider.py
python/ray/autoscaler/node_provider.py
import logging from types import ModuleType from typing import Any, Dict, List, Optional from ray.autoscaler.command_runner import CommandRunnerInterface from ray.autoscaler._private.command_runner import \ SSHCommandRunner, DockerCommandRunner logger = logging.getLogger(__name__) class NodeProvider: """Int...
Python
0.000002
@@ -7201,38 +7201,32 @@ ces(%0A - self, cluster_config:
6a6653cb0e5b34d961e889573d6567faebea39e8
Fix example (#4700)
examples/pip_requirements/pip_requirements.py
examples/pip_requirements/pip_requirements.py
""" This example demonstrates how to specify pip requirements using `pip_requirements` and `extra_pip_requirements` when logging a model via `mlflow.*.log_model`. """ import tempfile import sklearn from sklearn.datasets import load_iris import xgboost as xgb import mlflow def read_lines(path): with open(path) a...
Python
0.000002
@@ -766,18 +766,28 @@ urn +set( reqs +) , +set( cons +) %0A%0A @@ -795,20 +795,25 @@ return +set( reqs +) %0A%0A%0Adef m @@ -1354,36 +1354,44 @@ assert pip_reqs - == +.issuperset( %5B%22mlflow%22, xgb_r @@ -1389,24 +1389,25 @@ w%22, xgb_req%5D +) , pip_reqs%0A%0A @@ -1699,33 +1699,33 @@ ert pip_req...
8d43724e5027ab5b3ea09e47013c011da06a844f
Disable usage of latex for figure caption.
examples/radialSamplingDensityCompensation.py
examples/radialSamplingDensityCompensation.py
# Copyright (c) 2016, Imperial College London # Copyright (c) 2016, Benedikt Lorch # All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the BSD license. See the accompanying LICENSE file # or read the terms at https://opensource.org/licenses/BSD-3-Claus...
Python
0
@@ -3912,43 +3912,8 @@ lib%0A -matplotlib.rc('text', usetex=True)%0A matp
62a8d6d413668e57f049d2e9c3c4f807eb2b4566
improve unit-tests
exercises/rectangles/rectangles_count_test.py
exercises/rectangles/rectangles_count_test.py
import unittest from rectangles import count class WordTest(unittest.TestCase): # unit tests def test_zero_area_1(self): assert 0 == count() def test_zero_area_2(self): lines = "" assert 0 == count(lines) def test_empty_area(self): lines = " " assert 0 == cou...
Python
0
@@ -80,25 +80,8 @@ e):%0A - # unit tests%0A @@ -120,27 +120,35 @@ +self. assert - 0 == +Equal(0, count() %0A%0A @@ -143,16 +143,17 @@ count() +) %0A%0A de @@ -201,35 +201,43 @@ %22%22%0A +self. assert - 0 == +Equal(0, count(lines @@ -229,32 +229,33 @@ (0, count(lines) +) %0A%0...
5022210cd5aa50467c7a2b880de04ca547714001
resolve merge conflicts
main.py
main.py
import praw from config import config import sqlite3 as lite import sys class Bot(object): def __init__(self): self.r = praw.Reddit(user_agent=config['user_agent']) def get_comments_for_user(self,user_name): # this fuction returns all the comments for a user reddit_user = self.r.get_r...
Python
0.000001
@@ -785,16 +785,25 @@ omments%0A + %0A @@ -965,17 +965,16 @@ text)%0A%0A%0A -%0A
a68f10eeff40591487ede5ac27c9dca488b1e494
Implement length parameter
main.py
main.py
from createCollection import createCollection from ObjectFactories.ItemFactory import ItemFactory from DataObjects.Collection import Collection import datetime, json, os.path, argparse CONST_COLLECTIONS_NAME = 'collections' def generateArgumentsFromParser(): parser = parser = argparse.ArgumentParser(description="...
Python
0.000004
@@ -586,24 +586,90 @@ uired=True)%0A + parser.add_argument('--length', dest='length', required=True)%0A return p @@ -1290,10 +1290,29 @@ me, -10 +int(arguments.length) )%0A%0A
91294ee9601a0aae89a2d45123138e1db69ad289
remove the magic xpos numbers from shooter setup, and simplify
main.py
main.py
#! /usr/bin/env python import cv2 import sys from shooters import Shooter from arduino import Arduino, FakeArduino from camera import Camera def choose_center(centers): if centers == []: return centers nearesty = sorted(centers, key = lambda pair: pair[0]) # game tactics logic goes here retur...
Python
0
@@ -606,108 +606,209 @@ def -main(args):%0A if %22fake%22 in args:%0A board = FakeArduino()%0A else:%0A board = Arduino() +setup_shooters(board, offset_in = 3, field = %5B22.3125, 45%5D, dpi = 17):%0A offset = offset_in * dpi%0A wpx = field%5B0%5D * dpi%0A sixth = int(wpx / 6)%0A # lef...
2e39d0c864680793b42234d2c686cae44ed7727c
Add some missing imports
elections/mixins.py
elections/mixins.py
from django.conf import settings class ElectionMixin(object): '''A mixin to add election data from the URL to the context''' def dispatch(self, request, *args, **kwargs): self.election = election = self.kwargs['election'] if election not in settings.ELECTIONS: raise Http404(_("Unk...
Python
0.000201
@@ -26,16 +26,99 @@ ettings%0A +from django.http import Http404%0Afrom django.utils.translation import ugettext as _%0A %0A%0Aclass
8124c8d9582e743cb52707a5e097198794f00cd0
fix license notice
testbed/threading/thread-subprocess-test.py
testbed/threading/thread-subprocess-test.py
"""Test that the 'subprocess' releases the GIL, allowing threading. If the GIL was not released for the duration of the calls to 'sleep' then we'd expect the running time to be over 9 seconds. In practice it's closer to the ideal of 3 in the single-processor Lubuntu 13.04 VM tested on. With this result we can see tha...
Python
0
@@ -1218,8 +1218,758 @@ main())%0A +# -----------------------------------------------------------------------------%0A# Copyright (C) 2014 Bloomberg Finance L.P.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may ...
60cc9be7d9c6490a0dd949b47aa760fe6f4a3581
Update to return as job schema
enrique/__init__.py
enrique/__init__.py
import sys import threading import json import imp from importlib import import_module import mesos.interface import mesos.native from mesos.interface import mesos_pb2 from pyrallelsa import group_runner from pyrallelsa import ProblemClassPath class Enrique(mesos.interface.Executor): def registered(self, driver...
Python
0
@@ -239,16 +239,48 @@ assPath%0A +from pyrallelsa import Solution%0A %0A%0Aclass @@ -1208,60 +1208,8 @@ d'%5D%0A - task_divisions = task_data%5B'divisions'%5D%0A @@ -1536,16 +1536,72 @@ sions':%0A + task_divisions = task_data%5B'divisions'%5D%0A @@ -1744,16 +1744,100 @@ ...
1369fca588fd7681a4f5bc84d07b418c9e32c875
Fix format string in emit_param.
katagawa/backends/postgresql/asyncpg/__init__.py
katagawa/backends/postgresql/asyncpg/__init__.py
""" The :ref:`asyncpg` connector for PostgreSQL databases. """ import typing import logging import asyncpg from asyncpg import Record from asyncpg.cursor import Cursor from asyncpg.transaction import Transaction from dsnparse import ParseResult from katagawa.backends.base import BaseConnector, BaseTransaction, BaseRe...
Python
0.000009
@@ -4838,17 +4838,16 @@ %7Bname%7D%7D%7D -%7D %22.format
fa14c040e6483087f5b2c78bc1a7aeee9ad2274a
Add time formatter for competitions
Instanssi/kompomaatti/misc/time_formatting.py
Instanssi/kompomaatti/misc/time_formatting.py
# -*- coding: utf-8 -*- import awesometime def compo_times_formatter(compo): compo.compo_time = awesometime.format_single(compo.compo_start) compo.adding_time = awesometime.format_single(compo.adding_end) compo.editing_time = awesometime.format_single(compo.editing_end) compo.voting_time = awesometime...
Python
0
@@ -384,8 +384,250 @@ n compo%0A +%0Adef competition_times_formatter(competition):%0A competition.start_time = awesometime.format_single(competition.start)%0A competition.participation_end_time = awesometime.format_single(competition.participation_end)%0A return competition%0A
607c48b426c934dd56724e1966497d0742eb0a05
Update BinomialProbability_Calculator.py
PYTHON/BinomialProbability_Calculator.py
PYTHON/BinomialProbability_Calculator.py
#This Python script calculates the probability for n choose k in a binomial probability distribution. #Functions are described in the docstrings. print('-------------------') print("This will calculate the probability for n choose k in a binomial probability distribution.") p = float(input('Choose the probability for...
Python
0
@@ -139,16 +139,39 @@ strings. +%0A#!/usr/bin/env python3 %0A%0Aprint(
fcc20e6c62b801cd377480e5e5a7075c03ab2eeb
Make len a simple unary function
raco/expression/expressions_library.py
raco/expression/expressions_library.py
''' A library of expressions that can be composed of existing expressions. ''' from .udf import Function from raco.expression import * def lookup(function_name, num_args): func = EXPRESSIONS.get(function_name.lower()) if hasattr(func, '__call__'): return func(num_args) if isinstance(func, dict): ...
Python
0.999954
@@ -1769,69 +1769,8 @@ )),%0A - 'len': Function(%5B'str'%5D, LEN(NamedAttributeRef('str'))),%0A @@ -2691,16 +2691,32 @@ ': TAN,%0A + 'LEN': LEN,%0A %7D%0A%0A%0Adef
98f2b72768f005ca83af2d8cea02a542c60cbfcb
Bump version -> v0.0.3
estools/__init__.py
estools/__init__.py
__version__ = '0.0.2'
Python
0
@@ -16,7 +16,7 @@ 0.0. -2 +3 '%0A
b651eee2f837ee7eb7a7dbd73a3d9e7685a5dbbf
Fix a typo
readthedocs/settings/docker_compose.py
readthedocs/settings/docker_compose.py
import os import socket from .dev import CommunityDevSettings class DockerBaseSettings(CommunityDevSettings): """Settings for local development with Docker""" DOCKER_ENABLE = True RTD_DOCKER_COMPOSE = True RTD_DOCKER_COMPOSE_VOLUME = 'community_build-user-builds' RTD_DOCKER_USER = f'{os.geteuid...
Python
1
@@ -1336,16 +1336,17 @@ ress lis +t %0A _,
5b0c092ab39087724d11960c76e9d2fb62888e1d
append str, not Path, to sys.path
etc/debsources.wsgi
etc/debsources.wsgi
# WSGI Python file to bridge apache2 / Flask application import sys from pathlib import Path DEBSOURCES_LIB = Path(__file__).resolve().parent.parent / "lib" sys.path.append(DEBSOURCES_LIB) from debsources.app import app_wrapper app_wrapper.go() application = app_wrapper.app
Python
0.998411
@@ -168,16 +168,20 @@ .append( +str( DEBSOURC @@ -187,16 +187,17 @@ CES_LIB) +) %0A%0Afrom d
a171bbe0cd36f23d994870453a6e35d9cf56a6fe
Fix to Hyperprecossor Test
tests/autokeras/hyper_preprocessors_test.py
tests/autokeras/hyper_preprocessors_test.py
# Copyright 2020 The AutoKeras 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 applicable law or agreed to i...
Python
0.000002
@@ -1966,32 +1966,40 @@ or.preprocessor, +%0A preprocessors.C @@ -2019,16 +2019,29 @@ umerical +Preprocessor, %0A )%0A%0A
e01dd7facca2afa5fca78817ddad2ba6d8899ff4
update to nxos_command with additional exception handling
lib/ansible/modules/network/nxos/nxos_command.py
lib/ansible/modules/network/nxos/nxos_command.py
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
Python
0
@@ -749,17 +749,17 @@ %22Peter -s +S prygada @@ -2508,17 +2508,16 @@ ault: 1%0A -%0A %22%22%22%0A%0AEXA @@ -3570,20 +3570,8 @@ t re -%0Aimport json %0A%0AIN @@ -3755,169 +3755,8 @@ item -%0Adef get_response(data):%0A try:%0A json_data = json.loads(data)%0A except ValueError:%0A json_data =...
3b1f9b599904148c4bc7f1fb9749b1a3a96915c5
Update iterators.py
evolib/iterators.py
evolib/iterators.py
from evolib.formats.IteratorObjects import FastqRead, GFFRecord, msFormat, VCFrow, FastaAlignment, VCFrow3 from evolib.formats.VCFcolumns import CHROM, POS, ID, REF, ALT, QUAL, FILTER, INFO, FORMAT, FORMAT2, SAMPLE, SAMPLE2 import os import collections ###### ###### def fasta_iter(file_paths): if isinstance(...
Python
0.000001
@@ -3644,53 +3644,8 @@ ''%0A - Row = VCFrow3(None, headerClass, Format)%0A @@ -4111,32 +4111,85 @@ mble = preamble%0A + Row = VCFrow3(None, headerClass, Format)%0A %0Adef
f2554fe15f220d0a7912e335c3ddcaf6a7c15b14
Remove this flaky entrance exam test.
common/test/acceptance/tests/lms/test_lms_entrance_exams.py
common/test/acceptance/tests/lms/test_lms_entrance_exams.py
# -*- coding: utf-8 -*- """ Bok choy acceptance tests for Entrance exams in the LMS """ from textwrap import dedent from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc from common.test.acceptance.pages.common.auto_auth import AutoAuthPage from common.test.acceptance.pages.lms.course_hom...
Python
0
@@ -3168,1223 +3168,8 @@ l)%0A%0A - def test_course_is_unblocked_as_soon_as_student_passes_entrance_exam(self):%0A %22%22%22%0A Scenario: Ensure that entrance exam status message is updated and courseware is unblocked as soon as%0A student passes entrance exam.%0A Given I have a course w...
26e7dc786d58dad94e9555fb20e6992c29533f0e
add pre-twisted-import stub to spyne.Address for _address_from_twisted_address
spyne/_base.py
spyne/_base.py
# # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libra...
Python
0.000001
@@ -1293,8 +1293,290 @@ ess_str%0A +%0A # this gets overwritten once spyne.server.twisted is imported%0A @staticmethod%0A def _fta(*a, **kw):%0A from spyne.server.twisted._base import _address_from_twisted_address%0A return _address_from_twisted_address(*a, **kw)%0A%0A Address.from_twisted_ad...
c56d3150ecf4d240f58f207cb14110893a099970
Fix linode cloud tests
tests/integration/cloud/providers/linode.py
tests/integration/cloud/providers/linode.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>` ''' # Import Python Libs from __future__ import absolute_import import os import random import string # Import Salt Testing Libs from salttesting import skipIf from salttesting.helpers import ensure_in_syspath, expensiveTest e...
Python
0.000001
@@ -219,39 +219,8 @@ ibs%0A -from salttesting import skipIf%0A from @@ -354,40 +354,8 @@ tion - # pylint: disable=import-error %0Afro @@ -402,296 +402,44 @@ fig%0A -%0A# Import Third-Party Libs%0A# pylint: disable=import-error%0Afrom salt.ext.six.moves import range # pylint: disable=redefined-builtin%0Atry:%0A ...