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
e267bf384a33e17c48101e4726975dae31a88563
Fix docstring for correlations.
scikits/talkbox/tools/correlations.py
scikits/talkbox/tools/correlations.py
import numpy as np from scipy.fftpack import fft, ifft __all__ = ['nextpow2', 'acorr'] def nextpow2(n): """Return the next power of 2 such as 2^p >= n. Notes ----- Infinite and nan are left untouched, negative values are not allowed.""" if np.any(n < 0): raise ValueError("n should be > 0...
Python
0
@@ -172,17 +172,16 @@ -----%0A -%0A Infi @@ -1270,28 +1270,24 @@ ----------%0A - x : arra @@ -1293,20 +1293,16 @@ ay-like%0A - @@ -1322,28 +1322,24 @@ relate.%0A - - axis : int%0A @@ -1337,20 +1337,16 @@ s : int%0A - @@ -1391,20 +1391,16 @@ mputed.%0A - ...
78d02e170f7f8d2b00a9420998d8ccaa98b67f0f
test commit-msg 3
versioner.py
versioner.py
#!/bin/env python import sys from optparse import OptionParser import os import re usage = "usage: %prog [options] file" version = "0.1.8.0" version_text = "%prog {}".format(version) opt = OptionParser(usage = usage, version = version_text) opt.add_option ("-l","--language" ,action = "store" ...
Python
0.000001
@@ -2608,17 +2608,16 @@ read())%0A -%0A
45918f696ff43815a15640b080b68b007c27b2f8
Clean-up query
scripts/analytics/preprint_summary.py
scripts/analytics/preprint_summary.py
import pytz import logging from dateutil.parser import parse from datetime import datetime, timedelta from django.db.models import Q from website.app import init_app from scripts.analytics.base import SummaryAnalytics logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) LOG_THRESHOLD = 11 ...
Python
0.999883
@@ -1013,16 +1013,33 @@ l=False, +%0A node__is @@ -1156,16 +1156,29 @@ atetime) +%0A ).count(
32aec3e5595fe0868b77260cb64be718d4e7f3b8
Update Keras.py
Momentum/Keras.py
Momentum/Keras.py
from keras.datasets import mnist from keras.initializers import RandomUniform from keras.layers import Dense from keras.models import Sequential from keras.optimizers import SGD from keras.utils import to_categorical batch_size = 128 epochs = 30 learning_rate = 0.1 momentum = 0.9 num_classes = 10 (x_trai...
Python
0
@@ -652,36 +652,36 @@ activation=' -tanh +relu ',%0D%0A @@ -838,12 +838,12 @@ on=' -tanh +relu ',%0D%0A @@ -1507,8 +1507,10 @@ y_test)) +%0D%0A
aa6090b69f64721391dec38de04e8d01d23c48bf
Add tests for differential calculus methods
sympy/calculus/tests/test_singularities.py
sympy/calculus/tests/test_singularities.py
from sympy import Symbol, exp, log from sympy.calculus.singularities import singularities from sympy.utilities.pytest import XFAIL def test_singularities(): x = Symbol('x', real=True) assert singularities(x**2, x) == () assert singularities(x/(x**2 + 3*x + 2), x) == (-2, -1) @XFAIL def test_singularit...
Python
0.000003
@@ -69,16 +69,17 @@ import +( singular @@ -83,16 +83,235 @@ larities +, is_increasing,%0A is_strictly_increasing, is_decreasing,%0A is_strictly_decreasing)%0Afrom sympy.sets import Interval%0Afrom sympy import oo, S %0A%0Afrom s @@ ...
f84f7e9091725d638e93d1dc14b830118a1833c8
add returns for views
gps_tracker/views.py
gps_tracker/views.py
from pyramid.view import view_config points_list = [ {"_id": 'ObjectId("52e3eb56a7cade5d0898e012")', "latitude": "45.215", "longitude": "14.131", "gas_station": "Lukoil", "odometer": "24100", "description": "Bad coffee"}, {"_id": 'ObjectId("52e3eb79a7cade5d0898e013")', "latitude": "47.412", "lon...
Python
0
@@ -1593,36 +1593,22 @@ urn -%7B'response': 'point edited'%7D +points_list%5B1%5D %0A%0A%0A@
f15f15ae8d8629e2387a552ed6616ec2ccdab574
fix to poll.py, in python3 in raspberry, the cmd string to serial must be encode as UTF-8
greenery/bin/poll.py
greenery/bin/poll.py
#!/usr/bin/python3 """ Poll sensors to get temp/humid/soil-moisture etc... The Arduino accepts number-based command codes over the usb serial connection. Like, 002\n = 0=mode(get),0=measurement(temperature),2=address(digital pin 2) 0214\n = 0=mode(get),2=measurement(soil),14=address(analog pin 14, o...
Python
0.000175
@@ -1930,40 +1930,26 @@ ne() -%0A print(line) +.decode().strip()%0A %0A
d5f84783c376906dd5733391593ceae792b5edda
Bump version to 0.1.0
vcli/__init__.py
vcli/__init__.py
__version__ = '0.0.1'
Python
0.000001
@@ -14,9 +14,9 @@ '0. -0.1 +1.0 '%0A
7c09e8cad8892aa2a491297618b6091e7286c6d3
move get model code to method
exportdata/management/commands/exportdata.py
exportdata/management/commands/exportdata.py
import os import csv import sys from optparse import make_option from collections import Callable from django.contrib.sites.models import Site from django.db.models.loading import get_model from django.core.management.base import LabelCommand, CommandError DOMAIN = Site.objects.get_current().domain class Command(L...
Python
0
@@ -676,18 +676,15 @@ def -handle_lab +get_mod el(s @@ -697,19 +697,8 @@ abel -, **options ):%0A @@ -867,16 +867,122 @@ (label)) +%0A return Model%0A%0A def handle_label(self, label, **options):%0A Model = self.get_model(label) %0A%0A
654022be05ca24596b643a891d11ea26a2ab393a
drop todos
corehq/apps/performance_sms/forms.py
corehq/apps/performance_sms/forms.py
import copy from corehq.apps.groups.fields import GroupField from django import forms from django.utils.translation import ugettext as _, ugettext_lazy from corehq.apps.app_manager.fields import ApplicationDataSourceUIHelper from corehq.apps.performance_sms import parser from corehq.apps.performance_sms.exceptions impo...
Python
0
@@ -1419,66 +1419,8 @@ es:%0A - # todo: needs to support multiple sources%0A @@ -3021,58 +3021,8 @@ e'%5D%0A - # todo: support more than one data source%0A @@ -3463,57 +3463,8 @@ f):%0A - # todo: need to support multiple sources%0A
1587598a16b5822dcb87e95cfc131c04d4625d53
Add delete_all_repeaters util
corehq/apps/repeaters/dbaccessors.py
corehq/apps/repeaters/dbaccessors.py
from dimagi.utils.parsing import json_format_datetime from corehq.util.couch_helpers import paginate_view from corehq.util.test_utils import unit_testing_only from .const import RECORD_PENDING_STATE, RECORD_FAILURE_STATE, RECORD_SUCCESS_STATE def get_pending_repeat_record_count(domain, repeater_id): return get_...
Python
0.000001
@@ -3953,12 +3953,254 @@ rd.delete()%0A +%0A%0A@unit_testing_only%0Adef delete_all_repeaters():%0A from .models import Repeater%0A for repeater in Repeater.get_db().view('receiverwrapper/repeaters', reduce=False, include_docs=True).all():%0A Repeater.wrap(repeater%5B'doc'%5D).delete()%0A
680122f69c5aab9be4dc1965024ac882326d1c5b
Add license to watched.py
derpibooru/watched.py
derpibooru/watched.py
class Watched(object): def __init__(self, key, page=1, perpage=15, comments=False, fav=False): self.__parameters = {} self.key = key self.page = page self.perpage = perpage self.comments = comments self.fav = fav @property def hostname(self): return("https://derpiboo.ru") @propert...
Python
0
@@ -1,8 +1,1345 @@ +# Copyright (c) 2014, Joshua Stone%0A# All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions are met:%0A#%0A# * Redistributions of source code must retain the above copyright notice, this...
42e26737d083b82716c3adb8c19fb66a5063dc65
change version number to v3.0.1
src/cmdlr/info.py
src/cmdlr/info.py
"""Cmdlr infomation files.""" VERSION = '3.0.0' DESCRIPTION = ('An extensible comic subscriber.') LICENSE = 'MIT' AUTHOR = 'Civalin' AUTHOR_EMAIL = 'larinawf@gmail.com' PROJECT_URL = 'https://github.com/civalin/cmdlr' PROJECT_NAME = 'cmdlr'
Python
0.000123
@@ -39,17 +39,17 @@ = '3.0. -0 +1 '%0ADESCRI
ee7c06579551f89296d60a1929357d637d5c9389
Update yeti.py
misp_modules/modules/expansion/yeti.py
misp_modules/modules/expansion/yeti.py
import json import logging try: import pyeti except ImportError: print("pyeti module not installed.") from pymisp import MISPEvent, MISPObject, MISPAttribute misperrors = {'error': 'Error'} mispattributes = {'input': ['ip-src', 'ip-dst', 'hostname', 'domain'], 'format': 'misp_standard' ...
Python
0
@@ -3387,24 +3387,25 @@ return%0A +%0A attr.tag @@ -3400,63 +3400,74 @@ -attr.tags.extend(%5Bt%5B'name'%5D for t in obs_to_add%5B'tags'%5D +for t in obs_to_add%5B'tags'%5D:%0A attr.tags.append(t%5B'name' %5D)%0A
49e301ac6a74a30cfdf00bf4178889f9ecb74889
Patch release for bug-fix #166
vtki/_version.py
vtki/_version.py
""" version info for vtki """ # major, minor, patch version_info = 0, 18, 1 # Nice string for the version __version__ = '.'.join(map(str, version_info))
Python
0
@@ -67,17 +67,17 @@ 0, 18, -1 +2 %0A%0A# Nice
4c6ec1413d1a12165c1231095783aa94d235389a
Add __version__ to vumi package.
vumi/__init__.py
vumi/__init__.py
Python
0.000001
@@ -0,0 +1,69 @@ +%22%22%22%0AVumi scalable text messaging engine.%0A%22%22%22%0A%0A__version__ = %220.5.0a%22%0A
c775006de5b4f984356052e2414e8a64d75d0e6b
Update Ridge_Kernel.py
KernelModel/Ridge_Kernel.py
KernelModel/Ridge_Kernel.py
import numpy as np import scipy as sp from MachineLearning.KernelModel import KernelCalc class KerRidgeReg: ########################################################################################################################## # Kernel Ridge Regression/Gaussian process ...
Python
0
@@ -2375,86 +2375,8 @@ n)%0A%0A - #Is it faster to do it at once ( np.linalg.solve(Klam,y) ) ?%0A %09%09tr
8adb539d04660bc058dca6cc6eb8bc19993f6d30
update BeerEX.bot.py
BeerEX.bot.py
BeerEX.bot.py
#!/usr/bin/env python # coding=utf-8 from telegram import ReplyKeyboardRemove, KeyboardButton, ReplyKeyboardMarkup, ParseMode from telegram.ext import MessageHandler, Filters, Updater, CommandHandler from emoji import emojize import logging import clips import os # Enable logging logging.basicConfig(format='%(asctime...
Python
0
@@ -5059,28 +5059,8 @@ Add -command and message hand
3bb474a4506abb569d5c54703ba3bf2c9c933fd9
Add tof-server to path
tof-server.wsgi
tof-server.wsgi
activate_this = '/var/www/tof-server/flask/bin/activate_this.py' execfile(activate_this, dict(__file__=activate_this)) #activator = 'some/path/to/activate_this.py' #with open(activator) as f: # exec(f.read(), {'__file__': activator}) from tof_server import app as application
Python
0.000001
@@ -1,20 +1,32 @@ +import sys%0A%0A activate_this = '/va @@ -125,16 +125,56 @@ this))%0A%0A +sys.path.append('/var/www/tof-server')%0A%0A #activat
92eec11b7a2531632d7e67e6c65f3db686af2322
update BeerEX.bot.py
BeerEX.bot.py
BeerEX.bot.py
#!/usr/bin/env python # coding=utf-8 from telegram import ReplyKeyboardRemove, KeyboardButton, ReplyKeyboardMarkup, ParseMode from telegram.ext import MessageHandler, Filters, Updater, CommandHandler from emoji import emojize import logging import clips import os # Enable logging logging.basicConfig(format='%(asctime...
Python
0
@@ -5651,18 +5651,16 @@ bot%0A - # updater
5ede219cd4613af0fecbf415030aaa23df1ff3ee
Add test for measurement order
test/core/measurements_test.py
test/core/measurements_test.py
# Copyright 2016 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 agre...
Python
0
@@ -3064,28 +3064,485 @@ record, 'replaced_min_max')%0A +%0A @htf_test.yields_phases%0A def test_measurement_order(self):%0A record = yield all_the_things.dimensions%0A self.assertEqual(record.measurements.keys(),%0A %5B'unset_dims', 'dimensions', 'lots_of_dims'%5D)%0A record = yield all...
bfe9e372a7f891a1537f37e383548612ce49fb9c
Change error message to get item_id + few fixes
lazyblacksmith/tasks/market_order.py
lazyblacksmith/tasks/market_order.py
# -*- encoding: utf-8 -*- import config import time from lazyblacksmith.extension.celery_app import celery_app from lazyblacksmith.models import ItemAdjustedPrice from lazyblacksmith.models import ItemPrice from lazyblacksmith.models import Region from lazyblacksmith.models import db from lazyblacksmith.utils.crestuti...
Python
0
@@ -1279,20 +1279,33 @@ ppened ! + Item ID: %25s %22 %25 +( time.str @@ -1310,32 +1310,42 @@ trftime(%22%25x %25X%22) +, item_id) %0A else:%0A @@ -1381,18 +1381,27 @@ ed error +. Item ID: -: %25s %22 %25 @@ -1425,21 +1425,23 @@ x %25X%22), -api_e +item_id )%0A @@ -1448,16 +1448,21 @@ re...
ff6d9647b72c2101480f170e55ee28fd0cb37d11
add MME tag by default
xbrowse_server/base/management/commands/add_default_tags.py
xbrowse_server/base/management/commands/add_default_tags.py
import sys from optparse import make_option from xbrowse_server import xbrowse_controls from django.core.management.base import BaseCommand from xbrowse_server.base.models import Project, ProjectTag, Family def get_or_create_project_tag(project, tag_name, description, color='#1f78b4'): """ Gets or creates a ...
Python
0
@@ -3254,24 +3254,141 @@ 1') # green +%0A%0A get_or_create_project_tag(project, tag_name=%22MME%22, description=%22Match Maker Exchange%22, color='#ff7f00') %0A pri
66c33c880d1e5f20a23e01937f8c88f5b66bfc5c
fix SQL error on non existing column
addons/website_membership/models/membership.py
addons/website_membership/models/membership.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models class MembershipLine(models.Model): _inherit = 'membership.membership_line' def get_published_companies(self, limit=None): if not self.ids: return [] limit_c...
Python
0.000272
@@ -557,15 +557,10 @@ ERE -website +is _pub
d5cb2a37ea77b15c5725d6ebf8e0ab79f3bea613
Fix interface in historian service interface
flow_workflow/historian/service_interface.py
flow_workflow/historian/service_interface.py
import logging from flow_workflow.historian.messages import UpdateMessage LOG = logging.getLogger(__name__) class WorkflowHistorianServiceInterface(object): def __init__(self, broker=None, exchange=None, routing_key=None): self.broker = broker self.exchange = ex...
Python
0.000004
@@ -1002,32 +1002,33 @@ net_key, +o peration_id, nam @@ -1136,16 +1136,82 @@ ion_id,%0A + name=name, workflow_plan_id=workflow_plan_id,%0A
26f5adea28f81ebbe830d4a207958320e0b40520
update version
gtfparse/__init__.py
gtfparse/__init__.py
# Copyright (c) 2015. Mount Sinai School of Medicine # # 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 o...
Python
0
@@ -921,17 +921,17 @@ = %220.2. -2 +3 %22%0A%0A__all
85dc28b44def27658e282d621749598ec80ea420
Fix typo
ambari-server/src/main/python/TeardownAgent.py
ambari-server/src/main/python/TeardownAgent.py
#!/usr/bin/env python ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License")...
Python
0.999999
@@ -973,17 +973,17 @@ tus%22: os -. +_ stat.ret
31f55658d7495bf1fed8a5a466ffe54502a0348c
Make countersong check for language-dependent spells
tpdatasrc/tpgamefiles/scr/tpModifiers/countersong.py
tpdatasrc/tpgamefiles/scr/tpModifiers/countersong.py
from templeplus.pymod import PythonModifier from toee import * import tpdp def Remove(char, args, evt_obj): if evt_obj.is_modifier('Countersong'): args.condition_remove() return 0 countersong = PythonModifier() countersong.ExtendExisting('Countersong') countersong.AddHook(ET_OnConditionAddPre, EK_NONE, Remove, ()...
Python
0
@@ -179,16 +179,463 @@ turn 0%0A%0A +# built-in hook only checks for Sonic descriptor%0Adef Lang(char, args, evt_obj):%0A%09lang = 1 %3C%3C (D20STD_F_SPELL_DESCRIPTOR_LANGUAGE_DEPENDENT-1)%0A%09sonic = 1 %3C%3C (D20S%25D_F_SPELL_DESCRIPTOR_SONIC-1)%0A%0A%09if (evt_obj.flags & lang) and not (evt_obj.flags & sonic):%0A%...
e535def2bc9b7de203e1fd37fc592cdeed1be526
fix selection bug
src/choose.py
src/choose.py
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. # # @nolint from __future...
Python
0
@@ -437,16 +437,30 @@ t logger +%0Aimport format %0A%0APICKLE @@ -1404,32 +1404,47 @@ tionsFromPickle( +selectionPath, lineObjs)%0A%0A m @@ -1688,16 +1688,31 @@ mPickle( +selectionPath, lineObjs
ec7150144682afb1f64cd3ba3713207912820264
Remove add_station reference.
agent/manager.py
agent/manager.py
import json import logging import threading import time import pika from db.db import session from db.models import Metric, WeatherStation LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) ' '-35s %(lineno) -5d: %(message)s') LOGGER = logging.getLogger(__name__) class AgentManager(o...
Python
0
@@ -3796,35 +3796,8 @@ f):%0A - self.add_station()%0A
a6372a8be985ef630e960d8dab5a4de02f12739a
fix indentation
testbeam_analysis/testing/test_examples.py
testbeam_analysis/testing/test_examples.py
''' Script to check that the examples run. The example data is reduced at the beginning to safe time. ''' import os import unittest import mock from shutil import copyfile import tables as tb import testbeam_analysis from testbeam_analysis.tools import data_selection from testbeam_analysis.examples import (eutele...
Python
0.000008
@@ -4543,16 +4543,17 @@ .0001)%0A%0A +%0A if __nam
01a574cc5ed872df93b70795916acae978e4b86f
Make TripleStatsHandler return just 3 URLs (in order) to its entity charts.
marry-fuck-kill/triple_handlers.py
marry-fuck-kill/triple_handlers.py
#!/usr/bin/env python # # Copyright 2010 Hunter Freyer and Michael Kelly # # 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
@@ -3977,16 +3977,20 @@ %0A if +not triple_i @@ -3990,24 +3990,70 @@ riple_id:%0A + raise Exception(%22Need triple key%22)%0A %0A t = mode @@ -4101,631 +4101,192 @@ - self.response.out.write('%25s: %25r' %25 (triple_id, t))%0A entities = %5Bt.one, t.two, t.three%5D%0A%0A for e in...
0a44fc07efb902912e22e72979f69fbab200cd32
Update version 0.6.8 -> 0.6.9
dimod/package_info.py
dimod/package_info.py
__version__ = '0.6.8' __author__ = 'D-Wave Systems Inc.' __authoremail__ = 'acondello@dwavesys.com' __description__ = 'A shared API for binary quadratic model samplers.'
Python
0
@@ -16,9 +16,9 @@ 0.6. -8 +9 '%0A__
81cbe1730702343d62dcf7585f3387291644b17c
fix reference to private modules, use absolute imports
neuroglancer_scripts/chunk_encoding.py
neuroglancer_scripts/chunk_encoding.py
# Copyright (c) 2018 Forschungszentrum Juelich GmbH # Author: Yann Leprince <y.leprince@fz-juelich.de> # # This software is made available under the MIT licence, see LICENCE.txt. import numpy as np def get_encoder(info, scale_info, encoder_params={}): data_type = info["data_type"] num_channels = info["num_ch...
Python
0
@@ -2872,33 +2872,52 @@ from -. +neuroglancer_scripts import compressed_s @@ -2896,32 +2896,33 @@ _scripts import +_ compressed_segme @@ -3066,16 +3066,17 @@ buf = +_ compress @@ -3200,25 +3200,44 @@ from -. +neuroglancer_scripts import compress @@ -3228,16 +3228,17 @@ import +_ compre...
9724f382b448948a0ce5ce9c5da935a46fa02a1a
Version bump
edx_proctoring/__init__.py
edx_proctoring/__init__.py
""" The exam proctoring subsystem for the Open edX platform. """ # Be sure to update the version number in edx_proctoring/package.json __version__ = '2.4.5' default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
Python
0.000001
@@ -152,9 +152,9 @@ 2.4. -5 +6 '%0A%0Ad
6d86e8565a9ea1aac07b8a1470e2f3b724b981c2
fix for use on python 2.1
Lib/bsddb/test/test_misc.py
Lib/bsddb/test/test_misc.py
"""Miscellaneous bsddb module test cases """ import os import sys import unittest try: # For Python 2.3 from bsddb import db, dbshelve except ImportError: # For earlier Pythons w/distutils pybsddb from bsddb3 import db, dbshelve from test.test_support import verbose #--------------------------------...
Python
0.000002
@@ -245,47 +245,8 @@ ve%0A%0A -from test.test_support import verbose%0A%0A #---
d7b8186f0f4115307753d0aef038ec61155c83bc
Fix typo in python
Test/Test-IO/python/TestIO.py
Test/Test-IO/python/TestIO.py
#!/usr/bin/python import timeit, sys, io def wrapper(func, *args, **kwargs): def wrapped(): return func(*args, **kwargs) return wrapped def start(file, outfile): #input = open(file, 'r') #output = open(outfile, 'w') line = input.readline() while line: line = line.replace('Tel...
Python
0.999998
@@ -178,17 +178,16 @@ e):%0A -# input = @@ -206,17 +206,16 @@ r')%0A -# output =
ecb9ee29e2d934c9a53ed26860c3fa4327c62464
Add type "completion" in field.FIELDS
elasticsearch_dsl/field.py
elasticsearch_dsl/field.py
from datetime import date from dateutil import parser from .utils import DslBase, _make_dsl_class, ObjectBase, AttrDict __all__ = ['construct_field', 'Object', 'Nested', 'Date', 'String', 'Float', 'Double', 'Byte', 'Short', 'Integer', 'Long', 'Boolean', 'Ip', 'Attachment', 'GeoPoint', 'GeoShape', ] def const...
Python
0.000432
@@ -3904,16 +3904,34 @@ shape',%0A + 'completion',%0A )%0A%0A# gen
a9b27bc7c3821536657405790f38532db473b92c
Fix bug in recent shelves views
books/views/shelf_views.py
books/views/shelf_views.py
from datetime import datetime, timedelta from django.core.urlresolvers import reverse from django.contrib import messages from django.shortcuts import ( get_object_or_404, redirect, ) from django.views.generic import ( CreateView, DeleteView, DetailView, ListView, UpdateView, View, ) f...
Python
0
@@ -17,18 +17,8 @@ port - datetime, tim @@ -24,17 +24,16 @@ medelta%0A -%0A from dja @@ -175,16 +175,50 @@ rect,%0A)%0A +from django.utils import timezone%0A from dja @@ -398,25 +398,24 @@ Shelf,%0A)%0A -%0A from books.v @@ -473,19 +473,18 @@ yMixin,%0A + )%0A -%0A from rea @@ -2792,39 +2792,39 @@ l...
7997dc0785f124dd3836bc8490c701fe99217a48
add test mode param
umapi/api.py
umapi/api.py
import requests import json from error import UMAPIError, UMAPIRetryError, UMAPIRequestError, ActionFormatError class UMAPI(object): def __init__(self, endpoint, auth): self.endpoint = str(endpoint) self.auth = auth def users(self, org_id, page=0): return self._call('/users/%s/%d' % (...
Python
0.000001
@@ -165,16 +165,33 @@ nt, auth +, test_mode=False ):%0A @@ -247,16 +247,51 @@ h = auth +%0A self.test_mode = test_mode %0A%0A de @@ -913,16 +913,152 @@ n.data%5D%0A + if self.test_mode:%0A return self._call('/action/%25s?testOnly=true' %25 org_id, requests.post, actions)%0A ...
b19429159f3c813297ba2e237abba276045f9ff1
add 0.10.17, mariadb-connector-c dependency (#11044)
var/spack/repos/builtin/packages/r-rmysql/package.py
var/spack/repos/builtin/packages/r-rmysql/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RRmysql(RPackage): """Implements 'DBI' Interface to 'MySQL' and 'MariaDB' Databases.""" ...
Python
0
@@ -514,16 +514,114 @@ MySQL%22%0A%0A + version('0.10.17', sha256='754df4fce159078c1682ef34fc96aa5ae30981dc91f4f2bada8d1018537255f5')%0A vers @@ -692,16 +692,21 @@ n('r-dbi +@0.4: ', type= @@ -746,11 +746,19 @@ 'mariadb +@:5.5.56 ')%0A
564f1da2c6643a4ef6d27b736620116b144fa2ac
Handle stale PostgreSQL (or others) more gracefully. Closes #3394. Thanks to flfr at stibo.com for the patch.
trac/db/pool.py
trac/db/pool.py
# -*- coding: utf-8 -*- # # Copyright (C) 2005 Edgewall Software # Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgew...
Python
0.000002
@@ -2266,37 +2266,217 @@ -break +try:%0A cnx.cursor() # check whether the connection is stale%0A break%0A except Exception:%0A cnx.close() %0A
bcff742c27904f995d9f5e8a184f0348b58139a5
fix closing bracket
{{cookiecutter.repo_name}}/fabfile.py
{{cookiecutter.repo_name}}/fabfile.py
# -*- coding: utf-8 -*- import os import datetime from contextlib import contextmanager from fabric.api import env, run, local, prefix, sudo def live(): """Connects to the server.""" env.hosts = [os.environ.get('{{cookiecutter.repo_name}}_host')] env.user = 'freshmilk' env.cwd = '/var/www...
Python
0.000001
@@ -1676,16 +1676,17 @@ sqldump' +) %0D%0A%0D%0A%0D%0Ade
36625021ce3d4f7203601c3fcb8a95f091d1470a
Update uc only if package is included in RDO release
update-uc.py
update-uc.py
#!/usr/bin/env python # # Update OpenStack Oslo and Clients libraries versions in rdoinfo from: # * master branch (default) # curl -OJ http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=master # * stable/newton # curl -OJ http://git.openstack.org/cgit/openstack/requirements/plain/upper-c...
Python
0.000012
@@ -3004,16 +3004,212 @@ = None%0A + if UC_RELEASE not in pkg%5B'tags'%5D:%0A print(%22Not updating %25s, it is not included in release %25s%22%0A %25 (project, UC_RELEASE))%0A continue%0A
645c640f38ae67008eb18c79301e19ddfd39c041
use new valgrind repo (#8538)
var/spack/repos/builtin/packages/valgrind/package.py
var/spack/repos/builtin/packages/valgrind/package.py
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Python
0
@@ -2116,44 +2116,46 @@ p', -svn='svn://svn.valgrind +git='git://sourceware .org/ +git/ valgrind /tru @@ -2154,14 +2154,12 @@ rind -/trunk +.git ')%0A%0A
cc4ad5a2e8dc70bb66f80306bd2408d32f492608
make tests pass
ansible/modules/hashivault/hashivault_write.py
ansible/modules/hashivault/hashivault_write.py
#!/usr/bin/env python import warnings from hvac.exceptions import InvalidPath from ansible.module_utils.hashivault import hashivault_argspec from ansible.module_utils.hashivault import hashivault_auth_client from ansible.module_utils.hashivault import hashivault_init from ansible.module_utils.hashivault import hashiw...
Python
0.000003
@@ -6092,16 +6092,116 @@ ead_data +.get('data', %7B%7D)%0A %0A if version == 2:%0A read_data = read_data.get %5B'data'%5D
88a028663b7688af362a2ebd5c168aaccc5695c0
Comment updates
bravado/mapping/request.py
bravado/mapping/request.py
from bravado.mapping.operation import log from bravado.mapping.param import unmarshal_param class RequestLike(object): """ Define a common interface for bravado to interface with server side request objects. Subclasses are responsible for providing attrs for __required_attrs__. """ __required...
Python
0
@@ -130,18 +130,9 @@ -Define a c +C ommo @@ -151,34 +151,8 @@ for -bravado to interface with serv @@ -158,20 +158,16 @@ ver side -%0A request
f0dda4f875c13947d47cf91a58e9a834a5e4a92c
Fix flapping demo geo_location test (#37516)
tests/components/demo/test_geo_location.py
tests/components/demo/test_geo_location.py
"""The tests for the demo platform.""" import unittest from homeassistant.components import geo_location from homeassistant.components.demo.geo_location import ( DEFAULT_UPDATE_INTERVAL, NUMBER_OF_DEMO_DEVICES, ) from homeassistant.const import LENGTH_KILOMETERS from homeassistant.setup import setup_component ...
Python
0
@@ -49,16 +49,31 @@ ittest%0A%0A +import pytest%0A%0A from hom @@ -571,16 +571,152 @@ o%22%7D%5D%7D%0A%0A%0A +@pytest.fixture(autouse=True)%0Adef mock_legacy_time(legacy_patchable_time):%0A %22%22%22Make time patchable for all the tests.%22%22%22%0A yield%0A%0A%0A class Te
27a5d095ddacf848bef9190b90856350c31fc85f
Remove print
seq2seq/decoders/attention_decoder.py
seq2seq/decoders/attention_decoder.py
""" A basic sequence decoder that performs a softmax based on the RNN state. """ from collections import namedtuple import tensorflow as tf from seq2seq.decoders import DecoderBase, DecoderOutput, DecoderStepOutput class AttentionDecoderOutput( namedtuple("DecoderOutput", ["logits", "predictions", "attention_sco...
Python
0.000016
@@ -4156,30 +4156,8 @@ ts)%0A - print(next_input)%0A
f6912851795e116771d1f82cd79999a3f32b81e3
remove unused import
niworkflows/reports/tests/test_core.py
niworkflows/reports/tests/test_core.py
''' Testing module for niworkflows.reports.core ''' import os from pathlib import Path from pkg_resources import resource_filename import tempfile from itertools import product from pkg_resources import resource_filename as pkgrf import matplotlib.pyplot as plt from bids.layout.writing import build_path import pytes...
Python
0.000001
@@ -175,60 +175,8 @@ uct%0A -from pkg_resources import resource_filename as pkgrf %0A%0Aim
29c11f115f63007bceb3abe018ae2300fef39265
fix writing remainder construct after object modification
distance/construct.py
distance/construct.py
"""Facilities for defining fragments with the construct module.""" from construct import ( PascalString, VarInt, Bytes, ConstructError, Const, Select, FocusedSeq, Tell, Mapping, Rebuild, Computed, Compiled, Container, this, len_, ) from distance.base import Fragment from distance.bytes im...
Python
0.000002
@@ -118,16 +118,29 @@ , Bytes, + GreedyBytes, %0A Con @@ -206,25 +206,18 @@ ng, -Rebuild, Computed +IfThenElse ,%0A @@ -256,14 +256,8 @@ his, - len_, %0A)%0A%0A @@ -956,32 +956,73 @@ ' -size' / Rebuild(Computed +rem' / IfThenElse(this._parsing,%0A Bytes (thi @@ -1059,34 +1059,...
9a7edf9de8de22055462a3cab99ffc62aef36591
remove print
ArangoExec.py
ArangoExec.py
import sublime, sublime_plugin, http.client, socket, types, threading, time, json selectedIndexOptions = -1 class Options: def __init__(self, name): self.name = name connections = sublime.load_settings("ArangoExec.sublime-settings").get('connections') self.host = connections[self...
Python
0.000793
@@ -2004,35 +2004,8 @@ ST%22%0A - print(request_page) %0A
887b03d7587525509d3652ef42b930025194d2ad
Update 2sum.py
Array/2sum.py
Array/2sum.py
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are not zero-based. Yo...
Python
0
@@ -499,16 +499,37 @@ index2)%0A + # 48s%0A # O(n)%0A def
dbdfbc18ebadc0a1d50a6513bb982d2e3881036f
Add MAX_TURNS and some more output to train-ml-bot
train-ml-bot.py
train-ml-bot.py
""" Train a machine learning model for the classifier bot. We create a player, and watch it play games against itself. Every observed state is converted to a feature vector and labeled with the eventual outcome (-1.0: player 2 won, 1.0: player 1 won) This is part of the second worksheet. """ from api import State, uti...
Python
0
@@ -376,16 +376,27 @@ orithms%0A +import sys%0A import s @@ -710,16 +710,66 @@ NETS = 6 +%0A# Maximum number of turns to play%0ANUM_TURNS = 100 %0A%0A# The @@ -952,16 +952,26 @@ rs = %5B%5D%0A + i = 0%0A whil @@ -992,18 +992,36 @@ nished() + and i %3C= NUM_TURNS : -%0A %0A @@ -1132,16 +1132,32 @...
249b6a3cd013d23df8748de691a391ef40b5539b
put try except around wx-config --ldflags to support older versions of wxPython
weave/wx_spec.py
weave/wx_spec.py
import common_info from c_spec import common_base_converter import sys,os # these may need user configuration. if sys.platform == "win32": wx_base = r'c:\wxpython-2.3.3.1' else: # probably should do some more discovery here. wx_base = '/usr/lib/wxPython' def get_wxconfig(flag): wxconfig = os.path.join...
Python
0
@@ -4482,41 +4482,220 @@ -ldflags = get_wxconfig('ldflags') +%0A #older versions of wx do not support the ldflags.%0A try:%0A ldflags = get_wxconfig('ldflags')%0A except RuntimeError:%0A ldflags = %5B%5D%0A %0A
c5af0d98407052b9f04e37efc741c9b457825eb7
Fix reading JSON file
Python/scoreP2.py
Python/scoreP2.py
# coding=utf-8 import json import os import numpy as np from scoreCommon import matchInputFile, \ computeCommonMetrics, computeAveragePrecisionMetrics _FEATURE_NAMES = ['globules', 'streaks'] def loadFeatures(featuresPath): try: features = json.load(featuresPath) except ValueError: # ...
Python
0.999549
@@ -249,28 +249,206 @@ -features = json.load +with open(featuresPath) as f:%0A features = json.load(f)%0A except IOError:%0A raise Exception('Internal error: error reading JSON file: %25s'%0A %25 os.path.basename (fea @@ -453,24 +453,25 @@ eaturesPath) +) %0A exce...
8285d61247c8e8d33cc12e74a39aca6fea40e5bd
Remove unneeded "d".
tests/tabular_output/test_preprocessors.py
tests/tabular_output/test_preprocessors.py
# -*- coding: utf-8 -*- """Test CLI Helpers' tabular output preprocessors.""" from __future__ import unicode_literals from decimal import Decimal from cli_helpers.tabular_output.preprocessors import (align_decimals, bytes_to_string, ...
Python
0.000984
@@ -3215,36 +3215,35 @@ ecimal_format=', -d ',%0A + @@ -3711,33 +3711,32 @@ ecimal_format=', -d ',%0A @@ -4168,33 +4168,32 @@ ecimal_format=', -d ',%0A @@ -4610,17 +4610,16 @@ ormat=', -d ')%0A%0A @@ -5161,32 +5161,32 @@ aders = ('h1',)%0A + result = for @@ ...
6454bca66b73efa6e124fce80634fc98bd0b9c25
add new dependencies for python 3.7.6
Back/setup.py
Back/setup.py
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.txt')) as f: README = f.read() with open(os.path.join(here, 'CHANGES.txt')) as f: CHANGES = f.read() requires = [ 'pyodbc==4.0.28', 'pyramid==1.10.4', 'sqla...
Python
0.000001
@@ -259,16 +259,42 @@ res = %5B%0A + 'marshmallow==3.3.0',%0A 'pyo @@ -307,9 +307,9 @@ .0.2 -8 +7 ',%0A @@ -425,17 +425,17 @@ ==6.0.0b -2 +3 '%0A %5D%0A @@ -479,17 +479,17 @@ sion='0. -3 +4 ',%0A d
d9c9f9c363f5520f37800930efd9eaa1e43daed7
bump version
ttt/__init__.py
ttt/__init__.py
# -*- coding: utf-8 -*- __version__ = '0.3.1'
Python
0
@@ -41,7 +41,7 @@ 0.3. -1 +2 '%0A
f20055c525577069333271283d921705bf21bfb2
disable bad graphic button for now
tweets/admin.py
tweets/admin.py
from django.contrib import admin from django.utils.safestring import mark_safe from models import Tweet, SearchTerm, Message, MarketAccount from filters import TwitterImageFilter, TweetStatusFilter, TongueGraphicFilter # Register your models here. def mark_deleted(modeladmin, request, queryset): queryset.update(d...
Python
0
@@ -3022,32 +3022,36 @@ +%3C!-- %3Cli%3E%3Ca class=%22bt @@ -3118,32 +3118,35 @@ 't work%3C/a%3E%3C/li%3E +--%3E %0A
37d97f21ec4e73855a49659ef3a867b1706ac914
Update error messsage (#11197)
datadog_checks_base/datadog_checks/base/checks/openmetrics/base_check.py
datadog_checks_base/datadog_checks/base/checks/openmetrics/base_check.py
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from copy import deepcopy import requests from six import PY2 from ...errors import CheckException from ...utils.tracing import traced_class from .. import AgentCheck from .mixins import OpenMetricsScrap...
Python
0
@@ -4272,16 +4272,20 @@ t could +not connect @@ -4291,12 +4291,11 @@ to -none +any of @@ -4311,16 +4311,17 @@ wing URL +s : %25s.%22 %25
c6c74870e6557dbd0523d1b01f377f14b05b632a
Add db check to makeTest to ensure we cover cases where an explicit path to a test function is passed
django_nose/plugin.py
django_nose/plugin.py
import os.path import sys from django.conf import settings from django.db.models.loading import get_apps, load_app from django.test.testcases import TransactionTestCase class ResultPlugin(object): """ Captures the TestResult object for later inspection. nose doesn't return the full test result object fro...
Python
0
@@ -1936,16 +1936,241 @@ ction)%0A%0A + def makeTest(self, test, parent):%0A if self.needs_db:%0A return%0A if not test.im_class:%0A return%0A if issubclass(test.im_class, TransactionTestCase):%0A self.needs_db = True%0A%0A def
aa3a6dd01d7681f92d1be42fb2831126ced7a76e
Update __init__.py
django_su/__init__.py
django_su/__init__.py
import os # The fake password we will use to authenticate su'ed users SECRET_PASSWORD = os.urandom(64) __version__ = '0.4.8'
Python
0.000072
@@ -101,27 +101,75 @@ 64)%0A -%0A__version__ = '0.4.8' +VERSION = (0, 4, 8)%0A%0A__version__ = '.'.join(%5Bstr(n) for n in VERSION%5D) %0A
3566e996b350b1b5e74caa886b69c17b13ba4913
Add HTTPs support to assertRedirectsTo
django_test_mixins.py
django_test_mixins.py
from django.test import TestCase from django.core.cache import cache import urlparse class HttpCodeTestCase(TestCase): # TODO: this should be a private method. def assertHttpCode(self, response, code, code_description): self.assertEqual( response.status_code, code, "Expected a...
Python
0
@@ -2598,32 +2598,24 @@ response.%22)%0A - %0A sel @@ -3471,24 +3471,16 @@ True.%22)%0A - %0A @@ -3575,16 +3575,60 @@ ttp://') + and not expected_url.startswith('https://') :%0A
8bee6d753e623cdd09353be262b2b6b395d7c7c8
Check stream when close socket
stormed/connection.py
stormed/connection.py
import time import socket from tornado.iostream import IOStream from tornado.ioloop import IOLoop from stormed.util import logger from stormed.frame import FrameReader, FrameHandler, status from stormed.channel import Channel from stormed.method.connection import Close TORNADO_1_2 = hasattr(IOStream, 'connect') cla...
Python
0
@@ -4959,32 +4959,85 @@ = status.CLOSED%0A +%0A if self.stream is None:%0A return%0A%0A self.str
f860d338ae22c73ad7e313bf9cd268014be138db
Add Dense Layer to SpecGAN Discriminator
structures/SpecGAN.py
structures/SpecGAN.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0.000001
@@ -1937,36 +1937,24 @@ init__(self, - channels=1, d=4):%0A @@ -2087,32 +2087,48 @@ ), strides=(2,2) +, padding='same' ))%0A layer @@ -2224,32 +2224,48 @@ ), strides=(2,2) +, padding='same' ))%0A layer @@ -2361,32 +2361,48 @@ ), strides=(2,2) +, padding='same' ))%0A layer @@ -2498,32 ...
f623312b5df6e8f201f641f87193075e8d3f70ea
Add version attribute
nuxeo-drive-client/nxdrive/__init__.py
nuxeo-drive-client/nxdrive/__init__.py
Python
0
@@ -0,0 +1,23 @@ +_version_ = '1.0.0-dev'
a5d249fc056a58dbcbf995b8686e06f44f83395d
Tidy up
src/common.py
src/common.py
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2017 Dean Jackson <deanishe@deanishe.net> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2017-11-14 # """Common workflow variables and functions.""" from __future__ import print_function, absolute_import from collections import Ordered...
Python
0.000027
@@ -2967,110 +2967,8 @@ ')%0A%0A -# AppleScript to run an Alfred search%0ASEARCH_AS = u'tell application %22Alfred 3%22 to search %22%7Bquery%7D%22'%0A%0A %0Adef
96479e7a883af913a3c13bd73f26f0aa49c63621
Create target directory.
wikiconv/conversation_reconstruction/construct_utils/reconstruct_conversation.py
wikiconv/conversation_reconstruction/construct_utils/reconstruct_conversation.py
import apache_beam as beam import logging import copy import json import tempfile import resource import os import shutil from google.cloud import storage from construct_utils.conversation_constructor import Conversation_Constructor class ReconstructConversation(beam.DoFn): def merge(self, ps1, ps2): # Merg...
Python
0
@@ -4321,24 +4321,65 @@ %5D, page_id)%0A + os.mkdir(tempfile_path, page_id)%0A for
c9277fa65afcf513c2e3000193d7837900ff8ee1
Improve logging runtime state poll fail message
src/nodeconductor_openstack/tasks/base.py
src/nodeconductor_openstack/tasks/base.py
from celery import shared_task from nodeconductor.core.tasks import Task from .. import models # TODO: move this signal to itacloud assembly application @shared_task def register_instance_in_zabbix(instance_uuid): from nodeconductor.template.zabbix import register_instance instance = models.Instance.objects...
Python
0.000001
@@ -1008,24 +1008,18 @@ ' -Instance +%25s %25s (PK: @@ -1058,16 +1058,66 @@ %25s' %25 ( +%0A instance.__class__.__name__, instance
f165ddf15914bd9b1c3720e99b3171fb73d331a3
kNN remove l5 distance
ParamSklearn/components/classification/k_nearest_neighbors.py
ParamSklearn/components/classification/k_nearest_neighbors.py
import sklearn.neighbors from HPOlibConfigSpace.configuration_space import ConfigurationSpace from HPOlibConfigSpace.hyperparameters import CategoricalHyperparameter, \ Constant, UnParametrizedHyperparameter, UniformIntegerHyperparameter from HPOlibConfigSpace.conditions import EqualsCondition from ParamSklearn.c...
Python
0.999757
@@ -3204,167 +3204,8 @@ o%22)%0A - if dataset_properties is not None and dataset_properties.get('sparse'):%0A p_choices = %5B1, 2%5D%0A else:%0A p_choices = %5B1, 2, 5%5D%0A @@ -3273,17 +3273,14 @@ ces= -p_choices +%5B1, 2%5D , de @@ -3350,193 +3350,8 @@ 0)%0A%0A - #...
2474e584b228c45bba01e97ef8c23185b7b1d31c
Update j2cl_library so matched by open-source replacement
build_def/j2cl_library.bzl
build_def/j2cl_library.bzl
"""j2cl_library build macro Takes Java source, translates it into Closure style JS and surfaces it to the rest of the build tree with a js_common.provider. Generally library rules dep on other library rules for reference resolution and this build macro is no exception. In particular the deps this rule needs for refere...
Python
0
@@ -2621,16 +2621,23 @@ t_name = + %22//%22 + native. @@ -2708,33 +2708,9 @@ != %22 -third_party/java_src/j2cl +/ /jre
e3035fb91a96a3ff5627b6847203e3dc11fbc78f
Add libunwind-1.2.1 (#8145)
var/spack/repos/builtin/packages/libunwind/package.py
var/spack/repos/builtin/packages/libunwind/package.py
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Python
0.000002
@@ -1540,16 +1540,73 @@ ar.gz%22%0A%0A + version('1.2.1', '06ba9e60d92fd6f55cd9dadb084df19e')%0A vers
77db7bb96686e3308a4061d24c257466d9987405
add delete_project dashboard api.
rio/blueprints/dashboard.py
rio/blueprints/dashboard.py
# -*- coding: utf-8 -*- from slugify import slugify from flask import Blueprint from flask import jsonify from flask_wtf import Form from wtforms import StringField from wtforms.validators import DataRequired from wtforms.validators import ValidationError from wtforms.validators import Length from rio.utils.user impor...
Python
0
@@ -452,16 +452,56 @@ nstance%0A +from rio.models import delete_instance%0A from rio @@ -1526,24 +1526,50 @@ roject_id):%0A + %22%22%22Delete Project.%22%22%22%0A project @@ -1721,73 +1721,35 @@ -# TODO: implement delete_project%0A task = delete_project.delay( +delete_instance('project', proj @@...
91a77b860387ebed146b9e4e604d007bfabf0b9e
Fix potential bug in parameter passing
lib/ansible/plugins/action/normal.py
lib/ansible/plugins/action/normal.py
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
Python
0.000001
@@ -960,16 +960,20 @@ dule(tmp +=tmp , task_v
e0db9a970c6ea778419cc1f20ca66adedffb7aae
Set HOME, allow errors to pass through to stdout/stderr
utils/mwm.py
utils/mwm.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import os import shutil import subprocess import tempfile from string import Template from .artifact import Artifact LOG = logging.getLogger(__name__) class MWM(object): name = 'mwm' description = 'maps.me MWM' cmd = Template...
Python
0
@@ -924,16 +924,29 @@ .update( +HOME=tmpdir, MWM_WRIT @@ -1172,88 +1172,8 @@ ash' -,%0A stdout=subprocess.PIPE,%0A stderr=subprocess.PIPE )%0A%0A
bbcd5e00a4dcd991b9699ef6ae19339325bff7fd
Clean history bug resolved For a large data using batch size was not filtering proberly. So updated the batch logic LEARNER-2697
ecommerce/core/management/commands/clean_history.py
ecommerce/core/management/commands/clean_history.py
from __future__ import unicode_literals import logging import time from dateutil.parser import parse from django.core.management.base import BaseCommand, CommandError from django.db import transaction from oscar.core.loading import get_model from ecommerce.courses.models import Course from ecommerce.invoice.models i...
Python
0
@@ -2527,16 +2527,32 @@ ff_date) +.order_by('-pk') %0A%0A @@ -2685,172 +2685,417 @@ -qs = qs%5B:batch_size%5D%0A while qs.exists():%0A history_batch = list(qs.values_list('id', flat=True))%0A%0A with transaction.atomic() +try:%0A # use Primary keys s...
33da474861334d361f3e990eda2518f919158726
Fix reading from socket for Python 3 (PY-15772).
python/helpers/profiler/prof_io.py
python/helpers/profiler/prof_io.py
import traceback from _prof_imports import TSerialization from _prof_imports import TJSONProtocol from _prof_imports import ProfilerRequest from _prof_imports import IS_PY3K from prof_util import ProfDaemonThread import struct def send_message(sock, message): """ Send a serialized message (protobuf Message int...
Python
0
@@ -1124,21 +1124,8 @@ %22%22%22%0A - buf = ''%0A @@ -1161,16 +1161,43 @@ earray() +%0A else:%0A buf = '' %0A%0A wh
1a00a2aaa2ce73f723a7555cad34dd5742677b3a
test name duplicated
python/intercoop/apiclient_test.py
python/intercoop/apiclient_test.py
# -*- encoding: utf-8 -*- import unittest from . import apiclient from . import packaging from . import crypto import requests_mock from yamlns import namespace as ns class ApiClient_Test(unittest.TestCase): yaml=u"""\ originpeer: somillusio origincode: 666 name: Perico de los Palotes address: Percebe, 13 city: ...
Python
0.000626
@@ -914,17 +914,16 @@ )%0A%0A -%0A def @@ -2675,17 +2675,16 @@ %5D)%0A%0A -%0A def @@ -2700,35 +2700,31 @@ vateService_ -receivesUrl +badPeer (self):%0A
e38407cb7e5fae9f7f3b6750d791175bd134c92e
fix adding host on ubuntu Reviewed-by:frank
python/lib/cloudutils/utilities.py
python/lib/cloudutils/utilities.py
from cloudException import CloudRuntimeException, formatExceptionInfo import logging from subprocess import PIPE, Popen from signal import alarm, signal, SIGALRM, SIGKILL import sys import os class bash: def __init__(self, args, timeout=600): self.args = args logging.debug("execute:%s"%args) ...
Python
0
@@ -5264,36 +5264,35 @@ rvicename,force= -Fals +Tru e):%0A if s @@ -5639,36 +5639,35 @@ rvicename,force= -Fals +Tru e):%0A if n @@ -5846,36 +5846,35 @@ name,forcestart= -Fals +Tru e):%0A bash
8c43729c4be33a6758d3ade9cc745e757c261c4f
fix variable name
Baraffe_tables/BDmass_to_flux_ratio.py
Baraffe_tables/BDmass_to_flux_ratio.py
#!/usr/bin/python """Brown Dwarf Flux ratio calculator. Calculates the flux/contrast ratio between a host star and a brown dwarf of a specified mass. This script uses the SIMBAD database to obtain the host star parameters, such as magnitude and age. The companion/brown dwarf mass is a given input (in Mjup) and is us...
Python
0.998523
@@ -3533,27 +3533,16 @@ _radius( -star_name, star_par @@ -3795,16 +3795,23 @@ ompanion +_params %5B%22R%22%5D, 4 @@ -3859,33 +3859,32 @@ ion/star = %7B%7D - %22.format(Rcomp_R @@ -3946,17 +3946,16 @@ = %7B%7D - %22.format
ee42b37a7dff1e111d7b4df71ece818e7c2f2d38
set Keen.io settings
buildtimetrend/settings.py
buildtimetrend/settings.py
# vim: set expandtab sw=4 ts=4: # pylint: disable=invalid-name,too-few-public-methods ''' Manages settings of buildtime trend Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net> This file is part of buildtime-trend <https://github.com/ruleant/buildtime-trend/> This program is free software: you ca...
Python
0
@@ -896,16 +896,28 @@ rt yaml%0A +import keen%0A import b @@ -2998,16 +2998,462 @@ trend%22%5D) +%0A%0A # set Keen.io settings%0A if %22keen%22 in config:%0A if %22project_id%22 in config%5B%22keen%22%5D:%0A keen.project_id = config%5B%22keen%22...
19672bf43c721ee66c1f8c7f3d65cfbeae564cad
fix typo in perfmon parameter
yape/main.py
yape/main.py
# os methods for manipulating paths import os import argparse import sys import bokeh import csv import sqlite3 from yape.parsepbuttons import parsepbuttons from yape.plotpbuttons import mgstat,vmstat,iostat,perfmon,sard def fileout(db,filename,fileprefix,section): c = db.cursor() c.execute("SELECT name FRO...
Python
0.000026
@@ -2738,16 +2738,17 @@ t(%22--per +f mon%22,des
12efb71143a18e191e05a1b5f0e6d7c59854e0ba
fix brampton scraper class name
ca_on_brampton/__init__.py
ca_on_brampton/__init__.py
# coding: utf-8 from utils import CanadianJurisdiction class London(CanadianJurisdiction): jurisdiction_id = u'ocd-jurisdiction/country:ca/csd:3521010/council' geographic_code = 3521010 division_name = u'Brampton' name = u'Brampton City Council' url = 'http://www.brampton.ca'
Python
0.000004
@@ -60,12 +60,14 @@ ass -Lond +Brampt on(C
a4fbc3372a446861f086d847186726b80443f212
add utils for printing results; add ndiff table
causalinference/results.py
causalinference/results.py
import numpy as np from scipy.stats import norm class Results(object): def __init__(self, causal): self.causal = causal def ndiff(self): print self.causal.ndiff def propensity(self): if not hasattr(self.causal, 'pscore'): self.causal.propensity() print 'Coefficients:', self.causal.pscore['coeff...
Python
0
@@ -124,36 +124,711 @@ sal%0A -%0A%0A%09def ndiff(self):%0A%0A%09%09print +%09%09self.table_width = 80%0A%0A%0A%09def _varnames(self, varnums):%0A%0A%09%09return %5B'X'+str(varnum+1) for varnum in varnums%5D%0A%0A%0A%09def _make_row(self, entries):%0A%0A%09%09col_width = self.table_width // len(entries)%0A%09%09first_...
d0ce2b074ffd603c507069d8a5ab1189fad0ca56
Update a version number from trunk r9016
pywikibot/families/wikia_family.py
pywikibot/families/wikia_family.py
# -*- coding: utf-8 -*- __version__ = '$Id$' import family # The Wikia Search family # user-config.py: usernames['wikia']['wikia'] = 'User name' class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = u'wikia' self.langs = { u'wikia': None,...
Python
0
@@ -444,11 +444,11 @@ %221.1 -5.1 +6.2 %22%0A%0A
9161e2dfe0edd27004ccd964a39c092275e9e5ab
Add derivation outlines
eqs_backend/eqs_backend.py
eqs_backend/eqs_backend.py
# Copyright (c) 2016, Herman Bergwerf. All rights reserved. # Use of this source code is governed by an AGPL-3.0-style license # that can be found in the LICENSE file. from flask import Flask, request from neo4j.v1 import GraphDatabase, basic_auth from .helpers import * # Define Flask server instance. server = Flask(...
Python
0.000005
@@ -266,16 +266,170 @@ port *%0A%0A +%0A# TODO: consider using http://flask-restful.readthedocs.io/en/latest/%0A# http://blog.miguelgrinberg.com/post/designing-a-restful-api-using-flask-restful%0A%0A # Define @@ -1281,17 +1281,21 @@ ('/deriv -e +ation /', meth @@ -1348,71 +1348,1211 @@ -Append derivation to e...
27049d58b322bb50554198ecc64eab7731b86149
add support for group metadata
zarr/meta.py
zarr/meta.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division import json import numpy as np from zarr.compat import PY2, text_type from zarr.errors import MetadataError def decode_metadata(b): s = text_type(b, 'ascii') meta = json.loads(s) zarr_format = meta.get('zarr_forma...
Python
0
@@ -192,24 +192,42 @@ dataError%0A%0A%0A +ZARR_FORMAT = 2%0A%0A%0A def decode_m @@ -221,24 +221,30 @@ %0Adef decode_ +array_ metadata(b): @@ -369,17 +369,27 @@ rmat != -1 +ZARR_FORMAT :%0A @@ -978,16 +978,22 @@ encode_ +array_ metadata @@ -1041,9 +1041,19 @@ mat= -1 +ZARR_FORMAT ,%0A @@ -2035,12 +20...
1b2f9e8cff542868765f61d1af0eca004c1de791
support skipping rows in the base processor
datapackage_pipelines_mojp/common/processors/base_processors.py
datapackage_pipelines_mojp/common/processors/base_processors.py
from itertools import chain from datapackage_pipelines.wrapper import ingest, spew from datapackage_pipelines_mojp import settings as mojp_settings class BaseProcessor(object): """ all mojp processor should extend this class it is pluggable into our unit tests to allow mocks and automated tests of process...
Python
0
@@ -2588,37 +2588,46 @@ ce:%0A -yield +filtered_row = self._filter_ro @@ -2636,32 +2636,108 @@ row, descriptor) +%0A if filtered_row is not None:%0A yield filtered_row %0A%0A def _filte
69642fbfa143d475b3dcc548bffbda8a6dd6c680
Enable template caching in production
rotd/settings/production.py
rotd/settings/production.py
# -*- coding: utf-8 -*- from .base import * from .util import get_env_setting DEBUG = False DOMAIN = get_env_setting('ROTD_DOMAIN') ALLOWED_HOSTS = [ DOMAIN, ] DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql_psycopg2", "NAME": get_env_setting('ROTD_DB_NAME'), ...
Python
0
@@ -824,8 +824,774 @@ = True%0A +%0ATEMPLATES = %5B%0A %7B%0A 'BACKEND': 'django.template.backends.django.DjangoTemplates',%0A 'DIRS': %5Bos.path.abspath(os.path.join(BASE_DIR, 'templates'))%5D,%0A 'OPTIONS': %7B%0A 'context_processors': %5B%0A 'django.template.contex...
faaf1d64fc8c5b15c346f70288235426f0647757
use /usr/bin/env python to run the script
FulltoSNP.py
FulltoSNP.py
#!/usr/bin/env python2.6 import sys import re import itertools import math from Bio import SeqIO #SNP alignment from full Alignment nexus file #Check for correct commandline arguments if len(sys.argv) != 4: print("Usage: FulltoSNP.py <nexus file> <output file> <threshold>") sys.exit(0) #Get filenames InFile...
Python
0.000001
@@ -18,11 +18,8 @@ thon -2.6 %0A%0Aim
d01bb6e89c6fcfe8a17d90f3ace175ad26f921b5
Support CSV files beginning with a byte order mark
git-keeper-core/gkeepcore/local_csv_files.py
git-keeper-core/gkeepcore/local_csv_files.py
# Copyright 2016 Nathan Sommer and Ben Coleman # # 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 dis...
Python
0
@@ -1488,32 +1488,54 @@ h open(file_path +, encoding='utf-8-sig' ) as f:%0A
1657e46cd5c2a81df4cbb73b292b0bf9072d5c51
Fix test: make sure that Isolation Forest actually make a categorical split
h2o-py/tests/testdir_tree/pyunit_tree_irf.py
h2o-py/tests/testdir_tree/pyunit_tree_irf.py
import h2o from h2o.tree import H2OTree from h2o.estimators import H2OIsolationForestEstimator from tests import pyunit_utils def check_tree(tree, tree_number, tree_class = None): assert tree is not None assert len(tree) > 0 assert tree._tree_number == tree_number assert tree._tree_class == tree_clas...
Python
0.000076
@@ -779,151 +779,181 @@ ():%0A -%0A -prostate = h2o.import_file(path=pyunit_utils.locate(%22smalldata/prostate/prostate.csv%22))%0A prostate%5B%22RACE%22%5D = prostate%5B%22RACE%22%5D.asfactor() +cat_frame = h2o.create_frame(cols=10, categorical_fraction=1, seed=42)%0A # check all columns are categorical%0...
0500105b9dc148855b7957963b3949d89a7cc3b4
Remove routes for PayPal
gratipay/models/exchange_route.py
gratipay/models/exchange_route.py
from __future__ import absolute_import, division, print_function, unicode_literals import balanced import braintree from postgres.orm import Model class ExchangeRoute(Model): typname = "exchange_routes" def __bool__(self): return self.error != 'invalidated' __nonzero__ = __bool__ @classme...
Python
0.000001
@@ -2747,24 +2747,291 @@ f.address)%0A%0A + # For Paypal, we remove the record entirely to prevent%0A # an integrity error if the user tries to add the route again%0A if self.network == 'paypal':%0A self.db.run(%22DELETE FROM exchange_routes WHERE id=%25s%22, (self.id,))%0A else:...
7e5477682dfc0d907fe55a489c75179a6e4c832b
fix Swale import script
polling_stations/apps/data_collection/management/commands/import_swale.py
polling_stations/apps/data_collection/management/commands/import_swale.py
from data_collection.management.commands import BaseShpStationsShpDistrictsImporter class Command(BaseShpStationsShpDistrictsImporter): srid = 27700 council_id = 'E07000113' districts_name = 'shp/Swale Polling Districts' stations_name = 'shp/Swale Polling Stations.shp' #elections = ['local.kent.201...
Python
0.000002
@@ -41,27 +41,27 @@ import Base -Shp +Csv StationsShpD @@ -96,19 +96,19 @@ and(Base -Shp +Csv Stations @@ -252,45 +252,66 @@ = ' -shp/ Swale -Polling Stations.shp +21 Feb 2017 Polling scheme station numbers.csv '%0A -# elec @@ -347,27 +347,8 @@ 04'%5D -%0A elections = %5B%5D %0A%0A @@ -536,48 +536...
960688f925cba5c82e1c7c0b01bc032957023118
Fix flake8 violations
f5_openstack_agent/lbaasv2/drivers/bigip/tenants.py
f5_openstack_agent/lbaasv2/drivers/bigip/tenants.py
"""Tenants Manager.""" # Copyright 2014 F5 Networks 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 la...
Python
0
@@ -2430,32 +2430,24 @@ - bigip, folde @@ -2705,17 +2705,16 @@ ork %25s.%22 - %25%0A @@ -2837,20 +2837,16 @@ - %22Disconn @@ -2881,36 +2881,32 @@ or tenant %25s%22 %25%0A -
fc7f51877b6b991ad5a25afb755dd7a35e91dfea
Use get_or_create to avoid duplicate objects
cla_backend/apps/legalaid/migrations/0022_default_contact_for_research_methods.py
cla_backend/apps/legalaid/migrations/0022_default_contact_for_research_methods.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations import uuid from cla_common.constants import RESEARCH_CONTACT_VIA def create_default_contact_for_research_methods(apps, schema_editor): ContactResearchMethods = apps.get_model("legalaid", "ContactResearchMethod") ...
Python
0.000001
@@ -394,16 +394,23 @@ objects. +get_or_ create(m @@ -422,16 +422,27 @@ =value, +defaults=%7B%22 referenc @@ -442,17 +442,19 @@ eference -= +%22: uuid.uui @@ -461,15 +461,9 @@ d4() -).save( +%7D )%0A%0A%0A
d8300217d5a65465144772000e8fcbe2279758f8
Make _markdown property private on MarkdownDocumentFormat.
grow/documents/document_format.py
grow/documents/document_format.py
"""Document formatting specifics for parsing and working with documents.""" import copy import markdown from markdown.extensions import tables from grow.common import markdown_extensions from grow.common import structures from grow.common import utils from grow.documents import document_front_matter as doc_front_matte...
Python
0
@@ -4937,16 +4937,17 @@ def +_ markdown @@ -6691,28 +6691,33 @@ -return +md, html = self. +_ markdown .toc @@ -6712,16 +6712,34 @@ markdown +%0A return md .toc%0A%0A @@ -6812,16 +6812,17 @@ = self. +_ markdown
c8ccee311b5939b116987c1a6192cc2935f9ff3b
test bad query op
test/test_utility_functions.py
test/test_utility_functions.py
import testutils import json import psycopg2 class TestSplitQueries(testutils.BedquiltTestCase): def _assert_examples(self, examples): for query, match, specials in examples: result = self._query(""" select * from bq_split_queries('{}'::jsonb) """.format(json.dumps(que...
Python
0.998676
@@ -2997,28 +2997,346 @@ ._assert_examples(examples)%0A +%0A def test_bad_op(self):%0A query = %7B%0A 'a': %7B'$totallynotavalidop': 42%7D%0A %7D%0A with self.assertRaises(psycopg2.InternalError):%0A self.cur.execute(%22%22%22%0A select * from bq_split_queries('...
e570c537a8e6889732fdaec987b7676f3e065534
Fix recursive loop in PdfHexString.__repr__
gymnast/pdf_types/string_types.py
gymnast/pdf_types/string_types.py
""" PDF string-like objects """ import binascii import codecs import io from .common import PdfType from ..exc import PdfParseError, PdfError from ..pdf_codec import register_codec # Go ahead and register the codec here, I guess. register_codec() class PdfString(PdfType): """Base class from which all ...
Python
0.000114
@@ -4727,24 +4727,73 @@ n str(self)%0A + def __str__(self):%0A return self._text%0A def pdf_