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
8e4459f5f72b035be93beae3c9803940a3900d95
add test for client transaction id overflow
aiozk/test/test_session.py
aiozk/test/test_session.py
import asyncio from unittest import mock import aiozk.session import pytest import asynctest from aiozk import exc @pytest.fixture def session(event_loop): fake_retry_policy = asynctest.MagicMock(wraps=aiozk.session.RetryPolicy.forever()) session = aiozk.session.Session( 'zookeeper.test', t...
Python
0.000001
@@ -5014,28 +5014,352 @@ t.assert_called_once_with()%0A +%0A%0A@pytest.mark.asyncio%0Aasync def test_cxid_rollover(zk, path):%0A zk.session.xid = 0x7fffffff - 10%0A%0A try:%0A await zk.create(path)%0A for _ in range(20):%0A await zk.set_data(path, '')%0A finally:%0A await zk.de...
ae460d9fb932cb4733083bee09aa10250bf6b702
add what get_data returns
neuroshare/SegmentEntity.py
neuroshare/SegmentEntity.py
from .Entity import Entity class SegmentSource(object): """Segment sources provide access to the metadata of individual sources of a :class:`SegmentEntity`""" def __init__(self, segment, source_id, info): self._segment = segment self._source_id = source_id self._info = info @p...
Python
0.008853
@@ -3646,16 +3646,489 @@ %60index%60%60 +.%0A%0A Returns:%0A%0A data : numpy.ndarray%0A The Segment data.%0A timestamp : float%0A Time stamp of the Segment data.%0A sample_count : int%0A How many sample points were obtained.%0A unit_id : int%0A ...
74563f17edeb0b42224a9d4ac0221ec3c7c321e6
Make sure the email subject and body are strings
salt/returners/smtp_return.py
salt/returners/smtp_return.py
# -*- coding: utf-8 -*- ''' Return salt data via email The following fields can be set in the minion conf file:: smtp.from (required) smtp.to (required) smtp.host (required) smtp.port (optional, defaults to 25) smtp.username (optional) smtp.password (optional) smtp.tls (optional, defaults ...
Python
0.000005
@@ -4497,24 +4497,35 @@ ject, **ret) +.getvalue() %0A log.deb @@ -4697,24 +4697,35 @@ erer, **ret) +.getvalue() %0A else:%0A @@ -5033,16 +5033,27 @@ , **ret) +.getvalue() %0A%0A if
5d6c69bccc7e136c43bc1806112e36b02cf21e64
Update error message in LLVM version check.
ffi/build.py
ffi/build.py
#!/usr/bin/env python """ Build script for the shared library providing the C ABI bridge to LLVM. """ from __future__ import print_function from ctypes.util import find_library import re import os import subprocess import shutil import sys import tempfile here_dir = os.path.abspath(os.path.dirname(__file__)) build_...
Python
0
@@ -3580,17 +3580,34 @@ LLVM 7.0 -+ +.x, 7.1.x or 8.0.x Be sure
91087bd04ae10a01c6042aba6f89982da24c0e9f
add decorator with arguments
new_usage/decorator_suppress_error.py
new_usage/decorator_suppress_error.py
#!/usr/bin/env python # coding=utf-8 import functools def suppress_errors(func): """ Automatically silence errors that occur within a function """ @functools.wraps(func) def wrapper(*args, **kwargs): try: return func(*args, **kwargs) except Exception: pass ...
Python
0.000001
@@ -72,16 +72,20 @@ rors +_raw (func):%0A @@ -80,16 +80,16 @@ (func):%0A - %22%22%22%0A @@ -340,24 +340,606 @@ er%0A%0A -@suppress_errors +def suppress_errors_arguments(func = None, log_func = None):%0A %22%22%22%0A With arguments%0A %22%22%22%0A def decorator(func):%0A @functools.wrap...
58175af26936397a1850cc18c04e60ab9584fad6
version bump to 0.1.4
version.py
version.py
__version__ = (0, 1, 3)
Python
0.000001
@@ -18,7 +18,7 @@ 1, -3 +4 )%0A
91fb8f3825f521c52bed82fbfe1969bda5b22534
Test Cases
exercise2.py
exercise2.py
#!/usr/bin/env python """ Assignment 1, Exercise 2, INF1340, Fall, 2015. Name that shape. This module contains one function name_that_shape(). It prompts the user to input the number of sides in a shape and outputs the name of the shape. """ __author__ = 'Susan Sim' __email__ = "ses@drsusansim.org" __copyright__ = ...
Python
0.000001
@@ -563,35 +563,102 @@ ror, Error, -Pentagon, D +triangle, quadrilateral, pentagon, hexagon,%0A heptagon, octagon, nonagon, d ecagon, Erro @@ -659,16 +659,22 @@ , Error, + Error %0A%0A Ac @@ -698,49 +698,120 @@ or, -Pentagon, Decagon, Error, invalid literal +Error, Error, triangle, quadrilateral, pentagon...
0a90a86bbb157b2a8b52393e87cccfca8cd32788
replace lenient glob-like pattern with more specific regexp to load test utility modules
h2o-py/tests/_utils.py
h2o-py/tests/_utils.py
import fnmatch import imp import importlib import os import sys def list_all_files(paths, filter_=None, recursive=True): """ Need this function as Py2 doesn't provide any useful `glob` implementation. :param paths: the directories to look into. :param filter_: None, or a predicate function returning T...
Python
0
@@ -12,19 +12,8 @@ tch%0A -import imp%0A impo @@ -35,16 +35,26 @@ port os%0A +import re%0A import s @@ -2496,16 +2496,35 @@ # Py2%0A + import imp%0A @@ -2564,16 +2564,16 @@ _path%5D)%0A - @@ -2654,44 +2654,130 @@ -ff = file_filter(include=%22**/_*.py%22, +utils_pat = re.compile(...
c83688e4081197d8f381535d51af41b79d1aee23
Fix incorrect reference to function in same module
runac/util.py
runac/util.py
import os, sys BASE = os.path.dirname(os.path.dirname(__file__)) CORE_DIR = os.path.join(BASE, 'core') IGNORE = {'pos'} if sys.version_info[0] < 3: def keys(d): return d.iterkeys() def values(d): return d.itervalues() def items(d): return d.iteritems() else: def keys(d): return d.keys() def values(d): ...
Python
0.000008
@@ -502,13 +502,8 @@ ted( -util. item
79cc4f7667d84ab0d9b5d71db114095dd7078e0a
Fix get_open_fds() for None arguments in main
fdinfo/fd.py
fdinfo/fd.py
import stat import os import _fdinfo get_open_fds = _fdinfo.get_open_fds def stat_pid_fd(pid, fd): # TODO: Implement for darwin return os.stat("/proc/%d/fd/%d" % (pid, fd)) _TYPE_LOOKUP = { 000: "anon_inode", stat.S_IFBLK: "block", stat.S_IFCHR: "character", stat.S_IFDIR: "directory", st...
Python
0.000001
@@ -2033,35 +2033,143 @@ -for fd in get_open_fds(pid) +if pid is None:%0A open_fds = get_open_fds()%0A else:%0A open_fds = get_open_fds(pid)%0A for fd in open_fds :%0A
4f47691b876b74e8763a68981d22ceedf2889f9c
Revise doc string and add time complexity
alg_bubble_sort.py
alg_bubble_sort.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division def bubble_sort(a_list): """Bubble Sort algortihm. Concept: - Start from the item at the 1st slot to check if it is bigger than the next one. If yes, swap these two items. - Then ...
Python
0.000002
@@ -168,275 +168,31 @@ -Concept:%0A - Start from the item at the 1st slot to check %0A if it is bigger than the next one. If yes, swap these two items.%0A - Then check the following successive pair and swap them if needed.%0A - Iterate the procedure over the length of the list +Time complexi...
0acdaffa94f47a0e7f03e6bfe599a65858a13b3e
remove enabled from Provider admin
allaccess/admin.py
allaccess/admin.py
from django.contrib import admin from .models import Provider, AccountAccess class ProviderAdmin(admin.ModelAdmin): "Admin customization for OAuth providers." list_display = ('name', 'enabled', 'site',) list_filter = ('name', 'enabled', 'site', ) class AccountAccessAdmin(admin.ModelAdmin): "Admi...
Python
0
@@ -231,35 +231,24 @@ r = ('name', - 'enabled', 'site', )%0A%0A
98cd06e56d05c23c69cc6abfda2c90c31f45a328
remove debug-print
usr/local/bin/qnib-setup.py
usr/local/bin/qnib-setup.py
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Setup a qnib/terminal container Usage: qnib-setup.py [options] qnib-setup.py (-h | --help) qnib-setup.py --version Options: -h --help Show this screen. --version Show version. --loglevel, -L=<str> Loglevel ...
Python
0.000764
@@ -1102,23 +1102,8 @@ ns)%0A - print qcfg%0A
2eeae8c7173a158bee3fd26d453728b603e7ba85
Update location_timestamp in AmbulanceUpdateView.
ambulance/forms.py
ambulance/forms.py
from django import forms from django.contrib.gis.forms import PointField from django.utils import timezone from emstrack.forms import LeafletPointWidget from .models import Ambulance, Call class AmbulanceCreateForm(forms.ModelForm): location = PointField( widget = LeafletPointWidget(attrs...
Python
0
@@ -609,76 +609,78 @@ lean -(self):%0D%0A%0D%0A # get cleaned data%0D%0A data = super().clean( +_location_timestamp(self):%0D%0A%0D%0A print('clean_location_timestamp' )%0D%0A%0D @@ -811,16 +811,29 @@ +self.cleaned_ data%5B'lo @@ -869,24 +869,26 @@ .now()%0D%0A +%0D%0A ...
ed45c8201977aecde226b2e9b060820a8fd677c3
Remove test for deprecated createmultsig option
test/functional/rpc_deprecated.py
test/functional/rpc_deprecated.py
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test deprecation of RPC calls.""" from test_framework.test_framework import BitcoinTestFramework from test_f...
Python
0
@@ -305,64 +305,8 @@ work -%0Afrom test_framework.util import assert_raises_rpc_error %0A%0Acl @@ -482,39 +482,8 @@ %5D, %5B -%22-deprecatedrpc=createmultisig%22 %5D%5D%0A%0A @@ -509,24 +509,191 @@ lf):%0A + # This test should be used to verify correct behaviour of deprecated%0A # RPC methods with an...
488edda7c20f00dbca36e477d1d400655eb37f9d
increment version
rasa/version.py
rasa/version.py
__version__ = "1.3"
Python
0.000004
@@ -11,10 +11,14 @@ _ = %221.3 +.1a1 %22%0A
23719083123110afb864c9d7cbbf33ae5503f667
Fix ADMX template format for Windows Server 2008
tools/grit/grit/format/policy_templates/writer_configuration.py
tools/grit/grit/format/policy_templates/writer_configuration.py
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. def GetConfigurationForBuild(defines): '''Returns a configuration dictionary for the given build that contains build-specific settings and informati...
Python
0.000027
@@ -1523,17 +1523,17 @@ ss'%5D = ' -b +B oth'%0A c
c19e1c2ace9d0c5bdd169bf545280b504f21b449
These are containers
src/service_deployment_tools/cleanup_marathon_orphaned_containers.py
src/service_deployment_tools/cleanup_marathon_orphaned_containers.py
#!/usr/bin/env python """ Usage: cleanup_marathon_orphaned_containers.py [options] """ import argparse import calendar import datetime import logging import docker from service_deployment_tools.marathon_tools import get_deployed_images log = logging.getLogger('__main__') def get_running_containers(client): ""...
Python
0.999516
@@ -1345,23 +1345,31 @@ rn %5B -image for image +container for container in @@ -1394,21 +1394,25 @@ if -image +container .get('Cr @@ -1423,21 +1423,25 @@ d') and -image +container .get('Cr
2716ae180cb3a3f14678bac5f27e4d1514feb965
fix version
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', 'sphinx.ext.doctest', 'sphinx.ext.extlinks', 'sphinx.ext.ifconfig', 'sphinx.ext.napoleon', 'sphinx.ext.todo', 'sphinx.ext...
Python
0.000001
@@ -648,17 +648,17 @@ = u'0.1. -0 +1 '%0A%0Apygme
d6a58826ca78bc01cd98a2ff9d10091c676e3266
Set project root for docs
docs/conf.py
docs/conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # WunderAPI documentation build configuration file, created by # sphinx-quickstart on Thu Feb 8 15:43:50 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 #...
Python
0
@@ -679,18 +679,16 @@ here.%0A#%0A -# import o @@ -689,18 +689,16 @@ port os%0A -# import s @@ -700,18 +700,16 @@ ort sys%0A -# sys.path @@ -737,16 +737,18 @@ spath('. +./ '))%0A%0A%0A#
42f3b67a783cc26490554c06b24b5137e5fe92bf
update to docs config
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # AMPtk documentation build configuration file, created by # sphinx-quickstart on Tue Sep 12 09:56:49 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...
Python
0
@@ -1768,14 +1768,13 @@ = u' -0.10.3 +1.0.0 '%0A%0A#
f024362b28280353b56e011190ed700190311f43
Update copyright
docs/conf.py
docs/conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import subprocess import datetime if 'check_output' not in dir(subprocess): import subprocess32 as subprocess extensions = [ 'sphinx.ext.autodoc', 'rst.linker', ] # General information about the project. root = os.path.join(os.path.dirnam...
Python
0
@@ -668,10 +668,10 @@ e(20 -17 +05 ,1,1
bf38b00c5246627c8fa270c151b78202ddfebc6f
Append search path to include parent directory.
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # Mobly documentation build configuration file, created by # sphinx-quickstart on Wed Feb 22 11:40:14 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...
Python
0
@@ -651,18 +651,16 @@ here.%0A#%0A -# import o @@ -661,18 +661,16 @@ port os%0A -# import s @@ -672,18 +672,16 @@ ort sys%0A -# sys.path @@ -695,16 +695,39 @@ (0, -u'mobly' +os.path.abspath(os.path.pardir) )%0A%0A%0A
64c6b9229668b98b7515583be4bedbde3b95da0a
Add napoleon to sphinx conf.py
docs/conf.py
docs/conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # pdfebc documentation build configuration file, created by # sphinx-quickstart on Sat May 27 17:35:36 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 # aut...
Python
0.000012
@@ -1353,16 +1353,42 @@ ubpages' +%0A 'sphinx.ext.napoleon' %5D%0A%0A# Add
5a13c6e39e877c31acf34e51f8b268ee9b945665
add google analytics
docs/conf.py
docs/conf.py
import sys import os import shlex from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer lexers['php'] = PhpLexer(startinline=True, linenos=1) lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) primary_domain = 'php' project = u'eBay SDK for PHP' version = '1.x' copyright = u'2...
Python
0
@@ -2859,11 +2859,60 @@ guides/' +,%0A 'google_analytics_account': 'UA-51857511-1' %0A%7D%0A
72b11602b2ad5e3fcc82464f507f6ac1970f936d
Make firewall rules tests idempotent, move IPy=>netaddr, add deltete test.
nova/tests/test_adminapi.py
nova/tests/test_adminapi.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
@@ -3239,24 +3239,99 @@ .1.1.1/32')%0A + self.api.remove_external_address_block(self.context, '1.1.1.1/32')%0A self @@ -3737,16 +3737,91 @@ ntext))%0A + self.api.remove_external_address_block(self.context, '1.1.1.2/32')%0A @@ -3932,8 +3932,615 @@ nfo'%5D))%0A +%0A def test_remove_...
e22f770ae7590f664b39552ae76a06b3631284c6
update copyright date on docs
docs/conf.py
docs/conf.py
# Ensure we get the local copy of tornado instead of what's on the standard path import os import sys sys.path.insert(0, os.path.abspath("..")) import waterbutler # noqa import waterbutler.server # noqa # import waterbutler.providers # noqa master_doc = "index" project = "WaterButler" copyright = "2014, Center For...
Python
0
@@ -300,17 +300,17 @@ t = %22201 -4 +6 , Center
412bf0d7ea04671e2aed7861bccaa240418af74b
remove user profile by default
DjMainApp/models.py
DjMainApp/models.py
from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save # Create your models here. class UserProfile(models.Model): user = models.OneToOneField(User, related_name="profile") pass_reset_code = models.CharField(max_length=200, null=True, blank=True, defau...
Python
0.000001
@@ -114,16 +114,180 @@ t_save%0A%0A +%0A%0A%22%22%22%0A# Uncomment those lines after you have synced your database to get user profile functionality%0A##############################################################%0A%0A # Create @@ -705,8 +705,13 @@ er=User) +%0A%22%22%22%0A
f8c22c35088293f899da263db0f7e74955101281
Apply black to conf.py.
docs/conf.py
docs/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html import datetime # -- Project information --------------------------------------------...
Python
0
@@ -334,17 +334,17 @@ oject = -' +%22 django-s @@ -348,17 +348,17 @@ o-sesame -' +%22 %0Acopyrig @@ -362,17 +362,17 @@ right = -' +%22 2012-%7B%7D, @@ -388,17 +388,17 @@ Augustin -' +%22 .format( @@ -434,17 +434,17 @@ uthor = -' +%22 Aymeric @@ -451,17 +451,17 @@ Augustin -' +%22 %0A%0A# The @@ -517,13...
9654609bf31d4b8451eb94d580797320e4bc3dd3
Fix syntax error in processing
gitreload/processing.py
gitreload/processing.py
""" Module for handling the actual processing of requests and incluydes the workers and import task. """ import logging import multiprocessing import os import subprocess from git import Repo from gitreload.config import settings log = logging.getLogger('gitreload') # pylint: disable=C0103 def import_repo(action...
Python
0.000725
@@ -713,16 +713,17 @@ ry_path' +, %0A
09c3b752154478b15a45d11f08d46a5003f174ec
Revert keyword optimization for current release
giveaminute/keywords.py
giveaminute/keywords.py
""" :copyright: (c) 2011 Local Projects, all rights reserved :license: Affero GNU GPL v3, see LICENSE for more details. """ from framework.controller import log # find keywords in a string def getKeywords(db, s): """Get all matches for passed in string in keyword tables :param db: database handle ...
Python
0
@@ -128,45 +128,8 @@ %0A%22%22%22 -%0Afrom framework.controller import log %0A%0A# @@ -186,184 +186,79 @@ -%22%22%22Get all matches for passed in string in keyword tables%0A %0A :param db: database handle%0A :param s: string to look for%0A :returns list of matching keywords +sql = %22select keyw...
dceb7e25824b161fc3a11081822b45245bd0c66a
Update TestProgram
numba/hsa/tests/hsadrv/test_driver.py
numba/hsa/tests/hsadrv/test_driver.py
from __future__ import print_function, absolute_import import os import ctypes import numpy as np import numba.unittest_support as unittest from numba.hsa.hsadrv.driver import hsa, Queue, BrigModule from numba.hsa.hsadrv import drvapi, enums class TestLowLevelApi(unittest.TestCase): """This test checks that all...
Python
0
@@ -182,16 +182,37 @@ , Queue, + Program, Executable, BrigMod @@ -2277,136 +2277,44 @@ le)%0A - symbol_offset = brig_module.find_symbol_offset(symbol)%0A program = hsa.create_program(%5Bself.gpu%5D)%0A module = +%0A program = Program()%0A pro @@ -2354,27 +2354,16 @@ code -_...
c275b205605c68c96dd1a8f33e1c4694cb5ae98a
update URL to whl file, #2314
test/python/topology/test2_pkg.py
test/python/topology/test2_pkg.py
# Licensed Materials - Property of IBM # Copyright IBM Corp. 2016,2019 import unittest import os import sys import itertools import test_functions from test_utilities import standalone from streamsx.topology.topology import * from streamsx.topology.tester import Tester from streamsx.topology import schema import stre...
Python
0
@@ -2918,17 +2918,18 @@ com/ -markheger +IBMStreams /str
58a375f5376eefc8b7f731b80ce2c6abc6dff8a8
Comment out failing portions of __mul__ and __rmul__ until they are fixed in chararray.
numpy/core/tests/test_defchararray.py
numpy/core/tests/test_defchararray.py
from numpy.testing import * from numpy.core import * import numpy as np class TestBasic(TestCase): def test_construction(self): A = np.array([['abc', '123'], ['789', 'xyz']]) A1 = A.view(np.chararray) A2 = np.chararray.__new__(np.chararray, A.shape, itemsize=A.itemsize...
Python
0.000011
@@ -1370,32 +1370,33 @@ A = self.A%0A +# for r in @@ -1403,32 +1403,33 @@ (2,3,5,7,197):%0A +# Ar = @@ -1453,32 +1453,33 @@ %5D*r, A%5B0,1%5D*r%5D,%0A +# @@ -1523,33 +1523,35 @@ w(np.chararray)%0A -%0A +#%0A# asse @@ -1656,21 +1656,16 @@ -self. A...
441e9e378a467cc69af96c8c465a1a351e667326
Fix Python 2.7 failures
glue/_plugin_helpers.py
glue/_plugin_helpers.py
# The following funtion is a thin wrapper around iter_entry_points. The reason it # is in this separate file is that when making the Mac app, py2app doesn't # support entry points, so we replace this function with a version that has the # entry points we want hardcoded. If this function was in glue/main.py, the # refer...
Python
0.999119
@@ -1327,27 +1327,37 @@ not -'plugins' in config +config.has_section('plugins') :%0A @@ -1417,29 +1417,38 @@ for -key in sorted(config%5B +name, enabled in config.items( 'plu @@ -1452,17 +1452,16 @@ plugins' -%5D ):%0A @@ -1475,19 +1475,20 @@ plugins%5B -key +name %5D = bool @@ -1492,38 +1492,23 @@ oo...
d7001ccab0879e17308bf2dc945b5fd3b726be27
Write the critical multiplier or the range when the damage gets converted into a String
statblock/dice.py
statblock/dice.py
from random import random class Die: """ Abstracts the random dice throw. Roll will produce the result. The die can be further parametrized by a multiplicator and/or a modifier, like 2 * Die(8) +4. """ def __init__(self, number, multiplicator=1, modifier=0): self.number = number ...
Python
0.000295
@@ -1113,24 +1113,21 @@ -return +base = %22%25sd%25s -+%25s %22 %25 @@ -1162,24 +1162,109 @@ mber -, self.modifier) +)%0A if self.modifier %3E 0:%0A return base + (%22+%25s%22 %25 self.modifier)%0A return base %0A
dc7c0a1e329d9cc676ff306b18e7ad6cf258aed0
Update post_cohort_management_fix to Django 1.8
openedx/core/djangoapps/course_groups/management/commands/post_cohort_membership_fix.py
openedx/core/djangoapps/course_groups/management/commands/post_cohort_membership_fix.py
""" Intended to fix any inconsistencies that may arise during the rollout of the CohortMembership model. Illustration: https://gist.github.com/efischer19/d62f8ee42b7fbfbc6c9a """ from django.core.management.base import BaseCommand from django.db import IntegrityError from openedx.core.djangoapps.course_groups.models i...
Python
0
@@ -730,20 +730,19 @@ ns.%0A +%0A -%7C commit -%7C : op @@ -847,16 +847,344 @@ '''%0A%0A + def add_arguments(self, parser):%0A %22%22%22%0A Add arguments to the command parser.%0A %22%22%22%0A parser.add_argument(%0A '--commit',%0A action='store_true',%0...
77d0baceee021418291a56d2c0c7d9d6e44a0084
Use pytest to skip test_guess_github_repo
doctr/tests/test_local.py
doctr/tests/test_local.py
import os from ..local import check_repo_exists, GIT_URL, guess_github_repo from ..__main__ import on_travis import pytest from pytest import raises TEST_TOKEN = os.environ.get('TESTING_TOKEN', None) if TEST_TOKEN: HEADERS = {'Authorization': 'token {}'.format(TEST_TOKEN)} else: HEADERS = None @pytest.mark...
Python
0
@@ -2149,24 +2149,206 @@ octr.git')%0A%0A +@pytest.mark.skipif(not on_travis(), reason=%22Not on Travis%22)%0A@pytest.mark.skipif(os.environ.get('TRAVIS_SECURE_ENV_VARS', 'false') != 'true', reason=%22Not run on Travis fork builds%22)%0A def test_gue @@ -2511,96 +2511,8 @@ %22%22%22%0A - if on_travis() and os.env...
5b8758405d39783011dc659033c9e87824eade87
Allow configuring logging in local_callback
driller/local_callback.py
driller/local_callback.py
import os import sys import signal import logging import driller import subprocess import multiprocessing l = logging.getLogger("local_callback") def _run_drill(drill, fuzz, _path_to_input_to_drill): _binary_path = fuzz.binary_path _fuzzer_out_dir = fuzz.out_dir _bitmap_path = os.path.join(_fuzzer_out_dir...
Python
0.000001
@@ -43,16 +43,38 @@ logging%0A +import logging.config%0A import d @@ -2986,24 +2986,168 @@ sys.argv))%0A%0A + logcfg_file = os.path.join(os.getcwd(), '.driller.ini')%0A if os.path.isfile(logcfg_file):%0A logging.config.fileConfig(logcfg_file)%0A%0A binary_p @@ -3529,16 +3529,67 @@ : pass%0A%0A + ...
3eacdbf9652ca581d212c97abc517ea09ea9ef9c
remove pdb
openpds/connectors/opensense/views.py
openpds/connectors/opensense/views.py
#-*- coding: utf-8 -*- import os import json import random import pdb from django.http import HttpResponse, HttpResponseBadRequest from openpds import settings from openpds.authorization import PDSAuthorization from openpds.core.models import Profile from openpds import getInternalDataStore def data(request): p...
Python
0.000024
@@ -312,28 +312,8 @@ t):%0A - pdb.set_trace()%0A
13fd6eb0e653e16df2b68591bf574cc47448cf8c
Fix prompt positioning
vx/pane.py
vx/pane.py
from .buffer import buffer from .scratchbuffer import scratchbuffer from .status_bar import status_bar from .line_numbers import line_numbers from .pointer import panes, windows, organizer class pane: def __init__(self, buffer, rows, columns, y, x): self.rows = rows self.columns = columns ...
Python
0.000011
@@ -1604,24 +1604,62 @@ h_window(p)%0A + p.move(self.y + self.rows, 0)%0A wind @@ -2029,17 +2029,26 @@ ize( -lines-1, +self.rows-1, self. colu
3675a1a87e67a089ac0fcee424b13c1dd6e969d8
Fix undo module references in text.py
vx/text.py
vx/text.py
import vx import vx.window import vx.movement as move import vx.utils import re from functools import partial def remove_text_linecol_to_linecol(rowa, cola, rowb, colb): """Removes all text between two points each specified as a row and column The removed text is not saved in the undo system. """ # T...
Python
0.000002
@@ -3509,32 +3509,35 @@ , r, c)%0A +vx. undo.register_re @@ -4225,16 +4225,19 @@ +vx. undo.reg
70e984f29c7b49a3a007b8219c44a62df44cf693
write docstrings for Toph
onlinejudge/service/toph.py
onlinejudge/service/toph.py
# Python Version: 3.x import posixpath import re import string import urllib.parse from typing import * import bs4 import requests import onlinejudge._implementation.logging as log import onlinejudge._implementation.utils as utils import onlinejudge.dispatch import onlinejudge.type from onlinejudge.type import Submis...
Python
0.000001
@@ -15,16 +15,64 @@ on: 3.x%0A +%22%22%22%0Athe module for Toph (https://toph.co/)%0A%22%22%22%0A%0A import p @@ -2545,16 +2545,134 @@ oblem):%0A + %22%22%22%0A :ivar problem_id: :py:class:%60str%60%0A :ivar contest_id: :py:class:%60Optional%60 %5B :py:class:%60str%60 %5D%0A %22%22%22%0A%0A def
ffe08baa97ce72c3139727495330c05082fd30c3
Make PyFeeds pip-installable
feeds/cli.py
feeds/cli.py
import logging import os import click from scrapy.crawler import CrawlerProcess from scrapy.utils.log import configure_logging from scrapy.utils.project import get_project_settings from twisted.python import failure from feeds.cache import FeedsCache from feeds.settings import load_feeds_settings logger = logging.ge...
Python
0
@@ -1664,16 +1664,311 @@ __))))%0A%0A + # Specify Scrapy's default settings via SCRAPY_SETTINGS_MODULE in case it%0A # is not set by the user. Override with our settings afterwards.%0A feeds_environment = os.getenv('SCRAPY_SETTINGS_MODULE', %22feeds.default_settings%22)%0A os.environ%5B'SCRAPY_SETTINGS_MOD...
4844ba3b3ff784f25b3b0b0f1dca50f014f33753
remove test for num barcodes as likely testexecution order dependence
amgut/test/test_dbpatch_source.py
amgut/test/test_dbpatch_source.py
from unittest import TestCase, main from amgut.lib.data_access.sql_connection import TRN class TestMigration(TestCase): def test_oldtables(self): # check that we have 13512 distinct "sources" in ag_login_surveys, # which are of tuple ag_login_id, participant_name with TRN: sql...
Python
0.000059
@@ -2355,345 +2355,8 @@ ??%0A%0A - # check number of barcodes%0A with TRN:%0A sql = %22%22%22SELECT COUNT(*)%0A FROM (SELECT DISTINCT barcode%0A FROM ag.ag_kit_barcodes) AS foo%22%22%22%0A TRN.add(sql, %5B%5D)%0A num_barcodes ...
1b1da6093405d369f299b9e589b86948895bfd24
update erai2icar script to point to new RDA location on glade by default
helpers/erai/config.py
helpers/erai/config.py
import datetime,os import argparse import numpy as np from bunch import Bunch import mygis import io_routines as io version="1.1" def set_bounds(info): atm_file=info.atmdir+info.atmfile erai_file=atm_file.replace("_Y_","2000").replace("_M_","01").replace("_D_","01").replace("_h_","00") varlist=["g4_lat...
Python
0
@@ -2806,17 +2806,27 @@ %22/glade/ -p +collections /rda/dat
ceea8bb6135706977713f4aa023f13c5cf251697
Add django.core.context_processors.media to the TEMPLATE_CONTEXT_PROCESSORS setting. This makes MEDIA_URL available to templates.
satchmo/settings-customize.py
satchmo/settings-customize.py
# Django settings for satchmo project. # If you have an existing project, then ensure that you modify local_settings-customize.py # and import it from your main settings file. (from local_settings import *) import os DIRNAME = os.path.abspath(os.path.dirname(__file__)) DJANGO_PROJECT = 'satchmo' DJANGO_SETTINGS_MODUL...
Python
0.000004
@@ -2956,28 +2956,27 @@ (%0A ' -satchmo.shop +django.core .context @@ -2987,24 +2987,20 @@ cessors. -settings +auth ',%0A ' @@ -3022,36 +3022,37 @@ text_processors. -auth +media ',%0A 'satchmo. @@ -3099,16 +3099,64 @@ ducts',%0A + 'satchmo.shop.context_processors.settings',%0A )%0A%0AROOT_
c0f58a4134cb9e517c02b09844d57bdc3de39d5e
use COMMENT_PREFIX instead of '#'
dwi/files.py
dwi/files.py
import re import dwi.util """Operations regarding miscellaneous files.""" COMMENT_PREFIX = '#' def read_subwindows(filename): """Read a list of subwindows from file, return in a dictionary.""" r = {} with open(filename, 'rU') as f: for line in f: line = line.strip() if no...
Python
0.000009
@@ -1386,19 +1386,30 @@ e%5B0%5D == -'#' +COMMENT_PREFIX :%0A
cd375458ce1b5d9663403151d979cb400940214b
fix adsense scraper bug where text node has a period in it
adsense_scraper.py
adsense_scraper.py
#!/usr/bin/env python """Scrapes Google AdSense data with Python using Twill Current canonical location of this module is here: http://github.com/etrepum/adsense_scraper/tree/master Usage:: from adsense_scraper import get_adsense, get_time_period b = get_adsense('YOUR_ADSENSE_LOGIN', 'YOUR_ADSENSE_PASSWORD'...
Python
0.000001
@@ -2456,77 +2456,440 @@ = %5B -(c.text or c.findtext('a') or '').strip() for c in row.findall('td')%5D +%5D%0A for c in row.findall('td'):%0A tail = ''%0A # adsense inserts an empty span if a row has a period in it, so%0A # get the children and find the tail element to append ...
beee78c4d59039e8c4f3bc2aef9b5d6231471553
Add standard flags to use the normal bot progress indicator
annotated_steps.py
annotated_steps.py
#!/usr/bin/python # 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 file. import os import re import subprocess import sys # We are deliberately not using bot u...
Python
0
@@ -2297,32 +2297,221 @@ ting(bot_info):%0A + standard_args = %5B'--suite-dir=third_party/pkg/%25s' %25 bot_info.package_name,%0A '--use-sdk', '--report', '--progress=buildbot',%0A '--clear_browser_cache'%5D%0A%0A with BuildStep @@ -2605,78 +2605,8 @@ y',%0A - '--sui...
9c04944dc4cab079373ca39399f4b0719d17af15
Change default items per page
open511/utils/pagination.py
open511/utils/pagination.py
from django.conf import settings from open511.utils.exceptions import BadRequest class APIPaginator(object): """ Largely cribbed from django-tastypie. """ def __init__(self, request, objects, limit=None, offset=0, max_limit=500): """ Instantiates the ``Paginator`` and allows for some c...
Python
0
@@ -1386,17 +1386,17 @@ ault is -2 +5 0 per pa @@ -1480,9 +1480,9 @@ E', -2 +5 0)%0A%0A
989fec1e95ade0fd357efef115b96bc3f7d61d51
initialize ctx even if options.cotentxs was empty
anytemplate/cli.py
anytemplate/cli.py
# # Copyright (C) 2015 Satoru SATOH <ssato @ redhat.com> # License: MIT # """ CLI frontend for various template engines. """ from __future__ import absolute_import from __future__ import print_function import logging import optparse # argparse is not available in python 2.6 standard lib. import sys import anytemplat...
Python
0.00003
@@ -3175,16 +3175,29 @@ args%5B0%5D +%0A ctx = %7B%7D %0A%0A if
67cbb212675057266686736c060fc617ca8644b2
Fix UserMessage.id sequence calculation in 0240.
zerver/migrations/0240_usermessage_migrate_bigint_id_into_id.py
zerver/migrations/0240_usermessage_migrate_bigint_id_into_id.py
# Generated by Django 1.11.23 on 2019-08-23 21:03 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("zerver", "0239_usermessage_copy_id_to_bigint_id"), ] operations = [ migrations.RunSQL( """ DROP TRIGGER zerver_use...
Python
0
@@ -1039,15 +1039,32 @@ ECT -SETVAL( +setval(%0A 'zer @@ -1091,26 +1091,132 @@ eq', - (SELECT MAX +%0A GREATEST(%0A (SELECT max(id) FROM zerver_usermessage),%0A (SELECT max (id) -+1 FRO @@ -1216,32 +1216,40 @@ id) FROM zerver_ +archived userm...
1df5bf573bf36b94a2bafbd16870053805a80e6e
set complex example as default
web/web.py
web/web.py
from flask import Flask, request, render_template, url_for from subprocess import run, TimeoutExpired, PIPE from base64 import b64encode app = Flask(__name__) FILES = { 'Cube': 'examples/cube.css', 'Pyramid': 'examples/pyramid.css', 'Triangle': 'examples/triangle.css', 'Fillers': 'examples/fillers.css...
Python
0.000007
@@ -937,19 +937,22 @@ ame = 'C -ube +omplex '%0A%0A p
25ed1e5f6a263fcd61e6d5fcb67220f72664efc6
remove final blank line.
grd/tests/test_event.py
grd/tests/test_event.py
from django.test import TestCase from grd.models import Event class EventTest(TestCase): fixtures = ['agents.json', 'devices.json', 'events.json', 'users.json'] def test_event_representation(self): for event in Event.objects.all(): self.assertIsNotNone(repr(event))
Python
0.000002
@@ -294,9 +294,8 @@ event))%0A -%0A
b988587af4cf744fa4980274364129a071cf4a77
optimize imports
voting-server/app/models.py
voting-server/app/models.py
from app import db from app import validators from passlib.hash import pbkdf2_sha512 def cursor_to_json(query, data): return dict(zip(tuple(query.keys()), data)) class Voter: def __init__(self, data): self.voter_id = data.get('voter_id') self.password = data.get('password') self.hash ...
Python
0
@@ -1,24 +1,64 @@ +from passlib.hash import pbkdf2_sha512%0A%0A from app import db%0Afrom @@ -83,47 +83,8 @@ ors%0A -from passlib.hash import pbkdf2_sha512%0A %0A%0Ade @@ -163,16 +163,17 @@ data))%0A%0A +%0A class Vo @@ -447,17 +447,16 @@ 'city')%0A -%0A @@ -2808,17 +2808,16 @@ n None%0A%0A -%0A ...
4382bd15bddb42509ae0b731a6396cfb6749d721
Set default scale to 0.4 (this may still be slightly on the high side, but it's easy to set via command line option or editing the python script.)
scripts/3a-detect-features.py
scripts/3a-detect-features.py
#!/usr/bin/python3 import argparse import fnmatch import numpy as np import os.path from props import getNode from lib import ProjectMgr # for all the images in the project image_dir, detect features using the # specified method and parameters # # Suggests censure/star has good stability between images (highest # l...
Python
0
@@ -995,17 +995,17 @@ fault=0. -5 +4 , help='
95f7c6cba7c4077053899e3ca01c8ffd3172873c
Add view mixin for working with filters in templates
grouprise/core/views.py
grouprise/core/views.py
import json import django from rules.contrib.views import PermissionRequiredMixin class PermissionMixin(PermissionRequiredMixin): @property def raise_exception(self): return self.request.user.is_authenticated class AppConfig: def __init__(self): self._settings = {} self._defaul...
Python
0
@@ -19,16 +19,61 @@ t django +%0Afrom django_filters.views import FilterMixin %0A%0Afrom r @@ -269,16 +269,528 @@ cated%0A%0A%0A +class TemplateFilterMixin(FilterMixin):%0A def get_context_data(self, **kwargs):%0A filterset_class = self.get_filterset_class()%0A self.filterset = self.get_filterset(fi...
62bf08812c8a8ade326d1bc44af67cbd061df0ba
Move undistorted feature filtering to ProjectMgr() so we don't have to carry all our results in memory for the entire data set. Now we can just process images one-by-one and unload the biggest structures after finishing each image.
scripts/3a-detect-features.py
scripts/3a-detect-features.py
#!/usr/bin/python3 import argparse import fnmatch import numpy as np import os.path from progress.bar import Bar import sys from props import getNode sys.path.append('../lib') import ProjectMgr # for all the images in the project image_dir, detect features using the # specified method and parameters # # Suggests ce...
Python
0
@@ -4468,13 +4468,82 @@ %0Aif -True: +False:%0A # should now be handled by proj.detect_features() automatically %0A
4173a7f4db268e9370484cf93fee2d9f0e913d6e
Update deprecated --auth usage instructions. #146
grow/commands/deploy.py
grow/commands/deploy.py
from grow.common import utils from grow.deployments.destinations import base from grow.deployments.stats import stats from grow.pods import pods from grow.pods import storage import click import os @click.command() @click.argument('deployment_name', required=False, default='default') @click.argument('pod_path', defau...
Python
0
@@ -872,20 +872,16 @@ ted) - The --auth flag @@ -880,13 +880,8 @@ uth -flag must @@ -918,17 +918,16 @@ - ' before @@ -931,45 +931,22 @@ ore -%22build%22, e.g.:'%0A ' +deploy. Usage: gro @@ -971,21 +971,22 @@ ple.com -build +deploy ')%0A@clic @@ -1073,16 +1073,27 @@ m, tes...
d7190980ad5edecd3625af4ba6d8a7bdbb66b810
Change start page text.
flask_app.py
flask_app.py
from flask import Flask from flask_caching import Cache import main from flask import Flask from flask_caching import Cache import main app = Flask(__name__) cache = Cache(app, config={'CACHE_TYPE': 'simple'}) @app.route('/') def display_available(): content = ('<html>' + '<head>' + ...
Python
0
@@ -447,17 +447,24 @@ ki%22%3E -KI ( +Campus Solna + (KI )%3C/a @@ -509,10 +509,22 @@ uu%22%3E -UU +Campus Uppsala (BM
9cb68eb149039619212bd4b1ede23c1043ebe3af
fix example syntax
gsshapy/lib/db_tools.py
gsshapy/lib/db_tools.py
""" ******************************************************************************** * Name: Initialize Database Functions * Author: Nathan Swain * Created On: August 6, 2013 * Copyright: (c) Brigham Young University 2013 * License: BSD 2-Clause **************************************************************************...
Python
0.000096
@@ -1264,32 +1264,37 @@ %0A%0A Example::%0A + %0A from gss @@ -2258,24 +2258,29 @@ Example::%0A + %0A from
f105aa42cc7435524d39a92296887e729dae507b
fix missing config variable
flog/core.py
flog/core.py
import dateutil.parser import flog.app import importlib import mimetypes import os from StringIO import StringIO from flask import Flask, Markup, render_template, send_file, abort from flask import redirect, url_for, make_response from flog.mime import mimetype from os.path import abspath, dirname, join, isdir, isfile,...
Python
0.000009
@@ -456,16 +456,31 @@ _name__) +%0Ac = app.config %0A%0A@app.c
c77b63f4c8dcbd495ec88d24709571b7061d1b62
Add main method to scanner for quick testing
mopidy/audio/scan.py
mopidy/audio/scan.py
from __future__ import absolute_import, division, unicode_literals import collections import pygst pygst.require('0.10') import gst # noqa import gst.pbutils from mopidy import exceptions from mopidy.audio import utils from mopidy.utils import encoding _missing_plugin_desc = gst.pbutils.missing_plugin_message_get_...
Python
0
@@ -5424,20 +5424,712 @@ %25dms' %25 timeout_ms)%0A +%0A%0Aif __name__ == '__main__':%0A import os%0A import sys%0A%0A import gobject%0A%0A from mopidy.utils import path%0A%0A gobject.threads_init()%0A%0A scanner = Scanner(5000)%0A for uri in sys.argv%5B1:%5D:%0A if not gst.uri_is_valid(uri...
a53941e1eee016acbddf9db3096b2b3e42953276
Update HexStats.py
HexChat/HexStats.py
HexChat/HexStats.py
import hexchat #Based on Weechat's Weestats: https://weechat.org/scripts/source/weestats.py.html/ #By Filip H.F. 'FiXato' Slagter <fixato [at] gmail [dot] com> __module_name__ = 'HexStats' __module_version__ = '0.0.1' __module_description__ = 'Displays HexChat Wide User Statistics' __module_author__ = 'Vlek' def st...
Python
0.000001
@@ -355,159 +355,586 @@ -context = hexchat.find_context()%0A chans = hexchat.get_list('channels')%0A types = %5Bi.type for i in chans%5D%0A channels = types.count(2)%0A ops = 0 +print( getstats() )%0A return hexchat.EAT_ALL%0A%0A%0Adef printstats(word, word_to_eol, userdata):%0A context = hexcha...
21415422967ffc51f1eac00a2cef953f7da10da2
use OptionParser; implement -w
encodings.py
encodings.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from collections import defaultdict from textwrap import TextWrapper wrap=True # edit to change def encodings(): '''http://stackoverflow.com/a/1728414/874188''' import pkgutil import encodings exclude=set(['aliases', # Exclude binary encoding...
Python
0.000002
@@ -113,38 +113,222 @@ per%0A -%0A%0Awrap=True # edit to change +from optparse import OptionParser%0A%0A%0Aparser = OptionParser()%0Aparser.add_option('-w', '--wrap', dest='wrap', action='store_true',%0A help='Wrap output for limited column width')%0A(options, args) = parser.parse_args() %0A%0A%0Ad @@ -1764,16 +...
32293126f24aa1425fad14944d27e90382034979
default width is 1024
webshot.py
webshot.py
import sys import gl import os import gtk import time import webkit class OutputView(webkit.WebView): '''a class that represents the output widget of a conversation ''' def __init__(self): webkit.WebView.__init__(self) self.load_finish_flag = False self.set_property('can-focus', True...
Python
0.999972
@@ -1526,11 +1526,12 @@ ize( -800 +1024 , 24
e4ef6d13caa70f91c51c2cb30462754f117e8ddf
Correct mixer.set_volume() docstring
mopidy/core/mixer.py
mopidy/core/mixer.py
from __future__ import absolute_import, unicode_literals import logging logger = logging.getLogger(__name__) class MixerController(object): pykka_traversable = True def __init__(self, mixer): self._mixer = mixer def get_volume(self): """Get the volume. Integer in range [0..10...
Python
0.000001
@@ -608,95 +608,125 @@ 100%5D - or :class:%60None%60%0A if the mixer is disabled.%0A%0A The volume scale +.%0A%0A The volume scale is linear.%0A%0A Returns :class:%60True%60 if call is -linear +successful, otherwise :class:%60False%60 .%0A
8de7697b3b8a73e79a73ec34f17ef0fa842cfbb2
Update setup.py for release.
lib/setup.py
lib/setup.py
# Copyright 2021 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 or agreed to in writing, ...
Python
0
@@ -730,17 +730,17 @@ n='0.0.1 -3 +4 ',%0A a
87983687634236a583bca38b8df5935150bbed9f
Move GStreamer to the bottom
mopidy/utils/deps.py
mopidy/utils/deps.py
from __future__ import unicode_literals import functools import os import platform import sys import pygst pygst.require('0.10') import gst import pkg_resources from . import formatting def list_deps_optparse_callback(*args): """ Prints a list of all dependencies. Called by optparse when Mopidy is ru...
Python
0
@@ -491,177 +491,8 @@ ne:%0A - adapters = %5B%0A platform_info,%0A python_info,%0A gstreamer_info,%0A functools.partial(pkg_info, 'Mopidy', True),%0A %5D%0A%0A @@ -661,24 +661,102 @@ 'Mopidy'%5D)%0A + dist_infos = %5B%0A functools.part...
786cc9b8f793f608098c1da97cb564e7d24b15cd
add IPython.start_ipython
IPython/__init__.py
IPython/__init__.py
# encoding: utf-8 """ IPython: tools for interactive and parallel computing in Python. http://ipython.org """ #----------------------------------------------------------------------------- # Copyright (c) 2008-2011, IPython Development Team. # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu> # ...
Python
0.000044
@@ -3201,8 +3201,688 @@ kwargs)%0A +%0Adef start_ipython(argv=None, **kwargs):%0A %22%22%22launch a normal IPython instance (as opposed to embedded)%0A %0A This is a public API method, and will survive implementation changes.%0A %0A %0A Parameters%0A ----------%0A %0A argv : list or None, op...
967652bffb4b731ce98a301f24bfcd57cba19011
Add missing comma
honeybadger/payload.py
honeybadger/payload.py
import sys import traceback import os import re from datetime import datetime import psutil from .version import __version__ from .utils import filter_dict def error_payload(exception, exc_traceback, config): def _filename(name): return name.replace(config.project_root, '[PROJECT_ROOT]') def is_not...
Python
0.999998
@@ -1188,16 +1188,17 @@ ception) +, %0A
274da6e09045ffc7cdfff618e3b77f066200eb10
Add gametype_id to path params, if valid gametype param is set
endpoints.py
endpoints.py
# -*- coding: utf-8 -*- from time import gmtime from email.utils import parsedate, formatdate from db import cache, get_db_pool from typing import Tuple from asyncpg import Connection from starlette.endpoints import HTTPEndpoint from starlette.exceptions import HTTPException from starlette.requests import Request fro...
Python
0.000001
@@ -1264,16 +1264,27 @@ + gametype = request @@ -1369,37 +1369,16 @@ if -request.path_params%5B' gametype '%5D n @@ -1373,18 +1373,16 @@ gametype -'%5D not in @@ -1476,41 +1476,118 @@ mat( -request.path_params%5B'gametype'%5D)) +gametype))%0A else:%0A request.path_params%...
f29a7818b313f882da502369ac9d29a77c225b89
use _get_redis_key_for_config
corehq/apps/userreports/tasks.py
corehq/apps/userreports/tasks.py
import datetime import logging from celery.task import task from sqlalchemy.exc import DataError from casexml.apps.case.models import CommCareCase from corehq.apps.domain.dbaccessors import get_doc_ids_in_domain_by_type from corehq.apps.userreports.models import DataSourceConfiguration, StaticDataSourceConfiguration fr...
Python
0.000003
@@ -683,16 +683,21 @@ d):%0A +def _ is_stati @@ -701,21 +701,36 @@ atic - = indicator_ +(config_id):%0A return conf @@ -798,16 +798,272 @@ _prefix) +%0A%0A def _get_redis_key_for_config(config):%0A if _is_static(config._id):%0A rev = 'static'%0A else:%0A rev = con...
14276843ce67d53a4f9600914872368bc29b145b
Fix bug where log_quantities in _CustomAction was a list
hoomd/custom_action.py
hoomd/custom_action.py
from abc import ABC, abstractmethod from hoomd.parameterdicts import ParameterDict class _CustomAction(ABC): flags = [] log_quantities = [] def __init__(self): pass def attach(self, simulation): self._state = simulation.state def detach(self): if hasattr(self, '_state'):...
Python
0.000001
@@ -140,18 +140,18 @@ ities = -%5B%5D +%7B%7D %0A%0A de
58841a499e6046c75193bb20d547c2dd498f4a21
fix path to pyannote.audio.features
scripts/feature_extraction.py
scripts/feature_extraction.py
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2016 CNRS # 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 ...
Python
0.000001
@@ -4451,14 +4451,8 @@ ures -.yaafe ',%0A
e3e25fb9133e6fa580b8b5f84a938ff78463ed46
Replace column names even if capitalized
lib/table.py
lib/table.py
from retriever.lib.cleanup import * import csv class Table: """Information about a database table.""" def __init__(self, name, **kwargs): self.name = name self.pk = True self.contains_pk = False self.delimiter = None self.header_rows = 1 self.column_names_row = ...
Python
0.000002
@@ -1621,32 +1621,142 @@ lower()%0A +replace_columns = %5B(old.lower(), new.lower())%0A for old, new in self.replace_columns%5D %0A replace @@ -2124,21 +2124,16 @@ %5D + -self. replace_
55e94b68933cfee13db859003665391df87f4b01
Add code example for hoomd custom particle filter
hoomd/filter/custom.py
hoomd/filter/custom.py
"""Contains a class for custom particle filters in Python.""" from abc import abstractmethod from collections.abc import Hashable, Callable class CustomFilter(Hashable, Callable): """Abstract base class for custom particle filters. The class allows the definition of particle filters in Python (see `hoomd...
Python
0
@@ -852,16 +852,1174 @@ eq__%3E%60_. +%0A%0A The example below creates a custom filter that filters out particles above%0A and below a certain mass, and uses that filter in a %60hoomd.write.GSD%60%0A object.%0A%0A Example::%0A%0A class MassFilter(hoomd.filter.CustomFilter):%0A def __init_...
8622a5e0734c3f5ef1538362971824218fb8aa19
add target module
welcome.py
welcome.py
# Copyright 2015 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
Python
0.000001
@@ -719,16 +719,42 @@ ightdata +%0Afrom target import target %0A%0Aapp = @@ -804,16 +804,47 @@ htdata)%0A +app.register_blueprint(target)%0A CORS(app
71a085bc9fd60ad946b1ffdb11c2342fb35238b5
Check that CustomActions are correctly subclassed
hoomd/python_action.py
hoomd/python_action.py
from hoomd.operation import _TriggeredOperation from hoomd.parameterdicts import ParameterDict from hoomd.typeconverter import OnlyType from hoomd.trigger import Trigger from hoomd.util import trigger_preprocessing from hoomd.logger import LoggerQuantity from hoomd import _hoomd class _PythonAction(_TriggeredOperatio...
Python
0
@@ -88,16 +88,62 @@ terDict%0A +from hoomd.custom_action import _CustomAction%0A from hoo @@ -406,16 +406,194 @@ ger=1):%0A + if not issubclass(action, _CustomAction):%0A raise ValueError(%22action must be a subclass of %22%0A %22hoomd.custom_action._CustomAction.%22)%0A...
215182b211ccc676435a6c1d3293ab05d1a8cc74
fix empty command loses cwd
mssql/mssql_shell.py
mssql/mssql_shell.py
#!/usr/bin/env python from __future__ import print_function # Author: Alamot # Use pymssql >= 1.0.3 (otherwise it doesn't work correctly) # To upload a file type: UPLOAD local_path remote_path # e.g. UPLOAD myfile.txt C:\temp\myfile.txt # If you omit the remote_path it uploads the file on the current working folder. im...
Python
0.000186
@@ -311,16 +311,156 @@ folder.%0A +# Be aware that pymssql has some serious memory leak issues when the connection fails (see: https://github.com/pymssql/pymssql/issues/512).%0A import _ @@ -620,15 +620,15 @@ 10.1 -3.38.11 +0.10.10 %22%0AMS @@ -1591,17 +1591,25 @@ ecode()%0A + %0A - prin @@ -3290,24 ...
7091645989ec1514664939248588afb450d84b1b
Use thread.nonidle_elapsed_time, not thread.core_elapsed_time which no longer exists
scripts/scheduler-locality.py
scripts/scheduler-locality.py
import sim def getScoreMetricTime(thread_id): return long(sim.stats.get('thread', thread_id, 'core_elapsed_time')) def getScoreMetricInstructions(thread_id): return long(sim.stats.get('thread', thread_id, 'instruction_count')) class Thread: def __init__(self, thread_id, getScoreMetric): self.thread_id =...
Python
0
@@ -91,19 +91,22 @@ ad_id, ' -cor +nonidl e_elapse
79bcc50e8544921044fa9d392d772477913defa4
Add better window switching
windows.py
windows.py
import vx import math _windows = [] _windows_traversable = [] class _graffiti: def __init__(self, y, x, text): self.y = y self.x = x self.text = text def render(self, window): vx.set_cursor(window._c_window, self.y, self.x) vx.add_string_window(window._c_window, self.t...
Python
0.000002
@@ -55,16 +55,39 @@ ble = %5B%5D +%0A_focused_window = None %0A%0Aclass @@ -890,24 +890,81 @@ append(self) +%0A _windows_traversable.sort(key=lambda w: w.y) %0A%0A if @@ -4325,16 +4325,43 @@ rn new%0A%0A +def _next_window():%0A if _focused @@ -4372,105 +4372,111 @@ dow -= +is None -%0A_...
dc4b72c27a639d859197491aa49da8ef3200533e
Update pride parade puzzle with recently added A == B == C shorthand.
src/puzzle/examples/msp/msp2017_06_21_pride_parade.py
src/puzzle/examples/msp/msp2017_06_21_pride_parade.py
from puzzle.puzzlepedia import puzzle def get(): return puzzle.Puzzle('Pride Parade', SOURCE) # TODO: # The pink, violet, and green floats are facing the same direction. # pink.direction == violet.direction # violet.direction == green.direction SOURCE = """ position <= {1, 2, 3, 4, 5, 6, 7} color <= {orange, blue...
Python
0
@@ -97,159 +97,8 @@ )%0A%0A%0A -# TODO:%0A# The pink, violet, and green floats are facing the same direction.%0A# pink.direction == violet.direction%0A# violet.direction == green.direction%0A SOUR @@ -3788,17 +3788,20 @@ let.left -%0A + == violet.l
9d238293e91b69c5c2014b75bad3ddd39c1fd9e8
use "python3" command instead of "python3.2"
wolfbot.py
wolfbot.py
#!/usr/bin/env python3.2 # Copyright (c) 2011 Jimmy Cao # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, m...
Python
0.000214
@@ -19,10 +19,8 @@ hon3 -.2 %0A%0A#
8ff90c8f55ff8cfd772b664a6271453e47c1fd78
bump version
mustaine/__init__.py
mustaine/__init__.py
# Copyright (c) 2010, Brandon Gilmore # Copyright (c) 2010, Phill Tornroth # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright #...
Python
0
@@ -1594,17 +1594,17 @@ (0, 1, -2 +3 )%0A__vers @@ -1645,8 +1645,9 @@ _info))%0A +%0A
621224db245a705b12f4345e70c8e242e3336969
Add timestamp in spam index
holonet/core/message.py
holonet/core/message.py
# -*- coding: utf8 -*- from io import BytesIO class HolonetEmailMessage(object): encoding = None def __init__(self, msg, list_recipients, connection=None): self.msg = msg self.list_recipients = list_recipients self.connection = connection super(HolonetEmailMessage, self).__i...
Python
0.000063
@@ -40,16 +40,63 @@ BytesIO%0A +import time%0A%0Afrom django.utils import timezone%0A %0A%0Aclass @@ -1758,16 +1758,95 @@ pients() +,%0A '@timestamp': int(time.mktime(timezone.now().timetuple()) * 1000) %0A
825778d5cd589990ff299cccd4d111271cbebd02
Update more affected tests.
st2common/tests/unit/services/test_synchronization.py
st2common/tests/unit/services/test_synchronization.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Python
0
@@ -1154,16 +1154,38 @@ se_args( +coordinator_noop=False )%0A
9187979699a0f49ec5fc1659e9e2f87c97699a74
Remove unused import
lib/utils.py
lib/utils.py
from __future__ import print_function import os import random import chainer import numpy as np class Namespace(object): def __init__(self, kwargs): self.kwargs = kwargs for key in kwargs.keys(): setattr(self, key, kwargs[key]) def __repr__(self): str = [] for ke...
Python
0.000001
@@ -60,23 +60,8 @@ om%0A%0A -import chainer%0A impo
ad8eaacd2e022cb904834bb6ae1faa38618c5cbf
Add events to csv output
nemreader/outputs.py
nemreader/outputs.py
""" nemreader.outputs ~~~~~ Output results in different formats """ import csv from nemreader import read_nem_file def output_as_csv(file_name, nmi=None, output_file=None): """ Transpose all channels and output a csv that is easier to read and do charting on :param file_name: The NEM fil...
Python
0
@@ -1219,16 +1219,53 @@ ethod')%0A + heading_list.append('event')%0A @@ -1295,16 +1295,16 @@ g_list)%0A - %0A @@ -1532,16 +1532,152 @@ _method%0A + event_code = m.readings%5Bnmi%5D%5Bchannels%5B0%5D%5D%5Bi%5D.event_code%0A event_desc = m.readings%5Bnmi%5D%5Bchannels%5B0...
e279912de868f2f4346cf4ecc65ff7e98c91efec
improve query results file naming
MaudeMiner/query.py
MaudeMiner/query.py
import os from MaudeMiner.database import db from MaudeMiner.settings import DATA_PATH from datetime import datetime from sqlalchemy.exc import InvalidRequestError class Query: __tables = [] __limit = None __distinct = False def __init__(self, table): model = db.get_model_from_table_name(table) if model == N...
Python
0.000001
@@ -3123,11 +3123,8 @@ ime. -utc now( @@ -3141,19 +3141,22 @@ (%22%25Y --%25m-%25d-%25H +_%25m_%25d__%25I_ %25M +_ %25S%22)
a789e8bf574973259c0461b99fb9a486abed6e23
Fix a bug that would add updated control ip address instead of replace
systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py
systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py
from pprint import pprint from netaddr import * def merge(dbag, ip): added = False for dev in dbag: if dev == "id": continue for address in dbag[dev]: if address['public_ip'] == ip['public_ip']: dbag[dev].remove(address) if ip['add']: ipo = IPNet...
Python
0.000001
@@ -609,16 +609,127 @@ public'%0A + if ip%5B'nw_type'%5D == 'control':%0A dbag%5B'eth' + str(ip%5B'nic_dev_id'%5D)%5D = %5B ip %5D%0A else:%0A d
6ecc22cc4d37b3efb49ccdeb0f0a4ae2c37bb2e0
check submitted date instead of published date
get_arxiv.py
get_arxiv.py
import os from time import sleep import feedparser import pandas as pd import requests from constants import BASE_URL, BRUNDAGE_CATEGORIES, PICKLE_PATH, QUERY_PAGE_SIZE, QUERY_WAIT_TIME def check_for_update(): """Return true if an update to the arxiv is online""" prev_data = pd.read_pickle(PICKLE_PATH) ...
Python
0
@@ -692,16 +692,14 @@ ': ' -lastUpda +submit tedD @@ -1069,20 +1069,31 @@ sed. -feed.updated +entries%5B0%5D%5B'published'%5D ).da
9a7305c6b91af002236cefb5cda0fbcf03729b81
Trim decoration to make X reachable in 80col views
git-blame.py
git-blame.py
import sublime import sublime_plugin import os import functools import subprocess from subprocess import check_output as shell stylesheet = ''' <style> div.phantom-arrow { border-top: 0.4rem solid transparent; border-left: 0.5rem solid color(var(--bluish) blend(var(--background) 30%...
Python
0
@@ -1405,17 +1405,16 @@ it Blame -: %3C/strong @@ -1443,17 +1443,8 @@ - Updated: %7Bda @@ -5544,9 +5544,8 @@ , desc)%0A -%0A
01405a7a0f25ab254bf394174ff1bc04547d6c67
use IntEnum so for NeuriteType so they are sortable (#631)
neurom/core/types.py
neurom/core/types.py
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
Python
0
@@ -1729,16 +1729,19 @@ import +Int Enum, un @@ -1773,16 +1773,19 @@ iteType( +Int Enum):%0A
67ebe8da58384529c49673e2314d4fc228aebe9e
Fix test data for PyPackageRequirementsInspectionTest.testImportsNotInRequirementsTxt.
python/testData/inspections/PyPackageRequirementsInspection/ImportsNotInRequirementsTxt/test1.py
python/testData/inspections/PyPackageRequirementsInspection/ImportsNotInRequirementsTxt/test1.py
import pip import <weak_warning descr="Package 'opster' is not listed in project requirements">opster</weak_warning> from <weak_warning descr="Package 'clevercss' is not listed in project requirements">clevercss</weak_warning> import convert import <weak_warning descr="Package 'django' is not listed in project requirem...
Python
0
@@ -40,16 +40,34 @@ Package +containing module 'opster' @@ -162,16 +162,34 @@ Package +containing module 'cleverc @@ -307,16 +307,34 @@ Package +containing module 'django' @@ -451,16 +451,34 @@ Package +containing module 'test3'
6cdb68cee04431eb079a98694c7c2909dc644fc0
Fix import of CustomerTaxGroup inside models
shoop/core/models/contacts.py
shoop/core/models/contacts.py
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django.conf import settings fr...
Python
0
@@ -756,88 +756,78 @@ ore. -models import CustomerTaxGroup%0Afrom shoop.core.utils.name_mixin import NameMixin +utils.name_mixin import NameMixin%0A%0Afrom .taxes import CustomerTaxGroup %0A%0A%0A@
b4d3e4706f738e9991250ab64b3362fe88368595
add some more documentation on access_scheme
src/radical/pilot/compute_pilot_description.py
src/radical/pilot/compute_pilot_description.py
#pylint: disable=C0301, C0103, W0212, E1101, R0903 """ .. module:: radical.pilot.compute_pilot_description :platform: Unix :synopsis: Provides the interface for the ComputePilotDescription class. .. moduleauthor:: Ole Weidner <ole.weidner@rutgers.edu> """ __copyright__ = "Copyright 2013-2014, http://radical.ru...
Python
0
@@ -1769,29 +1769,8 @@ ing%60 - or %60list of strings%60 %5D %5B* @@ -2124,16 +2124,322 @@ hrown.%0A%0A + .. data:: access_scheme%0A%0A %5BType: %60string%60%5D %5B**%60optional%60**%5D The key of an access mechanism to use.%0A The valid access mechanism are defined in the resource configurations,%0A ...
cc840151fdc2e7573ba61093de0419c8255eecde
Remove dead code There was some code that could not ever be hit except upon a bug. Also mark a repr line as no cover for now
simplecpreprocessor/tokens.py
simplecpreprocessor/tokens.py
import re DEFAULT_LINE_ENDING = "\n" TOKEN = re.compile((r"<\w+(?:/\w+)*(?:\.\w+)?>|L?\".+\"|'\w'|/\*|" r"\*/|//|\b\w+\b|\r\n|\n|[ \t]+|\W")) DOUBLE_QUOTE = '"' SINGLE_QUOTE = "'" CHAR = re.compile(r"^'\w'$") CHUNK_MARK = object() RSTRIP = object() COMMENT_START = ("/*", "//") LINE_ENDINGS = ("\r\n...
Python
0
@@ -1111,24 +1111,43 @@ self.value) + # pragma: no cover %0A%0A%0Aclass Tok @@ -2167,70 +2167,9 @@ kens -, None)%0A if token is None:%0A continue +) %0A @@ -2767,245 +2767,8 @@ if -(lookahead.whitespace and%0A lookahead.value != self.line_ending):%...
ed91a6832d459dffa18d1b2d7b827b6aa6da2627
Add team project list to docs
src/sentry/api/endpoints/team_project_index.py
src/sentry/api/endpoints/team_project_index.py
from __future__ import absolute_import from rest_framework import serializers, status from rest_framework.response import Response from sentry.api.bases.team import TeamEndpoint from sentry.api.permissions import assert_perm from sentry.api.serializers import serialize from sentry.constants import MEMBER_ADMIN from s...
Python
0
@@ -126,16 +126,55 @@ sponse%0A%0A +from sentry.api.base import DocSection%0A from sen @@ -618,36 +618,209 @@ d -ef get(self, request, team): +oc_section = DocSection.TEAMS%0A%0A def get(self, request, team):%0A %22%22%22%0A List a team's projects%0A%0A Return a list of projects bound to a...