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
946f9e3224a31d7d1788d94489197b206cc7c6be
fix urls
web_frontend/cloudscheduler/csv2/urls.py
web_frontend/cloudscheduler/csv2/urls.py
from django.conf.urls import url from . import views, cloud_views, group_views, settings_views, user_views urlpatterns = [ url(r'^$', cloud_views.status, name='cloud-status'), url(r'^cloud/add', cloud_views.add, name='cloud-add'),...
Python
0.005145
@@ -721,25 +721,25 @@ '%5Ecloud/yaml -_ +- add', @@ -821,25 +821,25 @@ '%5Ecloud/yaml -_ +- delete', @@ -924,25 +924,25 @@ '%5Ecloud/yaml -_ +- fetch/(?P%3Cse @@ -1026,25 +1026,25 @@ '%5Ecloud/yaml -_ +- update', @@ -1621,17 +1621,17 @@ oup/yaml -_ +- add', @@ -1717,25 +1717,25 @@ '%5Egroup...
2719b830a1e20c11a90ae6ee219b46f58b0283be
Add more comments
luigi/tasks/export/ftp/bed/bed_tasks.py
luigi/tasks/export/ftp/bed/bed_tasks.py
# -*- coding: utf-8 -*- """ Copyright [2009-2018] EMBL-European Bioinformatics Institute 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...
Python
0
@@ -1172,32 +1172,138 @@ mp(luigi.Task):%0A + %22%22%22%0A Export a tsv file with genome coordinates that will be processed into bed%0A format.%0A %22%22%22%0A assembly_id @@ -1330,32 +1330,32 @@ fault='GRCh38')%0A - species = lu @@ -1827,32 +1827,73 @@ le(luigi.Task):%0A + %22%22%22%0A ...
fd5711c7acabea1ed304a3e2113b907de556e645
Set Docker API version in the DockerOperator params
dags/cochrane_reviews.py
dags/cochrane_reviews.py
from datetime import datetime from airflow.operators.docker_operator import DockerOperator from airflow.models import DAG, Variable import utils.helpers as helpers import os args = { 'owner': 'airflow', 'depends_on_past': False, 'start_date': datetime.strptime('Dec 1 2016', '%b %d %Y'), 'retries': 1, }...
Python
0
@@ -590,32 +590,56 @@ orce_pull=True,%0A + api_version='1.23',%0A environment= @@ -632,32 +632,32 @@ environment=%7B%0A - 'WAREHOU @@ -924,74 +924,8 @@ '%5D,%0A - 'DOCKER_API_VERSION': Variable.get('DOCKER_API_VERSION'),%0A @@ -1115,24 +1115,48 @@ _pull=True,%0A + api_version='1.2...
545f45bda1c7f40e4fd70fd7286479d5e1cf3bed
Add optional dtype argument to _get_ang_freq_grid
dask_ndfourier/_utils.py
dask_ndfourier/_utils.py
# -*- coding: utf-8 -*- import collections import itertools import numbers import numpy import dask.array from dask_ndfourier import _compat try: from itertools import imap except ImportError: imap = map try: irange = xrange except NameError: irange = range def _get_freq_grid(shape, chunks, dty...
Python
0
@@ -1069,18 +1069,196 @@ , chunks -): +, dtype=float):%0A dtype = numpy.dtype(dtype).type%0A%0A assert (issubclass(dtype, numbers.Real) and%0A not issubclass(dtype, numbers.Integral))%0A%0A pi = dtype(numpy.pi)%0A %0A fre @@ -1294,16 +1294,29 @@ , chunks +, dtype=dtype )%0A an @@ -1333,22 ...
6d0c99026f8382822d49ad636b06f884f96351eb
Set version to 0.19.2 final
eulexistdb/__init__.py
eulexistdb/__init__.py
# file eulexistdb/__init__.py # # Copyright 2010,2011 Emory University Libraries # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
Python
0.00001
@@ -1109,20 +1109,19 @@ (0, -20, 0, 'dev' +19, 2, None )%0A%0A#
e63c9bad85853666a8f949db8c58b28c49b9ed53
Use display_avatar instead of avatar in converters example
examples/converters.py
examples/converters.py
# This example requires the 'members' privileged intent to use the Member converter. # This example also requires the 'message_content' privileged intent to function. import typing import discord from discord.ext import commands intents = discord.Intents.default() intents.members = True intents.message_content = Tru...
Python
0
@@ -1227,16 +1227,24 @@ = user. +display_ avatar.u
e125fc909e569a6612bf2f967fffd86ce18f7e08
Update example url
examples/downloader.py
examples/downloader.py
""" A rudimentary URL downloader (like wget or curl) to demonstrate Rich progress bars. """ import os.path import sys from concurrent.futures import as_completed, ThreadPoolExecutor import signal from functools import partial from threading import Event from typing import Iterable from urllib.request import urlopen f...
Python
0.000001
@@ -2108,11 +2108,9 @@ .04. -2.0 +3 -des
d21da3716e34576c02cc296cac4844c525fc84a5
Fix typo
examples/play_track.py
examples/play_track.py
#!/usr/bin/env python """ This is an example of playing music from Spotify using pyspotify. The example use the :class:`spotify.sink.AlsaSink`, and will thus only work on systems with an ALSA sound subsystem, which means most Linux systems. You can either run this file directly without arguments to play a default tr...
Python
0.998931
@@ -911,9 +911,9 @@ %0A# E -V +v ents
ee9532a9b1baa39fa8e674ff3b88b0847177c53a
Make simExample importable.
examples/simExample.py
examples/simExample.py
import uci.Sim as Sim import uci.TrapConfiguration as TrapConfig import numpy as np t = TrapConfig.TrapConfiguration() t.Bz = 4.5 #V0 in V/m^2 t.kz = 2.0 * 1.167e6 delta = 0.010 t.kx = -(0.5 + delta) * t.kz t.ky = -(0.5 - delta) * t.kz t.theta = 0 t.omega = 2.0 * np.pi * 43.0e3 fundcharge = 1.602176565e-19 ionMass =...
Python
0
@@ -78,17 +78,42 @@ as np%0A%0A -%0A +def run_simulation():%0A t = Trap @@ -139,16 +139,20 @@ ation()%0A + t.Bz = 4 @@ -154,16 +154,20 @@ z = 4.5%0A + #V0 in V @@ -171,16 +171,20 @@ n V/m%5E2%0A + t.kz = 2 @@ -196,16 +196,20 @@ 1.167e6%0A + delta = @@ -214,16 +214,20 @@ = 0.010%0A + ...
65266813c6438eeb67002e17dd4cd70a00e84b5d
Clean the code with autopen8
meta-iotqa/lib/oeqa/runtime/boottime.py
meta-iotqa/lib/oeqa/runtime/boottime.py
#[PROTEXCAT] #\License: ALL RIGHTS RESERVED """System boot time""" import os from oeqa.oetest import oeRuntimeTest from oeqa.runtime.helper import collect_pnp_log class BootTimeTest(oeRuntimeTest): def _setup(self): (status,output) = self.target.copy_to(os.path.join(os.path.dirname(__file__), 'files','sy...
Python
0.000028
@@ -158,16 +158,17 @@ np_log%0A%0A +%0A class Bo @@ -225,32 +225,33 @@ (status, + output) = self.t @@ -264,16 +264,29 @@ copy_to( +%0A os.path. @@ -325,16 +325,42 @@ 'files', +%0A 'systemd @@ -370,16 +370,17 @@ alyze'), + %22/tmp/sy @@ -416,34 +416,71 @@ assertE...
db5f174e8d72bb74083181ab2582c3e57f74aca3
Add space before icon
cfgov/v1/__init__.py
cfgov/v1/__init__.py
import os, re,HTMLParser from urlparse import urlparse from django.contrib.staticfiles.storage import staticfiles_storage from django.core.urlresolvers import reverse from django.template.defaultfilters import slugify from wagtail.wagtailcore.templatetags import wagtailcore_tags from django.contrib import messages fr...
Python
0.000021
@@ -2505,16 +2505,83 @@ class%7D)%0A + a.append(' ') # We want an extra space before the icon%0A
d11596b7511cdc9e6164f46436fdf66661edff3a
change way of columns' redefining
CSchoolSite/userprofile/tables.py
CSchoolSite/userprofile/tables.py
from django_datatables_view.base_datatable_view import BaseDatatableView from django.utils.translation import ugettext_lazy as _ from userprofile.models import Relationship, User class PossibleRelativesTable(BaseDatatableView): max_display_length = 50 # yep, we need to redefine existed column for custom dat...
Python
0.000007
@@ -1055,341 +1055,224 @@ -# change some columns (here redefinition comes to play)%0A def prepare_results(self, qs):%0A json_data = %5B%5D%0A%0A for item in qs:%0A full_name = '%7B%7D %7B%7D %7B%7D'.format(item.last_name, item.first_name, item.patronymic).strip()%0A json_dat...
04faafaf79fa6558fb8c6bb5986cb72c2c541c6d
Change timezone to Europe/Helsinki
cfh/settings/base.py
cfh/settings/base.py
import os import dj_database_url # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.environ.setdefault( 'DATABASE_URL', 'postgis://postgres:cfh@localhost:5432/cfh' ) ALLOWED_HOSTS = ['*'] # Application definitio...
Python
0.999961
@@ -3114,11 +3114,23 @@ = ' -UTC +Europe/Helsinki '%0A%0AU
b580fff84a0c159b5ce9b6734baa0726b4cfd7af
Fix getInfo
module/plugins/hoster/ShareonlineBiz.py
module/plugins/hoster/ShareonlineBiz.py
# -*- coding: utf-8 -*- import re from time import time from urllib import unquote from urlparse import urlparse from module.network.RequestFactory import getURL from module.plugins.internal.CaptchaService import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class Shareonl...
Python
0
@@ -419,17 +419,17 @@ _ = %220.4 -2 +3 %22%0A%0A _ @@ -1262,16 +1262,22 @@ info -.update( +%5B'pattern'%5D = re.m @@ -1314,17 +1314,16 @@ updict() -) %0A%0A @@ -1456,21 +1456,16 @@ links%22: -self. info%5B'pa
cc2685f4242fe1e1c30f82b5319edc62c5acaebb
Bump version
lintreview/__init__.py
lintreview/__init__.py
__version__ = '2.1.2'
Python
0
@@ -14,9 +14,9 @@ '2. -1.2 +2.0 '%0A
0aeb3aad2cd4d3f13f4e99b888fa12f9d6dbaedb
Bump version
lintreview/__init__.py
lintreview/__init__.py
__version__ = '2.34.9'
Python
0
@@ -17,7 +17,8 @@ .34. -9 +10 '%0A
1906c2dca105eb7ba9c69689a37c9884683d67e8
Add License
database/__init__.py
database/__init__.py
import dataset, json from xml.sax.saxutils import escape def save_to_database(db_path, str_json): str_json = json.loads(str_json) db = dataset.connect('sqlite:///%s' % (db_path.replace("'", "_"))) table = db['api_captures'] table.insert(dict(time=str_json['time'], operation=str_json['txnType'], artifac...
Python
0
@@ -1,12 +1,624 @@ +###%0A # Copyright (c) 2016 eBay Software Foundation.%0A #%0A # Licensed under the Apache License, Version 2.0 (the %22License%22);%0A # you may not use this file except in compliance with the License.%0A # You may obtain a copy of the License at%0A #%0A # http://www.apache.org/licenses/LICENSE-2.0...
305340f912bd9b05da425100135c1825c5a738fd
Prepare rel. 0.0.15
femagtools/__init__.py
femagtools/__init__.py
# -*- coding: utf-8 -*- """ femagtools ~~~~~~~~~~ Python bindings for FEMAG :copyright: 2016 Semafor Informatik & Energie AG, Basel :license: BSD, see LICENSE for more details. """ __title__ = 'femagtools' __version__ = '0.0.14' __author__ = 'Ronald Tanner' __license__ = 'BSD' __copyright__ = 'Cop...
Python
0.000065
@@ -245,9 +245,9 @@ .0.1 -4 +5 '%0A__
4d396ccd8364b6635c54be0ef747f019a1d71af6
Remove unnecessary code from datasift/__init__.py
datasift/__init__.py
datasift/__init__.py
# -*- coding: utf-8 -*- """ The official DataSift API library for Python. This module provides access to the REST API and also facilitates consuming streams. Requires Python 2.4+. To use, 'import datasift' and create a datasift.User object passing in your username and API key. See the examples folder for reference u...
Python
0.000002
@@ -699,30 +699,8 @@ %22%22%0A%0A -import sys%0Aimport os%0A%0A __au @@ -915,742 +915,224 @@ -%0A# -Add this folder to the system path.%0A#-----------------------------------------------------------------------------%0Asys.path%5B0:0%5D = %5Bos.path.dirname(__file__), %5D%0A%0A#-------------------------------------...
84c24e43f8856a6d07a0baef679a01437644714c
Set up Datalogger Python script to be run under docker
datalogger/datalogger.py
datalogger/datalogger.py
#! /usr/bin/python from xbee import ZigBee import serial import struct from datetime import datetime import logging logging.basicConfig(filename="./datalogger.log", format='%(asctime)s %(levelname)s:%(message)s', level=logging.INFO) class zbDataLogger: def __init__(self, port='/dev/ttyUSB0', baud=9600, escaped=T...
Python
0
@@ -141,17 +141,21 @@ lename=%22 -. +/data /datalog @@ -4724,16 +4724,22 @@ h open(' +/data/ data.log
dc42a2622f482d7a0dfc40f3925c61961dde5811
Add 'regex' and full text search column settings
datatableview/columns.py
datatableview/columns.py
import re try: from functools import reduce except ImportError: pass from django.db import models from django.db.models import Model, Manager from django.core.exceptions import ObjectDoesNotExist from django.utils.encoding import smart_text from django.utils.safestring import mark_safe from django.forms.util i...
Python
0
@@ -2103,16 +2103,82 @@ sor=None +, allow_regex=False,%0A allow_full_text_search=False ):%0A @@ -2816,16 +2816,116 @@ rocessor +%0A self.allow_regex = allow_regex%0A self.allow_full_text_search = allow_full_text_search %0A%0A
47504100712fb29b5380fcaaf2647fb85443c348
Implement caching
lot/landmapper/urls.py
lot/landmapper/urls.py
from django.urls import include, re_path, path from landmapper.views import * urlpatterns = [ # What is difference between re_path and path? # re_path(r'', # home, name='landmapper-home'), path('', home, name="home"), path('identify/', identify, name="identify"), # path('/report/', report, ...
Python
0.000001
@@ -40,16 +40,69 @@ h, path%0A +from django.views.decorators.cache import cache_page%0A from lan @@ -499,22 +499,52 @@ y_id%3E', +cache_page(60 * 60 * 24 * 7)( report +) , name='
de877d7dc98bc6cb227dbdea51df9a95281f10df
Add version to init
fil_finder/__init__.py
fil_finder/__init__.py
# Licensed under an MIT open source license - see LICENSE from cores import * from length import * from pixel_ident import * from utilities import * from width import * from analysis import Analysis from filfind_class import fil_finder_2D
Python
0
@@ -52,16 +52,39 @@ ICENSE%0A%0A +__version__ = %221.2.2%22%0A%0A from cor
4d4448e23957cc537a9e2d5c2013e4b19b24f836
Fix imports for py34
dbaas_zabbix/__init__.py
dbaas_zabbix/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from dbaas_api import DatabaseAsAServiceApi from provider_factory import ProviderFactory def factory_for(**kwargs): databaseinfra = kwargs['databaseinfra'] del kwargs['databaseinfra'] dbaas_api = DatabaseAsAServiceApi(databaseinfra) return ProviderFactor...
Python
0.000001
@@ -44,16 +44,29 @@ *-%0Afrom +dbaas_zabbix. dbaas_ap @@ -101,16 +101,29 @@ pi%0Afrom +dbaas_zabbix. provider
88659c4fae533e4550fd8f56a1b25f4b98980cfd
add last update time for datapackage.json
ddf_utils/datapackage.py
ddf_utils/datapackage.py
# -*- coding: utf-8 -*- """functions for datapackage.json""" import os import re import json import csv import logging from .model.package import Datapackage from collections import OrderedDict def get_datapackage(path, use_existing=True, update=True): """get the datapackage.json from a dataset path, create one ...
Python
0
@@ -113,16 +113,58 @@ logging%0A +from datetime import datetime%0Aimport pytz%0A from .mo @@ -3096,16 +3096,118 @@ %5D = lang +%0A datapackage%5B'last_updated'%5D = datetime.today().astimezone(pytz.utc).strftime(%22%25Y-%25m-%25d %25H:%25M:%25S%22) %0A%0A #
6fe4f4bc8b4b564e8111aba162c00aaf7a4fc057
Make is_local=False
demo/fit_a_line/train.py
demo/fit_a_line/train.py
import paddle.v2 as paddle import pcloud.dataset.uci_housing as uci_housing def main(): # init paddle.init() # network config x = paddle.layer.data(name='x', type=paddle.data_type.dense_vector(13)) y_predict = paddle.layer.fc(input=x, size=1, act=paddle.activation.Linear()) y = paddle.layer.da...
Python
0.999999
@@ -677,16 +677,32 @@ ptimizer +, is_local=False )%0A%0A f
8dd7f378b7ff870a2492805edeeacd8246a8af89
allow base_url with path (#2620)
checks.d/marathon.py
checks.d/marathon.py
# (C) Datadog, Inc. 2014-2016 # (C) graemej <graeme.johnson@jadedpixel.com> 2014 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib from urlparse import urljoin # 3rd party import requests # project from checks import AgentCheck class Marathon(AgentCheck): DEFAULT_TIMEOUT =...
Python
0.001214
@@ -1253,17 +1253,16 @@ n(url, %22 -/ v2/apps%22
860e16f506d0a601540847fe21e617d8f7fbf882
Add pickle convert to json method
malware/pickle_tool.py
malware/pickle_tool.py
import os import cPickle as pickle import simplejson as json def update_pickle(new_cache): # print('Updated pickle') pickle.dump(new_cache, open('url_cache.pkl', 'wb'), 2) def check_pickle(): # print('Checking in pickle') if not os.path.isfile('url_cache.pkl'): malicious_url = {} pic...
Python
0.999068
@@ -934,24 +934,241 @@ 59-1%22)%0A return cache%0A +%0A%0Adef pickle2json(pkl):%0A if os.path.isfile(pkl):%0A cache = pickle.load(open(pkl, 'rb'))%0A with open('pkl2json.json', 'wb') as fp:%0A json.dump(cache, fp)%0A else:%0A print %22No such file%22%0A
c11bd08412bf13758dabf30f638f10e91f2f8a73
Add environment flag for redirecting http to https
democracylab/settings.py
democracylab/settings.py
""" Django settings for democracylab project. Generated by 'django-admin startproject' using Django 1.11.1. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ impo...
Python
0
@@ -3975,16 +3975,97 @@ ', '')%0A%0A +SECURE_SSL_REDIRECT = os.environ.get('DL_SECURE_SSL_REDIRECT', False) == 'True'%0A%0A # TODO: @@ -4085,24 +4085,25 @@ n production +s %0A# SESSION_C
1a3cda9c2148bac85d9db5fa6ef221360697b07c
Tidying. Remove some redundant code
DatabaseServer/mysql_abstraction_layer.py
DatabaseServer/mysql_abstraction_layer.py
# This file is part of the ISIS IBEX application. # Copyright (C) 2012-2016 Science & Technology Facilities Council. # All rights reserved. # # This program is distributed in the hope that it will be useful. # This program and the accompanying materials are made available under the # terms of the Eclipse Public License...
Python
0.999999
@@ -2017,189 +2017,74 @@ (e)%0A - else:%0A try:%0A self._curs = self._conn.cursor()%0A except Exception as e:%0A raise Exception(e)%0A%0A def close_connection(self) +%0A def close_connection(self):%0A if self._conn is not None :%0A @@ -2085,34 ...
de6fea0ead5a8d2c7ffe65e1bb07249ad6823c69
bump cifparser version to 0.0.2
cifparser/version.py
cifparser/version.py
# Copyright 2015 Michael Frank <msfrank@syntaxjockey.com> # # This file is part of cifparser. cifparser is BSD-licensed software; # for copyright information see the LICENSE file. __version__ = (0, 0, 1) def versionstring(): """ Return the version number as a string. """ return "%i.%i.%i" % __version...
Python
0
@@ -196,17 +196,17 @@ (0, 0, -1 +2 )%0A%0Adef v
a45c2e9cd7190dc09fadc41e936cb3bc61d90056
Fix "already implemented" error.
ckanext/qa/plugin.py
ckanext/qa/plugin.py
import logging import types import ckan.model as model import ckan.plugins as p from ckanext.archiver.interfaces import IPipe from ckanext.qa.logic import action, auth from ckanext.qa.model import QA, aggregate_qa_for_a_dataset from ckanext.qa import helpers from ckanext.qa import lib from ckanext.report.interfaces i...
Python
0
@@ -1878,211 +1878,648 @@ urn -get_functions(action)%0A%0A # IAuthFunctions%0A%0A def get_auth_functions(self):%0A return get_functions(auth)%0A%0A # ITemplateHelpers%0A%0A def get_helpers(self):%0A return get_functions(helpers) +%7B%0A 'qa_resource_show': action.qa_resource_show,...
d7bab03e01ffb20cb3e081b06a7b5a51ab195508
Change Elements to strings in comp_dict.
mpinterfaces/mat2d/pourbaix/analysis.py
mpinterfaces/mat2d/pourbaix/analysis.py
""" Create pourbaix diagrams for 2D materials against their ions in solution using the scheme outlined in PHYSICAL REVIEW B 85, 235438 (2012) """ from __future__ import print_function, division, unicode_literals import os import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from matplotlib.patches ...
Python
0
@@ -5161,16 +5161,23 @@ ct = %7Bel +.symbol : 1/len(
11cf5c092cb71adb5713c414c585afca3586ff1a
Bump version - v0.2.0
flake8diff/__init__.py
flake8diff/__init__.py
__version__ = '0.1.2' __all__ = ['__version__']
Python
0
@@ -14,11 +14,11 @@ '0. -1.2 +2.0 '%0A%0A_
74ac930e77621cac426ac1c5fb806c4f02121a47
Comment plotting lines
Exercises/Exercise_3/part_2/problem2_3.py
Exercises/Exercise_3/part_2/problem2_3.py
#from mpl_toolkits.mplot3d import Axes3D #import matplotlib.pyplot as plt import numpy as np import sys import csv class LinearRegression: """ Class implementing Linear Regression """ pass def __init__(self, inputFile, learning_rate = 0.01): # Open file input = np.loadtxt(open(inputFile, '...
Python
0
@@ -988,24 +988,25 @@ e()%0A +# self.ax = fi
5c35a57d703b2627f9f8903841e8115c2e1606e4
add io
meinheld/middleware.py
meinheld/middleware.py
from meinheld import server import greenlet CLIENT_KEY = 'meinheld.client' CONTINUATION_KEY = 'meinheld.continuation' class Continuation(object): def __init__(self, client): self.client = client def suspend(self): return server._suspend_client(self.client) def resume(self, *args, **...
Python
0.00001
@@ -111,16 +111,36 @@ nuation' +%0AIO_KEY = 'wsgix.io' %0A%0Aclass @@ -562,86 +562,164 @@ -g = greenlet.greenlet(self.app)%0A %0A client = environ%5BCLIENT_KEY%5D%0A +client = environ%5BCLIENT_KEY%5D%0A g = client.get_greenlet()%0A if not g:%0A # new greenlet%0A ...
7e9b594ba72b488f82d5758c4f516b6ea9153255
Replace logging with print statements in the worker
fmn/consumer/worker.py
fmn/consumer/worker.py
# FMN worker figuring out for a fedmsg message the list of recipient and # contexts import json import logging import time import random import fmn.lib import fmn.rules.utils import fedmsg import fedmsg.meta import fedmsg_meta_fedora_infrastructure from fedmsg_meta_fedora_infrastructure import fasshim import pika ...
Python
0.000008
@@ -3520,34 +3520,13 @@ -log.debug(%0A +print %22Do @@ -3558,25 +3558,28 @@ %250.2fs %25s%22 -, + %25 ( %0A @@ -4073,26 +4073,22 @@ IG)%0A -log.debug( +print %22results @@ -4109,18 +4109,20 @@ %250.2fs%22 -, +%25 ( time.tim @@ -4135,26 +4135,22 @@ t)%0A%0A -log.de...
996f110415cfb1f84ec6171f0b1a362b537685d8
Fix "invalid escape sequence \s" deprecation warning
form_designer/email.py
form_designer/email.py
import re import django from django.core.mail import EmailMessage from django.utils.encoding import force_text from form_designer.utils import string_template_replace DJANGO_18 = django.VERSION[:2] >= (1, 8) def _template_replace_list(input_str, context_dict): """ Split the input string by commas or semico...
Python
0.998825
@@ -749,16 +749,17 @@ compile( +r '%5Cs*%5B,;%5D
122a784edc0e884f590739eefc40810ad4fe603d
fix course url, add script ids
notebooks/computer_vision/track_meta.py
notebooks/computer_vision/track_meta.py
track = dict( author_username='ryanholbrook', course_name='Computer Vision', course_url='https://www.kaggle.com/ryanholbrook/computer-vision', course_forum_url='https://www.kaggle.com/learn-forum', ) TOPICS = [ 'The Convolutional Classifier', 'Convolution and ReLU', 'Maximum Pooling', '...
Python
0
@@ -117,28 +117,21 @@ gle.com/ -ryanholbrook +learn /compute @@ -1240,39 +1240,65 @@ nable_gpu=True,%0A + scriptid=10781907%0A ),%0A - dict(%0A @@ -1360,32 +1360,58 @@ ype='exercise',%0A + scriptid=11989557%0A ),%0A dict( @@ -1480,32 +1480,58 @@ ype='exercise',%0A + scr...
92157285a21b838b11fe74297e9c2ae55fdfcfa8
Allow for logging into file.
src/pudl/cli.py
src/pudl/cli.py
"""A command line interface (CLI) to the main PUDL ETL functionality. This script generates datapacakges based on the datapackage settings enumerated in the settings_file which is given as an argument to this script. If the settings has empty datapackage parameters (meaning there are no years or tables included), no d...
Python
0
@@ -2125,16 +2125,131 @@ uction%22) +%0A parser.add_argument(%0A %22--logfile%22, default=None,%0A help=%22If specified, write logs to this file.%22) %0A%0A ar @@ -2661,16 +2661,196 @@ s.argv)%0A + if args.logfile:%0A file_logger = logging.FileHandler(args.logfile)%0A file_logger...
981329235f9b8e8629d993e63e1215dd94e4e0d7
Add extra checks in the body and header comparisons
ooni/nettests/blocking/http_requests.py
ooni/nettests/blocking/http_requests.py
# -*- encoding: utf-8 -*- # # :authors: Arturo Filastò # :licence: see LICENSE import random from twisted.python import usage, failure from ooni.utils import log from ooni.utils.net import userAgents from ooni.templates import httpt from ooni.errors import failureToString class UsageOptions(usage.Options): optP...
Python
0
@@ -4653,16 +4653,69 @@ ontrol:%0A + if experiment.body and control.body:%0A @@ -4801,16 +4801,18 @@ + len(expe @@ -4825,16 +4825,75 @@ .body))%0A + if experiment.headers and control.headers:%0A @@ -4934,16 +4934,19 @@ eaders,%0A +
273c72db94c9dabb8448f6e619459303b35a8bdc
Revert "fix virtualenv sys.path"
src/pycd/cli.py
src/pycd/cli.py
#!/usr/bin/env python # import os import sys from clint.textui import colored, puts, indent from clint.eng import join as eng_join from clint import Args from .package import get_package_paths this_dir = os.path.dirname(__file__) def cmd_help(args): is_data_only = False if args.contains(('--data-only')): ...
Python
0
@@ -1084,14 +1084,17 @@ path - = %5B'' +.insert(0 , en @@ -1098,17 +1098,17 @@ env_lib -%5D +) %0A%0A ar
5e85d4d9ab5de2f2bea12132089dedf7ded81f09
Fix task_done() call.
statbot/crawler.py
statbot/crawler.py
# # crawler.py # # statbot - Store Discord records for later analysis # Copyright (c) 2017 Ammon Smith # # statbot is available free of charge under the terms of the MIT # License. You are free to redistribute and/or modify it under those # terms. It is distributed in the hopes that it will be useful, but # WITHOUT ANY...
Python
0.000191
@@ -6469,38 +6469,32 @@ 1)%0A%0A -await self.queue.task_
054576df74046701efe861c68724e99c6bb45d1e
Fix broken unit tests
opentreemap/treemap/tests/middleware.py
opentreemap/treemap/tests/middleware.py
from django.test import TestCase from django.conf import settings from django.http import HttpResponseRedirect from opentreemap.middleware import InternetExplorerRedirectMiddleware class USER_AGENT_STRINGS: IE_6 = 'Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1)' IE_7 = 'Mozilla/4.0 (compatible; MSIE 7.0; ...
Python
0.000008
@@ -1,20 +1,155 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import print_function%0Afrom __future__ import unicode_literals%0Afrom __future__ import division%0A%0A from django.test imp @@ -239,16 +239,64 @@ edirect%0A +from django.test.utils import override_settings%0A from ope @@ -962,16 +962,57 @@ %7D%0A%0A...
4138b4ae840fb44d7da563a56005fe8aa0d9f920
fix except syntax error
django_peeringdb/sync.py
django_peeringdb/sync.py
import datetime from django.core.exceptions import ValidationError, ObjectDoesNotExist, FieldDoesNotExist from django.db import models from django_peeringdb import settings from decimal import Decimal import logging def sync_obj(cls, row): try: obj = cls.objects.get(pk=row['id']) except cls.DoesNotE...
Python
0.000006
@@ -483,17 +483,19 @@ NotExist -, + as inst:%0A
d4349db6f2bb3ce521648bf5f13978ceeb5bd7d9
Tweak status thresholds
functions/eitu/main.py
functions/eitu/main.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, re, sys, logging import pytz, requests from datetime import datetime, timedelta from jinja2 import Environment, FileSystemLoader import ics_parser URL_STUDY_ACTIVITIES = 'https://dk.timeedit.net/web/itu/db1/public/ri6Q7ZYQQZ0Z6gQ9Q1gfQvXx5fY90Zc0nY5yZo.ics' URL...
Python
0.000001
@@ -1416,17 +1416,17 @@ ients %3E -0 +1 : return
aae9902a42cf4f3c1d7cb5357b64dc21545b55cb
Add method Skeleton.update_locales(locales) to run update_locales on all the LocalizedFields. Also import only the necessary fields
structures/base.py
structures/base.py
#!/usr/bin/python # -*- coding: utf-8 -*- import copy from .fields import * from ..logger import log ########## ## Core ## ########## class DBStructure(list): """ A database structure. """ signature = "WDBC" def __init__(self, build=0, parent=None): self.name = type(self).__name__.lower() self...
Python
0
@@ -72,17 +72,81 @@ import -* +DynamicFieldsBase, IDField, LocalizedFields, RecLenField, LOCALES %0D%0Afrom . @@ -2285,18 +2285,20 @@ fore))%0D%0A -%0D%0A +%09%0D%0A%09 %0D%0A%09def a @@ -2370,26 +2370,27 @@ end(field)%0D%0A +%09 %0D%0A - %09def delete_ @@ -2455,18 +2455,20 @@ self%5D%0D%0A +%09%09 %0D%0A -...
a6a693aff12e7c45ea0e762683a7ea5ed35cdd84
Set initial log-level to DEBUG
coalib/coala_main.py
coalib/coala_main.py
import os import platform import pip from pyprint.ConsolePrinter import ConsolePrinter from coalib import coala_delete_orig, VERSION from coalib.misc.Exceptions import get_exitcode from coalib.output.Interactions import fail_acquire_settings from coalib.output.printers.LogPrinter import LogPrinter from coalib.output....
Python
0
@@ -294,16 +294,71 @@ Printer%0A +from coalib.output.printers.LOG_LEVEL import LOG_LEVEL%0A from coa @@ -2658,16 +2658,33 @@ rinter() +, LOG_LEVEL.DEBUG )%0A%0A e
406ea2fb536af48d1d4ea6b9ae9e7d23d2d0dd20
Fix doctest
coalib/misc/Shell.py
coalib/misc/Shell.py
from contextlib import contextmanager import platform import shlex from subprocess import PIPE, Popen from shutil import which class ShellCommandResult(tuple): """ The result of a :func:`coalib.misc.run_shell_command` call. It is based on a ``(stdout, stderr)`` string tuple like it is returned form `...
Python
0.002138
@@ -547,25 +547,128 @@ -c', - 'print(input() + +%0A ... 'import sys; print(sys.stdin.readline().strip() +'%0A ... ' %22 p @@ -852,16 +852,38 @@ 'data')%0A + %3E%3E%3E stderr%0A ''%0A %3E%3E%3E
c428c38290f6410abe607fa082492feae0be985c
comment on current status
cocrawler/burners.py
cocrawler/burners.py
''' Python's multiprocess library doesn't work with async/await. Given that I am lazy, this file implements a similarish thing as a RESTish server. This module starts the server(s) and is the client. The best usage of this is to have a single call do a lot of processing, and return a lot of results. For example, all ...
Python
0
@@ -533,16 +533,262 @@ parent? +%0A%0ASo far this service is way too slow -- maybe 7 MB/elapsed second. I%0Adon't think it helps that we have to go str -%3E bytes -%3E str, over the%0Aloopback, all that crap. Straight passing through memory (like%0Amultiprocessing does) has got to be faster. %0A'''%0A%0Aim
f150db45502a172982cb50ec0d7320a6b1d10c72
make the queue thing represent itself well
gamechat/chat/views.py
gamechat/chat/views.py
from django.views.decorators.csrf import csrf_exempt from django.shortcuts import render, redirect from django.shortcuts import render, get_object_or_404 from django.http import JsonResponse from chat.models import ChatRoom from gevent import queue class QueueContainer(object): def __new__(cls, *args, **kwargs): ...
Python
0.000002
@@ -541,16 +541,115 @@ stance%0A%0A + def __repr__(self):%0A return %22%7B%7D: %7B%7D%22.format(id(self._container), str(self._container))%0A%0A def
3662fa3f0b9c05305e6695ececd1e0101230504e
Add missing DoesNotExistError import
swf/models/base.py
swf/models/base.py
# -*- coding:utf-8 -*- # Copyright (c) 2013, Theo Crevon # Copyright (c) 2013, Greg Leclercq # # See the file LICENSE for copying permission. from collections import namedtuple, OrderedDict from swf.core import ConnectedSWFObject Difference = namedtuple('Difference', ('attr', 'local', 'upstream')) class ModelDif...
Python
0.000417
@@ -226,16 +226,61 @@ FObject%0A +from swf.exceptions import DoesNotExistError%0A %0A%0ADiffer @@ -1835,16 +1835,17 @@ ) for k, + v%0A
a6362b702b5494146a6c9e1d5accf03797fee981
Reduce duplication of settings name
src/settings.py
src/settings.py
import sublime class Settings(): @staticmethod def load(): return sublime.load_settings('Format.sublime-settings') @staticmethod def save(): sublime.save_settings('Format.sublime-settings') @staticmethod def on_change(callback): Settings.load().add_on_change('Format.s...
Python
0.99994
@@ -24,24 +24,73 @@ Settings():%0A + FORMAT_SETTINGS = 'Format.sublime-settings'%0A%0A @staticm @@ -152,33 +152,32 @@ ngs( -'Format.sublime-settings' +Settings.FORMAT_SETTINGS )%0A%0A @@ -243,33 +243,32 @@ ngs( -'Format.sublime-settings' +Settings.FORMAT_SETTINGS )%0A%0A @@ -355,33 +355,32 @@ nge( -'For...
8bd18fee6543ab4e93d0f5b662caa01169f10f23
Add the function to specify an Axes object for a colorbar
ph_plotter/band_density_mesh_plotter.py
ph_plotter/band_density_mesh_plotter.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) __author__ = "Yuji Ikeda" import numpy as np from matplotlib.ticker import AutoMinorLocator from .plotter import Plotter, read_band_labels from .file_io import rea...
Python
0.000001
@@ -4237,16 +4237,25 @@ elf, fig +, ax=None ):%0A @@ -4364,16 +4364,23 @@ ad_mesh, + ax=ax, extend=
dce20a6c0323ad919498062bb742d87b846d1d1c
Fix problem with encoding in user name
tahiti/app_auth.py
tahiti/app_auth.py
# -*- coding: utf-8 -*-} import json import logging import re from collections import namedtuple from functools import wraps import requests from flask import request, Response, current_app, g as flask_g User = namedtuple( "User", "id, login, email, name, first_name, last_name, locale, roles") MSG1 = 'Could not ...
Python
0.893479
@@ -49,18 +49,8 @@ ing%0A -import re%0A from @@ -2731,52 +2731,8 @@ me'%5D -.encode(%0A 'utf8') ,%0A @@ -2801,52 +2801,8 @@ me'%5D -.encode(%0A 'utf8') ),%0A
be4c5e06ba8edade7c38db02b08313628627f0d5
fix default api_param
tapioca/tapioca.py
tapioca/tapioca.py
# coding: utf-8 from __future__ import unicode_literals import copy import requests import webbrowser from .exceptions import ResponseProcessException class TapiocaInstantiator(object): def __init__(self, adapter_class): self.adapter_class = adapter_class def __call__(self, *args, **kwargs): ...
Python
0.000003
@@ -515,18 +515,20 @@ _params= -%7B%7D +None , resour @@ -675,16 +675,22 @@ i_params + or %7B%7D %0A
93a1359f01d936891f51fca1c9b5f3272dc36bf9
update master prefix
giantcellsim_master.py
giantcellsim_master.py
import sys import getopt from giantcellsim_motifoutput import giantcellsim_motifoutput from giantcellsim_fulltrialoutput import giantcellsim_fulltrialoutput from giantcellsim_allstrandoutput import giantcellsim_allstrandoutput def usage(): print "Running a Motif Simulation using the parameters designated by options\...
Python
0.000001
@@ -2438,12 +2438,8 @@ = ' -TEST Gian
cb9e234600c3f06c7dec084d2055f4a52b1f5975
Update urls.py
monitcollector/urls.py
monitcollector/urls.py
"""prettymonit URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class...
Python
0.000002
@@ -1,18 +1,21 @@ %22%22%22 -prettymonit +monitcollector URL
3144b548d58f219b573d82bbb2d1bfee171061d9
Fix history view after merge
gitfs/views/history.py
gitfs/views/history.py
import os from stat import S_IFDIR from errno import ENOENT from fuse import FuseOSError from gitfs.log import log from .read_only import ReadOnlyView class HistoryView(ReadOnlyView): def getattr(self, path, fh=None): ''' Returns a dictionary with keys identical to the stat C structure of ...
Python
0.000001
@@ -640,17 +640,21 @@ in self. -_ +repo. get_comm
c4f1dd1d8054a87416f478f684785627b5110381
Fix syntax error in case of multiple results
movienamer/identify.py
movienamer/identify.py
import os.path as path import re import Levenshtein from .sanitize import sanitize from .tmdb import search def _gather(filename, directory=None, titles={}): # Sanitize the input filename name, year = sanitize(filename) # Start with a basic search results = search(name, year) if year is not No...
Python
0.000997
@@ -1781,24 +1781,23 @@ ctory = -identify +_gather (dirname @@ -2361,46 +2361,394 @@ -results = _gather(filename, directory) +if directory == '' or directory == '.' or directory == '..':%0A directory = None%0A%0A results = _gather(filename, directory)%0A for i, result in enumerate(results):%0A ...
e3e52d63a05d0373a91a4cac746ad09dbbc42f13
Remove filesystem signal for stopping speech
mycroft/audio/utils.py
mycroft/audio/utils.py
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
Python
0.000161
@@ -638,23 +638,8 @@ gnal -, create_signal %0A%0A%0Ad @@ -1392,41 +1392,8 @@ end%0A - create_signal('stoppingTTS')%0A @@ -1528,72 +1528,4 @@ 25)%0A -%0A # This consumes the signal%0A check_for_signal('stoppingTTS')%0A
c9c2cb0661de4a0fd955068acc5a1c7dbc2de790
update tests
test/test_fasta.py
test/test_fasta.py
import os from sequana import FastA, sequana_data from sequana.fasta import is_fasta from easydev import TempFile def test_format_contigs_denovo(): # test with a custom fasta filename = sequana_data("test_fasta.fasta") contigs = FastA(filename) with TempFile(suffix='.fasta') as fh: contigs.f...
Python
0.000001
@@ -401,16 +401,117 @@ comments +%0A contigs.GC_content()%0A contigs.GC_content_sequence(contigs.sequences%5B0%5D)%0A contigs.summary() %0A%0Adef te @@ -1620,24 +1620,88 @@ me=fh.name)%0A + ff.select_random_reads(100000, output_filename=fh.name)%0A assert f
e7954822d9c941b84917c4ec4a0a2f5357c9751b
Fix test to make it compatible with further changes
test/test_model.py
test/test_model.py
# coding: utf-8 import os, sys sys.path.append(os.path.join(sys.path[0], '..')) from carlo import Model, ModelException, eq, int_val, string_val import pytest def test_minimal_model(): m = Model(const={'int': int_val(42)}).build() assert [('const', {'int': 42})] == m.create() m = Model(const2={'str': stri...
Python
0
@@ -1123,14 +1123,8 @@ val( -'west' )%7D,%0A
2933ac6a0ecdd18763a528559d2813512d309873
Add Unit Tests for utils.py
test/test_utils.py
test/test_utils.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2016: # Matthieu Estrada, ttamalfor@gmail.com # # This file is part of (AlignakApp). # # (AlignakApp) 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 Sof...
Python
0
@@ -1452,24 +1452,1278 @@ pp_config)%0A%0A + def test_set_app_config(self):%0A %22%22%22Reload config%22%22%22%0A%0A # Reset and Init %22app_config%22%0A utils.app_config = None%0A self.assertIsNone(utils.app_config)%0A utils.init_config()%0A%0A # Get current url%0A ...
981696170729881af1f77994ada06385cb2fe3dc
append leading 0 to temp file name to help with getting things in order.
myth_commercial_cut.py
myth_commercial_cut.py
#!/usr/bin/env python from decimal import * getcontext().prec = 40 import os from math import ceil import sys import base64 import uuid import subprocess import ConfigParser import StringIO import shutil try: import MySQLdb except ImportError: print('You need to install the MySQLdb python module in o...
Python
0
@@ -5030,16 +5030,22 @@ tf = + '0' + str(i)
75379d0510961c8a88251de38c87ea3fe4f31542
Fix CORS headers configuration.
greenlight/settings.py
greenlight/settings.py
# Django settings for greenlight project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS TIME_ZONE = 'America/Montreal' USE_I18N = False SECRET_KEY = '9&amp;@r*3hth4m=ml5t5tme0*(9^x@2xqo-ua^s+wg_ws(-^4-7@v' MIDDLEWARE_CLASSES = ( 'django.middleware...
Python
0
@@ -340,16 +340,58 @@ eware',%0A +%09'corsheaders.middleware.CorsMiddleware',%0A )%0A%0AROOT_ @@ -508,16 +508,33 @@ ensions' +,%0A%09'corsheaders', %0A)%0A%0ACORS
2b4ccb7b7dd9bf24d74fc686c7f4296cfe34db51
Add registration functions to `reg`
nanshe_workflow/reg.py
nanshe_workflow/reg.py
Python
0
@@ -0,0 +1,1991 @@ +from builtins import range as irange%0A%0Aimport numpy%0Aimport scipy.ndimage%0A%0Aimport dask%0Aimport dask.array%0A%0A%0Adef fourier_shift_wrap(array, shift):%0A result = numpy.empty_like(array)%0A for i in irange(len(array)):%0A result%5Bi%5D = scipy.ndimage.fourier_shift(array%5Bi%5...
7ee30ea1606122e97119ca7190f080c2ed105f6a
fix support title handling + better find budget items for bad takanas
processors/fix_support_budget_titles.py
processors/fix_support_budget_titles.py
import json import logging if __name__ == "__main__": input = sys.argv[1] output = sys.argv[2] processor = fix_changeline_budget_titles().process(input,output,[]) class fix_support_budget_titles(object): def process(self,inputs,output): out = [] budgets = {} supports_jsons,...
Python
0
@@ -288,16 +288,60 @@ ets = %7B%7D +%0A budgets2 = %7B%7D%0A supports = %7B%7D %0A%0A @@ -528,16 +528,267 @@ 'title'%5D +%0A budgets2.setdefault(%22%25(year)s/%25(title)s%22 %25 line,%5B%5D).add(line%5B'code'%5D)%0A%0A for line in file(supports_jsons):%0A line = json....
28d0f14a172821657ec7f17cfaf0ffb95f5ff8f8
Make sure the right python path is used for plugins.
py2app/bundletemplate/plist_template.py
py2app/bundletemplate/plist_template.py
import sys import py2app __all__ = ['infoPlistDict'] def infoPlistDict(CFBundleExecutable, plist={}): CFBundleExecutable = unicode(CFBundleExecutable) NSPrincipalClass = u''.join(CFBundleExecutable.split()) version = sys.version[:3] pdict = dict( CFBundleDevelopmentRegion=u'English', CF...
Python
0.0046
@@ -1099,16 +1099,168 @@ ckages=%5B + (s %25 version) for s in %5B%0A u'lib/python%25s',%0A u'lib/python%25s/lib-dynload',%0A u'lib/python%25s/site-packages.zip',%0A %5D %5D,%0A
4b6dd813d489a96b3d4031a33d7cf6fe6c7a4cf7
Fix typo in create entity operation.
pyhaystack/client/ops/vendor/widesky.py
pyhaystack/client/ops/vendor/widesky.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ VRT WideSky operation implementations. """ import hszinc import fysom import json import base64 import shlex from ....util import state from ....util.asyncexc import AsynchronousException from ..entity import EntityRetrieveOperation class WideskyAuthenticateOperatio...
Python
0
@@ -5224,32 +5224,90 @@ te.%0A %22%22%22%0A + self._log = session._log.getChild('create_entity') %0A super(C @@ -6300,16 +6300,19 @@ stance(e +_id , hszinc
3adfc96892b0f45a5d95164f81cea75d02b2df0d
add missing dependency
gyp/SimpleCocoaApp.gyp
gyp/SimpleCocoaApp.gyp
{ 'targets': [ { 'target_name': 'SimpleCocoaApp', 'type': 'executable', 'mac_bundle' : 1, 'include_dirs' : [ '../experimental/SimpleCocoaApp/', ], 'sources': [ '../src/views/mac/SkEventNotifier.h', '../src/views/mac/SkEventNotifier.mm', '../src/v...
Python
0.00002
@@ -921,24 +921,51 @@ .gyp:opts',%0A + 'ports.gyp:ports',%0A 'uti
50647e0c5033fb397d0acd5440427c6002bab510
implement merging by process
PyAnalysisTools/ROOTUtils/ObjectHandle.py
PyAnalysisTools/ROOTUtils/ObjectHandle.py
__author__ = 'marcusmorgenstern' __mail__ = 'marcus.matthias.morgenstern@cern.ch' # helper methods to deal with objects def get_objects_from_canvas(canvas): # todo: add logger warning for empty canvas obj = [canvas.GetPrimitive(key.GetName()) for key in canvas.GetListOfPrimitives()] return obj def get...
Python
0.000001
@@ -460,24 +460,583 @@ e), obj)%0A return obj%0A +%0A%0Adef merge_objects_by_process_type(canvas, process_config, merge_type):%0A objects = get_objects_from_canvas_by_type(canvas, %22TH1%22)%0A if len(objects) == 0:%0A return None%0A first_object = objects%5B0%5D%0A variable = %22_%22.join(first_...
7065051f2171ac154c2174bfb0595a0cc1131141
Test for the mixed-precision training.
python/test/solver/solver_test_utils.py
python/test/solver/solver_test_utils.py
# Copyright (c) 2017 Sony Corporation. 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 applicabl...
Python
0
@@ -2957,32 +2957,1075 @@ .d, atol=atol)%0A%0A + # Check inf, nan, and inf/nan%0A for v, method in zip(%5B%5Bnp.inf%5D, %5Bnp.nan%5D, %5Bnp.inf, np.nan%5D%5D,%0A %5Blambda s: s.check_inf_grad(),%0A lambda s: s.check_nan_grad(),%0A lambda s...
a032f92300802db664bdc7c21d6d300b72dab3a2
change so that it works with split base/root url
tests/test_base.py
tests/test_base.py
import unittest from requests import HTTPError from kbcstorage.base import Endpoint class TestEndpoint(unittest.TestCase): """ Test Endpoint functionality. """ def setUp(self): self.root = 'https://httpbin.org' self.token = '' def test_get(self): """ Simple get w...
Python
0.000001
@@ -9,16 +9,25 @@ nittest%0A +import os %0Afrom re @@ -50,17 +50,16 @@ TPError%0A -%0A from kbc @@ -222,29 +222,37 @@ t = -'https://httpbin.org' +os.getenv('KBC_TEST_API_URL') %0A @@ -270,16 +270,26 @@ oken = ' +some-token '%0A%0A d @@ -311,58 +311,8 @@ f):%0A - %22%22%22%0A Simple get wor...
a198bbd875d56bc0132f28553f09b3ffae69fc4f
clean code
readthedocs/vcs_support/backends/svn.py
readthedocs/vcs_support/backends/svn.py
# -*- coding: utf-8 -*- """Subversion-related utilities.""" from __future__ import ( absolute_import, division, print_function, unicode_literals, ) import csv from builtins import str from six import StringIO # noqa from readthedocs.projects.exceptions import RepositoryError from readthedocs.vcs_su...
Python
0.000008
@@ -1692,54 +1692,19 @@ +base_ url = -'%7Bbase_url%7D/%7Btag%7D'.format(base_url=self. base @@ -1723,14 +1723,27 @@ '/') -, +%0A tag -= + = iden @@ -1760,16 +1760,63 @@ rip('/') +%0A url = '%7B%7D/%7B%7D'.format(base_url, tag )%0A
41e8a16e950421677086575dd72592563fa52598
fix space
timepiece/forms.py
timepiece/forms.py
from django import forms from timepiece.models import Project, Activity, Entry from timepiece.fields import PendulumDateTimeField from timepiece.widgets import PendulumDateTimeWidget from datetime import datetime from timepiece import models as timepiece from crm import models as crm class ClockInForm(forms.ModelFor...
Python
0.001366
@@ -1590,36 +1590,32 @@ 'comments')%0A - %0A def save(se
d9ed86a28ba2eaca3f2c013ef5ffdb38584868d9
Use double quotes instead of single.
compiler/doc/json.py
compiler/doc/json.py
import os import os.path import compiler.lang as lang class Component(object): def __init__(self, package, name, component): self.package = package self.name = name self.component = component def generate_section(self, r, type, title, data, comma): if type not in data: return values = data[type] r.a...
Python
0
@@ -3389,17 +3389,17 @@ end( -%22 +' %5Ct%5Ct%5Ct%5Ct '%25s' @@ -3398,15 +3398,15 @@ %5Ct%5Ct -'%25s': ' +%22%25s%22: %22 %25s/%25 @@ -3415,12 +3415,12 @@ json -'%25s%22 +%22%25s' %25(n
81c3f28fd199e9ba989299ddcad36560a76233e4
Revise comment for decreasing key
ds_min_priority_queue.py
ds_min_priority_queue.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np def parent(i): return i // 2 def left(i): return 2 * i def right(i): return 2 * i + 1 class MinPriorityQueue(object): """Min Priority Queue.""" def __init__(self): ...
Python
0
@@ -2142,18 +2142,18 @@ %0A%0A # -In +De crease k @@ -2159,15 +2159,14 @@ key -4 +8 to -15 +2 .%0A
73022d74d68c0aaad40536cc8557820659830be4
fix import
dvc/cloud/storage_aws.py
dvc/cloud/storage_aws.py
import sys, os, argparse, boto.ec2 from base_aws import AwsBase #logger, Logger class StorageTool(AwsBase): def __init__(self, homedir, conf_file): super().__init__(homedir, conf_file) def extend_args(self, parser): parser.add_argument('--size', metavar = '', type = int, ...
Python
0
@@ -33,16 +33,26 @@ c2%0Afrom +dvc.cloud. base_aws
9f9397bccb20e0c3376c211b487f8cba498a4498
Add CACHES to settings
dwitter/settings/base.py
dwitter/settings/base.py
""" Django settings for dwitter project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # B...
Python
0
@@ -5494,8 +5494,152 @@ omain%0A%7D%0A +%0ACACHES = %7B%0A 'default': %7B%0A 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',%0A 'LOCATION': 'dwitter-default',%0A %7D%0A%7D%0A
5ba72c9877d2f6e8400fae81bd88254d5b1db657
bump version
dynamic_rest/__init__.py
dynamic_rest/__init__.py
__version__ = "1.3.2"
Python
0
@@ -16,7 +16,7 @@ 1.3. -2 +3 %22%0A
688783ec544616d177540ae024b90e3c18d32680
disable heartbeat
hiispider/amqp/amqp.py
hiispider/amqp/amqp.py
import specs from twisted.internet.protocol import ClientCreator from twisted.internet import reactor from txamqp.client import TwistedDelegate from txamqp.protocol import AMQClient import txamqp.spec import sys def createClient(amqp_host, amqp_vhost, amqp_port=5672): amqp_spec = txamqp.spec.loadString(specs.v0_8...
Python
0.000001
@@ -512,9 +512,8 @@ eat= -1 0).c
27d78ce21f0b6243472653a540d7645e0e93a76a
Address task reliability
conf/celeryconfig.py
conf/celeryconfig.py
from datetime import timedelta import os from ast import literal_eval from celery.schedules import crontab from kombu import Queue from conf.appconfig import MONGODB_DB, MONGODB_URL TOTEM_ENV = os.getenv('TOTEM_ENV', 'local') CLUSTER_NAME = os.getenv('CLUSTER_NAME', TOTEM_ENV) MESSAGES_TTL = 7200 * 1000 # Broker a...
Python
0.000001
@@ -807,24 +807,77 @@ UT', '20'))%0A +BROKER_TRANSPORT_OPTIONS = %7B'confirm_publish': True%7D%0A BROKER_HEART
45c4c1f627f224f36c24acebbec43a17a5c59fcb
Print out file being processed, need to do to other modules, add -v flag
nib/plugins/lesscss.py
nib/plugins/lesscss.py
from __future__ import absolute_import, division, print_function, unicode_literals from os import path import sh from nib import Processor, resource @resource('.less') class LessCSSProcessor(Processor): def resource(self, resource): filepath = path.join(self.options['resource_path'], ...
Python
0
@@ -357,16 +357,56 @@ ension)%0A + print(%22Processing: %22, filepath)%0A
fb304cd1ae8c89db346fbc2d8d07b1f66f708964
Add “nimp check processes” to kill problematic processes.
nimp/commands/check.py
nimp/commands/check.py
# -*- coding: utf-8 -*- import sys import platform import os import unittest from nimp.commands._command import * from nimp.tests.utilities import file_mapper_tests from nimp.utilities.processes import * class CheckCommand(Command): def __init__(self): Command.__init__(self, 'check', 'Various checks a...
Python
0
@@ -487,12 +487,23 @@ nimp +, processes )',%0A - @@ -590,24 +590,160 @@ elf, env):%0A%0A + # Check running processes for possible issues%0A if env.mode == 'processes':%0A return self.check_processes(env)%0A%0A # Pr @@ -1178,16 +1178,16 @@ v.mode)%0A - @@ -1197,24 +1...
da010df9a5319d9451d97932d6ac1385442c5601
update call to savemat for compatibility
nipy/interfaces/spm.py
nipy/interfaces/spm.py
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ''' Interfaces to SPM ''' from __future__ import with_statement import os import numpy as np from scipy.io import savemat from nibabel import load from nibabel.tmpdirs import InTemporaryDirectory from ...
Python
0
@@ -1760,16 +1760,31 @@ , jobdef +, oned_as='row' )%0A
cd79906dbdb9758acdacdf6a251b21a54634ce29
Update version for v0.10.dev
elasticutils/_version.py
elasticutils/_version.py
# follow pep-386 # Examples: # * 0.3 - released version # * 0.3a1 - alpha version # * 0.3.dev - version in development __version__ = '0.9' __releasedate__ = '20140403'
Python
0
@@ -139,9 +139,14 @@ '0. -9 +10.dev '%0A__ @@ -166,14 +166,6 @@ = ' -20140403 '%0A
e6a31975fea0858e35e1f7c270639c3822543cfe
Version bump to 0.1.12
email_extras/__init__.py
email_extras/__init__.py
__version__ = "0.1.11"
Python
0
@@ -14,11 +14,11 @@ = %220.1.1 -1 +2 %22%0A
ec9258dcf3a2ca648c87c595752ea57eb9f9b943
insert doSth() at current position
nodejs_autocomplete.py
nodejs_autocomplete.py
import sublime import sublime_plugin class NodejsAutocompleteCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.insert(edit, 0, "Hello, World!")
Python
0.000001
@@ -114,16 +114,117 @@ edit):%0A +%09%09view = self.view%0A%09%09view_sel = view.sel()%0A%09%09if not view_sel:%0A%09%09%09return%0A%0A%09%09pos = view_sel%5B0%5D.begin()%0A %09%09self.v @@ -244,24 +244,22 @@ it, -0, %22Hello, World! +pos, %22.doSth() %22)%0A +%0A
e8e6c73ff1fd70e2fdf0c25321ce80719eb5ac89
Update groupsettings.py (#504)
samples/groupssettings/groupsettings.py
samples/groupssettings/groupsettings.py
#!/usr/bin/python # # Copyright 2014 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 b...
Python
0
@@ -1200,16 +1200,21 @@ port run +_flow %0A%0A%0A# CLI @@ -5608,16 +5608,21 @@ ls = run +_flow (FLOW, s
d28134b62ee4fdfb7676a65de54bc0e422c439e9
add link
sandbox/webapi/githubapi_listproject.py
sandbox/webapi/githubapi_listproject.py
#! /usr/bin/env python # -*- coding: utf-8 -*- import json import requests token ='' # get all the public projects of github.com #url = 'https://api.github.com/users/rboman/repos' url = 'https://api.github.com/orgs/ulgltas/repos' #url = 'https://api.github.com/orgs/math0471/repos' r = requests.get(url) #r = request...
Python
0
@@ -41,16 +41,107 @@ -8 -*-%0A%0A +# see https://developer.github.com/v3/repos/#list-repositories-for-the-authenticated-user%0A%0A import j
e241cc61de9de12a97d61615f9a868b4015589fe
parse complete movie program
schauburg_cal/spiders/program_spider.py
schauburg_cal/spiders/program_spider.py
import scrapy import datetime class ProgramSpider(scrapy.Spider): name = "program" allowed_domains = ["schauburg.de"] start_urls = ["http://schauburg.de/programm.php"] def parse(self, response): dates = response.xpath('/html/body/h5/text()').extract() movieLists = response.xpath('/html...
Python
0.999999
@@ -22,16 +22,78 @@ datetime +%0Aimport urlparse%0A%0Afrom schauburg_cal.items import MovieShowing %0A%0Aclass @@ -235,16 +235,53 @@ mm.php%22%5D +%0A base_url = %22http://schauburg.de%22 %0A%0A de @@ -551,16 +551,92 @@ eLists): +%0A%0A # construct scrapy item%0A showing = MovieShowing...
e246c83b0ef40d60d583ee1e9e278462da2cb637
Version bump to 0.14.1
homeassistant/const.py
homeassistant/const.py
# coding: utf-8 """Constants used by Home Assistant components.""" __version__ = "0.14.0" # Can be used to specify a catch all when registering state or event listeners. MATCH_ALL = '*' # If no name is specified DEVICE_DEFAULT_NAME = "Unnamed Device" # #### CONFIG #### CONF_ICON = "icon" CONF_LATITUDE = "latitude" ...
Python
0
@@ -81,17 +81,17 @@ = %220.14. -0 +1 %22%0A%0A# Can
10f9c049bb3d383f5ae575a1362cb56faad628b3
Version bump to 0.13.0.dev0
homeassistant/const.py
homeassistant/const.py
# coding: utf-8 """ Constants used by Home Assistant components. """ __version__ = "0.12.0" # Can be used to specify a catch all when registering state or event listeners. MATCH_ALL = '*' # If no name is specified DEVICE_DEFAULT_NAME = "Unnamed Device" # #### CONFIG #### CONF_ICON = "icon" CONF_LATITUDE = "latitude...
Python
0.000001
@@ -85,10 +85,15 @@ %220.1 -2. +3.0.dev 0%22%0A%0A
c00a73544735e00e1d61be382e7aecfffb164117
Fix consistency verification
src/verifier.py
src/verifier.py
import prover from bplib.bp import GTElem def step1(gk, A1, A2, g1_sum, g2_sum): return prover.step1c(gk, A1, A2, g1_sum, g2_sum) def step2(gk, n): p1 = [gk.q.random() for i in range(n)] p2 = [gk.q.random() for j in range(3)] p3 = [[gk.q.random() for j in range(3)] for i in range(n)] p...
Python
0
@@ -2045,23 +2045,29 @@ ir1 -+ +* pair2 -- +* pair3 +.inv() %0A%0A%0Ad @@ -2454,17 +2454,17 @@ r_numer -+ +* = e(do_i @@ -2568,17 +2568,17 @@ r_denom -+ +* = e(do_i @@ -2620,9 +2620,9 @@ mer -- +* out @@ -2629,16 +2629,22 @@ er_denom +.inv() == R%0A%0A%0A
ef036decf1ec13a52e0d98f4c1e60bdcba58de96
FIX numerate on priting editable
account_check/models/account_checkbook.py
account_check/models/account_checkbook.py
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import fields, models, api, _ import ...
Python
0
@@ -3322,39 +3322,16 @@ oolean(%0A - readonly=True,%0A @@ -3384,32 +3384,59 @@ nting?',%0A + # readonly=True,%0A # states=%7B'draft'
d886a8c50f3cd7cb961ae114fa82322f25303481
Change how backfill_meta_created works
acoustid/scripts/backfill_meta_created.py
acoustid/scripts/backfill_meta_created.py
#!/usr/bin/env python # Copyright (C) 2019 Lukas Lalinsky # Distributed under the MIT license, see the LICENSE file for details. import logging logger = logging.getLogger(__name__) def run_backfill_meta_created(script, opts, args): if script.config.cluster.role != 'master': logger.info('Not running bac...
Python
0.00003
@@ -368,16 +368,116 @@ rn%0A%0A +last_meta_id_query = %22%22%22%0A SELECT max(id) FROM meta WHERE created IS NULL%0A %22%22%22%0A%0A update_ query = @@ -615,66 +615,59 @@ _id -IN (SELECT id FROM meta WHERE created IS NULL LIMIT 10000) +%3E %25(first_meta_id)s AND meta_id %3C= %25(last_meta_id)s %...
41ad2bebb3827c1772eddfaa7cf4dc23495f68f2
document the three abstract methods
src/zazo/abc.py
src/zazo/abc.py
""" """ from __future__ import absolute_import import abc from six import add_metaclass if False: from packaging.requirements import Requirement # NOQA from packaging.version import Version # NOQA from typing import List # NOQA @add_metaclass(abc.ABCMeta) class Candidate(object): @abc.abstractm...
Python
0.999992
@@ -393,16 +393,88 @@ -%3E bool%0A + %22%22%22Does this candidate match the given requirement?%0A %22%22%22%0A @@ -541,16 +541,16 @@ lass.%22)%0A - %0A%0A@add_m @@ -800,16 +800,96 @@ didate%5D%0A + %22%22%22Get all the candidates that match the given requirement.%0A %22%22%22%0...
71b511f97a6efa70c00c6dfa827f73f2c0d6b8c7
update moment2 plot
tools/h5plotsim.py
tools/h5plotsim.py
#!/usr/bin/env python """Plot simulation results """ from __future__ import print_function import sys from matplotlib.pylab import * from h5py import File fname, _junk, gname = sys.argv[1].partition(':') data = File(fname) grp = data[gname or '/'] simtype = grp.attrs['sim_type'] print('sim_type', simtype) def...
Python
0
@@ -788,16 +788,389 @@ ngle')%0A%0A +def show_moment2(grp):%0A pos = grp%5B'pos'%5D%5B:%5D%0A avg = grp%5B'moment0'%5D%5B:%5D%0A rms = grp%5B'moment0_rms'%5D%5B:%5D%0A%0A rmsp, rmsn = avg+rms, avg-rms%0A%0A for i,L in zip(range(6), ('x','px','y','py','z','pz')):%0A subplot(3,2,i+1)%0A plot...
f547d131a3ad8d9c452a4583c080ac9d29b53709
bump version
noselog/__version__.py
noselog/__version__.py
__version__ = "0.0.1"
Python
0
@@ -16,7 +16,7 @@ 0.0. -1 +2 %22%0A