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
c648ca369aa5d35fce7cceed860725828ba8d15b
Use system gradle if ./gradlew not present
repour/adjust/gradle_provider.py
repour/adjust/gradle_provider.py
import json import logging import os import shutil import subprocess from string import Template from . import process_provider from . import util from .. import asutil logger = logging.getLogger(__name__) EXECUTION_NAME = "GRADLE" INIT_SCRIPT_FILE_NAME = "analyzer-init.gradle" MANIPULATION_FILE_NAME = "manipulati...
Python
0
@@ -1615,16 +1615,230 @@ sure()%0A%0A + # Use system gradle%0A command_gradle = 'gradle'%0A%0A # If gradlew present, use it instead%0A if os.path.isfile(os.path.join(work_dir, './gradlew')):%0A command_gradle = './gradlew'%0A%0A @@ -1871,27 +1871,30 @@ cmd=%5B -%22....
55f3f240e263736022b57f6726c13f92e4131d20
Update replay_buffer.py
research/pcl_rl/replay_buffer.py
research/pcl_rl/replay_buffer.py
# Copyright 2017 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
Python
0.000001
@@ -4078,16 +4078,18 @@ ities, n +-1 )%5B:n%5D%0A%0A
51f107f3e218b42553340ca59b55386c39787a33
Fix required package intent_service
skills-sdk-setup.py
skills-sdk-setup.py
from setuptools import setup from mycroft.util.setup_base import get_version, place_manifest __author__ = 'seanfitz' place_manifest("skills-sdk-MANIFEST.in") setup( name="mycroft-skills-sdk", version=get_version(), install_requires=[ "mustache==0.1.4", "configobj==5.0.6", "pyee==...
Python
0.000001
@@ -649,16 +649,24 @@ s.intent +_service %22,%0A
c473cc6c30b95b250a1c2bc6eba47dbd26fe70f9
remove print
benchmarker/modules/do_pytorch.py
benchmarker/modules/do_pytorch.py
import numpy as np import torch import torch.nn as nn from timeit import default_timer as timer # import torch.nn.functional as F import torch.optim as optim # from torchvision import datasets, transforms from .i_neural_net import INeuralNet import argparse # TODO: should we expect an import error here? # https://stack...
Python
0.000793
@@ -1451,54 +1451,8 @@ s()%0A - print(output.shape, target.shape)%0A
4c16bd7c11aabb96e6df0ebbfcf600f92950e4d5
fix get_indices
tests/test_basic.py
tests/test_basic.py
from scvelo.tools.utils import prod_sum_obs, prod_sum_var, norm import numpy as np import scvelo as scv def test_einsum(): adata = scv.datasets.toy_data(n_obs=100) scv.pp.recipe_velocity(adata) Ms, Mu = adata.layers['Ms'], adata.layers['Mu'] assert np.allclose(prod_sum_obs(Ms, Mu), np.sum(Ms * Mu, 0))...
Python
0.000031
@@ -191,24 +191,41 @@ locity(adata +, n_top_genes=300 )%0A Ms, Mu
c52768515e337650aca41044b833402d097045ee
Fix unit test by removing call to unused function
tests/test_debug.py
tests/test_debug.py
# # Evy - a concurrent networking library for Python # # Unless otherwise noted, the files in Evy are under the following MIT license: # # Copyright (c) 2012, Alvaro Saurin # Copyright (c) 2008-2010, Eventlet Contributors (see AUTHORS) # Copyright (c) 2007-2010, Linden Research, Inc. # Copyright (c) 2005-2006, Bob Ippo...
Python
0.000001
@@ -4842,89 +4842,8 @@ se)%0A - debug.hub_listener_stacks(True)%0A debug.hub_listener_stacks(False)%0A
204c771c77b03ae1829ba09c6382d19c13591c41
move rest result for good
tests/test_files.py
tests/test_files.py
import os import graphviz def test_save_source_from_files(tmp_path): dot = graphviz.Digraph() dot.edge('hello', 'world') dot.render() old_stat = os.stat(dot.filepath) source = graphviz.Source.from_file(dot.filepath) source.save() assert os.stat(dot.filepath).st_mtime == old_stat.st_mtim...
Python
0
@@ -92,16 +92,34 @@ Digraph( +directory=tmp_path )%0A do
dbbca076307e5af435393dea04cf701a14059013
Update test_flask.py
tests/test_flask.py
tests/test_flask.py
# -*- coding: utf-8 -*- from six.moves import http_client import six from anyway import app as flask_app #from anyway.utilities import open_utf8 import json import pytest from functools import partial from urlobject import URLObject from collections import Counter @pytest.fixture def app(): return flask_app.test_c...
Python
0.000002
@@ -1042,12 +1042,12 @@ == -3232 +1624 %0A%0A%0Ad
9dd7f5a4036c5a757fb970ec0af291e4ae655b05
Remove superfluous symbol
tests/test_ftpfs.py
tests/test_ftpfs.py
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import ftplib import os import shutil import subprocess import sys import tempfile import time import unittest import uuid from six import text_type, PY2 from six.moves.urllib.request import urlopen f...
Python
0.999861
@@ -264,13 +264,8 @@ type -, PY2 %0Afro
21f1a34989c6170abffd2cae03188b9147a1462d
Make get_updates test less strict
tests/test_hnapi.py
tests/test_hnapi.py
""" Tests """ from __future__ import unicode_literals import unittest from hnapi.connectors.api_connector import ApiConnector class HnapiTest(unittest.TestCase): """ Test hnapi """ def test_get_item_by(self): """ Test item retrieval and 'by' field """ con = ApiConnecto...
Python
0.000702
@@ -914,33 +914,32 @@ 'profiles')) %3E 1 -0 )%0A user = @@ -1284,17 +1284,16 @@ s')) %3E 1 -0 )%0A
b026917c58d98bf70df452a7e04252af010ca441
Add test for dashboard change quantity form
tests/test_order.py
tests/test_order.py
from prices import Price from saleor.cart.models import Cart from saleor.order import models def test_total_property(): order = models.Order(total_net=20, total_tax=5) assert order.total.gross == 25 assert order.total.tax == 5 assert order.total.net == 20 def test_total_property_empty_value(): ...
Python
0
@@ -55,16 +55,76 @@ rt Cart%0A +from saleor.dashboard.order.forms import ChangeQuantityForm%0A from sal @@ -1146,8 +1146,1574 @@ ed == 2%0A +%0A%0Adef test_dashboard_change_quantity_form(billing_address, product_in_stock):%0A start_quantity = 1%0A variant = product_in_stock.variants.get()%0A cart = Cart()%0...
2db8c4874e10db7c78f4255df45b14a9484990ec
Update social_auth/urls.py
social_auth/urls.py
social_auth/urls.py
"""URLs module""" try: from django.conf.urls import patterns, url except ImportError: # for Django version less then 1.4 from django.conf.urls.default import patterns, url from social_auth.views import auth, complete, disconnect urlpatterns = patterns('', # authentication url(r'^login/(?P<...
Python
0.000001
@@ -158,16 +158,17 @@ .default +s import
72add1034c9f085b73ec45eff5f3cb686e0322cb
update phylo test
tests/test_phylo.py
tests/test_phylo.py
from vcfkit import phylo from subprocess import Popen, PIPE import hashlib from tests.test_utilities import Capturing def test_phylo_fasta(): with Capturing() as out: phylo.main(["phylo", "fasta", "test_data/test.vcf.gz"]) h = hashlib.sha224(str(out)).hexdigest() assert h == "3e13b81be200e1128d6ee...
Python
0
@@ -253,32 +253,40 @@ .sha224(str(out) +.strip() ).hexdigest()%0A @@ -275,32 +275,32 @@ ()).hexdigest()%0A - assert h == @@ -502,32 +502,40 @@ .sha224(str(out) +.strip() ).hexdigest()%0A @@ -777,32 +777,40 @@ .sha224(str(out) +.strip() ).hexdigest()%0A @@ -999,32 +999,32 @@ hylo.main(comm)%0A - ...
794596fd6f55806eecca1c54e155533590108eee
Rename misleading parameter name: UnicodeDictReader should have the same interface as csv.DictReader
openspending/lib/unicode_dict_reader.py
openspending/lib/unicode_dict_reader.py
# work around python2's csv.py's difficulty with utf8 # partly cribbed from http://stackoverflow.com/questions/5478659/python-module-like-csv-dictreader-with-full-utf8-support import csv class EmptyCSVError(Exception): pass class UnicodeDictReader(object): def __init__(self, file_or_str, encoding='utf8', **...
Python
0.001219
@@ -282,26 +282,17 @@ (self, f -ile_or_str +p , encodi @@ -388,18 +388,9 @@ er(f -ile_or_str +p , **
2a61298c453981e0f65dac7402a5a861a9e8f9f7
fix missing classmethod
ott/loader/otp/preflight/test_runner.py
ott/loader/otp/preflight/test_runner.py
import os import sys import time import inspect import logging log = logging.getLogger(__file__) from mako.template import Template from ott.utils.config_util import ConfigUtil from ott.utils import web_utils from ott.utils import file_utils from ott.utils import otp_utils from ott.loader.otp.preflight.test_suite im...
Python
0.998559
@@ -4537,32 +4537,49 @@ return ret_val%0A%0A + @classmethod%0A def test_gra
8e113123d4b0bce16571996e7d7ffa5b6ffca66a
fix bug when rollover is not specified
bokeh/core/property_containers.py
bokeh/core/property_containers.py
''' Provide special versions of list, dict, that can be used for property values. Mutations to these values are detected, and the properties owning the collection is notified of the changes. ''' from __future__ import absolute_import, print_function def notify_owner(func): ''' A decorator for mutating methods of...
Python
0
@@ -5169,32 +5169,77 @@ nd(new_data%5Bk%5D)%0A + if rollover is not None:%0A
42a6b8a5c547cf678900bd1f9d4852361edfe75b
Update tests
tests/test_start.py
tests/test_start.py
def test_start(): pass
Python
0.000001
@@ -1,27 +1,675 @@ -def test_start():%0A pass +import pytest%0Aimport webs%0A%0A%0Aclass TestVideoSpider():%0A def test_entry_points(self):%0A webs.douban.parsers.movie%0A webs.douban.parsers.celebrity%0A webs.douban.parsers.douban_api%0A webs.douban.parsers.movie_photo%0A webs....
c894bf9754a44cb4a0de26bdc95da65db0d08401
test for create_task
tests/test_utils.py
tests/test_utils.py
from django.test import TestCase from chatwork.utils import send_chatwork class SendChatworkTests(TestCase): def test_send_chatwork(self): response = send_chatwork('test', 1234) self.assertEqual(response, {'message_id': '1234'})
Python
0.00004
@@ -67,16 +67,29 @@ chatwork +, create_task %0A%0A%0Aclass @@ -258,8 +258,193 @@ 1234'%7D)%0A +%0A%0Aclass CreateTaskTests(TestCase):%0A def test_create_task(self):%0A response = create_task('test', 1234, %5B123, 124%5D)%0A self.assertEqual(response, %7B'task_ids': %5B123, 124%5D%7D)%0A
41c77be3820ae758d27540efbf4dff6e5c01a32b
Fix tests in py3
tests/test_utils.py
tests/test_utils.py
# -*- coding: utf-8 -*- from datetime import date import pytest from faker import Faker from recipe.utils import ( AttrDict, FakerAnonymizer, StringFormattableFaker, replace_whitespace_with_space ) class TestUtils(object): def test_replace_whitespace_with_space(self): assert replace_whitespace_...
Python
0.000004
@@ -83,16 +83,53 @@ Faker%0A%0A +from recipe.compat import basestring%0A from rec
207d4c71fbc40dd30c0099769d6f12fcb63f826e
Add missing username conf for mercurial.
tests/test_utils.py
tests/test_utils.py
import subprocess from pytest import mark from pytest_benchmark.utils import clonefunc, get_commit_info f1 = lambda a: a def f2(a): return a @mark.parametrize('f', [f1, f2]) def test_clonefunc(f): assert clonefunc(f)(1) == f(1) assert clonefunc(f)(1) == f(1) def test_clonefunc_not_function(): ass...
Python
0.000001
@@ -98,16 +98,46 @@ t_info%0A%0A +pytest_plugins = 'pytester',%0A%0A f1 = lam @@ -655,24 +655,131 @@ u'.split())%0A + else:%0A testdir.tmpdir.join('.hg', 'hgrc').write(%22%22%22%0A%5Bui%5D%0Ausername = you %3Cyou@example.com%3E%0A%22%22%22)%0A%0A testdir.
51d0daa1535b4a1730d2122d8178fb1047a6ab9e
Update import test.
tests/top/IMPORT.py
tests/top/IMPORT.py
#!/usr/bin/env python '''Test that all public modules are accessible after importing just 'pyglet'. This _must_ be the first test run. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $' import unittest import pyglet __noninteractive = True modules = [ ...
Python
0.000001
@@ -564,24 +564,43 @@ 'image',%0A + 'image.atlas',%0A 'media',
5c3649dab28c80a60f079fbbf8dae5d1e5ed5500
Remove unused import
HAProxyPro/HAProxyPro.py
HAProxyPro/HAProxyPro.py
""" Server Density Plugin HA Proxy https://github.com/serverdensity/sd-agent-plugins/ Version 1.0.0 """ import csv import os from urllib import urlopen from datetime import date, datetime class HAProxyPro: def __init__(self, agentConfig, logger, rawConfig): logger.debug("HAProxy - initializing"...
Python
0.000001
@@ -159,44 +159,8 @@ pen%0A -from datetime import date, datetime%0A %0A%0Acl
c21e31e7ebe91f75d659956e468b8f9fd01074e1
change the selected_layer selection comments to be accurate.
Install/genegis_addin.py
Install/genegis_addin.py
import os import sys import arcpy import pythonaddins # enable local imports addin_path = os.path.dirname(__file__) sys.path.insert(0, addin_path) # import local settings import config def _selectedLayer(): # return the selected layer object, check that it's just points layer = None # either grab our sh...
Python
0
@@ -297,32 +297,79 @@ -# either grab our shared +if config.selected_layer:%0A # our preference is to always use the sel @@ -377,68 +377,91 @@ cted - +_ layer -, o -r grab the current layer%0A # from the TOC.%0A if +bject, which is%0A # populated by our combination box.%0A layer =...
d18d8f2deb43a55b5898899dcfb2fd6d7fee45fe
Update label in test to match internal changes
pinax/notifications/tests/test_views.py
pinax/notifications/tests/test_views.py
from django.core.urlresolvers import reverse from django.test import TestCase, RequestFactory from ..compat import get_user_model from ..models import NoticeType, NoticeSetting from ..views import NoticeSettingsView from . import get_backend_id class TestViews(TestCase): def setUp(self): self.factory = ...
Python
0
@@ -1229,12 +1229,8 @@ -%7B1%7D --%7B2%7D %22.fo @@ -1269,41 +1269,8 @@ pk,%0A - notice_type_2.label,%0A
5f7d845fe65b9febc45d754a346dd749ab4e13bf
set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#402)
packages/google-cloud-language/synth.py
packages/google-cloud-language/synth.py
import synthtool as s import synthtool.gcp as gcp import logging import subprocess logging.basicConfig(level=logging.DEBUG) gapic = gcp.GAPICMicrogenerator() # tasks has two product names, and a poorly named artman yaml for version in ['v1', 'v1beta2']: library = gapic.typescript_library( 'language', ...
Python
0
@@ -119,16 +119,52 @@ DEBUG)%0A%0A +AUTOSYNTH_MULTIPLE_COMMITS = True%0A%0A%0A gapic =
1068eb81a1e3bb6031cce536450694d159d55034
bump version number to 0.0.4
tickets/__init__.py
tickets/__init__.py
__version__ = '0.0.3'
Python
0.0001
@@ -16,7 +16,7 @@ 0.0. -3 +4 '%0A
62a8a39589e1ef626e50a871fbfd441fc10c6457
Assign name to self.name in __init__
tinyetl/__init__.py
tinyetl/__init__.py
from functools import wraps import sys import os from datetime import datetime import logging import requests class TinyETL: """Manages facts about an ETL Process. Provides a consistent interface for storing log location, temporary data locations, and a way to facilitate dry-run and logging on Fabric-...
Python
0.99984
@@ -1833,16 +1833,41 @@ return%0A%0A + self.name = name%0A
9915a8717170d7853efd265afe79a87028afc72c
Disable gclient syntax validation when fetching dependencies.
tools/fetch_deps.py
tools/fetch_deps.py
#!/usr/bin/env python # Copyright (c) 2013 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This script will do: 1. Setup src's git initialization. 2. Place .gclient file outside of src. 3. Call gclient sync outside ...
Python
0.000004
@@ -1721,16 +1721,203 @@ _file))%0A + # As of revision 454e53abae6e4d68ee992b0a93a4174b75519393,%0A # src/xwalk/buildtools does not pass gclient's syntax validation.%0A gclient_cmd.append('--disable-syntax-validation')%0A gcli
221ecd21828c11a800c00a6ec52e93587b7e2a3b
Fix session auth
rest_framework/authentication.py
rest_framework/authentication.py
""" The :mod:`authentication` module provides a set of pluggable authentication classes. Authentication behavior is provided by mixing the :class:`mixins.RequestMixin` class into a :class:`View` class. """ from django.contrib.auth import authenticate from rest_framework.compat import CsrfViewMiddleware from rest_fram...
Python
0.000001
@@ -3252,32 +3252,33 @@ %22%22%22%0A +%0A user = getat @@ -3269,31 +3269,115 @@ -user = getattr(request. +# Get the underlying HttpRequest object%0A http_request = request._request%0A user = getattr(http _req @@ -3558,16 +3558,21 @@ ss_view( +http_ request,
eec4d737942e84ebfd0b45045f1ef8a883598598
Exclude new argument when running from UFO
Lib/fontmake/__main__.py
Lib/fontmake/__main__.py
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
Python
0
@@ -4098,16 +4098,29 @@ ded_args +, source_name ):%0A @@ -4126,26 +4126,16 @@ -exclusive_ msg = '%22 %7B%7D%22 @@ -4130,18 +4130,18 @@ msg = '%22 -%7B%7D +%25s %22 argume @@ -4166,133 +4166,18 @@ for -%7B%7D source'%0A exclusive_src = %7B'interpolate': 'Glyphs or MutatorMath',%0A ...
0d9368d141f85591d4c5a2852bf283c0f1fc6554
Add a test for the 'closed' attribute on the C-profiler object.
Lib/test/test_hotshot.py
Lib/test/test_hotshot.py
import hotshot import hotshot.log import os import pprint import unittest import test_support from hotshot.log import ENTER, EXIT, LINE def shortfilename(fn): # We use a really shortened filename since an exact match is made, # and the source may be either a Python source file or a # pre-compiled byteco...
Python
0
@@ -1971,58 +1971,207 @@ -profiler.runcall(callable)%0A profiler.close( +self.failUnless(not profiler._prof.closed)%0A profiler.runcall(callable)%0A self.failUnless(not profiler._prof.closed)%0A profiler.close()%0A self.failUnless(profiler._prof.closed )%0A
d8c2847c8f7df17692573ff7a641b834104c33ac
Update ik_wrapper.py
robosuite/wrappers/ik_wrapper.py
robosuite/wrappers/ik_wrapper.py
""" This file implements a wrapper for controlling the robot through end effector movements instead of joint velocities. This is useful in learning pipelines that want to output actions in end effector space instead of joint space. """ import os import numpy as np import robosuite import robosuite.utils.transform_util...
Python
0.000001
@@ -4617,34 +4617,73 @@ el -se +if self.env.mujoco_robot.name == %22baxter%22 :%0A @@ -4742,16 +4742,232 @@ n%5B14:%5D%5D) +%0A else:%0A raise Exception(%0A %22Only Sawyer and Baxter robot environments are supported for IK %22%0A ...
4e2b1c78102079c2138cd951289b5bb9f66205fc
Update __openerp__.py
product_price_margin_div/__openerp__.py
product_price_margin_div/__openerp__.py
{ "name": "Product price based on margin with formula sale_price=cost_price/margin", "version": "8.0.0.1", "author": "3nodus", 'category': 'Product', "website": "http://www.3nodus.com/", "license": "AGPL-3", "depends": [ "product", ], "demo": [ ], "data": [ ...
Python
0.000024
@@ -6,16 +6,68 @@ %22name%22: + %22Product price based on margin%22,%0A %22description%22: %22Produc @@ -103,16 +103,17 @@ formula +( sale_pri @@ -128,26 +128,26 @@ price/margin +) %22 -, %0A %22versio
151cfae24b650b74a9a216be61c3e440369274d9
Fix 'website´ manifest key
project_issue_department/__openerp__.py
project_issue_department/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012 Daniel Reis # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software...
Python
0.00021
@@ -1272,32 +1272,34 @@ ': ' -daniel.reis@securitas.pt +https://odoo-community.org ',%0A
256b425def54f146ac9b7ade21a5cd7c25097583
clean up the code and expose more traits
chaco/tools/legend_highlighter.py
chaco/tools/legend_highlighter.py
import operator # ETS imports from chaco.tools.api import LegendTool from traits.api import List, Float def get_hit_plots(legend, event): if legend is None or not legend.is_in(event.x, event.y): return [] try: # FIXME: The size of the legend is not being computed correctly, so # alwa...
Python
0.000001
@@ -422,17 +422,19 @@ legend.x -+ + + 20, even @@ -914,55 +914,270 @@ -drag_button = %22right%22%0A%0A dim_factor = Float(3 +#: Which mousebutton to use to move the legend%0A drag_button = %22right%22%0A%0A #: What to divide the alpha value by when plot is not selected%0A dim_factor = Float(3.0)%0A...
c2ea66556d52513c087f31401aacee907b2a6742
unify kernels
chainer/functions/math/maximum.py
chainer/functions/math/maximum.py
import numpy import chainer from chainer import cuda from chainer import function_node from chainer import utils from chainer.utils import type_check class Maximum(function_node.FunctionNode): """Element-wise maximum of input variables.""" def check_type_forward(self, in_types): type_check.expect( ...
Python
0.999979
@@ -1412,16 +1412,21 @@ gx1 +, gx2 = cuda. @@ -1476,162 +1476,71 @@ gx1 -',%0A 'gx1 = cond ? gy : (T)0.0',%0A 'maximum_bwd1')(self.cond, gy)%0A gx2 = cuda.elementwise(%0A 'S cond, T gy', 'T gx1', +, T gx2',%0A '''%0A gx1 = cond ? gy : (T)0.0; %0A ...
aca9b47fe7b78f86f86093b79dd3e3397412c882
Change xcode version
ci_scripts/test_osx-gui_wallet.py
ci_scripts/test_osx-gui_wallet.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import multiprocessing as mp import neblio_ci_libs as nci nci.setup_travis_or_gh_actions_env_vars() working_dir = os.getcwd() build_dir = "build" deploy_dir = os.path.join(os.environ['BUILD_DIR'],'deploy', '') parser = argparse.ArgumentParser()...
Python
0.000001
@@ -500,16 +500,69 @@ d_dir)%0A%0A +if os.environ.get('GITHUB_ACTIONS') is not None:%0A nci.call @@ -585,24 +585,28 @@ xcversion')%0A + nci.call_wit @@ -634,16 +634,134 @@ list')%0A + nci.call_with_err_code('xcversion install 9.4.1')%0A nci.call_with_err_code('xcversion select 9.4.1 --symlink')%0A%0...
7e946802893c16eacdfbb4d6cc04b44f1f162efa
Fix typo
ckanext/hierarchy/logic/action.py
ckanext/hierarchy/logic/action.py
import logging import ckan.plugins as p import ckan.logic as logic from ckanext.hierarchy.model import GroupTreeNode log = logging.getLogger(__name__) _get_or_bust = logic.get_or_bust @logic.side_effect_free def group_tree(context, data_dict): '''Returns the full group tree hierarchy. :returns: list of top...
Python
0.999999
@@ -814,16 +814,17 @@ to inclu +d e in the
d7c9891c338ecf1f049b5c38309940d924bbc846
remove fix since haystack update now supports django 1.10; reference indexes correctly
compass-api/G4SE/api/serializers.py
compass-api/G4SE/api/serializers.py
import datetime from drf_haystack.serializers import HaystackSerializer from rest_framework import serializers from rest_framework.utils.field_mapping import get_field_kwargs from api.search_indexes import GeoServiceMetadataIndex from .models import GeoServiceMetadata, GEO_SERVICE_METADATA_AGREED_FIELDS class GeoSe...
Python
0
@@ -109,104 +109,140 @@ ers%0A +%0A from -rest_framework.utils.field_mapping import get_field_kwargs%0A%0Afrom api.search_indexes import +api.search_indexes import GeoServiceMetadataIndex, EnglishGeoServiceMetadataIndex, GermanGeoServiceMetadataIndex, %5C%0A French GeoS @@ -1914,582 +1914,158 @@ -@staticm...
8b6f6c5cc41355642834cd0a6baf9ac64562c968
Change to kafka config settings
traptor/settings.py
traptor/settings.py
''' Settings for traptor ==================== ''' import os # Traptor defaults TRAPTOR_TYPE = 'track' # Type of traptor; options: follow, track, locations TRAPTOR_ID = 0 # Unique id of this traptor RULE_CHECK_INTERVAL = 60 # Number of se...
Python
0.000001
@@ -1020,51 +1020,8 @@ ta%0A%0A -KAFKA_BOOTSTRAP_SERVERS = 'localhost:9092'%0A KAFK @@ -1115,20 +1115,79 @@ QUEST = +bool(os.getenv('KAFKA_API_VERSION_REQUEST', 'False') == ' True +') %0AKAFKA_P
d19efb5ec138b6702b2e8d2b1507855a03835265
Allow redirection to file
coalib/output/ConsoleOutputter.py
coalib/output/ConsoleOutputter.py
""" This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT...
Python
0
@@ -611,16 +611,27 @@ /%3E.%0A%22%22%22%0A +import sys%0A from coa @@ -943,16 +943,35 @@ t__(self +, output=sys.stdout ):%0A @@ -1034,16 +1034,31 @@ t__(self +, output=output )%0A%0A d
0b80db297dc383efa315cffa6468eef7e6ebbf25
Improve list performance with select_related.
conf_site/reviews/views/__init__.py
conf_site/reviews/views/__init__.py
# -*- coding: utf-8 -*- from django.contrib.auth.mixins import UserPassesTestMixin from django.contrib.auth.models import Group from django.http import HttpResponseRedirect from django.urls import reverse from django.views.generic import DetailView, ListView, View from symposion.utils.mail import send_email from conf...
Python
0
@@ -1934,16 +1934,30 @@ return +(%0A Proposal @@ -1979,16 +1979,29 @@ by(%22pk%22) +%0A .exclude @@ -2016,16 +2016,90 @@ ed=True) +%0A .select_related(%22kind%22, %22speaker%22, %22review_result%22)%0A ) %0A%0A de
5f2c04ff2a8cd2046ab13d660d32152efd2027ae
Add User Streams.
tweepy/streaming.py
tweepy/streaming.py
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. import httplib from socket import timeout from threading import Thread from time import sleep import urllib from tweepy.models import Status from tweepy.api import API from tweepy.error import TweepError from tweepy.utils import import_simple...
Python
0
@@ -4834,16 +4834,336 @@ f._run() +%0A def userstream(self, count=None, async=False, secure=True):%0A if self.running:%0A raise TweepError('Stream object already connected!')%0A self.url = '/2/user.json'%0A self.host='userstream.twitter.com'%0A if count:%0A self.url...
6a1e170b371bfd52716ae05d85c2f303065fc687
Apply the auth before connecting, otherwise it will fail on reconnection when using OAuth (because the nonce has been used before, and the timestamp is no longer correct).
tweepy/streaming.py
tweepy/streaming.py
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. import httplib from socket import timeout from threading import Thread from time import sleep import urllib from tweepy.models import Status from tweepy.api import API from tweepy.error import TweepError from tweepy.utils import import_simple...
Python
0
@@ -2587,81 +2587,8 @@ url) -%0A self.auth.apply_auth(url, 'POST', self.headers, self.parameters) %0A%0A @@ -3088,32 +3088,113 @@ tion(self.host)%0A + self.auth.apply_auth(url, 'POST', self.headers, self.parameters)%0A
cc40e86cc1d9b68934a84caaff283a81b4cf4e82
comment routes
askomics/__init__.py
askomics/__init__.py
from pyramid.config import Configurator from pyramid.session import SignedCookieSessionFactory # from pyramid.authentication import AuthTktAuthenticationPolicy # from pyramid.authorization import ACLAuthorizationPolicy def main(global_config, **settings): """ This function returns a Pyramid WSGI application. ...
Python
0.000001
@@ -1390,16 +1390,49 @@ Format') +%0A%0A # Upload/integration routes %0A con @@ -2095,32 +2095,68 @@ _csv/%7Bname:.*%7D') +%0A%0A # Shortcuts and modules routes %0A config.add_ @@ -2698,24 +2698,240 @@ name:.*%7D')%0A%0A + # Galaxy route%0A config.add_route('connect_galaxy', '/connect_galaxy')%0A...
db9a51358c0caee87e1477313a38946b250f4de6
Use project_id
pybossa/repositories/task_repository.py
pybossa/repositories/task_repository.py
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2014 SF Isle of Man Limited # # PyBossa is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
Python
0.000001
@@ -2714,32 +2714,40 @@ ean_project( +element. project -. +_ id)%0A @@ -3064,32 +3064,40 @@ ean_project( +element. project -. +_ id)%0A @@ -3502,32 +3502,40 @@ ean_project( +element. project -. +_ id)%0A%0A def @@ -3881,32 +3881,40 @@ ean_project( +element. project -. +_ id)%0A%0A def
9b974a6395bc2ee35271d5f250684d54eab87c63
fix startDate
TheHive4py/models.py
TheHive4py/models.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import time class CustomJsonEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, JSONSerializable): return o.__dict__ else: return json.JSONEncoder.encode(self, o) class JSONSerializable(object): ...
Python
0.000054
@@ -1323,16 +1323,21 @@ .time()) +*1000 %0A%0A%0Aclass
517ba450e667fa5262e1a955b52cf68739013623
Correct the names of the "not known" exception classes.
datafork/__init__.py
datafork/__init__.py
import collections __all__ = [ "MergeConflict", "ValueNotKnownError", "ValueAmbiguousError", "root", ] class State(object): def __init__(self, root, parent=None, owner=None): self.root = root self.parent = parent self.slot_values = {} self.slot_positions = collec...
Python
0.000034
@@ -3359,24 +3359,16 @@ except -DataSlot ValueNot @@ -3563,32 +3563,24 @@ raise -DataSlot ValueAmbiguo @@ -3622,16 +3622,20 @@ alue is +cls. NOT_KNOW @@ -3659,16 +3659,8 @@ ise -DataSlot Valu
a172a1d4c0458fa0c1e145b7d44971d631ac30c8
Bump version.
datajoint/version.py
datajoint/version.py
__version__ = "0.13.dev5" assert len(__version__) <= 10 # The log table limits version to the 10 characters
Python
0
@@ -20,9 +20,9 @@ .dev -5 +6 %22%0A%0Aa
0549ad0bd541f4b32e522e62a007358f580faedd
Fix blueprints helper
app/helpers/blueprints_helper.py
app/helpers/blueprints_helper.py
from os import getcwd, path from importlib import import_module from pkgutil import walk_packages def register_blueprints(flask, package): package_dir = path.join(getcwd(), flask.name, package) blueprints = [import_module(f"{__name__}.{module.name}").blueprint for module in walk_packages(pa...
Python
0.000001
@@ -233,16 +233,28 @@ (f%22%7B -__name__ +flask.name%7D.%7Bpackage %7D.%7Bm @@ -323,16 +323,17 @@ ackages( +%5B package_ @@ -335,16 +335,17 @@ kage_dir +%5D )%5D%0A%0A
4a546d75f6dfeb24ba5273ace2725f70796ccf90
Change names in render layers ui
ui/render_layers.py
ui/render_layers.py
# # This source file is part of appleseed. # Visit http://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2013 Franz Beaune, Joel Daniels, Esteban Tovagliari. # # Permission is hereby granted, free of charge, to any person obtaining a co...
Python
0
@@ -233,16 +233,29 @@ vagliari +, Luke Kliber .%0A#%0A# Pe @@ -1831,80 +1831,8 @@ ers%0A - %0A layout.label( %22Render Layers:%22, icon = 'RENDERLAYERS')%0A @@ -2479,32 +2479,55 @@ to_renderlayer%22, + text = %22Add Selected%22, icon = %22ZOOMIN%22 @@ -2582,32 +2582,49 @@ om_renderlayer%22, +...
60ce593915c453b29cf474c812026c218f4d5b2e
add missing tests
pymatgen/io/lammps/tests/test_output.py
pymatgen/io/lammps/tests/test_output.py
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, print_function, unicode_literals, \ absolute_import import os import unittest import numpy as np from pymatgen.io.lammps.output import LammpsRun, LammpsLog, LammpsDump _...
Python
0.000023
@@ -4347,32 +4347,571 @@ decimal=10)%0A%0A + def test_get_structures_from_trajectory(self):%0A structures = self.lammpsrun.get_structures_from_trajectory()%0A self.assertEqual(len(structures), len(self.lammpsrun.timesteps))%0A%0A def test_get_displacements(self):%0A structure, disp = self...
eac3122adc0c16dc2c209965bdf89e0abd5277ec
Remove default prefix for cache key
dataviva/__init__.py
dataviva/__init__.py
import os from importlib import import_module # general flask library from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from flask.ext.babel import Babel from flask.ext.cache import Cache from flask.ext.mail import Mail from utils.jinja_helpers import jinja_f...
Python
0.000001
@@ -1623,15 +1623,8 @@ %22, %22 -dv2016: %22)%0Ac
5c54d85e74e8e17bfff58ab0e24ddb11271bdad0
Update topWords.py
app/lib/query/tweets/topWords.py
app/lib/query/tweets/topWords.py
# -*- coding: utf-8 -*- """ Top words application file. Search through messages of tweets in the database, the words and print out the occurence of each word. Characters are removed, but the hashtag (#) and mention (@) symbols are kept. """ import re from collections import Counter from lib import database as db # ...
Python
0
@@ -807,24 +807,140 @@ s):%0A %22%22%22%0A + Get the unique terms across the text in received tweets and output as%0A three groups.%0A%0A Note on regex:%0A The simp @@ -988,16 +988,24 @@ n-words, +%0A e.g. pu @@ -1015,20 +1015,16 @@ uation), -%0A as that @@ -1056,16 +1056,24 @@ ds...
6d61c195d1dbb54911dec0cb3d01a598c27b4a02
Fix getting platform mesh
UM/Scene/Platform.py
UM/Scene/Platform.py
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. from . import SceneNode from UM.Application import Application from UM.Resources import Resources from UM.Math.Vector import Vector from UM.Job import Job from UM.View.GL.OpenGL import OpenGL class Platform(SceneNode...
Python
0.000014
@@ -1546,32 +1546,33 @@ .findContainer(%7B + %22platform_mesh%22: @@ -1568,18 +1568,15 @@ form -_mesh %22: + %22*%22 + %7D)%0A @@ -1664,21 +1664,16 @@ platform -_mesh %22)%0A @@ -2281,21 +2281,16 @@ latform_ -mesh_ offset%22)
e4a4591eb51c2e2af0e99f50b4c03b063b2ae7b4
Make collective.recipe.pip compatible with pip 6.1.0+
collective/recipe/pip/__init__.py
collective/recipe/pip/__init__.py
# -*- coding: utf-8 -*- """Recipe pip.""" import itertools import os from pip import req from pip.download import PipSession old_parse_requirements = req.parse_requirements def parse_requirements(filename, *kv, **kw): """Override requirements parsing.""" file_dir = os.path.dirname(filename) if os.path....
Python
0
@@ -754,24 +754,59 @@ _links = %5B%5D%0A + self.format_control = None%0A self @@ -1082,27 +1082,20 @@ for +_ req -uirement in self @@ -1141,24 +1141,70 @@ ).split()):%0A + requirement = DownloadedReq(_req)%0A @@ -2906,8 +2906,612 @@ install%0A +%0A%0Aclass Downloaded...
e3dcb3497b921786db581571ef129cba80536c2e
Bump to 3.1.0
dbbackup/__init__.py
dbbackup/__init__.py
"Management commands to help backup and restore a project database and media" VERSION = (3, 0, 4) __version__ = '.'.join([str(i) for i in VERSION]) __author__ = 'Michael Shepanski' __email__ = 'mjs7231@gmail.com' __url__ = 'https://github.com/django-dbbackup/django-dbbackup' default_app_config = 'dbbackup.apps.Dbbackup...
Python
0.000054
@@ -89,12 +89,12 @@ (3, -0, 4 +1, 0 )%0A__
d2928d210cced832e3694ae96af90984ea5ceb6c
Remove a hardcoded magic number
unitypack/object.py
unitypack/object.py
import logging from . import engine as UnityEngine from .resources import UnityClass from .type import TypeMetadata, TypeTree from .utils import BinaryReader def load_object(type, obj): clsname = type.type if hasattr(UnityEngine, clsname): obj = getattr(UnityEngine, clsname)(obj) return obj class ObjectInfo: ...
Python
0.999934
@@ -835,12 +835,20 @@ ees%5B --150 +self.type_id %5D.ty
f86b502746d303900061ba33b58135f5730988e6
Update doc for Snake activation to match literature and return statement (#2572)
tensorflow_addons/activations/snake.py
tensorflow_addons/activations/snake.py
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0
@@ -1011,18 +1011,26 @@ = %5C -frac +mathrm %7Bx +%7D + -( +%5Cfrac%7B 1 - @@ -1069,17 +1069,16 @@ %5Ccdot x) -) %7D%7B2 %5Ccdo
d017eb0fd43d8a5ae7a07901d5ea7d0d93f72d2d
add docs to the jpegstream function
SimpleCV/Stream.py
SimpleCV/Stream.py
from SimpleCV.base import * _jpegstreamers = {} class JpegStreamHandler(SimpleHTTPRequestHandler): """ The JpegStreamHandler handles requests to the threaded HTTP server. Once initialized, any request to this port will receive a multipart/replace jpeg. """ def do_GET(self): global _jpegstreamers ...
Python
0
@@ -2423,16 +2423,96 @@ ve(js)%0A%0A + to open a browser and display:%0A import webbrowser%0A webbrowser.open(js.url)%0A%0A Note 3
5b6935487f0740b56cdeb6d85d5d95d4702e10a6
Update filtering.py
sciquence/sequences/filtering.py
sciquence/sequences/filtering.py
def parallel_filter(condition, *lists): ''' Parallelly filter multiple lists. Parameters ---------- condition: callable A function, which has as many arguments as the number of lists lists: list of list Returns ------- filtered_lists: Filtered accordingly s...
Python
0.000001
@@ -363,16 +363,97 @@ length%0A%0A + if isinstance(lists%5B0%5D, list) and len(lists) == 1:%0A lists = lists%5B0%5D%0A%0A outp
b4765fc0d98a9dd0b027fd1c5998d62b1a47d524
Update ca-san-jose scrapers for revised page layout.
scrapers/ca-san-jose/__init__.py
scrapers/ca-san-jose/__init__.py
# encoding: utf-8 from .legislators import SanJoseLegislatorScraper metadata = dict( name=u'San José', abbreviation='ca-san-jose', capitol_timezone='America/Los_Angeles', # http://en.wikipedia.org/wiki/San_Jose_City_Council legislature_name=u'San José City Council', legislature_url='http://www...
Python
0
@@ -2436,16 +2436,129 @@ s=%5B%5D%0A)%0A%0A +def strip_council_agendas_prefix(str):%0A import string%0A return string.replace(str, 'Council Agendas ', '')%0A%0A def sess @@ -3378,21 +3378,20 @@ ind -previous +agenda year +s %0A @@ -3406,23 +3406,36 @@ _agendas -_text = + = map(string.strip, current @...
8a67079c23c150102458f84d0077342b8f642b70
Replace " with '.
python/utilities/dnslookup/dnslookup.py
python/utilities/dnslookup/dnslookup.py
#!/usr/bin/env python # Implement DNS inclusion proof checking, see [TBD]. # # Unfortunately, getting at the SCTs in general is hard in Python, so this # does not start with an SSL connection, but instead fetches a log entry by # index and then verifies the proof over DNS. # You will need to install DNSPython (http:/...
Python
0.999999
@@ -3911,17 +3911,17 @@ ng.info( -%22 +' path = %25 @@ -3921,17 +3921,17 @@ ath = %25s -%22 +' %25 map(b
ebe21ae853f8fafa6fbbe07dfbf5dc98c3b887ee
Add Persian Wikivoyage
pywikibot/families/wikivoyage_family.py
pywikibot/families/wikivoyage_family.py
# -*- coding: utf-8 -*- """Family module for Wikivoyage.""" __version__ = '$Id$' # The new wikivoyage family that is hosted at wikimedia from pywikibot import family class Family(family.WikimediaFamily): """Family class for Wikivoyage.""" def __init__(self): """Constructor.""" super(Famil...
Python
0
@@ -520,16 +520,21 @@ ', 'el', + 'fa' %0A
967cf8774a5033f310ca69e7ad86fc79b2628882
Tag provisioning instances to make them easier to identify
infrastructure/aws/trigger-provision.py
infrastructure/aws/trigger-provision.py
# trigger-provision.py <indexer-provision.sh | web-server-provision.sh> import boto3 from datetime import datetime, timedelta import sys import os.path provisioners = sys.argv[1:] ec2 = boto3.resource('ec2') client = boto3.client('ec2') script = '' for provisioner in provisioners: script += open(provisioner).re...
Python
0
@@ -817,16 +817,189 @@ ngs': %5B%5D +,%0A 'TagSpecifications': %5B%7B%0A 'ResourceType': 'instance',%0A 'Tags': %5B%7B%0A 'Key': 'provisioner',%0A 'Value': sys.argv%5B1%5D,%0A %7D%5D,%0A %7D%5D, %0A%7D%0A%0Aclie
1fd6d7243cbbba95a747327d9c21ec0972b97e16
Update tests
demonstrare/tests.py
demonstrare/tests.py
import unittest from pyramid import testing class ViewTests(unittest.TestCase): def setUp(self): self.config = testing.setUp() def tearDown(self): testing.tearDown() def test_my_view(self): from .views import my_view request = testing.DummyRequest() info = my_vie...
Python
0.000001
@@ -243,23 +243,21 @@ import -my_view +index %0A @@ -305,23 +305,21 @@ info = -my_view +index (request @@ -355,30 +355,18 @@ fo%5B' -project'%5D, 'demonstrare' +year'%5D, 2015 )%0A
15d4f03471c7b34feab05ec725ccb536923aae6b
add methods to call ruby library
utils/repository.py
utils/repository.py
""" #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This file is part of the Smart Developer Hub Project: http://www.smartdeveloperhub.org Center for Open Middleware http://www.centeropenmiddleware.com/ #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-...
Python
0.000001
@@ -1072,16 +1072,85 @@ =#%0A%22%22%22%0A%0A +import os%0Aimport shutil%0Aimport settings%0Afrom subprocess import call%0A%0A __author @@ -1608,8 +1608,436 @@ ches)%0A%0A%0A +def move_to_specific_branch(repository, branch):%0A repository.switch_branch(branch)%0A%0A%0Adef generate_doc(branch):%0A file_path = se...
997af88d5210a8d07e2a08abe9ae944e115c0ae3
Version 0.8.5
uvicorn/__init__.py
uvicorn/__init__.py
from uvicorn.config import Config from uvicorn.main import Server, main, run __version__ = "0.8.4" __all__ = ["main", "run", "Config", "Server"]
Python
0
@@ -94,9 +94,9 @@ 0.8. -4 +5 %22%0A__
eceacfc149948c6d5c618e8ec609c05de66d939d
Update largest-number.py
Python/largest-number.py
Python/largest-number.py
# Time: O(n^2) # Space: O(n) # # Given a list of non negative integers, arrange them such that they form the largest number. # # For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330. # # Note: The result may be very large, so you need to return a string instead of an integer. # class Solution:...
Python
0.00002
@@ -9,10 +9,12 @@ O(n -%5E2 +logn )%0A# @@ -22,17 +22,17 @@ pace: O( -n +1 )%0A#%0A# Gi
8f830398c794e0f75cab4f959b6097eb53cecad4
make XMPP component multiprocessing
vbx/devices/xmpp.py
vbx/devices/xmpp.py
import asyncio import functools import importlib import queue import threading import twilio.base.values import twilio.rest import vbx import vbx.util class XMPP(vbx.Device): def __init__(self, jid, secret, server, port, target): import slixmpp class XMPPComponent(slixmpp.ComponentXMPP): ...
Python
0.000198
@@ -53,30 +53,36 @@ ort -queue%0Aimport threading +multiprocessing%0Aimport queue %0A%0Aim @@ -369,32 +369,45 @@ er, port, target +, timeout=0.5 ):%0A @@ -466,21 +466,31 @@ queue = -queue +multiprocessing .Queue() @@ -516,21 +516,25 @@ elf. -config = None +timeout = timeout %0A%0A @@ -552,36 +5...
c034d833038513ecd84e586dc163e09f86cf9f2a
Add debugging to `vee add PACKAGE`
vee/commands/add.py
vee/commands/add.py
import os import re from vee.cli import style, style_error, style_note, style_warning from vee.commands.main import command, argument from vee.git import GitRepo, normalize_git_url from vee.packageset import PackageSet from vee.package import Package from vee.utils import guess_name, checksum_file @command( argu...
Python
0
@@ -293,16 +293,36 @@ um_file%0A +from vee import log%0A %0A%0A@comma @@ -3240,16 +3240,69 @@ or url%0A + log.debug('adding dev remote url: %25s' %25 url)%0A @@ -3322,24 +3322,24 @@ ls.add(url)%0A - if not d @@ -3641,24 +3641,83 @@ rl(req.url)%0A + log.debug('does match package url?: ...
2f31af1ea22e0bfefe2042f8d2ba5ad6ce365116
Clear S3 API key from code
RG/drivers/s3/secrets.py
RG/drivers/s3/secrets.py
#!/usr/bin/python SECRETS = { "AWS_ACCESS_KEY_ID": "AKIAI2TRFQV2HZIHUD4A", "AWS_SECRET_ACCESS_KEY": "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" }
Python
0
@@ -53,28 +53,11 @@ %22: %22 -AKIAI2TRFQV2HZIHUD4A +XXX %22,%0A @@ -88,47 +88,10 @@ %22: %22 -rcI2TKQ8O2Dvx3S/b3bjf5zdg7+4Xrz0GhmyYYu +XX X%22%0A%7D
ed161f0ddc647ba4c80dbe096d5a8223227ded73
Add missing created field to serializer
server/covmanager/serializers.py
server/covmanager/serializers.py
from django.core.exceptions import MultipleObjectsReturned from django.core.files.base import ContentFile from django.forms import widgets import hashlib from rest_framework import serializers from rest_framework.exceptions import APIException from crashmanager.models import Client, Tool from .models import Collection...
Python
0
@@ -1336,16 +1336,27 @@ n', 'id' +, 'created' %0A @@ -1401,16 +1401,26 @@ = ('id', + 'created' )%0A%0A d
6b0a5c62580e584b59bb3ca517425875ea78fae9
Exclude zinb-fork, it is undefined if there is only one hidden layer
autoencoder/hyper.py
autoencoder/hyper.py
import os import pickle import json import numpy as np from kopt import CompileFN, test_fn from hyperopt import fmin, tpe, hp, Trials import keras.optimizers as opt from . import io from .network import AE_types def hyper(args): ds = io.create_dataset(args.input, output_file=os.path.j...
Python
0.005601
@@ -1572,21 +1572,8 @@ isp' -, 'zinb-fork' )),%0A
c1087678ce36d0ca00b6385cd57ac7c7c4b922f5
Simplify config queries.
automatron/config.py
automatron/config.py
from ConfigParser import SafeConfigParser from twisted.enterprise import adbapi from twisted.internet import defer class ConfigManager(object): def __init__(self, config_file): # Load configuration file config = SafeConfigParser() config.readfp(open(config_file)) # Set up the data...
Python
0.000002
@@ -1185,33 +1185,32 @@ l):%0A q = -%5B %22%22%22%0A @@ -1610,37 +1610,32 @@ %25s%0A -%22%22%22%5D%0A args = %5Bsect @@ -1626,79 +1626,8 @@ -args = %5Bsection%5D%0A%0A if server is not None:%0A q.append(' AND @@ -1649,34 +1649,32 @@ OR server = %25s...
b09f7214005cf6a6f32f721cbe02c2a58e8d2ada
version update
vip_hci/__init__.py
vip_hci/__init__.py
__version__ = "1.2.1" from . import preproc from . import config from . import fits from . import invprob from . import psfsub from . import fm from . import metrics from . import stats from . import var from .hci_dataset import * from .hci_postproc import * from .vip_ds9 import *
Python
0.000001
@@ -12,17 +12,17 @@ = %221.2. -1 +2 %22%0A%0Afrom
9f1a546a4a2b044b9b2513c4a653faaab299a76c
Add queryset for create channel API (#3534)
discussions/views.py
discussions/views.py
"""APIs for discussions""" from django.conf import settings from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import redirect from rest_framework import status from rest_framework.authentication import SessionAuthentication, TokenAuthentication from res...
Python
0
@@ -2213,24 +2213,82 @@ ass = ChannelSerializer%0A +%0A # Make django-rest-framework happy%0A queryset = %5B%5D%0A
5be02a226303633766f4403e14e2fe32ab644b71
add split() to template's global context
virtlib/setupenv.py
virtlib/setupenv.py
import sys import tarfile import time import subprocess import os.path import logging, logging.config from ConfigParser import SafeConfigParser as ConfigParser from optparse import OptionParser from jinja2 import Environment as JinjaEnv, FileSystemLoader as JinjaLoader LOG = logging.getLogger(__name__) def parse_cm...
Python
0
@@ -2875,16 +2875,72 @@ type)))%0A + jenv.globals%5B%22split%22%5D = lambda x: x.split(%22,%22)%0A%0A
6bdc9af31bda7a429a457445c16b0df7cc800239
Allow get_new_id to take sets and lists
virtool/db/utils.py
virtool/db/utils.py
import virtool.utils def apply_projection(document, projection): """ Apply a Mongo-style projection to a document and return it. :param document: the document to project :type document: dict :param projection: the projection to apply :type projection: Union[dict,list] :return: the proje...
Python
0
@@ -1337,17 +1337,16 @@ ion%5B -None, lis +list, se t%5D%0A%0A @@ -1429,16 +1429,20 @@ luded = +set( excluded @@ -1449,14 +1449,14 @@ or -li s +e t() +) %0A%0A @@ -1469,12 +1469,16 @@ uded - += +.update( awai @@ -1501,24 +1501,25 @@ tinct(%22_id%22) +) %0A%0A return
1a26df87bdae0b8ccc93047b535f87d9daa2bf84
update incident script
Scripts/fire_incident.py
Scripts/fire_incident.py
#Weinschenk #12-14 from __future__ import division import numpy as np import pandas as pd from pylab import * from matplotlib import rcParams rcParams.update({'figure.autolayout': True}) incident = pd.read_csv('../Data/arlington_incidents.csv', header=0) total_incidents = len(incident['incident_class_code']) total_fi...
Python
0.000001
@@ -180,16 +180,30 @@ : True%7D) +%0Aimport random %0A%0Aincide @@ -429,44 +429,202 @@ 1 %0A%0A -print 100*(total_fires/total_incidents) +for num in range(1,1000):%0A%09rand = random.randrange(1,len(incident%5B'incident_class_code'%5D),1)%0A%09if incident%5B'incident_class_code'%5D%5Brand%5D == 1:%0A%09 %09fire = Tr...
79ff75571e7ade45d35faeed34da984368b54285
Revert accidental change
controllers/gameday_controller.py
controllers/gameday_controller.py
import datetime import os import json import webapp2 from google.appengine.ext.webapp import template from controllers.base_controller import CacheableHandler from database.event_query import TeamYearEventsQuery from helpers.event_helper import EventHelper from helpers.model_to_dict import ModelToDict from helpers.va...
Python
0.000001
@@ -6254,9 +6254,10 @@ rn param +s %0A
7835b9e6d6c35fcfd38b0fdebe6cdf92a38e3c3a
Make necessary directories
django_ffmpeg/app.py
django_ffmpeg/app.py
from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class DjangoFfmpegConfig(AppConfig): name = 'django_ffmpeg' verbose_name = _('Videos')
Python
0.003262
@@ -1,20 +1,31 @@ +import os%0A%0A from django.apps imp @@ -38,16 +38,49 @@ pConfig%0A +from django.conf import settings%0A from dja @@ -128,16 +128,71 @@ y as _%0A%0A +from django_ffmpeg import defaults as ffmpeg_settings%0A%0A %0Aclass D @@ -248,16 +248,16 @@ ffmpeg'%0A - verb @@ -279,8 +279,461 @@ ideos'...
1375cece723b9627be1413f2eb25aa53b6a918ec
Update __init__.py
django_q/__init__.py
django_q/__init__.py
from .tasks import async, schedule, result, fetch from .models import Task, Schedule VERSION = (0, 3, 0) default_app_config = 'django_q.apps.DjangoQConfig'
Python
0.000003
@@ -96,17 +96,17 @@ (0, 3, -0 +q )%0A%0Adefau
3caf0231808268654570492a0623e72b22988243
Move imports to top and use absolute_import for Python 2.7 compatibility
setuptools/tests/test_develop.py
setuptools/tests/test_develop.py
"""develop tests """ import os import site import sys import io from setuptools.extern import six import pytest from setuptools.command.develop import develop from setuptools.dist import Distribution from . import contexts SETUP_PY = """\ from setuptools import setup setup(name='foo', packages=['foo'], use...
Python
0
@@ -14,16 +14,57 @@ sts%0A%22%22%22%0A +%0Afrom __future__ import absolute_import%0A%0A import o @@ -97,16 +97,50 @@ mport io +%0Aimport textwrap%0Aimport subprocess %0A%0Afrom s @@ -3280,44 +3280,8 @@ t%0A%0A%0A -import textwrap%0Aimport subprocess%0A%0A%0A clas
9ab39e7014b8706e8ee1ac3073c3e658f689af01
Update addresult_wally.py
run_tests/shaker_run/addresult_wally.py
run_tests/shaker_run/addresult_wally.py
import ConfigParser import base64 import json import urllib2 # Testrail API class APIClient: def __init__(self, base_url): self.user = '' self.password = '' if not base_url.endswith('/'): base_url += '/' self.__url = base_url + 'index.php?/api/v2/' def send_get(sel...
Python
0.000002
@@ -2441,16 +2441,149 @@ tdev'%5D%0A%0A +status = 1%0Aif (read_16mib_median %3C base_read_16mib_median * 0.1) or (read_16mib_stdev %3C base_read_16mib_stdev * 0.1):%0A status = 0%0A list_t = @@ -2868,17 +2868,27 @@ us_id': -1 +int(status) , 'versi
c0b81ed8c34051a5bcb7f9451d40bf16c41d88d4
Remove old lookup tables from jsonrpcproxy.py
jsonrpcproxy.py
jsonrpcproxy.py
#! /usr/bin/env python3 """A simple json-rpc service proxy with automatic method generation.""" from functools import wraps import json from base64 import b64encode, b64decode import requests from jsonrpc.dispatcher import Dispatcher import bitcoin.core from bitcoin.core.serialize import Serializable import bitcoin.w...
Python
0.000001
@@ -554,469 +554,8 @@ ))%0A%0A -KNOWN_BASE58 = %5B%0A bitcoin.wallet.CBitcoinAddress,%0A bitcoin.base58.CBase58Data,%0A%5D%0ABASE58_LOOKUP = %7Bcls.__name__:cls for cls in KNOWN_BASE58%7D%0AKNOWN_BYTES = %5B%0A bytes,%0A%5D%0ABYTES_LOOKUP = %7Bcls.__name__:cls for cls in KNOWN_BYTES%7D%0AKNOWN_SERIALIZABLE = ...
5c1833f8d056015d86ef1ef726a8097269db9d84
bump version -> 0.3.0-dev
webargs/__init__.py
webargs/__init__.py
# -*- coding: utf-8 -*- __version__ = '0.2.0' __author__ = 'Steven Loria' __license__ = "MIT" from webargs.core import Arg, WebargsError, ValidationError
Python
0
@@ -39,11 +39,15 @@ '0. -2 +3 .0 +-dev '%0A__
0af39adef5a4c3453b7adb95a793f3d2720a67b2
fix import bug
beanstalkw/client.py
beanstalkw/client.py
#!/usr/bin/python # -*- coding: utf-8 -*- import json import thread.allocate_lock import beanstalkc import job class Client(object): def __init__(self, host, port): self.connection = beanstalkc.Connection(host, port) self.current_tube = 'default' self.write_lock = thread.allocate_lock(...
Python
0.000001
@@ -61,30 +61,16 @@ t thread -.allocate_lock %0A %0Aimpor
195032a3ece262bcec2a8bebc7f443979caa0d58
move function
corehq/apps/change_feed/topics.py
corehq/apps/change_feed/topics.py
from kafka.common import OffsetRequest from corehq.apps.change_feed.connection import get_kafka_client from .document_types import CASE, FORM, DOMAIN, META, APP # this is redundant but helps avoid import warnings until nothing references these CASE = CASE FORM = FORM DOMAIN = DOMAIN META = META APP = APP # new model...
Python
0.000011
@@ -839,16 +839,138 @@ opic%5D%0A%0A%0A +def get_all_offsets():%0A %22%22%22%0A :returns: A dict of offsets keyed by topic%22%22%22%0A return get_multi_topic_offset(ALL)%0A%0A%0A def get_ @@ -1329,126 +1329,4 @@ %7D%0A -%0A%0Adef get_all_offsets():%0A %22%22%22%0A :returns: A dict of offsets keyed b...
8b808a4a703f1f665f73dc92a7ecaf080c8a5688
Fix import
corehq/apps/translations/views.py
corehq/apps/translations/views.py
from __future__ import absolute_import, unicode_literals import io from django.contrib import messages from django.http import HttpResponseRedirect from django.urls import reverse from django.utils.translation import ugettext as _ import six from couchexport.export import export_raw from couchexport.models import F...
Python
0.000002
@@ -1012,40 +1012,8 @@ ap,%0A - get_unique_ids_sheet_title,%0A @@ -1354,34 +1354,8 @@ or,%0A - get_single_worksheet,%0A
1093fe0328fb722d05a5d84afff7494e5df21216
Update clean_mac_info_plist.py
share/qt/clean_mac_info_plist.py
share/qt/clean_mac_info_plist.py
#!/usr/bin/env python # Jonas Schnelli, 2013 # make sure the Litecoin-Qt.app contains the right plist (including the right version) # fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267) from string import Template from datetime import date bitcoinDir = "./"; in...
Python
0.000001
@@ -54,20 +54,20 @@ ure the -Lite +Taco coin-Qt. @@ -376,12 +376,12 @@ = %22 -Lite +Taco coin @@ -471,19 +471,20 @@ oinDir+%22 -bit +taco coin-qt.
3f2740702855087236b6c8f0b35a44a335c952c0
test post receive hook
bika/lims/catalog.py
bika/lims/catalog.py
from AccessControl import ClassSecurityInfo from Acquisition import aq_inner from Acquisition import aq_parent from Globals import InitializeClass from Products.CMFCore.permissions import ManagePortal from Products.CMFCore.utils import getToolByName from Products.CMFPlone.CatalogTool import CatalogTool from Products.CM...
Python
0
@@ -2497,25 +2497,24 @@ Class(BikaSetupCatalog)%0A -%0A
a265aa24606248461a14892d51f7c37a4c2ae388
disable timeout.
blackgate/command.py
blackgate/command.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging from datetime import timedelta import requests from tornado import gen from tornado.ioloop import IOLoop from concurrent.futures import TimeoutError from blackgate.core import component logger = logging.getLogger(__name__) class Command...
Python
0
@@ -442,12 +442,48 @@ eout - = 1 +_seconds = 1%0A%0A timeout_enabled = True %0A%0A @@ -1218,32 +1218,73 @@ )%0A%0A try:%0A + if self.timeout_enabled:%0A time @@ -1319,18 +1319,30 @@ .timeout -)%0A +_seconds)%0A @@ -1413,16 +1413,91 @@ f.run))%0A + el...
74cde286b405a06480efba046242e79f92b20882
allow qt_plugin imsave() function to write to file-like objects
skimage/io/_plugins/qt_plugin.py
skimage/io/_plugins/qt_plugin.py
from .util import prepare_for_display, window_manager, GuiLockError import numpy as np import sys # We try to aquire the gui lock first or else the gui import might # trample another GUI's PyOS_InputHook. window_manager.acquire('qt') try: from PyQt4.QtGui import (QApplication, QMainWindow, QImage, QPixmap, ...
Python
0
@@ -282,35 +282,13 @@ n, Q -MainWindow, QImage, QPixmap +Image ,%0A @@ -321,16 +321,38 @@ QLabel, + QMainWindow, QPixmap, QWidget @@ -4569,19 +4569,36 @@ ame, img +, format_str=None ):%0A - # we @@ -4797,24 +4797,339 @@ mat_RGB888)%0A + if _is_filelike(filename):%0A byte_array = QtCore.QByteAr...
73afb3acd833f49187cd69d7e3a3f11367f8fc22
Update slack_bot_reddit_image_poster.py
slack_bot_reddit_image_poster.py
slack_bot_reddit_image_poster.py
from slackclient import SlackClient import praw from time import sleep import random import os BOT_TOKEN = os.getenv('BOT_TOKEN') CHANNEL_ID = os.getenv('CHANNEL_ID') # channel ID, or just use channel name subreddits = ('pics', 'funny', 'cats', 'aww', 'gifs') help_message = " It's time to have fun!!! I'm pulling t...
Python
0.000001
@@ -488,23 +488,25 @@ And type + %22 + %22%60%22 + + %22!comm @@ -509,19 +509,19 @@ command -hot +new %22 + %22%60%22 @@ -527,32 +527,190 @@ + %22 + to get -hottest pictures! +*newest* pictures! %22 %5C%0A %22 And type %22 + %22%60%22 + %22!command some_number from 2 to 10 (new also acceptab...
7b5de72d3b787b9a3e227c2433140b763cc68954
switch to urllib2 urlopen - the old one blocked for a long time
social_auth/backends/facebook.py
social_auth/backends/facebook.py
""" Facebook OAuth support. This contribution adds support for Facebook OAuth service. The settings FACEBOOK_APP_ID and FACEBOOK_API_SECRET must be defined with the values given by Facebook application registration process. Extended permissions are supported by defining FACEBOOK_EXTENDED_PERMISSIONS setting, it must ...
Python
0
@@ -503,21 +503,64 @@ cgi%0A -import urllib +from urllib import urlencode%0Afrom urllib2 import urlopen %0A%0Afr @@ -2129,39 +2129,32 @@ ION_URL + '?' + -urllib. urlencode(args)%0A @@ -2351,23 +2351,16 @@ -urllib. urlencod @@ -2643,23 +2643,16 @@ arse_qs( -urllib. urlopen( @@ -3688,23 +3688,16 @@ + '...
ff5594a918d194c46bb00384ab4ea2f43df69e3b
Test for material type
simlammps/io/tests/test_file_utility.py
simlammps/io/tests/test_file_utility.py
import unittest import tempfile import shutil import os from numpy.testing import assert_almost_equal from simphony.core.cuba import CUBA from simlammps.io.file_utility import read_data_file from simlammps.cuba_extension import CUBAExtension class TestFileUtility(unittest.TestCase): def setUp(self): se...
Python
0
@@ -945,16 +945,131 @@ cles())%0A + self.assertEqual(str(particles.data%5BCUBA.MATERIAL_TYPE%5D),%0A particles.name)%0A
b247d1d0d0d67288b585822c9f063fb087a99747
Update event_handler.py
bot/event_handler.py
bot/event_handler.py
import json import logging import random import Algorithmia from textblob import TextBlob from text_corpus import TextCorpus from aylienapiclient import textapi logger = logging.getLogger(__name__) class RtmEventHandler(object): def __init__(self, slack_clients, msg_writer): self.clients = slack_clients ...
Python
0.000004
@@ -4403,32 +4403,67 @@ %5D))+', msg_txt)%0A + url = ''.join(url)%0A
e1ee80455d8fa4ce1327e658be3ed0f8c659069c
Version upgrade to 0.9.4
budou/__version__.py
budou/__version__.py
VERSION = (0, 9, 3) __version__ = '.'.join(map(str, VERSION))
Python
0
@@ -14,9 +14,9 @@ 9, -3 +4 )%0A__
2c84a2135f8d3c566c9b9970544794e52262fb48
Remove custom dtype range
skimage/viewer/plugins/overlayplugin.py
skimage/viewer/plugins/overlayplugin.py
import numpy as np from skimage.util import dtype from .base import Plugin from ..utils import ClearColormap #TODO: Maybe this bool definition should be moved to skimage.util.dtype. dtype_range = dtype.dtype_range.copy() dtype_range[np.bool_] = (False, True) class OverlayPlugin(Plugin): """Plugin for ImageView...
Python
0
@@ -1,24 +1,4 @@ -import numpy as np%0A%0A from @@ -10,16 +10,22 @@ age.util +.dtype import @@ -29,16 +29,22 @@ rt dtype +_range %0Afrom .b @@ -101,160 +101,8 @@ p%0A%0A%0A -#TODO: Maybe this bool definition should be moved to skimage.util.dtype.%0Adtype_range = dtype.dtype_range.copy()%0Adtype_range%5Bnp.bool_...