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
098a4437a4de2f3daef86c33ca8e5cfb98ccc0f3
modify the refernces in reconst_dsi_metrics.py
doc/examples/reconst_dsi_metrics.py
doc/examples/reconst_dsi_metrics.py
""" ================================================= Calculate DSI metrics ================================================= We show how to calculate two DSI-based scalar metrics: return to origin probability (rtop) [Descoteaux2011] and mean square displacement (msd) [Wu2007] [Wu2008] on your dataset. First import...
Python
0.000014
@@ -228,16 +228,17 @@ aux2011%5D +_ and mea @@ -274,16 +274,18 @@ %5BWu2007%5D +_, %5BWu2008 @@ -285,16 +285,17 @@ %5BWu2008%5D +_ on your @@ -4455,17 +4455,16 @@ Measures - %0A%09%09%09in q @@ -4526,18 +4526,11 @@ ng%22, - %0A +%0A%09%09 %09IEE @@ -4592,24 +4592,18 @@ 58-865,%0A - +%09%0...
c8f560c7fbd65e7071a4743afa008c45442ef7a3
wrong varname
shop_categories/tests/__init__.py
shop_categories/tests/__init__.py
# -*- coding: utf-8 -*- import random from decimal import Decimal from shop.models.productmodel import Product # is the overridden CategoryProduct (project.models.product.Product) from shop_categories.models.categorymodel import Category # is the overridden Category (project.models.category.Category) from django...
Python
0.999043
@@ -1809,21 +1809,22 @@ el1_two_ -first +second _sub.sav
c46e2053c0c093c2ee82f13f48787584d48664af
Fix reorder unit test for Django 1.8
shuup_tests/front/test_reorder.py
shuup_tests/front/test_reorder.py
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2018, Shuup Inc. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. import pytest from django.core.urlresolvers import reverse from django.tes...
Python
0.000002
@@ -2627,20 +2627,26 @@ onse.url - == +.endswith( reverse( @@ -2660,16 +2660,17 @@ basket%22) +) %0A%0A #
8092ac34f95280adf884336999b481ef5241c2cb
update data container description to make sure that scalar values are returned as scalar
simphony/scripts/cuba-generate.py
simphony/scripts/cuba-generate.py
import click import yaml # Cuba keywords that are excludes from DataContainers CUBA_DATA_CONTAINER_EXLCUDE = ['Id', 'Position'] @click.group() def cli(): """ Auto-generate code from cuba yaml description. """ @cli.command() @click.argument('input', type=click.File('rb')) @click.argument('output', type=click.Fi...
Python
0.000001
@@ -1416,69 +1416,8 @@ '%5D)%0A - template = %22 %7B%7D = tables.%7B%7DCol(pos=%7B%7D, shape=(%7B%7D))%5Cn%22%0A @@ -1657,35 +1657,219 @@ if -len(keyword%5B'shape'%5D) == 1: +keyword%5B'type'%5D == 'string':%0A template = %22 %7B%7D = tables.%7B%7DCol(pos=%7B%7D, itemsize=%7B%7D)%5Cn%22%0A...
8cab7a7fffd31c3d7e924faa3f860e4e90579a4d
Add default GTM config key
sigal/settings.py
sigal/settings.py
# -*- coding:utf-8 -*- # Copyright (c) 2009-2016 - Simon Conseil # Copyright (c) 2013 - Christophe-Marie Duquesne # 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, i...
Python
0
@@ -1578,24 +1578,57 @@ ytics': '',%0A + 'google_tag_manager': '', %0A 'ignore_
3159f3fa6d4d055e8a53a0b4f1d798397cc3c3a3
The alteration of the context has no effect
base_report_to_printer/report.py
base_report_to_printer/report.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
Python
0.999999
@@ -2795,102 +2795,8 @@ %22%22%22%0A - if context is None:%0A context = self.pool%5B'res.users'%5D.context_get(cr, uid)%0A @@ -3463,64 +3463,8 @@ pe)%0A - context%5B'must_skip_sent_to_printer'%5D = True%0A
0c28e5fa23d7330db3bbed94594706f15a46b910
Switch to 1000 iterations for end-to-end tests.
end-to-end/demotest.py
end-to-end/demotest.py
#!/usr/bin/env python import sys import json import os import requests import time import yaml # Yes, it's a terrible idea to use skip cert verification for TLS. # We really don't care for this test though. import urllib3 urllib3.disable_warnings() def call(url, headers=None, iterations=1): got = {} for x ...
Python
0
@@ -1195,16 +1195,17 @@ ions=100 +0 )%0A%0A @@ -1236,16 +1236,18 @@ _seen = +(( got.get( @@ -1253,24 +1253,36 @@ ('2.0.0', 0) + + 5) // 10) %0A del
e89e721225e916f4c2514f4a6568571abfc2acc0
Add slides frame simibar
lib/plotter/matching/__init__.py
lib/plotter/matching/__init__.py
__all__ = ["core", "single_matching_plotter"] from core import MatchingPlotterBase class MatchingPlotter(MatchingPlotterBase): def __init__(self, root, name): """ Try to show one matching pairs use set_data to set matched results: array of `sid`, `fid`, `matches` """ ...
Python
0
@@ -40,16 +40,77 @@ tter%22%5D%0A%0A +from lib.exp.evaluator.ground_truth import GroundTruth as GT%0A from cor @@ -1306,8 +1306,796 @@ pass%0A +%0A def slice_bar(self, ax, x, y, z, start, size, cmm):%0A end = start+size%0A gt = GT(self.root, self.name)%0A for fi, mv, fid in zip(range(1, si...
95b08f0cb82fa376a6f07d5395bcba343a131dea
update labels
plantcv/plantcv/hyperspectral/analyze_spectral.py
plantcv/plantcv/hyperspectral/analyze_spectral.py
# Analyze signal data in Thermal image import os import numpy as np import pandas as pd from plantcv.plantcv import params from plantcv.plantcv import outputs from plotnine import ggplot, aes, geom_line, scale_x_continuous def analyze_spectral(array, header_dict, mask, histplot=True): """This extracts the hypers...
Python
0.000001
@@ -1970,39 +1970,36 @@ ectral', scale=' -degrees +none ', datatype=floa @@ -2248,39 +2248,36 @@ ectral', scale=' -degrees +none ', datatype=floa @@ -2421,25 +2421,25 @@ trait='mean -_ + reflectance' @@ -2524,39 +2524,36 @@ ectral', scale=' -degrees +none ', datatype=floa @@ -2697,33 +2697,33 @@ ', trait='me...
cd59979ab446d7613ec7df5d5737539464918edf
Fix span boundary handling in Spanish noun_chunks (#5860)
spacy/lang/es/syntax_iterators.py
spacy/lang/es/syntax_iterators.py
# coding: utf8 from __future__ import unicode_literals from ...symbols import NOUN, PROPN, PRON, VERB, AUX from ...errors import Errors def noun_chunks(doclike): doc = doclike.doc if not doc.is_parsed: raise ValueError(Errors.E029) if not len(doc): return np_label = doc.vocab.string...
Python
0
@@ -722,65 +722,28 @@ -token = doc%5B0%5D%0A while token and token.i %3C len( +for token in doclike -) :%0A
3d0886a277aa8cf3525a0915c3795f37f3d2cd85
fix -A
lib/svtplay_dl/service/urplay.py
lib/svtplay_dl/service/urplay.py
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- from __future__ import absolute_import import re import json import copy from svtplay_dl.service import Service, OpenGraphThumbMixin from svtplay_dl.utils.urllib import urljoin, urlparse from svtplay_dl.fetcher.hls import hlsparse...
Python
0
@@ -3027,32 +3027,33 @@ et(urljoin(%22http +s ://urskola.se%22, @@ -3147,16 +3147,24 @@ s=%22puff +program tv video @@ -3194,32 +3194,56 @@ %5B%5E%22%5D+)%22', data)%0A + print(tags)%0A for @@ -3288,16 +3288,17 @@ in(%22http +s ://ursko
d04052a5cf330ef7b9ec977361bc6fd5558a311d
Fix another test.
apps/sumo/tests/test_middleware.py
apps/sumo/tests/test_middleware.py
from django.http import HttpResponsePermanentRedirect from nose.plugins.skip import SkipTest from nose.tools import eq_ from test_utils import RequestFactory from sumo.middleware import PlusToSpaceMiddleware from sumo.tests import TestCase from sumo.urlresolvers import get_best_language class TrailingSlashMiddlewar...
Python
0.000037
@@ -684,20 +684,26 @@ '/en-US/ -home +docs/files /?xxx=%5Cx @@ -803,12 +803,18 @@ -US/ -home +docs/files ?xxx
d5cfab00d7667b42749f2ef054536fdaa8cb9d80
Fix bug with completely empty apt_config.yaml.
apt_config_tool/apt_config_tool.py
apt_config_tool/apt_config_tool.py
#!/usr/bin/env python2.7 # -*- mode: python; encoding: utf-8; -*- from __future__ import division, absolute_import, unicode_literals, print_function from future_builtins import * """apt-config-tool: Set up apt and install packages as part of a scripted provisioning process (such as building a Dockerfile). (c) 2014-20...
Python
0
@@ -1864,16 +1864,22 @@ .read()) + or %7B%7D %0A%0A ou
d07b48c018d8edf5c8dc3689e22a0c4e551f79a7
Add single file output option
cube.py
cube.py
#!/usr/bin/env python import numpy as np from scipy import ndimage, misc import sys, math, os import argparse parser = argparse.ArgumentParser(description='Turn a panorama image into a cube map (6 images)') parser.add_argument("--size", default=512, type=int, help="Size of output image sides") parser.add_argument("-...
Python
0.000004
@@ -551,24 +551,150 @@ put files%22)%0A +parser.add_argument(%22--onefile%22, help=%22Save output as one concatenated file, still uses intermediate files as temp storage.%22)%0A parser.add_a @@ -738,16 +738,16 @@ file%22)%0A - %0Aargs = @@ -882,17 +882,26 @@ .uint8)%0A +pids = %5B%5D %0A - for i in @@ -933,16 ...
75cb305c025ca3549c721faacb5ea51297c80052
Use GitPython
buster.py
buster.py
"""Ghost Buster. Static site generator for Ghost. Usage: buster.py generate [--domain=<local-address>] buster.py preview buster.py setup [--gh-repo=<repo-url>] buster.py deploy buster.py (-h | --help) buster.py --version Options: -h --help Show this screen. --version Sh...
Python
0.000001
@@ -98,16 +98,31 @@ ddress%3E%5D + %5B--dir=%3Cpath%3E%5D %0A buste @@ -133,16 +133,31 @@ preview + %5B--dir=%3Cpath%3E%5D %0A buste @@ -189,16 +189,31 @@ po-url%3E%5D + %5B--dir=%3Cpath%3E%5D %0A buste @@ -223,16 +223,31 @@ y deploy + %5B--dir=%3Cpath%3E%5D %0A buste @@ -385,16 +385,85 @@ ersion.%0A + -...
0c453d48e3d1b0dd80acffeae122c797335454f7
Fix setting cache dir
pw_env_setup/py/pw_env_setup/cipd_setup/update.py
pw_env_setup/py/pw_env_setup/cipd_setup/update.py
#!/usr/bin/env python # Copyright 2020 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
Python
0.000004
@@ -6524,16 +6524,53 @@ rning',%0A + '-cache-dir', cache_dir,%0A
d5b7647f848e351cafa4082dde76c90c750fa0fe
Add trigger id and location in BigQueryFuture result so subsequent task can query job status and result.
py/gps_building_blocks/cloud/workflows/futures.py
py/gps_building_blocks/cloud/workflows/futures.py
# python3 # coding=utf-8 # Copyright 2020 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
Python
0.000003
@@ -3202,16 +3202,141 @@ jobId')%0A + location = _get_value(%0A message,%0A 'protoPayload.serviceData.jobCompletedEvent.job.jobName.location')%0A co @@ -3741,36 +3741,112 @@ :%0A re -turn Result( +sult = %7B'job_id': bq_job_id, 'location': location%7D%0A return Result(resul...
a0afdc5f38c237918b2bb6906c977e83ba1574a0
allow to define a mandatory output extension
carpet.py
carpet.py
import tempfile import os class TempFileContext: remove_at_exit = True removable_files = [] """ Base class to create 'with' contexts. The __init__ method must define: - self.removable_files <list>. This list will hold a list of filenames which will removed at the end of the contex...
Python
0.000001
@@ -1060,16 +1060,37 @@ function +, output_extension=%22%22 ):%0A %22 @@ -2750,16 +2750,41 @@ mktemp() + + %22.%22 + output_extension %0A
db67db3cea880e40d1982149fea86699c15b5f75
change append to add (for the set in part 1)
day3.py
day3.py
#!/usr/local/bin/python3 from collections import namedtuple with open('day3_input.txt') as f: instructions = f.read().rstrip() Point = namedtuple('Point', ['x', 'y']) location = Point(0, 0) visited = {location} def new_loc(current_loc, instruction): if instruction == '^': xy = current_loc.x, curren...
Python
0
@@ -656,12 +656,9 @@ ed.a -ppen +d d(lo
ea90bf0b009118c108f39a15f4eb64f32c4e1eee
Resolve #23 that resizes text boxes according to number of lines. 10 max.
days.py
days.py
from Tkinter import * import ncore class VerticalScrolledFrame(Frame): """A pure Tkinter scrollable frame that actually works! * Use the 'interior' attribute to place widgets inside the scrollable frame * Construct and pack/place/grid normally * This frame only allows vertical scrolling """ de...
Python
0
@@ -2763,32 +2763,65 @@ ._more).pack()%0A%0A + def add(self):%0A pass%0A%0A def _more(se @@ -2829,32 +2829,32 @@ f, event=None):%0A - %22%22%22Adds @@ -3382,18 +3382,136 @@ ext. -yview(END) +config(height=10) #For better entry.%0A self.days%5B-1%5D.text.yview(END) #maybe make these tw...
2bcdf5e6e2e7bbf7113f3cbb1fce18ed778b9b62
Update conductance calculation code.
reveal_user_classification/quality/conductance.py
reveal_user_classification/quality/conductance.py
__author__ = 'Georgios Rizos (georgerizos@iti.gr)' import numpy as np def conductance(adjacency_matrix, node_array): number_of_nodes = adjacency_matrix.shape[0] node_array_bar = np.setdiff1d(np.arange(number_of_nodes), node_array) submatrix = adjacency_matrix[np.ix_(node_array, node_array)] submatr...
Python
0
@@ -3703,28 +3703,29 @@ cut_volume, submatrix_volume +%0A
40ea261dbb53524ace1b371510d9e4f04772d8b9
change called method to confirm sale orders
sale_automatic_workflow/automatic_workflow_job.py
sale_automatic_workflow/automatic_workflow_job.py
# -*- coding: utf-8 -*- ############################################################################### # # sale_automatic_workflow for OpenERP # Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com> # Copyright 2013 Camptocamp SA (Guewen Baconnier) # # This program is free software: you ...
Python
0
@@ -3348,38 +3348,29 @@ ale. -signal_workflow('order +action_button _confirm ')%0A%0A @@ -3365,17 +3365,17 @@ _confirm -' +( )%0A%0A @
ebcf06836d86bc6548531dcc4ac1cace018a3388
build index object
column.py
column.py
from __future__ import print_function import os import matplotlib as mpl mpl.use("Agg") from math import sqrt import numpy as np import math from pandas.util.testing import DataFrame, Series import matplotlib.pyplot as plt import pandas as pd import itertools __author__ = 'dietz' from argparse import ArgumentParser...
Python
0.000002
@@ -3496,16 +3496,25 @@ , index= +pd.Index( args.run @@ -3515,16 +3515,17 @@ gs.runs) +) %0Aif args
db713e62eafb29c1a968e16b997a4e8f49156c78
Correct config for touchscreen
config.py
config.py
__author__ = 'Florian' from util import get_lan_ip ################# # CONFIGURATION # ################# # CHANGE FROM HERE # UDP_PORT = 18877 IP = get_lan_ip() BUF_SIZE = 4096 TIMEOUT_IN_SECONDS = 0.1 # SCREEN_WIDTH = 320 SCREEN_HEIGHT = 240 SCREEN_DEEP = 32 # LABEL_RIGHT = 0 LABEL_LEFT = 1 ALIGN_CENTER = 0 ALIG...
Python
0.000002
@@ -988,17 +988,16 @@ 00)%0A -# from dat @@ -1034,17 +1034,16 @@ eam%0A -# datastre @@ -1068,24 +1068,25 @@ tream()%0A +# from datastr @@ -1110,32 +1110,33 @@ 0DataStream%0A +# datastream = PDU @@ -1207,438 +1207,480 @@ 2':%0A -%0A from evdev import InputDevice, list_devices%0A%0A devices...
d5e8fe7e7dfe0c98e6c520e53032cbb67e1977e5
Update VAT value when set document_type = CUIT
config.py
config.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012 OpenERP - Team de Localización Argentina. # https://launchpad.net/~openerp-l10n-ar-localization # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
Python
0.000001
@@ -5396,80 +5396,8 @@ e),%0A - 'wsfe_for_homologation': fields.boolean('Is for homologation'),%0A @@ -5484,32 +5484,104 @@ required=True),%0A + 'wsfe_for_homologation': fields.boolean('Is for homologation'),%0A 'wsfe_po
68593e359d5bb79c096d584c83df1ff55262a686
use with
config.py
config.py
# coding=utf-8 from configparser import ConfigParser import os __author__ = 'Victor Häggqvist' class Config: confdir = os.path.dirname(os.path.realpath(__file__)) config_file = os.path.join(confdir, 'ledman.conf') default = """ [gpio] red=22 green=27 blue=17 [default_level] red=0 green=0.3 blue=0.5 [se...
Python
0
@@ -1087,11 +1087,12 @@ -f = +with ope @@ -1116,17 +1116,27 @@ e, 'w+') -%0A + as f:%0A @@ -1161,22 +1161,4 @@ lt)%0A - f.close()%0A
e1f5744d9206a5a169f6997a6f3bb673ec8c6214
change googlemail de merde pour mailgun
config.py
config.py
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = 'dummy_secret_key' MAIL_SUBJECT_PREFIX = 'Socialite' MAIL_SENDER = 'Socialite Team <team.socialite.app@gmail.com>' ADMIN = ['delita.makanda@gmail.com'] POSTS_PER_PAGE = 10 FOLLOWERS_PER_PAGE = 20 COMMENTS_PER_PAGE = 10 SL...
Python
0
@@ -89,26 +89,36 @@ Y = -'dummy_secret_key' +os.environ.get('SECRET_KEY') %0A%09MA @@ -138,25 +138,25 @@ EFIX = ' -S +s ocialite '%0A%09MAIL_ @@ -147,16 +147,20 @@ ocialite + app '%0A%09MAIL_ @@ -187,39 +187,8 @@ Team - %3Cteam.socialite.app@gmail.com%3E '%0A%09A @@ -469,38 +469,35 @@ VER = 'smtp. -googlemai...
0812ec319291b709613152e9e1d781671047a428
Make server ignore missing environment variables
config.py
config.py
import os SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL'] ACCESS_TOKEN = os.environ['ACCESS_TOKEN'] PAGE_ID = os.environ['PAGE_ID'] APP_ID = os.environ['APP_ID'] VERIFY_TOKEN = os.environ['VERIFY_TOKEN']
Python
0
@@ -40,17 +40,21 @@ .environ -%5B +.get( 'DATABAS @@ -59,17 +59,30 @@ ASE_URL' -%5D +, 'sqlite://') %0A%0AACCESS @@ -100,17 +100,21 @@ .environ -%5B +.get( 'ACCESS_ @@ -119,17 +119,17 @@ S_TOKEN' -%5D +) %0APAGE_ID @@ -141,17 +141,21 @@ .environ -%5B +.get( 'PAGE_ID @@ -155,17 +155,17 @@ PAGE_ID' -%5D +) %0...
184cf0c253d8edf0eb9e19de54183086ca326951
Update sleepyoz_digitalclock3.py
mcpipy/sleepyoz_digitalclock3.py
mcpipy/sleepyoz_digitalclock3.py
#!/usr/bin/env python # mcpipy.com retrieved from URL below, written by SleepyOz # http://www.raspberrypi.org/phpBB3/viewtopic.php?f=32&t=33427 from .. import minecraft from .. import block import time import server """ Dot matrix digits 5 wide by 8 high. 0 - voxel should be drawn Anything else - voxel should be c...
Python
0.000004
@@ -140,31 +140,28 @@ =33427%0A%0A -from .. import +mcpi. minecraf @@ -165,23 +165,42 @@ raft -%0Afrom .. import + as minecraft%0Aimport mcpi.block as blo @@ -6408,8 +6408,9 @@ g again. +%0A
c5494d7ce4914932216c3de4a27dbcbb15b1c941
correct spelling mistake
measurement/measures/distance.py
measurement/measures/distance.py
# Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, #...
Python
0.999884
@@ -1637,17 +1637,16 @@ and conv -i enient c
d7e03596f8bf1e886e984c0ea98334af878a15e2
Use __future__.print_function so syntax is valid on Python 3
meta/bytecodetools/print_code.py
meta/bytecodetools/print_code.py
''' Created on May 10, 2012 @author: sean ''' from .bytecode_consumer import ByteCodeConsumer from argparse import ArgumentParser class ByteCodePrinter(ByteCodeConsumer): def generic_consume(self, instr): print instr def main(): parser = ArgumentParser() parser.add_argument() if __name__ ==...
Python
0.9985
@@ -40,16 +40,55 @@ ean%0A'''%0A +from __future__ import print_function%0A%0A from .by @@ -261,22 +261,23 @@ print - +( instr +) %0A%0Adef ma @@ -372,12 +372,13 @@ :%0A main() +%0A
1f343e52abb67ab2f85836b10dadb3cb34a95379
fix login issue with django 1.7: check_for_test_cookie is deprecated and removed in django 1.7.
xadmin/forms.py
xadmin/forms.py
from django import forms from django.contrib.auth import authenticate from django.contrib.auth.forms import AuthenticationForm from django.utils.translation import ugettext_lazy, ugettext as _ from xadmin.util import User ERROR_MESSAGE = ugettext_lazy("Please enter the correct username and password " ...
Python
0
@@ -1876,45 +1876,8 @@ ge)%0A - self.check_for_test_cookie()%0A
da1884711a7aa32b31f19104dc8513cba02c44ed
bump version number
cffi_magic/__init__.py
cffi_magic/__init__.py
""" A module that define a cffi magic for IPython import to get `%%cffi` cell magic in current namespace See `%%cffi?` for usage. Mostly playing with CFFI, feel free to contact me if you want to take over. """ from __future__ import print_function import re from cffi import FFI from hashlib import md5 import stri...
Python
0.000004
@@ -504,17 +504,17 @@ _ ='0.0. -8 +9 '%0Alog =
de49b589cf950f76019dc9472b505800ea92a74c
Use list instead of deque for improved efficiency
yvs/copy_ref.py
yvs/copy_ref.py
# yvs.copy_ref import collections import yvs.shared as shared from HTMLParser import HTMLParser # Parser for reference HTML class ReferenceParser(HTMLParser): # Associates the given reference object with this parser instance def __init__(self, ref): HTMLParser.__init__(self) if 'verse' in re...
Python
0
@@ -13,27 +13,8 @@ ef%0A%0A -import collections%0A impo @@ -932,27 +932,10 @@ s = -collections.deque() +%5B%5D %0A%0A
95a0bcd6bf0e65eb37fc8400db04f72557ba39c7
Allow multiple modes to be specified
charla/plugins/mode.py
charla/plugins/mode.py
from itertools import imap from operator import attrgetter from six import u from funcy import take from ..plugin import BasePlugin from ..models import Channel, User from ..commands import BaseCommands from ..replies import MODE, RPL_UMODEIS, RPL_CHANNELMODEIS from ..replies import ERR_NEEDMOREPARAMS, ERR_NOSUCHCH...
Python
0.000001
@@ -4943,29 +4943,33 @@ hannel, -%5B mode -%5D + -list +u(%22%22).join (args))%0A @@ -5293,21 +5293,25 @@ er, -%5B mode -%5D + -list +u(%22%22).join (arg
19e59e90cd44f6375d81c971bb5005efc1165a08
Fix security issue in filter_non_video_iframes
website/utils/filters.py
website/utils/filters.py
def filter_non_video_iframes(html, testing = False): """ Given an HTML string, strips iframe tags that do not (just) contain an embedded video. Returns the remaining HTML string. """ from bs4 import BeautifulSoup import re # Tuple of regexes that define allowed URL patterns ma...
Python
0.000001
@@ -981,37 +981,40 @@ t()%0A -break +continue %0A # If if @@ -1130,37 +1130,40 @@ t()%0A -break +continue %0A # Check
f99246cb8a41f9271d4d531c036975c9d105d973
Add ignored exceptions
polyaxon/polyaxon/config_settings/logging.py
polyaxon/polyaxon/config_settings/logging.py
import os from polyaxon.config_manager import ROOT_DIR, config LOG_DIRECTORY = ROOT_DIR.child('logs') if not os.path.exists(LOG_DIRECTORY): os.makedirs(LOG_DIRECTORY) LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'standard': { 'format': '[%(asctime)...
Python
0.000032
@@ -2500,16 +2500,227 @@ 0.0.0')%0A + RAVEN_CONFIG%5B'IGNORE_EXCEPTIONS'%5D = %5B'django.db.ProgrammingError',%0A 'django.db.OperationalError',%0A 'django.db.InterfaceError'%5D%0A RAVE
54282058900b473b1e1211f8e0b68c1d36280788
Fix investigations if no user input
core/web/frontend/investigations.py
core/web/frontend/investigations.py
from __future__ import unicode_literals from flask_classy import route from flask_login import current_user from flask import render_template, request, flash, redirect, url_for from mongoengine import DoesNotExist from core.web.frontend.generic import GenericView from core.investigation import Investigation, ImportMe...
Python
0.014118
@@ -2927,34 +2927,58 @@ el +if %22file%22 in request.file s -e :%0A @@ -3226,16 +3226,172 @@ (target) +%0A else:%0A flash(%22You need to provide an input%22, %22danger%22)%0A return redirect(request.referrer) %0A%0A
c9c312555d5137daa6ce0525bcd7b4f160a0d133
load file in chunks
corehq/apps/dump_reload/sql/load.py
corehq/apps/dump_reload/sql/load.py
from __future__ import unicode_literals import json from collections import defaultdict from django.apps import apps from django.conf import settings from django.core.management.color import no_style from django.core.serializers.python import ( Deserializer as PythonDeserializer, ) from django.db import ( Dat...
Python
0.000001
@@ -978,42 +978,559 @@ = 0%0A +%0A -objects = json.load(data_file) +def _process_chunk(chunk):%0A global total_object_count, loaded_object_count%0A chunk_total, chunk_loaded = load_objects(chunk)%0A total_object_count += len(chunk)%0A loaded_object_count += chunk_loaded%0A%0A chunk...
e519e6367686b2439b07ecd01a2a28ea5eded64d
use json encoder that handles decimals
corehq/apps/tzmigration/planning.py
corehq/apps/tzmigration/planning.py
import json import sqlite3 from sqlite3 import dbapi2 as sqlite from sqlalchemy import create_engine, Column, Integer, ForeignKey, String, \ UnicodeText, Text from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.orm.exc import NoResultFound Base = declara...
Python
0.000007
@@ -299,16 +299,71 @@ tFound%0A%0A +from corehq.apps.hqwebapp.encoders import LazyEncoder%0A%0A Base = d @@ -3215,24 +3215,41 @@ on.dumps(val +, cls=LazyEncoder )%0A%0A f
f058477eb0320fb28a00626c246d6ad7b2d120a2
use new experiment_utils.{get_fs_writer,get_fs_reader_funcs}
crosscat/tests/geweke_on_schemas.py
crosscat/tests/geweke_on_schemas.py
import argparse import itertools import functools # import crosscat.utils.geweke_utils as geweke_utils import crosscat.utils.experiment_utils as experiment_utils from crosscat.utils.general_utils import MapperContext, NoDaemonPool, Timer def generate_args_list(base_num_rows, num_iters): num_iters_str = str(num_it...
Python
0.000004
@@ -2021,422 +2021,163 @@ st%0A%0A -%0Ais_result_filepath = geweke_utils.is_summary_file%0Aconfig_to_filepath = geweke_utils.config_to_filepath%0Arunner = geweke_utils.run_geweke%0Ado_experiments = experiment_utils.do_experiments%0A# use provided local file system writer%0A_writer = experiment_utils.fs_write_result%0A...
7b6542d58bbe788587b47e282ef393eda461f267
add get method in UserAPI
api/route/user.py
api/route/user.py
from flask import request from flask.ext import restful from flask.ext.restful import marshal_with from route.base import api from flask.ext.bcrypt import generate_password_hash from model.base import db from model.user import User, user_marshaller class UserAPI(restful.Resource): @marshal_with(user_marshaller) ...
Python
0.000001
@@ -623,16 +623,109 @@ n user%0A%0A + @marshal_with(user_marshaller)%0A def get(self):%0A%09user = User.query.all()%0A%09return user%0A%0A api.add_ @@ -750,8 +750,9 @@ %22/user%22) +%0A
346a7d18ef6dc063e2802a0347709700a1543902
update 影视列表
1/showics/models.py
1/showics/models.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Last modified: Wang Tai (i@wangtai.me) """docstring """ __revision__ = '0.1' from django.db import models class ShowTableIcs(models.Model): # uid uid = models.CharField(max_length=255, unique=True, primary_key=True) # title title = models.CharField(ma...
Python
0
@@ -190,18 +190,8 @@ l):%0A - # uid%0A @@ -264,20 +264,8 @@ ue)%0A - # title%0A @@ -321,26 +321,8 @@ se)%0A - # description%0A @@ -372,19 +372,8 @@ 55)%0A - # date%0A @@ -398,16 +398,17 @@ Field()%0A +%0A clas @@ -423,16 +423,16 @@ bject):%0A - @@ -458,8 +458,231...
736e850a8ee4df1efeae41407a83bcde356d28bd
Use werzeug.urls instead of urlparse
addons/mass_mailing/models/mail_mail.py
addons/mass_mailing/models/mail_mail.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import re import werkzeug.urls from odoo import api, fields, models, tools from openerp.addons.link_tracker.models.link_tracker import URL_REGEX class MailMail(models.Model): """Add the mass mailing campaign data...
Python
0.000002
@@ -2710,20 +2710,26 @@ d = -urlparse +werkzeug.urls .url +_ pars
5b2cc6ed06045bbe219f9cf81317c1c1a5bac714
add missing docstring in ttls
biggraphite/drivers/ttls.py
biggraphite/drivers/ttls.py
#!/usr/bin/env python # Copyright 2016 Criteo # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
Python
0.000007
@@ -779,32 +779,76 @@ time(str_repr):%0A + %22%22%22Convert a string into a datetime.%22%22%22%0A if not str_r @@ -945,24 +945,69 @@ (str_repr):%0A + %22%22%22Convert a string into a timestamp.%22%22%22%0A if not s
808a5b14fc0bfff8d8c23cb4e1f125ef84de6d91
Remove deprecated oslotest.mockpatch usage
bilean/tests/common/base.py
bilean/tests/common/base.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
Python
0.000006
@@ -588,39 +588,8 @@ res%0A -from oslotest import mockpatch%0A impo @@ -2386,34 +2386,37 @@ .useFixture( -mockpatch. +fixtures.Mock PatchObject( @@ -2426,16 +2426,19 @@ , attr,%0A + @@ -2754,18 +2754,21 @@ ure( -mockpatch. +fixtures.Mock Patc
4426526fa1b7e9dac86d4252a3b163dc2c6325cb
Fix APITaxi2 routing
APITaxi/__init__.py
APITaxi/__init__.py
# -*- coding: utf-8 -*- import os import re from flask import Flask, g, request_started, request_finished from flask_restplus import abort from flask_uploads import configure_uploads from APITaxi_models import db, security, HailLog from APITaxi_utils.login_manager import init_app as init_login_manager from APITaxi_u...
Python
0.000014
@@ -4929,17 +4929,16 @@ '%5E/taxis -2 /.+$',%0A
ca5c3648ad5f28090c09ecbbc0e008c51a4ce708
Add a new dev (optional) parameter and use it
bin/push/silent_ios_push.py
bin/push/silent_ios_push.py
import json import logging import argparse import emission.net.ext_service.push.notify_usage as pnu if __name__ == '__main__': logging.basicConfig(level=logging.DEBUG) parser = argparse.ArgumentParser(prog="silent_ios_push") parser.add_argument("interval", help="specify the sync interval that the ...
Python
0.000001
@@ -358,16 +358,91 @@ ype=int) +%0A parser.add_argument(%22-d%22, %22--dev%22, action=%22store_true%22, default=False) %0A%0A ar @@ -645,12 +645,16 @@ dev= -True +args.dev )%0A
d37a1d333f00f7cd060734fce1c05f1434938bce
refactor connection and channel
kuyruk/__init__.py
kuyruk/__init__.py
from __future__ import absolute_import import errno import select import logging from contextlib import contextmanager import pika import pika.exceptions from kuyruk import exceptions from kuyruk.task import Task from kuyruk.queue import Queue from kuyruk.config import Config from kuyruk.worker import Worker from kuy...
Python
0.000001
@@ -77,46 +77,8 @@ ging -%0Afrom contextlib import contextmanager %0A%0Aim @@ -4408,32 +4408,81 @@ mpts=2)%0A +from kuyruk.connection import Connection%0A connection = pik @@ -4482,21 +4482,8 @@ n = -pika.Blocking Conn @@ -5045,30 +5045,33 @@ -return +channel = self.connec @@ -528...
a33b8222959cc14a4c89658e6d7aa6ff07f27c0c
remove commented code
ephypype/import_ctf.py
ephypype/import_ctf.py
"""Import ctf.""" # -------------------- nodes (Function) def convert_ds_to_raw_fif(ds_file): """CTF .ds to .fif and save result in pipeline folder structure.""" import os import os.path as op from nipype.utils.filemanip import split_filename as split_f from mne.io import read_raw_ctf _, bas...
Python
0
@@ -416,124 +416,8 @@ ile) -%0A # raw_fif_file = os.path.abspath(basename + %22_raw.fif%22)%0A%0A # raw.save(raw_fif_file)%0A # return raw_fif_file %0A%0A
ae09f2e330e6c2241e79c0d62929791479c9dd03
Add method to save the team
packages/base/webpages/main_page.py
packages/base/webpages/main_page.py
#!/usr/bin/env # -*- coding: utf-8 -*- from gnr.core.gnrbag import Bag from gnr.core.gnrdecorator import public_method class GnrCustomWebPage(object): css_requires = 'css/base' js_requires = 'js/main_page' def main(self, root, **kwargs): frame = root.framePane() sc = frame.center.stackC...
Python
0
@@ -701,19 +701,126 @@ 'white' +,%0A 'nodeId': 'team_page',%0A 'id': 'team_page' %7D)%0A +%0A @@ -5686,16 +5686,354 @@ urn Bag(values)%0A +%0A @public_method%0A def add_team(self, name, description):%0A values = %7B%0A '...
697d3c4c80574d82e8aa37e2a13cbaeefdad255c
bump version
kuyruk/__init__.py
kuyruk/__init__.py
from __future__ import absolute_import import logging from kuyruk.kuyruk import Kuyruk from kuyruk.worker import Worker from kuyruk.task import Task from kuyruk.config import Config __version__ = '0.13.1' try: # not available in python 2.6 from logging import NullHandler except ImportError: class NullHan...
Python
0
@@ -197,17 +197,17 @@ = '0.13. -1 +2 '%0A%0Atry:%0A
50b189888a0ff68f1cc4db1615991d1afe364854
Update cigar_party.py
Python/Logic_1/cigar_party.py
Python/Logic_1/cigar_party.py
# When squirrels get together for a party, they like to have cigars. A squirrel # party is successful when the number of cigars is between 40 and 60, inclusive. # Unless it is the weekend, in which case there is no upper bound on the number # of cigars. Return True if the party with the given values is successful, or #...
Python
0.000002
@@ -358,17 +358,19 @@ False) -%E2%86%92 +--%3E False%0A# @@ -393,17 +393,19 @@ False) -%E2%86%92 +--%3E True%0A# @@ -430,9 +430,11 @@ ue) -%E2%86%92 +--%3E Tru
ae3db425bbe4c82c95d71430a0fa9732f8e1e26f
fix for issue mentioned in previous commit.
labware/liquids.py
labware/liquids.py
class LiquidContainer(): max_volume = None min_working_volume = None max_working_volume = None """ A dict containing the liquid key (a user-specified name) along with the amount of that particular liquid in this blend. """ _contents = None # {} def __init__(self, max=None, min_working=None, max_working=Non...
Python
0
@@ -1903,16 +1903,20 @@ %5Bliquid%5D +, ml )%0A%09%09%09if
4d3d4e457c5886ace69250de1c5f4f696604d43b
Fix cal_seqs with no delay
QGL/BasicSequences/helpers.py
QGL/BasicSequences/helpers.py
# coding=utf-8 from itertools import product import operator from ..PulsePrimitives import Id, X, MEAS from ..ControlFlow import qwait from functools import reduce def create_cal_seqs(qubits, numRepeats, measChans=None, waitcmp=False, delay=None): """ Helper function to create a set of calibration sequences. P...
Python
0.000002
@@ -749,17 +749,18 @@ %0A cal -S +_s eqs = %5Br @@ -1042,155 +1042,248 @@ -return %5B%5Bseq, Id(qubits%5B0%5D, delay), measBlock, qwait('CMP')%5D if waitcmp else %5Bseq, Id(qubits%5B0%5D, delay), measBlock%5D%0A for +#Add optional delay%0A full_cal_seqs = %5B%5Bseq, Id(qubits%5B0%5D, delay), m...
214e9bfd10c153b5ef27ff924da12a299b54874c
Deprecate gettattr req. in theories
lamana/theories.py
lamana/theories.py
# ----------------------------------------------------------------------------- '''A interface between constructs and models modules.''' # BaseModel(): A super class for user-customized models. # flake8 constructs.py --ignore=E265,E501,N802,H806 import abc import importlib import logging import six # TODO: Replace w...
Python
0.999997
@@ -1933,16 +1933,81 @@ pass + # pragma: no cover %0A%0A%0Adef h @@ -5053,16 +5053,18 @@ Warn%0A + # if any( @@ -5093,24 +5093,26 @@ rame')):%0A + # logging @@ -5168,24 +5168,26 @@ ake()%60.'%0A + #
3567348e84034dc21378ab2d657bcb7a54a49502
Terminate the server before tearing down the databases.
protractor/management/commands/protractor.py
protractor/management/commands/protractor.py
# -*- coding: utf-8 -*- import os import sys from multiprocessing import Process from optparse import make_option import subprocess from django.core.management import call_command from django.core.management.base import BaseCommand from django.db import connection from django.test.runner import setup_databases cla...
Python
0
@@ -3270,16 +3270,253 @@ plit())%0A +%0A # Terminate the live server process before tearing down the databases%0A # to prevent the error%0A # django.db.utils.OperationalError: database is being accessed by other users%0A test_server_process.terminate()%0A%0A
22f6ecc5b61dae0a638b4191eb2ae3ddf1b13895
fix organization events don't have repository/owner/login
bioconda_utils/bot/views.py
bioconda_utils/bot/views.py
""" HTTP Views (pages) """ import logging from aiohttp import web from .events import event_routes from ..githubhandler import Event from .. import __version__ as VERSION from .worker import celery from .config import APP_SECRET logger = logging.getLogger(__name__) # pylint: disable=invalid-name web_routes = web.R...
Python
0.000713
@@ -1005,16 +1005,22 @@ r/login' +, None )%0A @@ -1058,16 +1058,22 @@ ry/name' +, None )%0A
667a87988d168a4dbd9b0d86267b445d91f1460b
Fix Daikin sensor temperature_unit & cleanup (#34116)
homeassistant/components/daikin/sensor.py
homeassistant/components/daikin/sensor.py
"""Support for Daikin AC sensors.""" import logging from homeassistant.const import CONF_ICON, CONF_NAME, CONF_TYPE from homeassistant.helpers.entity import Entity from homeassistant.util.unit_system import UnitSystem from . import DOMAIN as DAIKIN_DOMAIN from .const import ( ATTR_INSIDE_TEMPERATURE, ATTR_OUT...
Python
0
@@ -100,25 +100,28 @@ F_NAME, -CONF_TYPE +TEMP_CELSIUS %0Afrom ho @@ -164,62 +164,8 @@ tity -%0Afrom homeassistant.util.unit_system import UnitSystem %0A%0Afr @@ -219,22 +219,16 @@ import -(%0A ATTR_INS @@ -243,20 +243,16 @@ ERATURE, -%0A ATTR_OU @@ -261,36 +261,32 @@ IDE_TEMPERATURE, -%0A SENS...
a3e7da8c515e3d10217ebc5bf708da13479ab80c
Fix FLAGS.volumes_dir help message
cinder/volume/iscsi.py
cinder/volume/iscsi.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
Python
0.000002
@@ -1316,17 +1316,16 @@ e config -f uration @@ -3500,17 +3500,17 @@ # compat -a +i bility%0A%0A @@ -4480,16 +4480,17 @@ #Don +' t forget
fc975bd573d439490a65bb72ff5f6c69b2b0a771
Update loudness_zwicker_lowpass_intp.py
mosqito/functions/loudness_zwicker/loudness_zwicker_lowpass_intp.py
mosqito/functions/loudness_zwicker/loudness_zwicker_lowpass_intp.py
# -*- coding: utf-8 -*- """ @date Created on Fri May 22 2020 @author martin_g for Eomys """ # Standard library imports import math import numpy as np def loudness_zwicker_lowpass_intp(loudness, tau, sample_rate): """1st order low-pass with linear interpolation of signal for increased precision Parameter...
Python
0.014013
@@ -144,16 +144,98 @@ y as np%0A +#Needed for the loudness_zwicker_lowpass_intp_ea function%0Afrom scipy import signal %0A%0Adef lo @@ -1222,16 +1222,130 @@ polation + %0A # Must add a -1 because is repeating the twice the first value at the initial of the first for loop. %0A @@ -1372,16 +1372,18 ...
88e87a8b266059a74163e43286a7d34403d46be8
check for numpy first
bokeh/util/serialization.py
bokeh/util/serialization.py
""" Functions for helping with serialization and deserialization of Bokeh objects. """ from __future__ import absolute_import from six import iterkeys try: import numpy as np is_numpy = True except ImportError: is_numpy = False try: import pandas as pd is_pandas = True except ImportError: is...
Python
0
@@ -5986,24 +5986,37 @@ %22%22%22%0A if +is_numpy and not any(isin @@ -6061,21 +6061,8 @@ tum) - and is_numpy :%0A
260f5ba0b74cfbad9ed13809c62a1a942cc2be7a
fix style
tests/links_tests/connection_tests/test_conv_2d_bn_activ.py
tests/links_tests/connection_tests/test_conv_2d_bn_activ.py
import unittest import numpy as np import chainer from chainer import cuda from chainer.functions import relu from chainer import testing from chainer.testing import attr from chainercv.links import Conv2DBNActiv def _add_one(x): return x + 1 @testing.parameterize(*testing.product({ 'args_style': ['expli...
Python
0.000001
@@ -1022,16 +1022,17 @@ reshape( +( 1, 1, 3, @@ -1034,16 +1034,17 @@ 1, 3, 3) +) %0A
6a58e96eaf1aa6455ed190d63c3be5e9521a73a0
add remove prefix helper
biothings_explorer/utils/common.py
biothings_explorer/utils/common.py
"""Some common utils functions for BioThings Explorer""" from os.path import commonprefix from ..config import id_ranks def add_s(num: int) -> str: """Add 's' if num is more than one. :param: num: An integer representing count """ if not isinstance(num, int): return '' if num <= 1: ...
Python
0.000002
@@ -1164,26 +1164,24 @@ eturn d%0A -el if isinstanc @@ -2881,16 +2881,30 @@ (v%5B0%5D))%0A + return ''%0A %0A%0Adef ge @@ -3551,30 +3551,8 @@ %5B0%5D%0A - else:%0A @@ -3569,28 +3569,824 @@ turn v%0A return %22unknown%22%0A +%0Adef remove_prefix(_input, prefix):%0A %22%22%22Remove...
25010fb053a5a93d0706e1f8273f5f83cc5390ee
fix and add condor_gsi status to status poller
data_collectors/general/csstatus.py
data_collectors/general/csstatus.py
import multiprocessing from multiprocessing import Process import logging import time import sys import os import psutil from subprocess import Popen, PIPE from cloudscheduler.lib.db_config import * from cloudscheduler.lib.ProcessMonitor import ProcessMonitor from cloudscheduler.lib.poller_functions import \ sta...
Python
0
@@ -1133,24 +1133,43 @@ 2-machines%22, + %22csv2-condor-gsi%22, %22csv2-statu @@ -1553,24 +1553,88 @@ machines%22, %0A + %22csv2-condor-gsi%22: %22csv2_condor_gsi%22, %0A
4748fd514fcafd9a0536b24069bf3365cb60a926
Bump development version number
debreach/__init__.py
debreach/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from distutils import version __version__ = '1.3.0' version_info = version.StrictVersion(__version__).version default_app_config = 'debreach.apps.DebreachConfig'
Python
0
@@ -113,9 +113,9 @@ 1.3. -0 +1 '%0Ave
f4a010660aecaccf24fe2afdd5a568e06e65dd1e
Fix adding board_collaborator to invite
blimp_boards/boards/serializers.py
blimp_boards/boards/serializers.py
from django.core.exceptions import ValidationError from rest_framework import serializers from ..accounts.models import AccountCollaborator from ..invitations.models import InvitedUser from ..accounts.permissions import AccountPermission from ..users.serializers import UserSimpleSerializer from .models import Board, ...
Python
0
@@ -3757,16 +3757,53 @@ r = obj%0A + self.invited_user.save()%0A
6e3cd31c7efbea71b5f731429c24e946ce6fc476
Bump version
debreach/__init__.py
debreach/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from distutils import version __version__ = '0.1.1' version_info = version.StrictVersion(__version__).version
Python
0
@@ -111,11 +111,11 @@ '0. -1.1 +2.0 '%0Ave
21149eb8d128c405d0b69991d1855e99ced951c7
Test fixed: WorkbenchUser is auto created by signal, so creating it separately is not required
ExperimentsManager/tests.py
ExperimentsManager/tests.py
from django.test import TestCase from .models import Experiment from UserManager.models import WorkbenchUser from django.contrib.auth.models import User from django.test import Client class ExperimentTestCase(TestCase): def setUp(self): self.user = User.objects.create_user('test', 'test@test.nl', 'test') ...
Python
0
@@ -369,35 +369,12 @@ cts. -create(netid='jlmdegoede', +get( user @@ -880,8 +880,9 @@ table'%5D) +%0A
bbf6df137f4b9b37e733750937e58131f36c6aa3
Clean old todos
guicore/guievents/alertevents.py
guicore/guievents/alertevents.py
from guicore.displayscreen import EventDispatch import guicore.guiutils as guiutils from controlevents import CEvent import debug import logsupport from logsupport import ConsoleDetail, ConsoleWarning from utils import timers import alertsystem.alerttasks as alerttasks import guicore.switcher as switcher import screens...
Python
0.000002
@@ -2518,19 +2518,154 @@ '%0A%09else: -%0A%09%09 + # todo%0A%09%09# this is ok until maybe I figure out how to avoid. The change causes a firing and the the arming causes a second posting%0A%09%09# logsuppo @@ -2751,24 +2751,25 @@ r(alert),%0A%09%09 +# %09%09%09%09%09%22 Trigg @@ -2774,16 +2774,17 @@ gger IsT +...
f149baa8ca7a401f8d2d390d84fc85960edd743d
Work in progress
dius.py
dius.py
#!python3 # Copyright (c) 2016 Petr Veprek """Disk Usage""" import math import operator import os import string import sys import time TITLE = "Disk Usage" VERSION = "0.0.0" VERBOSE = False def now(on="on", at="at"): return "{}{} {}{}".format(on + " " if on != "" else "", time.strftime("%Y-%m-%d"), at + " " if a...
Python
0.000003
@@ -184,16 +184,38 @@ = False +%0AWIDTH = 80%0ACOUNT = 20 %0A%0Adef no @@ -948,95 +948,8 @@ d()%0A - top=%22./Petr/Docs/_Documents%22 #####################################################%0A @@ -1070,18 +1070,18 @@ ing %7B: %3C -80 +%7B%7D %7D%22.forma @@ -1097,11 +1097,21 @@ th, -80) +WIDTH), WIDTH )...
9ec49083879831d7b2cfd863ea139e0e86d42c36
Bump release version
debreach/__init__.py
debreach/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from distutils import version __version__ = '1.3.1' version_info = version.StrictVersion(__version__).version default_app_config = 'debreach.apps.DebreachConfig'
Python
0
@@ -111,11 +111,11 @@ '1. -3.1 +4.0 '%0Ave
b386ee505976ffda9c9037af5cca6c76adf90fe1
Fix SDCard issue when no SDCard inserted in ECPIX5 board. Now enable to detect SDCard presence. https://github.com/litex-hub/linux-on-litex-vexriscv/issues/171
litex_boards/platforms/ecpix5.py
litex_boards/platforms/ecpix5.py
# # This file is part of LiteX-Boards. # # Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr> # SPDX-License-Identifier: BSD-2-Clause from litex.build.generic_platform import * from litex.build.lattice import LatticePlatform from litex.build.lattice.programmer import OpenOCDJTAGProgrammer # IOs ---------...
Python
0
@@ -3268,24 +3268,69 @@ ns(%22P24%22)),%0A + Subsignal(%22cd%22, Pins(%22L22%22)),%0A Subs
206e8c2da4677532add03deadac03e88a7cd0da8
update __init__
cleverhans/__init__.py
cleverhans/__init__.py
"""The CleverHans adversarial example library""" from cleverhans.devtools.version import append_dev_version # If possible attach a hex digest to the version string to keep track of # changes in the development branch __version__ = append_dev_version('2.0.0')
Python
0.000004
@@ -249,9 +249,9 @@ on(' -2 +3 .0.0
878db5485946935f8784c6c9f15decbe15c0dfbc
Remove catchall redirect
democracylab/urls.py
democracylab/urls.py
"""democracylab URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cla...
Python
0
@@ -1785,32 +1785,34 @@ ent=False)),%0A + # url(r'%5E.*$', Re
491a99aa56d27d5c37af4e0538e808d2ec47d8a6
update problem
hackerrank/016_lisas_workbook.py
hackerrank/016_lisas_workbook.py
#!/bin/python3 """ https://www.hackerrank.com/challenges/bear-and-workbook?h_r=next-challenge&h_v=zen Lisa just got a new math workbook. A workbook contains exercise problems, grouped into chapters. * There are n chapters in Lisa's workbook, numbered from 1 to n. * The i-th chapter has ti problems, numbered ...
Python
0.000001
@@ -1725,18 +1725,18 @@ oblem1(R -ed +ED ) %7C %7C Pr
c2ac7f24d5263ed486fd4c50e3175fc4ea84a374
Remove unused forms
webserver/codemanagement/forms.py
webserver/codemanagement/forms.py
from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Fieldset, Submit from crispy_forms.bootstrap import FormActions from .models import BaseClient, TeamClient, TeamSubmission password_help = """ <p class="text-info"> Choose a password for cloning and submitti...
Python
0
@@ -4146,298 +4146,4 @@ ue)%0A -%0A%0Aclass PathForm(forms.Form):%0A %22%22%22Used by the RepoPathHandler to check data from API clients%22%22%22%0A teamid = forms.IntegerField(required=True)%0A%0A%0Aclass TagListForm(forms.Form):%0A %22%22%22Used by the RepoTagListHandler to obtain a list of tags%22%22%22%0A...
acd888679ef3005f36b9c5381da2b25440098ff0
clean up
doom.py
doom.py
import ppaquette_gym_doom import ppaquette_gym_doom.wrappers import numpy.random as npr import numpy as np import gym import tensorflow as tf from PIL import Image ENV = gym.make('ppaquette/DoomBasic-v0') wrapper = ppaquette_gym_doom.wrappers.action_space.ToDiscrete('minimal') ENV = wrapper(ENV) X, Y = 320, 240 #X, Y ...
Python
0.000001
@@ -1755,190 +1755,8 @@ 1%5D)%0A - #regularised_loss = -tf.reduce_sum((rewards - tau - tau * tf.log(action_probs)) * tf.log(action_probs * (1 - actions) + actions * (1 - action_probs)), reduction_indices=%5B0%5D)%0A @@ -1771,17 +1771,16 @@ .loss = -- tf.reduc @@ -4411,16 +4411,18 @@ earn(500 +00 , No...
2ebe8c55a70d3066eacd7e71c32d6fd95d4d21fd
fix a typo and a bug in ImageList.from_tensors
detectron2/structures/image_list.py
detectron2/structures/image_list.py
# Copyright (c) Facebook, Inc. and its affiliates. from __future__ import division from typing import Any, List, Tuple import torch from torch import device from torch.nn import functional as F from detectron2.utils.env import TORCH_VERSION def _as_tensor(x: Tuple[int, int]) -> torch.Tensor: """ An equivalen...
Python
0.998763
@@ -2420,17 +2420,16 @@ h.Tensor -s %60, each @@ -3124,25 +3124,24 @@ ert t.shape%5B -1 :-2%5D == tens @@ -3153,17 +3153,16 @@ %5D.shape%5B -1 :-2%5D, t.
4d6febe66a3db7f63f579620000899e175fd2204
verbose keyerror
client/python/spiff.py
client/python/spiff.py
import requests import json import logging import datetime log = logging.getLogger('spiff') class ServerError(Exception): def __init__(self, message): super(ServerError, self).__init__() self.__msg = message def __str__(self): return self.__msg def __repr__(self): return "ServerError(%r)"%(sel...
Python
0.998939
@@ -5173,16 +5173,24 @@ KeyError +(offset) %0A if
83a74c7013bd48f2dd7b6a302571bc2caf54b0e9
drop redundant coersion helper for EX
diofant/domains/expressiondomain.py
diofant/domains/expressiondomain.py
"""Implementation of :class:`ExpressionDomain` class. """ from ..core import SympifyError, sympify from .characteristiczero import CharacteristicZero from .field import Field from .simpledomain import SimpleDomain __all__ = ('ExpressionDomain',) class ExpressionDomain(Field, CharacteristicZero, SimpleDomain): ...
Python
0
@@ -4317,71 +4317,8 @@ ))%0A%0A - def _from_ExpressionDomain(self, a, K0):%0A return a%0A%0A
f14192b0e71e9bee1456bd240ba200920abc246b
add comment
direct/src/directnotify/Notifier.py
direct/src/directnotify/Notifier.py
"""Notifier module: contains methods for handling information output for the programmer/user""" from LoggerGlobal import * import time class Notifier: def __init__(self, name, logger=None): """__init__(self, string, Logger=None) Create a new instance of the Notifier class with a given name ...
Python
0
@@ -869,32 +869,187 @@ sage%0A %22%22%22 +%0A%0A # for some strange reason, time.time() updates only once/minute if%0A # the task is out of focus on win32. time.clock doesnt have this prob %0A return
7be087d4bd62557acd64a9e703443a8df404e3e3
Make storage size an int
director/sessions_/providers/ec2.py
director/sessions_/providers/ec2.py
import time from django.conf import settings import boto.ec2 class EC2: ''' Amazon EC2 provider for session Workers ''' def connection(self): ''' Get a EC2 connection to use in start() and stop() ''' return boto.ec2.connect_to_region( 'us-west-2', ...
Python
0.000123
@@ -2125,16 +2125,20 @@ .size = +int( worker.s @@ -2143,16 +2143,17 @@ .storage +) %0A
a369a9648e1c0bc2cb2a4964fd2f5814d0950902
echo 4
echo.py
echo.py
import IPython import warnings # These are actually used for the application import collections from golix import Ghid from hypergolix.service import HypergolixLink hgxlink = HypergolixLink(threaded=True) desktop = Ghid(algo=1, address=b'\xc0TZ\x15+\x9a\x8e\x01\xbbvw\x83\xc8%\xd5RG\x9c8<\xf7\x1f\xa4e\x08\xc4\x9a\xa0...
Python
0.999988
@@ -89,16 +89,28 @@ lections +%0Aimport time %0A%0Afrom g @@ -712,16 +712,599 @@ '%5Cx02'%0A%0A +# Etc%0Atimer = collections.deque(%5B0,0%5D, maxlen=2)%0Arecipients = %7B razpi, desktop %7D - %7B hgxlink.whoami %7D%0A%0Adef make_request(msg):%0A obj = hgxlink.new_object(%0A state = msg,%0A dynamic =...
4d86d5ffa27f5ee365bc832113cd6605a23d10d3
Update src/acquisition/covidcast_nowcast/load_sensors.py
src/acquisition/covidcast_nowcast/load_sensors.py
src/acquisition/covidcast_nowcast/load_sensors.py
from shutil import move import time import delphi.operations.secrets as secrets import pandas as pd import sqlalchemy from delphi.epidata.acquisition.covidcast.csv_importer import CsvImporter SENSOR_CSV_PATH = "/common/covidcast-nowcast/receiving/" TABLE_NAME = "covidcast_nowcast" DB_NAME = "epidata" CSV_DTYPES = {"g...
Python
0
@@ -647,19 +647,19 @@ to load -the +and insert
4743932c54a7e3231857df022b328258121dfef1
For case G.number_of_nodes()=0 break
ComplexCiPython/ComplexCiPython.py
ComplexCiPython/ComplexCiPython.py
import networkx as nx import csv import time import heapq import os import sys from ci import collective_influence def chunks(l, n, modelID): """Yield successive n-sized chunks from l.""" for i in range(0, len(l), n): genL = l[i:i + n] if len(genL)<n: genL.extend(["" for j in range...
Python
0.999343
@@ -4715,16 +4715,71 @@ break;%0A%0A + if G.number_of_nodes()==0:%0A break;%0A%0A with
a82b3b5ba8d6fba12df1a3c1993325955da893b6
Fix a typo in comment. Thanks for tmm1 for watching after me.
lib/carbon/util.py
lib/carbon/util.py
import os import pwd from os.path import abspath, basename, dirname, join from twisted.python.util import initgroups from twisted.scripts.twistd import runApp from twisted.scripts._twistd_unix import daemonize daemonize = daemonize # Backwards compatibility def dropprivs(user): uid, gid = pwd.getpwnam(user)[2:4...
Python
0.000001
@@ -1340,17 +1340,17 @@ the epo -o +l l reacto
e611e9518945fa38165e8adf7103561f438b70b1
Add subcommand to process directory
interdiagram/bin/interdiagram.py
interdiagram/bin/interdiagram.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from typing import List import click import yaml from ..models import Diagram click.disable_unicode_literals_warning = True # TODO: Correct documentation schema once it's frozen @click.command() @click.argument('yaml-file', nargs=-1, type=click.File()) @click.argument...
Python
0
@@ -49,26 +49,95 @@ rom -typing import List +pathlib import Path%0Afrom typing import Iterable, List, TypeVar%0Afrom typing.io import IO %0A%0Aim @@ -241,69 +241,1072 @@ ue%0A%0A -%0A# TODO: Correct documentation schema once it's frozen%0A@click +FileType = TypeVar('FileType', IO, Path)%0A%0A%0Adef _is_file_obj(%0A...
93defcbe389ff885da95dae69a0494e8806055b9
Remove alreadyExist()
lib/core/engine.py
lib/core/engine.py
#!/usr/bin/env python ''' Copyright (c) 2016 anti-XSS developers ''' import os import urllib import urllib2 from lib.core.urlfun import * from script import Script from lib.core.link import Link from lib.var.links import Links from lib.var.scripts import Scripts from lib.var.countpage import CountPage from lib.var....
Python
0.000001
@@ -631,225 +631,8 @@ xt%0A%0A -def alreadyExist(link):%0A '''%0A Judge if the link is already exist in links%5B%5D%0A '''%0A%0A for iLink in Links().getContent():%0A if link.getUrl() == iLink.getUrl():%0A return True%0A%0A return False%0A%0A def @@ -3520,15 +3520,10 @@ not -alread...
2163478d2d927c4e50fcef65a88ca9c81b9d245b
Remove print from tests
menpodetect/tests/opencv_test.py
menpodetect/tests/opencv_test.py
from menpodetect.opencv import (load_opencv_frontal_face_detector, load_opencv_eye_detector) import menpo.io as mio takeo = mio.import_builtin_asset.takeo_ppm() def test_frontal_face_detector(): takeo_copy = takeo.copy() opencv_detector = load_opencv_frontal_face_detector() ...
Python
0.000002
@@ -900,39 +900,8 @@ 5))%0A - print takeo_copy.landmarks%0A
475552061da6a58c6953c387a639d5b4e941600b
Fix shell completion
metakernel/magics/shell_magic.py
metakernel/magics/shell_magic.py
# Copyright (c) Metakernel Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function from metakernel import Magic, pexpect from metakernel.replwrap import cmd, bash import os import sys class ShellMagic(Magic): def __init__(self, kernel): super(Sh...
Python
0.000002
@@ -2733,28 +2733,54 @@ = self. -eval(command +repl.run_command(command, timeout=None )%0A
e8ad2ca0fc2ddec71645bef31686d9de2001dd88
add translate type
modularodm/fields/StringField.py
modularodm/fields/StringField.py
from . import Field from ..validators import StringValidator class StringField(Field): # default = '' validate = StringValidator() def __init__(self, *args, **kwargs): super(StringField, self).__init__(*args, **kwargs)
Python
0.000017
@@ -101,16 +101,40 @@ lt = ''%0A + translate_type = str %0A val
df5ac0a7f2246e5fbbb5f7d87903a5232e94fe87
Test deprecation.
morepath/tests/test_autosetup.py
morepath/tests/test_autosetup.py
from collections import namedtuple from morepath.autosetup import ( caller_module, caller_package, autoscan, morepath_packages, import_package) from base.m import App import morepath import pytest def setup_module(module): morepath.disable_implicit() def test_import(): import base import sub ...
Python
0.000001
@@ -222,24 +222,63 @@ le(module):%0A + with pytest.deprecated_call():%0A morepath
e1184f70abd477ae2d0c304321231c908c67882b
add comment to authorize() that uname and pw are saved in plain text
msl/package_manager/authorize.py
msl/package_manager/authorize.py
""" Create the GitHub authorization file. """ import getpass from .utils import log, get_username, _get_input, _GITHUB_AUTH_PATH WARNING_MESSAGE = """ Your username and password are saved in plain text in the file that is created. You should set the file permissions provided by your operating system to ensure that y...
Python
0
@@ -737,24 +737,47 @@ increased.%0A%0A + .. important::%0A%0A Calling @@ -835,24 +835,27 @@ GitHub%0A + + username and @@ -903,16 +903,236 @@ horized. + Your%0A username and password are saved in plain text in the file that is%0A created. You should set the file permissions provided ...
47b97cf311c36b993b59235dedc06993a6d58b6f
make TestVecSim subclass object
new_pmlib/TestVectorSimulator.py
new_pmlib/TestVectorSimulator.py
#========================================================================= # TestVectorSimulator #========================================================================= # This class simplifies creating unit tests which simply set certain # inputs and then check certain outputs every cycle. A user simply needs # to i...
Python
0
@@ -786,16 +786,26 @@ imulator +( object ) :%0A%0A #--
a335445273ebeca077f3508392fc347e62df64ca
Add name to argument list
nnadapter/backend/torchlegacy.py
nnadapter/backend/torchlegacy.py
""" Thanks to clcarwin https://github.com/clcarwin/convert_torch_to_pytorch """ from __future__ import print_function import torch import torch.nn as nn from torch.autograd import Variable from torch.utils.serialization import load_lua class LambdaBase(nn.Sequential): def __init__(self, name, fn, *args): ...
Python
0.000005
@@ -5110,16 +5110,22 @@ aReduce( +name, lambda x
2388b28aed8e01930f2e6138341b754c5a931c43
Update speakonomy.py
speakerbot/speakonomy.py
speakerbot/speakonomy.py
import datetime as dt import os import sys from speaker_db import SpeakerDB from dynamic_class import Singleton class Speakonomy: __metaclass__ = Singleton def __init__(self, speakerbot=None, disabled=False): self.db = SpeakerDB() self.speakerbot = speakerbot self.disabled = disabled ...
Python
0.000001
@@ -788,46 +788,8 @@ 1):%0A - assert isinstance(amount,int)%0A @@ -853,26 +853,21 @@ nce+ -%7B%7D%22.format( +?%22, %5B amount -) +,%5D )%0A%0A
0cd4862062bbe19aec5bb2a23563e03eb8ca8cb7
Fix stable release script
make_stable_release.py
make_stable_release.py
from robot.libdoc import libdoc from src.WhiteLibrary.version import VERSION import git import sys VERSION_FILE = './src/WhiteLibrary/version.py' def change_stable(from_stable, to_stable): with open(VERSION_FILE, 'r') as file : filedata = file.read() filedata = filedata.replace('STABLE = {0}'.format...
Python
0.000001
@@ -141,16 +141,17 @@ on.py'%0A%0A +%0A def chan @@ -185,17 +185,16 @@ table):%0A -%0A with @@ -217,33 +217,32 @@ LE, 'r') as file - :%0A fileda @@ -359,16 +359,17 @@ _stable) +) %0A%0A wi @@ -434,16 +434,17 @@ edata)%0A%0A +%0A def chan @@ -507,17 +507,16 @@ as file - :%0A @@ -712,16...
6d910ea91b550864f445fe33d0a29ef11a82f762
Replace iteritmes() with items()
malcolm/core/method.py
malcolm/core/method.py
#!/bin/env dls-python from collections import OrderedDict from malcolm.core.loggable import Loggable class Method(Loggable): """Exposes a function with metadata for arguments and return values""" def __init__(self, name): super(Method, self).__init__(logger_name=name) self.name = name ...
Python
0.99999
@@ -2344,12 +2344,8 @@ val. -iter item
ef5ed1bedd80ae03b9174088e579b5d85507266c
Update forms.py
app/auth/forms.py
app/auth/forms.py
from flask.ext.wtf import Form from wtforms import StringField, PasswordField, BooleanField, SubmitField, ValidationError from wtforms.validators import Required, Email, Length, Regexp, EqualTo from ..models import User class LoginForm(Form): email = StringField('Email', validators=[Required(), Length(1, 64), Ema...
Python
0.000001
@@ -213,16 +213,59 @@ rt User%0A +from app.exceptions import ValidationError%0A %0A%0Aclass