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
f51369999441cb85ed730488e943580d707e8856
use relative imports in parser/__init__.py
rflint/parser/__init__.py
rflint/parser/__init__.py
from parser import ResourceFile, SuiteFile, RobotFileFactory, Testcase, Keyword, Row, Statement from tables import DefaultTable, SettingTable, UnknownTable, VariableTable, MetadataTable, RobotTable
Python
0.000015
@@ -1,13 +1,14 @@ from +. parser i @@ -12,16 +12,30 @@ r import + (SuiteFolder, Resourc @@ -62,20 +62,16 @@ botF -ileF actory, Test @@ -66,16 +66,38 @@ actory, +%0A Testcase @@ -125,14 +125,45 @@ ment +, TestcaseTable, KeywordTable) %0Afrom +. tabl
650dae4ce3bd154dba442cf0476651e0e949b092
add default
controller/management/commands/2xmp.py
controller/management/commands/2xmp.py
from django.core.management.base import BaseCommand, CommandError from optparse import make_option from progressbar import ProgressBar, SimpleProgress import os, sys, subprocess from django.conf import settings from emma.core.metadata import Metadata class Command(BaseCommand): """ Migrates keywords from the I...
Python
0.000002
@@ -962,16 +962,67 @@ 'path',%0A + default=settings.APP_CONTENT_ROOT,%0A
b133d76627cb95b08a1c4e3cd357ea7204dfb5a2
Mark correct function as online
sunpy/lightcurve/tests/test_goes.py
sunpy/lightcurve/tests/test_goes.py
""" GOES LightCurve Tests """ from __future__ import absolute_import import pytest import sunpy.lightcurve from sunpy.time import TimeRange class TestGOESLightCurve(object): @pytest.fixture def timerange_a(self): return TimeRange('2008/06/01', '2008/06/02') @pytest.fixture def timerange_b(...
Python
0.999994
@@ -1802,16 +1802,40 @@ ES 10'%0A%0A + @pytest.mark.online%0A def
c984add3003b2970465d06556f8ec9366efc46d0
write more data
disk_balance_test.py
disk_balance_test.py
import os import os.path from dtest import DISABLE_VNODES, Tester, create_ks from tools.assertions import assert_almost_equal from tools.data import create_c1c2_table, insert_c1c2, query_c1c2 from tools.decorators import since from tools.jmxutils import (JolokiaAgent, make_mbean, remove_per...
Python
0.000003
@@ -871,17 +871,17 @@ te', 'n= -1 +5 0k', 'no @@ -945,17 +945,84 @@ (factor= -2 +3)', 'compaction(strategy=SizeTieredCompactionStrategy,enabled=false )'%5D)%0A
aae0dbb42360727c8dc63a668c8f75dbdb1a0bb3
Remove exec permissions from condconfigparser/tests/test_condconfig.py
condconfigparser/tests/test_condconfig.py
condconfigparser/tests/test_condconfig.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # test_condconfig.py --- Automated tests for condconfigparser.condconfig # # Copyright (c) 2014, 2015, Florent Rougon # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following c...
Python
0
42df834e1b259322703ae50e79bb3d8a93a4a296
Add destroy_all and update_all for updating/deleting list of objects
restlib/controller.py
restlib/controller.py
# # Copyright (c) 2008 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.rpath.com/permanent/...
Python
0
@@ -1058,24 +1058,136 @@ T='create',%0A + DELETE='destroy_all',%0A PUT='update_all',%0A
2653c537d8142bea9f7e68553a149cbcc0620895
Simplify get_dependency
injector.py
injector.py
import collections class InjectorException(Exception): pass class BadNameException(InjectorException): pass class DuplicateNameException(InjectorException): pass class MissingDependencyException(InjectorException): pass class CircularDependencyException(InjectorException): pass def has_missing...
Python
0.000003
@@ -4195,189 +4195,68 @@ -(factory, dependencies) = self._factories%5Bname%5D%0A args = map(self.get_dependency, dependencies) if dependencies else %5B%5D%0A self._value_cache%5Bname%5D = factory(*args +self._value_cache%5Bname%5D = self.inject(*self._factories%5Bname%5D )%0A
780f28cd91f92fea0dddee2b62bc659d244a8270
Change create sample code to select indexes by eval set
create_sample.py
create_sample.py
# importing modules/ libraries import pandas as pd import random import numpy as np # create a sample of prior orders orders_df = pd.read_csv("Data/orders.csv") s = round(3214874 * 0.1) i = sorted(random.sample(range(1,3214874), s)) orders_df.loc[i,:].to_csv("Data/orders_prior_sample.csv", index = False) # create a s...
Python
0
@@ -209,23 +209,60 @@ ple( -range(1,3214874 +list(orders_df%5Borders_df%5B%22eval_set%22%5D==%22prior%22%5D.index ), s @@ -425,22 +425,60 @@ ple( -range(1,131209 +list(orders_df%5Borders_df%5B%22eval_set%22%5D==%22train%22%5D.index ), s @@ -639,21 +639,59 @@ ple( -range(1,75000 +list(orders_df%5Borders_df%5B%22eva...
fee30c4017da4d41a9487d961ba543d2d1e20e85
Add explicit Note join relationship on NoteContent model. (also remove extraneous comments on old date format)
tuhi_flask/models.py
tuhi_flask/models.py
# Copyright 2015 icasdri # # This file is part of tuhi-flask. # # tuhi-flask is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # #...
Python
0
@@ -834,16 +834,56 @@ eignKey%0A +from sqlalchemy.orm import relationship%0A from wer @@ -2000,90 +2000,8 @@ och%0A - # date_modified = Column(DateTime) # May need to use Integer from epoch here%0A %0A%0Acl @@ -2285,86 +2285,38 @@ och%0A +%0A -# date_created = Column(DateTime) # May need to use Integer ...
0eba8c87373d44b1f7bec2afc8d4ee62d5abd2cb
Refactor debug interface to adapt connection
scripts/debug_serial.py
scripts/debug_serial.py
#!/usr/bin/python3 import struct import subprocess from enum import Enum import time import logging from functools import partial from typing import Callable import colorlog from meshnet.serio.connection import LegacyConnection, MessageHandler, MessageWriter from meshnet.serio.messages import MessageType, SerialMess...
Python
0
@@ -931,22 +931,8 @@ elf, - tty_dev: str, key @@ -968,97 +968,8 @@ key%0A -%0A%0A self.conn = LegacyConnection(tty_dev)%0A self.conn.register_handler(self)%0A @@ -1012,17 +1012,16 @@ sumer()%0A -%0A @@ -2052,159 +2052,8 @@ ss%0A%0A - def run(self):%0A self.conn.connect()%0A...
ed08ebd627846b8e4a3b3734a605495e64254a28
Fix a minor pylint warning
swift_scality_backend/http_utils.py
swift_scality_backend/http_utils.py
# Copyright (c) 2014 Scality # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
Python
0.000001
@@ -1764,18 +1764,19 @@ self, li +ne s -t ):%0A
ee76ae4f41be17a0f6a482273e99783df8212004
Reconfigure key repeat (should change to be configurable)
riker/worker/utils.py
riker/worker/utils.py
from logging import getLogger import tempfile from threading import Thread import lirc from django.conf import settings from systemstate.models import RemoteButton from systemstate.utils import push_button LOGGER = getLogger(__name__) LIRCRC_TEMPLATE = ''' begin prog = {lirc_name} button = {key_...
Python
0
@@ -347,16 +347,53 @@ y_name%7D%0A + repeat = 2%0A delay = 3%0A end%0A%0A'''
2e99e481e36b4634859e4071984aa5e1ae440945
fix bug
deepchem/molnet/load_function/clearance_datasets.py
deepchem/molnet/load_function/clearance_datasets.py
""" clearance dataset loader. """ import os import logging import deepchem logger = logging.getLogger(__name__) DEFAULT_DIR = deepchem.utils.data_utils.get_data_dir() CLEARANCE_URL = "https://deepchemdata.s3-us-west-1.amazonaws.com/datasets/clearance.csv" def load_clearance(featurizer='ECFP', ...
Python
0.000005
@@ -817,11 +817,14 @@ = %5B' -exp +target '%5D%0D%0A
0827911184bf43a6dd50712444d3f9385a64eb31
support combining bigrams
constraintWriterTool.py
constraintWriterTool.py
#!/usr/bin/env python from autosuggest import * import os, sys from sys import argv, exit def printUsage(): print("Usage: constraintWriterTool action [options]\nActions:\n\tsuggest\t\tbigramfile word\n\tsuggestPfx\t\tbigramfile word prefix\n\tinWhitelist\tbigramfile word\n\tinBlacklist\tbigramfile word\n\tcompile\t\...
Python
0
@@ -210,18 +210,16 @@ gestPfx%5C -t%5C tbigramf @@ -387,16 +387,66 @@ corpus_n +%5D%5Cn%5Ctcombine%5Ct%5Ctbigramfile_out %5Bbigramfile_in ... %5D%5Cn%22)%0A%09e @@ -1181,10 +1181,326 @@ rgv%5B2%5D)%0A +elif argv%5B1%5D==%22combine%22:%0A%09bigrams=%7B%7D%0A%09for fname in argv%5B3:%5D:%0A%09%09world=loadBigrams(f...
a1e468f7bf22f46de7ec0d41e37d75299cc205a7
Allow email-src and email-dst as input for apivoid module
misp_modules/modules/expansion/apivoid.py
misp_modules/modules/expansion/apivoid.py
import json import requests from . import check_input_attribute, standard_error_message from pymisp import MISPAttribute, MISPEvent, MISPObject misperrors = {'error': 'Error'} mispattributes = {'input': ['domain', 'hostname', 'email'], 'format': 'misp_standard'} moduleinfo = {'version': '0.2', 'author': 'Christian Stu...
Python
0
@@ -227,16 +227,42 @@ 'email' +, 'email-src', 'email-dst' %5D, 'form
8ec51a310324006b46d5bdfe1adfcef00f461d02
update construct images
construct_mockfields.py
construct_mockfields.py
import os import sys import numpy as np import glob import gfs_sublink_utils as gsu import shutil import math import astropy import astropy.io.fits as pyfits #import matplotlib #import matplotlib.pyplot as plt import scipy import scipy.ndimage #import make_color_image import numpy.random as random import congrid import...
Python
0.000009
@@ -1449,16 +1449,17 @@ ess.txt' +) %0A%0A im
23939ace63c12391dc07a3419a55ca573ee5dd73
Update debug output and remove unnecessary assignment
righteous/api/server_template.py
righteous/api/server_template.py
import re from urllib import urlencode from logging import getLogger import omnijson as json from .. import config from .base import _request, debug log = getLogger(__name__) def list_server_templates(): """ Lists ServerTemplates :return: list of dicts of server information with the following keys: ...
Python
0
@@ -2110,28 +2110,8 @@ one%0A - success = False%0A @@ -2554,23 +2554,24 @@ Created -S +s erver -T + t emplate
5a3d991d53e35ba7b307b53998d38e7382b5ec61
Add SOFTMAT to instrument list
scripts/set_instrument_list.py
scripts/set_instrument_list.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
@@ -4166,24 +4166,80 @@ led=False),%0A + inst_dictionary(%22SOFTMAT%22, is_scheduled=False),%0A %5D%0A%0A n
1f19fa52e40db1f28d620aa8bf75745e814c0f81
Remove unused import
cogs/fun.py
cogs/fun.py
import random import discord from discord.ext import commands from utils.messages import ColoredEmbed class Fun: def __init__(self, bot): self.bot = bot @commands.command() async def xkcd(self, ctx): """See the latest XKCD comic.""" async with self.bot.session.get('https://xkcd.co...
Python
0.000001
@@ -1,18 +1,4 @@ -import random%0A impo
6725788d8bbd64cbfd251036787125c07a50b32c
convert camera parameter value to string
ros3ddevcontroller/controller.py
ros3ddevcontroller/controller.py
# # Copyright (c) 2015 Open-RnD Sp. z o.o. # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without # restriction, including without limitation the rights to use, copy, # modify, merge, publ...
Python
0
@@ -3662,38 +3662,43 @@ set_param(name, +str( value) +) %0A
14eaff694912320296412f2e4ca51072c5dddf49
add unit_testing_only decorator
corehq/apps/userreports/dbaccessors.py
corehq/apps/userreports/dbaccessors.py
from django.conf import settings from dimagi.utils.couch.database import iter_docs from corehq.apps.domain.dbaccessors import get_docs_in_domain_by_class from corehq.apps.domain.models import Domain def get_number_of_report_configs_by_data_source(domain, data_source_id): """ Return the number of report conf...
Python
0
@@ -1,89 +1,4 @@ -from django.conf import settings%0A%0Afrom dimagi.utils.couch.database import iter_docs%0A%0A from @@ -109,16 +109,69 @@ Domain%0A +from corehq.util.test_utils import unit_testing_only%0A %0A%0Adef ge @@ -570,16 +570,35 @@ lue'%5D%0A%0A%0A +@unit_testing_only%0A def get_ @@ -623,42 +623,8 @@ ()...
e595d823e303a6db0a9c7e24f6a9d1644615009c
Bump version of CaptchaService.py
module/plugins/internal/CaptchaService.py
module/plugins/internal/CaptchaService.py
# -*- coding: utf-8 -*- from module.plugins.internal.Captcha import Captcha class CaptchaService(Captcha): __name__ = "CaptchaService" __type__ = "captcha" __version__ = "0.34" __status__ = "stable" __description__ = """Base anti-captcha service plugin""" __license__ = "GPLv3" ...
Python
0.003249
@@ -188,17 +188,17 @@ _ = %220.3 -4 +5 %22%0A __
06c72a654abf915c1ddbe8a58153a712de41eb69
fix defaults
rootpy/root2matplotlib.py
rootpy/root2matplotlib.py
from .plotting.hist import _HistBase from .plotting import HistStack from math import sqrt import matplotlib.pyplot as plt __all__ = [ 'hist', 'histstack', 'bar', 'barstack', 'errorbar', ] def _set_defaults(h, kwargs, types=['common']): defaults = {} for key in types: if key == 'c...
Python
0.000002
@@ -6271,17 +6271,27 @@ : h. -linec +GetLineC olor +('mpl') ,%0A @@ -6394,19 +6394,29 @@ : h. -m +GetM arker -s +S tyle +('mpl') ,%0A
5efc40cd9be0c212f142d7469a9bf6f44da0827a
add story support in client with -s boolean operator
instapy_cli/__main__.py
instapy_cli/__main__.py
import sys from platform import python_version from instapy_cli.cli import InstapyCli as client from optparse import OptionParser import pkg_resources # part of setuptools version = pkg_resources.require('instapy_cli')[0].version ''' TODO: - use instapy_cli.media to download image link and use it for upload and conf...
Python
0
@@ -229,216 +229,29 @@ on%0A%0A -%0A'''%0ATODO:%0A- use instapy_cli.media to download image link and use it for upload and configure_photo%0A- rewrite main to support file and links for media%0A'''%0Adef main(args=None):%0A%0A welcome_msg = 'instapy-cli' +def main(args=None):%0A %0A @@ -265,16 +265,20 @@ 'inst...
6341f351aab0ff510fcf1d9ce135be680763a971
Fix comments in backtracking/coloring.py (#4857)
backtracking/coloring.py
backtracking/coloring.py
""" Graph Coloring also called "m coloring problem" consists of coloring given graph with at most m colors such that no adjacent vertices are assigned same color Wikipedia: https://en.wikipedia.org/wiki/Graph_coloring """ def valid_coloring( neighbours: list[int], colored_vertices: list[int], col...
Python
0
@@ -74,16 +74,18 @@ oloring +a given gr @@ -158,16 +158,20 @@ ssigned +the same col @@ -370,32 +370,36 @@ ghbour check if +the coloring constra @@ -473,24 +473,24 @@ eturn False%0A - If all n @@ -508,16 +508,20 @@ alidate +the constrai @@ -1247,16 +1247,20 @@ colored +the graph)%0A%0A @@ -1288...
70076f43b3d430dbbe8a4106c53526a4dbacdfed
fix mention logging
cogs/msg.py
cogs/msg.py
import discord import logging import re from .utils import config from .utils.allmsgs import quickcmds, custom from .utils.checks import permEmbed, me from datetime import datetime from discord import utils log = logging.getLogger('LOG') class OnMessage: def __init__(self, bot): self.bot = bot s...
Python
0.000004
@@ -178,34 +178,8 @@ time -%0Afrom discord import utils %0A%0Alo @@ -3359,417 +3359,183 @@ -em = discord.Embed(title='%5CN%7BBELL%7D MENTION', colour=0x9b59b6)%0A ping = True%0A role = False%0A if hasattr(self.bot, 'mention_count'):%0A ...
0e8214509db0b273e7136270946b8d6688899356
Fix api.resultdb.update_inclusions
recipe_modules/resultdb/api.py
recipe_modules/resultdb/api.py
# Copyright 2019 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """API for interacting with the ResultDB service. Requires `rdb` command in `$PATH`: https://godoc.org/go.chromium.org/luci/resultdb/cmd/rdb """ ...
Python
0.000001
@@ -2061,21 +2061,20 @@ pdate-in -vocat +clus ions',%0A
86c9a2191e412d7701940e5aa64279ca000235b3
Add ListsRanking, which is identical to ProbabilisticRanking, and PairwisePreferenceRanking as well #57
interleaving/ranking.py
interleaving/ranking.py
from collections import defaultdict class BalancedRanking(list): ''' A list of document IDs generated by an interleaving method including two rankers A and B ''' __slots__ = ['a', 'b'] def __hash__(self): return hash((tuple(self), tuple(self.a), tuple(self.b))) def dumpd(self): ...
Python
0
@@ -1431,21 +1431,13 @@ ass -Probabilistic +Lists Rank @@ -2231,16 +2231,68 @@ %7D%0A%0A +class ProbabilisticRanking(ListsRanking):%0A pass%0A%0A class Te @@ -3390,20 +3390,77 @@ eam_dict,%0A %7D%0A +%0Aclass PairwisePreferenceRanking(ListsRanking):%0A pass%0A
ca295aff7a051c5a8b5272a47f4af32378db3185
Update PID_wrap.py
control/PID/PID_wrap.py
control/PID/PID_wrap.py
import sensors.SensorClass as SensorClass import PID_controller import numpy as np class PID(object): def __init__(self): self.data = SensorClass.Data_file.State() self.controller_x = PID_controller.PID_Controller(self) self.controller_y = PID_controller.PID_Controller(self) self.c...
Python
0
@@ -76,16 +76,49 @@ y as np%0A +import Accel_to_Pos as posfinder%0A %0A%0Aclass @@ -146,32 +146,67 @@ __init__(self):%0A + self.pos = posfinder(self)%0A self.dat @@ -1892,16 +1892,55 @@ heta):%0A%0A + %22%22%22%0A Depended on Sonar%0A%0A @@ -2046,32 +2046,284 @@ a.get_state...
c70725998da63acc0837400fcc885f60b98b8ee3
Update for new return format for rel show.
dbclient.py
dbclient.py
# -*- coding: iso-8859-1 -*- import socket, types, base64 class EResponse(Exception): pass class EDuplicate(EResponse): pass class dbclient: def __init__(self, host, port): self.server = (host, port) self.userpass = None self.auth_ok = False self.is_connected = False def _reconnect(self): if self.is_conn...
Python
0
@@ -3756,17 +3756,17 @@ %5B0%5D != %22 -P +R %22: raise @@ -3877,51 +3877,8 @@ :%5D:%0A -%09%09%09if rel%5B0%5D != %22R%22: raise EResponse(line)%0A %09%09%09l @@ -3888,20 +3888,16 @@ pend(rel -%5B1:%5D )%0A%09%09rels
f26c2059ff6e2a595097ef7a03efe149f9e253eb
Add default images for podcasts if necessary
iterator.py
iterator.py
import os, re, requests rootdir = '_posts' for subdir, dirs, files in os.walk(rootdir): for file in files: filename = os.path.join(subdir, file) f = open(filename, "r") contents = f.readlines() f.close() # Find first image for key, line in enumerate(contents): src = re.sear...
Python
0.000001
@@ -259,591 +259,234 @@ -%09for key, line in enumerate(contents):%0A %09%09src = re.search('%5C!%5C%5B.*?%5C%5D%5C((.*?)%5C)', lin + if re.search('podcast', filenam e) +: %0A -%09%09if src:%0A %09%09%09wordpress_src = re.search('/blog/images/wordpress/(.*)', src.group(1))%0A %09%09%09if wordpres...
6d52a6a1447ae854e22bc6317b694cb3bb317c12
Fix import paths
curiosity/bot.py
curiosity/bot.py
import traceback import logbook from ruamel import yaml from curious.commands.bot import CommandsBot from curious.commands.context import Context from curious.commands.exc import CheckFailureError, MissingArgumentError, ConversionFailedError from curious.dataclasses import Game, Status, Message from curious.event imp...
Python
0.00008
@@ -261,16 +261,23 @@ aclasses +.status import @@ -288,17 +288,56 @@ , Status -, +%0Afrom curious.dataclasses.message import Message
a72e0a6068614b740ade7586ec316db7b9611b46
Make JBrowse work in DEBUG mode without nginx.
genome_designer/urls.py
genome_designer/urls.py
from django.conf.urls import include from django.conf.urls import patterns from django.conf.urls import url from django.views.generic import RedirectView urlpatterns = patterns('', url(r'^$', 'genome_designer.main.views.home_view'), # Project-specific views url(r'^projects$', 'genome_designer....
Python
0.000001
@@ -148,16 +148,33 @@ ctView%0A%0A +import settings%0A%0A urlpatte @@ -3902,8 +3902,149 @@ ip'),%0A)%0A +%0Aif settings.DEBUG:%0A from django.conf.urls.static import static%0A urlpatterns += static('jbrowse', document_root=settings.JBROWSE_ROOT)%0A
e0f3e68435b406e3bad9b7f7e459b724ea832e9e
Disable summernote editor test from Travis
shuup_tests/browser/admin/test_editor.py
shuup_tests/browser/admin/test_editor.py
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2018, Shuup Inc. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. import os import pytest from django.core.urlresolvers import reverse from ...
Python
0
@@ -772,16 +772,126 @@ jangodb%0A +@pytest.mark.skipif(os.environ.get(%22SHUUP_TESTS_TRAVIS%22, %220%22) == %221%22, reason=%22Disable when run through tox.%22)%0A def test
2d228ed998ecdfd95822189d3532dbaafd3827ef
refactor datetime field in TickObject
rqalpha/model/tick.py
rqalpha/model/tick.py
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, 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 ...
Python
0.000001
@@ -1003,519 +1003,8 @@ %22%22%22%0A -%0A try:%0A dt = tick_dict%5B%22datetime%22%5D%0A except KeyError:%0A pass%0A else:%0A if not dt:%0A tick_dict%5B%22datetime%22%5D = datetime.datetime.min%0A else:%0A if not isinstance(d...
6f7c11c13793cbba7904cfd2a27ab3eb59ab9302
Update ispyb/sp/xtalimaging.py: proper multi-line docstring
ispyb/sp/xtalimaging.py
ispyb/sp/xtalimaging.py
from __future__ import absolute_import, division, print_function from ispyb.interface.dataarea import DataArea class XtalImaging(DataArea): """provides methods for accessing crystal imaging tables.""" def upsert_sample_image( self, id=None, sample_id=None, inspection_id=None,...
Python
0
@@ -1967,16 +1967,33 @@ e image. +%0A %0A Either @@ -2007,24 +2007,16 @@ a point -%0A (by pro @@ -2048,16 +2048,24 @@ ition1y) +%0A or a RO @@ -2086,24 +2086,16 @@ tionally -%0A providi @@ -2124,16 +2124,24 @@ tion2y). +%0A Positio @@ -2166,24 +2166,16 @@ give...
b1d1df9a5368a50f82a8bab6a4be023a51ef603f
Update PickList.py
Cogs/PickList.py
Cogs/PickList.py
import asyncio import discord from discord.ext import commands def setup(bot): # This module isn't actually a cog return class Picker: def __init__(self, **kwargs): self.list = kwargs.get("list", []) self.title = kwargs.get("title", None) self.timeout = kwargs.get("timeout", 60) ...
Python
0
@@ -2400,10 +2400,8 @@ ji)) -+1 %0A @@ -2437,16 +2437,18 @@ actions) +-1 :%0A
eda2f6905a3275623525c4179358e55e472b4fd7
Fix bug in urls.py following the sample_list template being renamed.
genome_designer/urls.py
genome_designer/urls.py
from django.conf.urls.defaults import include from django.conf.urls.defaults import patterns from django.conf.urls.defaults import url urlpatterns = patterns('', url(r'^$', 'genome_designer.main.views.home_view'), # Project-specific views url(r'^projects$', 'genome_designer.main.views.project_...
Python
0
@@ -1232,16 +1232,98 @@ mplates%0A + ############################################################################%0A%0A url( @@ -1427,14 +1427,15 @@ ist_ -upload +targets _tem @@ -1447,94 +1447,8 @@ '),%0A - ############################################################################%0A %0A %0A%0A
63702a236d6c882b747cb19b566122a4a8ddfa3b
Change Indicator.add_menu arguments to allow passing CheckMenuItem status
jackselect/indicator.py
jackselect/indicator.py
"""A convenience class for a GTK 3 system tray indicator.""" from pkg_resources import resource_filename import gi gi.require_version('Gtk', '3.0') # noqa from gi.repository import Gtk from gi.repository.GdkPixbuf import Pixbuf class Indicator: """This class defines a standard GTK3 system tray indicator. ...
Python
0
@@ -1919,22 +1919,23 @@ n=None, -active +enabled =True, i @@ -1966,24 +1966,38 @@ + active=False, menu=None, @@ -2681,32 +2681,70 @@ MenuItem(title)%0A + m_item.set_active(active)%0A else:%0A @@ -2904,30 +2904,31 @@ t_sensitive( -active +enabled )%0A m_
b324650da9dde4bbe2e235b29a3b4c571f41a7b2
Comment out debug output
run-google-java-format.py
run-google-java-format.py
#!/usr/bin/python # This script reformats each file supplied on the command line according to # the Google Java style (by calling out to the google-java-format program, # https://github.com/google/google-java-format), but with improvements to # the formatting of annotations in comments. from __future__ import print_f...
Python
0.000001
@@ -1602,24 +1602,26 @@ ar_name)%0A + # print(%22retr
50bd1ce1118ddb52a54f679fc9faee4bc3110458
Allow the --force command line argument to accept one or more stage names'
rubra/cmdline_args.py
rubra/cmdline_args.py
# Process the unix command line of the pipeline. import argparse from version import rubra_version def get_cmdline_args(): return parser.parse_args() parser = argparse.ArgumentParser( description='A bioinformatics pipeline system.') parser.add_argument( '--pipeline', metavar='PIPELINE_FILE', typ...
Python
0
@@ -1101,16 +1101,31 @@ ult=%5B%5D,%0A + nargs='+',%0A help
4009e01004ecd9b8f3d759842181b65a3893f73a
fix `TypeError: the JSON object must be str, bytes or bytearray, not NoneType`
simple_settings/dynamic_settings/base.py
simple_settings/dynamic_settings/base.py
# -*- coding: utf-8 -*- import re from copy import deepcopy import jsonpickle class BaseReader(object): """ Base class for dynamic readers """ _default_conf = {} def __init__(self, conf): self.conf = deepcopy(self._default_conf) self.conf.update(conf) self.key_pattern = s...
Python
0.000001
@@ -602,32 +602,57 @@ elf.auto_casting + and (result is not None) :%0A re
a6356d45059c0a323d315884bd1e24b8bf2eb4f5
Correct error in 'now' command with missing duration
commands.py
commands.py
# coding=utf-8 import argparse import dateutil.parser import re import sys from datetime import datetime, timedelta import connection parser = argparse.ArgumentParser() subparsers = parser.add_subparsers() def quickadd(summary): from config import config service = connection.connect() # Double up sin...
Python
0.000011
@@ -1019,25 +1019,28 @@ 0, duration= -0 +None ):%0A from @@ -1053,32 +1053,79 @@ import config%0A%0A + if duration is None:%0A duration = 0%0A%0A service = co
b884341d73cb80e86df9ec756d5b84154a2bb982
Update migration for tweak to available_power
netbox/dcim/migrations/0072_powerfeeds.py
netbox/dcim/migrations/0072_powerfeeds.py
import django.core.validators from django.db import migrations, models import django.db.models.deletion import taggit.managers class Migration(migrations.Migration): dependencies = [ ('extras', '0021_add_color_comments_changelog_to_tag'), ('dcim', '0071_device_components_add_description'), ] ...
Python
0
@@ -1553,16 +1553,32 @@ efault=0 +, editable=False )),%0A
a6cb3bfeb5f7201a0e702024257df1f874a3bb70
Bump version 15.
terroroftinytown/client/__init__.py
terroroftinytown/client/__init__.py
VERSION = 14 # Please update this whenever .client or .services changes # Please update MIN_VERSION_OVERRIDE and MIN_CLIENT_VERSION_OVERRIDE as needed
Python
0
@@ -8,9 +8,9 @@ = 1 -4 +5 #
3f70ead379b7f586313d01d5ab617fd5368f8ce3
Print traceback if startup fails
cthulhubot/management/commands/restart_masters.py
cthulhubot/management/commands/restart_masters.py
from django.core.management.base import BaseCommand from cthulhubot.models import Buildmaster class Command(BaseCommand): help = 'Restart all Buildmaster processes' args = "" def handle(self, *fixture_labels, **options): verbosity = int(options.get('verbosity', 1)) commit = int(options.ge...
Python
0.000008
@@ -1,12 +1,44 @@ +from traceback import print_exc%0A from django. @@ -732,16 +732,44 @@ master'%0A + print_exc()%0A @@ -875,16 +875,44 @@ o start master'%0A + print_exc()%0A
8095347cc2b4b1d10ae9e37223d98c2dd44b7164
fix reversing after commit
nm_payment/drivers/bbs/payment_session.py
nm_payment/drivers/bbs/payment_session.py
import concurrent.futures from threading import Lock import logging log = logging.getLogger('nm_payment') from nm_payment.base import PaymentSession from nm_payment.exceptions import ( SessionCompletedError, SessionCancelledError, CancelFailedError, ) from .session import BBSSession RUNNING = 'RUNNING' CANCELL...
Python
0.000002
@@ -1302,25 +1302,41 @@ -reverse = +commit = True%0A self._s @@ -1509,21 +1509,16 @@ -reverse = not +commit = sel @@ -1602,21 +1602,21 @@ -reverse = Tru +commit = Fals e%0A%0A @@ -1633,15 +1633,14 @@ if -reverse +commit :%0A @@ -1666,78 +1666,85 @@ _sta -rt_reversal()%0A ...
4541b5edc808d77f53305eafca418d3be6715e8d
Cut 0.17.3
invocations/_version.py
invocations/_version.py
__version_info__ = (0, 17, 2) __version__ = '.'.join(map(str, __version_info__))
Python
0.000001
@@ -24,9 +24,9 @@ 17, -2 +3 )%0A__
8d70bad3968cb11c929beafcef44b023822b886f
make interval adjustable in poll_request, and also remove check_response call duplication
stacktester/common/http.py
stacktester/common/http.py
from stacktester import exceptions import httplib2 import os import time class Client(object): USER_AGENT = 'python-nova_test_client' def __init__(self, host='localhost', port=80, base_url=''): #TODO: join these more robustly self.base_url = "http://%s:%s/%s" % (host, port, base_url) d...
Python
0
@@ -421,16 +421,61 @@ ', 180)%0A + interval = kwargs.pop('interval', 2)%0A @@ -529,16 +529,40 @@ ime())%0A%0A + while True:%0A @@ -622,19 +622,16 @@ -while (not + if ( chec @@ -651,24 +651,46 @@ sp, body)):%0A + break%0A @@ -820,70 +820,16...
a8fe56cd60296607f879dea86432532a5b40824a
Add a main method
dame/__init__.py
dame/__init__.py
Python
0.998985
@@ -0,0 +1,48 @@ +from .dame import *%0Adef main():%0A dame.main()%0A
c005ce217f77aa185ad8916475463f2040a3dc67
clean up yaml generator.
iridium/core/trapper.py
iridium/core/trapper.py
from functools import wraps from .logger import glob_logger from iridium.config import config from .exceptions import FunctionException import yaml from inspect import signature def tracer(func): """ tracer will decorate a given function which allow users to step through a function call on error. :par...
Python
0
@@ -2138,17 +2138,16 @@ _val)%7D%7D, - %0A
e6d0e3c2b01a28a3235d1de292f99328c77e6584
print usage
dnsquery.py
dnsquery.py
import sys import csv import time import logging from common import threadpool import dns.resolver import dns.message import dns.rdataclass import dns.rdatatype import dns.query import dns.exception class DNSQueryTask(threadpool.Task): def do(self): qname, qtype, qcount, bdnsip = "", "", 0, "" ...
Python
0.000003
@@ -1760,14 +1760,18 @@ = %22Q +uery File%22%0A - DNS_ @@ -1918,16 +1918,18 @@ print(%22 +%5Cn python d @@ -1942,49 +1942,91 @@ y.py - -f %3Cquery_list.csv%3E -s %3Cbackend_dns_ip%3E%22 +%5Cn%22)%0A for argItem in ARGUMENT_LIST:%0A print(%22 %22, argItem%5B1%5D, argItem%5B2%5D )%0A%0Ad @@ -2340,35 ...
083499cc0bb2ad443bbebb45d0e75bd0bc2df8b7
allow ssh key of any size
fig_leaf.py
fig_leaf.py
""" Fig Leaf: Encrypt and decrypt data with ssh keys! 2017 maryx Usage: 1. Run `pip install pycrypto` 2. To encrypt, run `python fig_leaf.py <path to file location> <path to output location> <path to public key>` 3. To decrypt, run `python fig_leaf.py <path to encrypted file location> <path to output location> <path t...
Python
0.000001
@@ -344,16 +344,30 @@ t%60%0A%22%22%22%0A%0A +import pickle%0A import a @@ -1100,16 +1100,17 @@ return +%5B encrypte @@ -1124,18 +1124,17 @@ tric_key - + +, encrypt @@ -1136,24 +1136,25 @@ crypted_data +%5D %0A%0Adef decryp @@ -1346,12 +1346,8 @@ ta%5B0 -:512 %5D%0A @@ -1398,12 +1398,9 @@ ata%5B -512: +...
1cbe7b335405e6294fcbca792914932f7226ac9b
Fix entities API
openfisca_web_api/controllers/entities.py
openfisca_web_api/controllers/entities.py
# -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or modify...
Python
0.000035
@@ -969,16 +969,22 @@ ontexts, + conv, model, @@ -995,16 +995,16 @@ helpers%0A - %0A%0A@wsgih @@ -1736,16 +1736,1011 @@ q.method +%0A params = req.GET%0A inputs = dict(%0A context = params.get('context'),%0A )%0A data, errors = conv.pipe(%0A conv.struct(%0A dict(%0A ...
f5e65b648d632f2e75dffe7943ed3e7105b21d7f
Remove GCS patch fixed upstream in te upstream library
core/polyaxon/fs/gcs.py
core/polyaxon/fs/gcs.py
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
Python
0
@@ -601,36 +601,8 @@ se.%0A -import os%0A%0Aimport aiofiles%0A%0A from @@ -653,116 +653,8 @@ stem -%0Afrom gcsfs.checkers import get_consistency_checker%0Afrom gcsfs.retry import retry_request, validate_response %0A%0Afr @@ -770,16 +770,16 @@ ystem):%0A + retr @@ -791,1359 +791,8 @@ 3%0A%0A - @retry_requ...
bbd2a08d732a2db4c0e9ae1fcfd16b3959876526
fix starting error
package/scripts/mongo_db.py
package/scripts/mongo_db.py
import os from time import sleep from resource_management import * from mongo_base import MongoBase from resource_management.core.logger import Logger from resource_management.libraries.script.script import Script class MongoMaster(MongoBase): mongo_packages = ['mongodb-org'] def install(self, env): i...
Python
0.000003
@@ -3126,16 +3126,25 @@ pattern%7D +; sleep 5 ')%0A
cb92a3cf67557fbd4a629601490a74bdb2119935
add print_list method to dijkstra
dijkstra.py
dijkstra.py
# -*- coding: utf-8 -*- class Dijkstra: def __init__(self, adj, start): self.adj = adj self.s = start self.dists = [0 for x in range(len(adj))] # Liefert minimales Element > 0 def minweight(self, verts): return min([x for x in verts if x>0]) # Baut liste der Entfernung...
Python
0.000001
@@ -471,10 +471,286 @@ )%5D = v%0A%0A -%0A + # Ausgabe der k%C3%BCrzesten Wege von Knoten s zu alle anderen Knoten%0A def print_list(self):%0A print(%22Distance from Node %22+ str(adj%5Bself.s%5D) + %22 to:%22 )%0A for node in range(len(self.adj)):%0A print(%22%5Ct%5CtNode %22+str(adj%5B...
ed42fa81e1029633f6b6f426c437df0c55262922
Fix LabHubApp.
jupyterlab/labhubapp.py
jupyterlab/labhubapp.py
import os from traitlets import default from .labapp import LabApp try: from jupyterhub.singleuser import SingleUserNotebookApp except ImportError: SingleUserLabApp = None raise ImportError('You must have jupyterhub installed for this to work.') else: class SingleUserLabApp(SingleUserNotebookApp, Lab...
Python
0
@@ -2,16 +2,32 @@ mport os +%0Aimport warnings %0A%0Afrom t @@ -557,17 +557,16 @@ - warnings @@ -658,16 +658,34 @@ set %22 + + %5C%0A %22c.Spaw
f4c1093616d08bd4abcb5ddc030b59d863dcec05
Change netapi to use processmanager
salt/client/netapi.py
salt/client/netapi.py
# encoding: utf-8 ''' The main entry point for salt-api ''' # Import python libs import logging import multiprocessing import signal import os # Import salt-api libs import salt.loader logger = logging.getLogger(__name__) class NetapiClient(object): ''' Start each netapi module that is configured to run ...
Python
0
@@ -178,16 +178,42 @@ t.loader +%0Aimport salt.utils.process %0A%0Alogger @@ -411,1409 +411,389 @@ -# pid -%3E %7Bfun: foo, Process: object%7D%0A self.pid_map = %7B%7D%0A self.netapi = salt.loader.netapi(self.opts)%0A%0A def add_process(self, fun):%0A '''%0A Start a netapi child p...
72b3d998a14388be98c73556df1cd20859a71573
remove invalid data
signal_receive.py
signal_receive.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com> # # Distributed under terms of the MIT license. """ """ import tornado.httpserver import tornado.ioloop import tornado.web import serial import signal import sys import json tornado_port = 8888 # create s...
Python
0.001233
@@ -932,24 +932,38 @@ _signal():%0A%0A + data = %22%22%0A try:%0A @@ -951,32 +951,32 @@ a = %22%22%0A try:%0A - if ser.i @@ -1084,21 +1084,27 @@ -print +error_msg = %22Error @@ -1274,16 +1274,17 @@ e.args)%0A +%0A @@ -1288,16 +1288,27 @@ print + error_msg, message ...
32e1ff21562c451ab790c0af077b3760855f1e6b
use slider component for bmi gui
ExPy/ExPy/module19.py
ExPy/ExPy/module19.py
""" BMI Calculator """ import rx import tkcomponents def calculate_bmi(weight, height): """ Given weight (pounds), height (inches) Return BMI """ return (weight / (height * height)) * 703. def bmi_recommendation(bmi): """Given a BMI, return a recommendation""" if bmi < 18.5: return 'Y...
Python
0
@@ -17,16 +17,47 @@ or %22%22%22%0A%0A +from tkinter import HORIZONTAL%0A import r @@ -1505,37 +1505,37 @@ = tkcomponents. -input +scale _stream(root, we @@ -1548,16 +1548,65 @@ abels, 1 +, from_=1, to=500, orient=HORIZONTAL, default=160 )%0A he @@ -1712,21 +1712,21 @@ ponents. -input +scale _stream( @@ -17...
89f8d0ebe01e188b5a043dfbf891cf3a3bca0504
Clarify that event is sent up to the master
salt/modules/event.py
salt/modules/event.py
''' Fire events on the minion, events can be fired up to the master ''' # Import salt libs import salt.crypt import salt.utils.event import salt.payload def fire_master(data, tag): ''' Fire an event off on the master server CLI Example:: salt '*' event.fire_master 'stuff to be in the event' 'ta...
Python
0.001957
@@ -207,18 +207,21 @@ ent off +up t o -n the mas
75ce6e126dc8865630d87d3a0dcad71017567082
update copyright
doc/conf.py
doc/conf.py
# -*- coding: utf-8 -*- # # StepScan doc import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.append(os.path...
Python
0
@@ -711,16 +711,17 @@ m ones.%0A +%0A extensio @@ -1449,14 +1449,8 @@ pics - Step Scan @@ -1469,17 +1469,17 @@ = u'201 -2 +5 , Matthe
d2f223c60c3b1e6ccf9ec088c821c92631b623a8
Comment that says PayPal doesn't work yet. Waiting on feedback from them.
config/idp_proxy_conf.example.py
config/idp_proxy_conf.example.py
# The port the service will listen on from idpproxy.social.facebook import FacebookOAuth2 from idpproxy.social.falltrough import FallTrough from idpproxy.social.google import GoogleOIC from idpproxy.social.twitter import Twitter from idpproxy.social.liveid import LiveIDOAuth2 from idpproxy.social.openidconnect import O...
Python
0
@@ -5757,24 +5757,55 @@ %0A %7D,%0A + # !!! Doesn't work yet !!!%0A %22paypal%22
4bc5883ad792078ade196610ee83adb967c95d8f
Check for available data before submitting it The code here is self-explaining again..
plugins/SliceInfoPlugin/SliceInfo.py
plugins/SliceInfoPlugin/SliceInfo.py
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Extension import Extension from UM.Application import Application from UM.Preferences import Preferences from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Scene.SceneNode import SceneNode f...
Python
0
@@ -4790,16 +4790,159 @@ ners():%0A + container_id = container.getId()%0A container_serialized = container.serialize()%0A if container_serialized:%0A @@ -4985,24 +4985,19 @@ ontainer -.getId() +_id )%5D = con @@ -4994,33 +4994,33 @@ id)%5D = container -. +_ serialize(...
e6d327a5249e14765999357a391d97c4fd2cd8b8
Test for sitemap.xml
skeleton/tests.py
skeleton/tests.py
from django.core import management from django.test import TestCase as BaseTestCase from django.test.client import Client as BaseClient, FakePayload, \ RequestFactory from django.core.urlresolvers import reverse from post.models import Post from foundry.models import Member class TestCase(BaseTestCase): @cl...
Python
0.000001
@@ -322,19 +322,17 @@ ssmethod - %0A + def @@ -839,17 +839,9 @@ e()%0A - %0A + @@ -1377,17 +1377,16 @@ ), 200), - %0A @@ -1406,32 +1406,67 @@ post-1/', 200),%0A + ('/sitemap.xml', 200),%0A )%0A
5f962415d401b3c37825d6e3a0560de47ce9ec3d
remove unused code
controller/lib/jubamgr/controller/main.py
controller/lib/jubamgr/controller/main.py
# -*- coding: utf-8 -*- import threading import msgpackrpc from jubavisor.client import Jubavisor from jubavisor.types import ServerArgv from .config import JubaManagerConfig from .zk import get_zk, cancel_if_down class JubaManagerController(): @classmethod def main(cls, args): myself = args.pop(0) # ...
Python
0.000017
@@ -2761,95 +2761,8 @@ ',)%0A - #future = client.call_async(method, cluster._id, 'jubamgr',)%0A #future.get()%0A
eb624f48a259e948f4bc4c33370fe971b19ea19b
Update alert() fn tests according to new signature
tests/alerts/geomodel/test_alert.py
tests/alerts/geomodel/test_alert.py
from datetime import datetime, timedelta from mozdef_util.utilities.toUTC import toUTC from alerts.geomodel.alert import alert import alerts.geomodel.locality as locality class TestAlert: '''Unit tests for alert generation. ''' def test_do_not_alert_when_travel_possible(self): state = locality....
Python
0
@@ -1012,32 +1012,59 @@ ed = alert(state +.username, state.localities )%0A%0A asser @@ -1872,16 +1872,43 @@ rt(state +.username, state.localities )%0A%0A
6312f162eb37ac3e57a18ea80fe201ab08a6ded1
Add Docstring entry for the filter feature of dir_items()
convenience/file_convenience/dir_items.py
convenience/file_convenience/dir_items.py
import os # ============================================================================== # DIR ITEMS # ============================================================================== def dir_items(d, opt="all", rel=True, root="", filter=""): """...
Python
0
@@ -2132,16 +2132,117 @@ ectory.%0A + :param filter: (string)%0A Used to filter for items that contain this string in their name.%0A %22%22%22%0A @@ -2339,16 +2339,18 @@ DO: -create a +Expand the fil @@ -2376,94 +2376,20 @@ ter -for certain types of files, or%0A # directories, using somet...
a710b93fead29a49cebebe37fecd33ed9ac4221c
add exception for not exit table
sacrud/pyramid_ext/views/CRUD.py
sacrud/pyramid_ext/views/CRUD.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2014 uralbash <root@uralbash.ru> # # Distributed under terms of the MIT license. """ Views for Pyramid frontend """ import itertools import json from pyramid.httpexceptions import HTTPFound, HTTPNotFound from pyramid.view import view_conf...
Python
0.000003
@@ -1961,24 +1961,83 @@ of_lists()%0A%0A + if not self.table:%0A raise HTTPNotFound%0A%0A pk =
2eb3a682706a5ff0255474230ec32fd0ac96c727
update mac build script
sansview/setup_mac.py
sansview/setup_mac.py
""" This is a setup.py script partly generated by py2applet Usage: python setup.py py2app """ from setuptools import setup import periodictable.xsf import DataLoader.readers from distutils.sysconfig import get_python_lib import os DATA_FILES = [] RESOURCES_FILES = [] #Periodictable data file DATA_FILES = period...
Python
0
@@ -784,16 +784,21 @@ xml_path +_test = '%25s/l @@ -851,16 +851,21 @@ xml_path +_test ): %0A @@ -872,13 +872,38 @@ -break +libxml_path = libxml_path_test %0Aif
9777b51ee2f898c176b6e7d2c9412eb7556bb60b
fix typo for load array (#5315)
keras/utils/io_utils.py
keras/utils/io_utils.py
"""Utilities related to disk I/O.""" from __future__ import absolute_import from __future__ import print_function import numpy as np import sys from collections import defaultdict try: import h5py except ImportError: h5py = None try: import tables except ImportError: tables = None class HDF5Matrix(...
Python
0.000001
@@ -3271,36 +3271,36 @@ or('The use of %60 -save +load _array%60 requires
b6c8e38b96293bacd7739411200cd85f47f1efca
handle division by zero
prophet/analyze.py
prophet/analyze.py
from prophet.utils.formatters import dict_to_table import math import numpy as np class Analyzer(object): def __repr__(self): return self.name class Volatility(Analyzer): name = 'volatility' def run(self, backtest, **kwargs): return backtest.get_daily_returns().std() class Sharpe(Ana...
Python
0.002079
@@ -587,32 +587,81 @@ ING_DAYS', 252)%0A + if volatility == 0:%0A return 0%0A return ( @@ -710,16 +710,16 @@ atility%0A - @@ -1167,32 +1167,98 @@ ING_DAYS', 252)%0A + if volatility_negative_returns == 0:%0A return 0%0A return ( @@ -1842,16 +1842,16 @@ ...
6ddc32c10124d10db53f9017044be65a00a35a33
Add newline to end of __init__.py.
propka/__init__.py
propka/__init__.py
"""PROPKA 3.1 See https://github.com/jensengroup/propka-3.1 for more information. Please cite these PROPKA references in publications: * Sondergaard, Chresten R., Mats HM Olsson, Michal Rostkowski, and Jan H. Jensen. "Improved Treatment of Ligands and Coupling Effects in Empirical Calculation and Rationalization of ...
Python
0.000005
@@ -985,8 +985,9 @@ ersion%22%5D +%0A
468dd25146fb5041f4fd029f72a8caa39c808e63
Fix typo in keystoneclient
keystoneclient/utils.py
keystoneclient/utils.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
Python
0.009128
@@ -830,16 +830,17 @@ the sema +n tics of
0560f65eb6740281c77c9b016bd9a44f486be6ae
Use dense matrices instead of sparse where that makes sense
openprescribing/matrixstore/matrix_ops.py
openprescribing/matrixstore/matrix_ops.py
import numpy import scipy.sparse def sparse_matrix(shape, integer=False): """ Create a new sparse matrix (either integer or floating point) in a form suitable for populating with data """ dtype = numpy.int_ if integer else numpy.float_ return scipy.sparse.lil_matrix(shape, dtype=dtype) def f...
Python
0.000011
@@ -1,12 +1,45 @@ +from __future__ import division%0A%0A import numpy @@ -61,16 +61,627 @@ parse%0A%0A%0A +# Above a certain level of density it becomes more efficient to use a normal%0A# dense matrix instead of a sparse one. This threshold was determined through a%0A# not particularly scientific process of trial and...
34f6eef42401590bc1809af68e15992f63736027
Add sensor class for gyroscope uncalibrated
plyer/platforms/android/gyroscope.py
plyer/platforms/android/gyroscope.py
''' Android Gyroscope --------------------- ''' from plyer.facades import Gyroscope from jnius import PythonJavaClass, java_method, autoclass, cast from plyer.platforms.android import activity Context = autoclass('android.content.Context') Sensor = autoclass('android.hardware.Sensor') SensorManager = autoclass('andro...
Python
0.000001
@@ -1337,16 +1337,1016 @@ pass%0A%0A%0A +class GyroUncalibratedSensorListener(PythonJavaClass):%0A __javainterfaces__ = %5B'android/hardware/SensorEventListener'%5D%0A%0A def __init__(self):%0A super(GyroUncalibratedSensorListener, self).__init__()%0A service = activity.getSystemService(Context.SE...
00dce916e18bb0b05601d82d734e1cfdc45af140
Fix update container and call to ocular
polyaxon/monitor_statuses/monitor.py
polyaxon/monitor_statuses/monitor.py
import logging import ocular from django.conf import settings from constants.jobs import JobLifeCycle from db.redis.containers import RedisJobContainers from polyaxon.celery_api import celery_app from polyaxon.settings import K8SEventsCeleryTasks logger = logging.getLogger('polyaxon.monitors.statuses') def update...
Python
0
@@ -2013,20 +2013,16 @@ -job_ containe @@ -2577,20 +2577,21 @@ logger. -info +debug ('------ @@ -2650,32 +2650,36 @@ ate)%0A if +not pod_state:%0A
1185595ea55f4b4be2f227a37b33d8142bcf92c1
bump version to 6.0.0.dev0
stellar_sdk/__version__.py
stellar_sdk/__version__.py
""" _____ _______ ______ _ _ _____ _____ _____ _ __ / ____|__ __| ____| | | | /\ | __ \ / ____| __ \| |/ / | (___ | | | |__ | | | | / \ | |__) |____| (___ | | | | ' / \___ \ | | | __| | | | | / /\ \ | _ /______\___ \| | | | < _...
Python
0.000004
@@ -718,12 +718,17 @@ = %22 -5.0. +6.0.0.dev 0%22%0A_
e589f4347a730abc64f43b3b427ac556643c361f
Use proper mesh
graphs/hydrogen_pfem.py
graphs/hydrogen_pfem.py
R_x = { 0: [5, 7, 13, 15, 21, 25, 29], } R_y = { (1, 0): [0.1843068472879863, 0.06235603500209852, 0.011111956105256449, 0.00050366115986938409, 7.1562463805907583e-06, 4.0298526238213839e-08, 3.9956294661802616e-08], (2, 0): [0.046105675637867799, 0.013246017078074462, 0.005542485710768652,...
Python
0.000032
@@ -24,25 +24,29 @@ 7, 1 -3, 15 +0, 16 , -2 1 +8 , 2 -5, 29 +2, 28, 34 %5D,%0A @@ -82,162 +82,187 @@ %5B0.1 -8430684 +70766 72 -8 79 -86 +596837 3, 0.0 -6235603500209852, 0.011111956105256449, 0.00050366115986938409, 7.1562463805907583 +43356138894337204, 0.041045532914633254, 0.0058943597765469535, 0.000187...
9b3fee4f413c02c0b69465fe935b9ea48206191d
Add context to excerpts
conjure/controllers/jujumodel.py
conjure/controllers/jujumodel.py
from conjure.ui.views.jujumodel import (NewModelView, ExistingModelView) from conjure.controllers.deploy import DeployController from conjure.controllers.jujumodels.maas import MaasJujuModelController from conjure.controllers.jujumodels.openstack import OpenStackJujuModelController # noqa from conjure.controllers.juju...
Python
0.999997
@@ -803,17 +803,238 @@ to use. -%22 + This would be the %22%0A %22equivalent of running %60juju bootstrap -e %3Cmodel%3E%60.%5Cn%5Cn%22%0A %22For more information type %60%7Bcmd%7D%60 at your %22%0A %22command prompt.%22.format(cmd='juju help bootstrap') )%0A%0A @@ -...
5ad7dfbea0b85fca283025e09a0dc33b2fbe97a6
switch to the cdn domain
crate_project/settings/production/base.py
crate_project/settings/production/base.py
from ..base import * LOGGING = { "version": 1, "disable_existing_loggers": True, "filters": { "require_debug_false": { "()": "django.utils.log.RequireDebugFalse", }, }, "formatters": { "simple": { "format": "%(levelname)s %(message)s" }, }...
Python
0.000001
@@ -1646,19 +1646,24 @@ es.crate -.io +-cdn.com %22,%0A%7D%0A%0ADE @@ -1872,27 +1872,32 @@ %22media.crate -.io +-cdn.com %22%0A%0A# PRIVATE
01be6bb650c7077cd5b3b7edacfa1b325c798def
Set email addresses
deployment/templates/local_settings.py
deployment/templates/local_settings.py
from opendebates.settings import * DEBUG = False # logging settings #LOGGING['filters']['static_fields']['fields']['deployment'] = '{{ deployment_tag }}' #LOGGING['filters']['static_fields']['fields']['environment'] = '{{ environment }}' #LOGGING['filters']['static_fields']['fields']['role'] = '{{ current_role }}' # ...
Python
0
@@ -2537,16 +2537,17 @@ ettings%0A +# EMAIL_HO @@ -2648,16 +2648,188 @@ nt %7D%7D%5D ' +%0AADMINS = %5B%0A ('Caktus Opendebates team', 'opendebates-team@caktusgroup.com'),%0A%5D%0ADEFAULT_FROM_EMAIL = 'opendebates-team@caktusgroup.com'%0ASERVER_EMAIL = DEFAULT_FROM_EMAIL %0A%0A# Redi
f4f39057cbbfa4daf66f82061e57101b88d88d05
Make csviter work on python 3.7
scrapy/utils/iterators.py
scrapy/utils/iterators.py
import re import csv import logging try: from cStringIO import StringIO as BytesIO except ImportError: from io import BytesIO from io import StringIO import six from scrapy.http import TextResponse, Response from scrapy.selector import Selector from scrapy.utils.python import re_rsearch, to_unicode logger = l...
Python
0
@@ -3320,24 +3320,25 @@ 'utf-8'%0A +%0A def _getrow( @@ -3329,29 +3329,35 @@ def -_getrow(csv_r +row_to_unicode(row_ ):%0A @@ -3412,19 +3412,12 @@ in -next(csv_r) +row_ %5D%0A%0A @@ -3810,77 +3810,185 @@ -headers = _getrow(csv_r)%0A%0A while True:%0A row = _getrow(csv_r +try:%0A...
61cf2cb400e5ad80923570824e50dd40828ce434
make scope_server status work again
scope/scope_server.py
scope/scope_server.py
# The MIT License (MIT) # # Copyright (c) 2014-2015 WUSTL ZPLAB # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, ...
Python
0
@@ -2318,43 +2318,64 @@ -client_tester = ScopeClientTester() +from . import scope_client%0A connected = False %0A @@ -2375,32 +2375,35 @@ lse%0A +is_ connected = lamb @@ -2411,86 +2411,296 @@ a: c -lient_tester.connected # wait for connection to be established%0A if +onne...
59833d6a9ef216ae78c4116e6fae8441f1ba5d9c
remove redundants
tests/chainer_tests/functions_tests/activation_tests/test_sigmoid.py
tests/chainer_tests/functions_tests/activation_tests/test_sigmoid.py
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import testing from chainer.testing import attr def _sigmoid(x): half = x.dtype.type(0.5) return numpy.tanh(x * half) * half + half @testing.parameterize(*testing.product({ 'shape':...
Python
0.999999
@@ -1386,34 +1386,8 @@ id(x -.copy()).astype(self.dtype )%0A
bbb9d7e65fdff189562d1e2a5cdf4a302e562f3e
Use parameterized test
tests/chainer_tests/functions_tests/math_tests/test_trigonometric.py
tests/chainer_tests/functions_tests/math_tests/test_trigonometric.py
import unittest import numpy import chainer from chainer import cuda import chainer.functions as F from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition class UnaryFunctionsTestBase(object): def make_data(self): raise NotIm...
Python
0.000001
@@ -230,16 +230,88 @@ ition%0A%0A%0A +@testing.parameterize(*testing.product(%7B%0A 'shape': %5B(3, 2), ()%5D,%0A%7D))%0A class Un @@ -330,19 +330,26 @@ Test -Base(object +(unittest.TestCase ):%0A%0A @@ -447,35 +447,151 @@ lf.x -, self.gy = self.make_data( + = numpy.random.uniform(.5, 1, self.shape).astype(nump...
f265c31a8500e5f66096bc157266c4400e68cb2e
Version bump
rest_witchcraft/__version__.py
rest_witchcraft/__version__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals __author__ = 'Serkan Hosca' __author_email__ = 'serkan@hosca.com' __version__ = '0.2.3' __description__ = 'SQLAlchemy specific things for django-rest-framework'
Python
0.000001
@@ -178,11 +178,11 @@ '0. -2.3 +3.0 '%0A__
a985f0ac4ef31e534e96319da9980745f5169252
Disable some Pylint errors
tests/integration/modules/pillar.py
tests/integration/modules/pillar.py
# -*- coding: utf-8 -*- # Import Python Libs from distutils.version import LooseVersion # Import Salt Testing libs from salttesting import skipIf from salttesting.helpers import ( ensure_in_syspath, requires_network ) ensure_in_syspath('../../') # Import salt libs import integration GIT_PYTHON = '0.3.2' HAS...
Python
0.000001
@@ -81,16 +81,66 @@ eVersion + # pylint: disable=import-error,no-name-in-module %0A%0A# Impo
abb72e478fd0bdf5929111d3bc782b94e98819ab
Revert b00b3c4 (but keep addition to allow_failure list in test_valid_docs())
tests/integration/modules/sysmod.py
tests/integration/modules/sysmod.py
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import import re # Import Salt Testing libs from salttesting.helpers import ensure_in_syspath ensure_in_syspath('../../') # Import salt libs import integration # Import 3rd-party libs import salt.ext.six as six class SysModuleTest(integr...
Python
0
@@ -380,1737 +380,8 @@ '''%0A - def test_list_functions(self):%0A '''%0A sys.list_functions%0A '''%0A # Get all functions%0A funcs = self.run_function('sys.list_functions')%0A self.assertIn('hosts.list_hosts', funcs)%0A self.assertIn('pkg.install', funcs)%0A%0A ...
c98ef2e8b64b7daa94c0e883f71813a3e3226a78
set current day to none if there is none
riskgame/context_processors.py
riskgame/context_processors.py
# -*- coding: utf-8 from riskgame.models import Player, TeamPlayer, EpisodeDay, Game def player(request): returnDict = {} if request.user.is_authenticated(): try: currentPlayer = Player.objects.get(user=request.user) except Player.DoesNotExist: currentPlayer = Playe...
Python
0.020175
@@ -701,36 +701,64 @@ st:%0A -pass +returnDict%5B'current_day'%5D = None %0A%0A try:%0A
734c7c9ad2d1290a202e48ebb5535a0bc371bd75
fix iarc constant test
mkt/constants/tests/test_ratingsbodies.py
mkt/constants/tests/test_ratingsbodies.py
from contextlib import contextmanager from nose.tools import eq_ from tower import activate import amo.tests import mkt.constants.ratingsbodies as ratingsbodies class TestRatingsBodies(amo.tests.TestCase): def test_all_ratings_waffle_off(self): ratings = ratingsbodies.ALL_RATINGS() # Assert o...
Python
0.000002
@@ -2205,75 +2205,8 @@ ting -%0A assert isinstance(rating.description, unicode), rating %0A%0A
7bb6ac8e1d6e742c2c02c3cc489ea350175dc8cd
Refactor source grab's try/catch
vizydrop/rest/base.py
vizydrop/rest/base.py
from http.client import INTERNAL_SERVER_ERROR import json from vizydrop.rest import VizydropAppRequestHandler from vizydrop.sdk.source import StreamingDataSource from tornado.gen import coroutine from tornado.httpclient import AsyncHTTPClient, HTTPRequest, HTTPError from . import TpaHandlerMixin class BaseHandler(Vi...
Python
0
@@ -1489,16 +1489,33 @@ ields)%0A%0A + try:%0A @@ -1567,32 +1567,36 @@ e):%0A + + source_type.stre @@ -1629,33 +1629,16 @@ am_data%0A - try:%0A @@ -1791,223 +1791,11 @@ e -xcept HTTPError as e:%0A raise e%0A except Exception as ...
546d4ac0bbf14da2bc5610aa09b5a75627b297a6
Add 131
100_to_199/euler_131.py
100_to_199/euler_131.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Problem 131 There are some prime values, p, for which there exists a positive integer, n, such that the expression n3 + n2p is a perfect cube. For example, when p = 19, 83 + 82×19 = 123. What is perhaps most surprising is that for each prime with this property the val...
Python
0.999937
@@ -486,16 +486,26 @@ me_sieve +, is_prime %0Afrom it @@ -625,16 +625,21 @@ def p131 +_slow (): # A @@ -1051,15 +1051,254 @@ (cnt)%0A%0A%0A +def p131():%0A # n**3 + p = (n+1)**3%0A # p = 3n**2 + 3n + 1%0A cnt = 0%0A for n in count(1):%0A p = 3 * (n ** 2) + 3 * n + 1%0A if p %3E= 1000000:...
6e04d3ab8a6d967c14afaf45869152c93d94d1ec
Refactor remote URI formatting functions
gutenberg/textsource.py
gutenberg/textsource.py
"""Module providing implementations of the api.TextSource interface.""" from __future__ import absolute_import from . import beautify from . import api from .common import wget import itertools import logging import os import rdflib import tarfile class GutenbergEbooks(api.TextSource): """Implementation of api....
Python
0
@@ -245,16 +245,982 @@ rfile%0A%0A%0A +def _is_legacy_uid(uid):%0A return 0 %3C uid %3C 10%0A%0A%0Adef _format_uri(uid):%0A if _is_legacy_uid(uid):%0A raise ValueError('should use legacy URI format for UIDs in (0..10)')%0A%0A uid = str(uid)%0A return '%7Broot%7D/%7Bpath%7D/%7Buid%7D/%7Buid%7D.txt'.f...
2e158ee445e2714b655ea12ef09810aad2c172fb
decrease ct size
tests/syft/lib/tenseal/duet_test.py
tests/syft/lib/tenseal/duet_test.py
# stdlib import atexit from multiprocessing import Process from multiprocessing import set_start_method import socket import sys import time from typing import Any from typing import Generator from typing import List # third party import pytest # syft absolute import syft as sy # syft relative from ...grid.duet.proc...
Python
0.000005
@@ -3060,34 +3060,12 @@ %5B10 - ** p for p in range(2, 3) +, 20 %5D:%0A
10318a11dded5e69c3d9c98325613700c9b3db63
Fix for dependent package detection.
lib/spack/spack/cmd/dependents.py
lib/spack/spack/cmd/dependents.py
Python
0
@@ -0,0 +1,1814 @@ +##############################################################################%0A# Copyright (c) 2013, Lawrence Livermore National Security, LLC.%0A# Produced at the Lawrence Livermore National Laboratory.%0A#%0A# This file is part of Spack.%0A# Written by Todd Gamblin, tgamblin@llnl.gov, All rights...
a941b99cd198b1be7707c1110a2d0e24f7539b2e
support for the new output mode
lib/svtplay_dl/service/tv4play.py
lib/svtplay_dl/service/tv4play.py
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- from __future__ import absolute_import import sys import re import xml.etree.ElementTree as ET import json import copy from svtplay_dl.utils.urllib import urlparse, parse_qs, quote_plus from svtplay_dl.service import Service, Open...
Python
0.000001
@@ -142,16 +142,26 @@ port re%0A +import os%0A import x @@ -393,16 +393,28 @@ _py2_old +, filenamify %0Afrom sv @@ -2005,32 +2005,422 @@ sys.exit(2)%0A +%0A if options.output_auto:%0A directory = os.path.dirname(options.output)%0A options.service = %22tv4play%22%0A title...
4f3c3755d9fcbfd9ce0551c19bb893e7ba73db91
Add missing setup.py
numpy/numarray/setup.py
numpy/numarray/setup.py
Python
0.000003
@@ -0,0 +1,524 @@ +%0Afrom os.path import join%0A%0Adef configuration(parent_package='',top_path=None):%0A from numpy.distutils.misc_util import Configuration%0A config = Configuration('numarray',parent_package,top_path)%0A%0A config.add_data_files('include/numarray/*.h')%0A%0A # Configure fftpack_lite%0A ...
735ce7f11b70bf8e916bad5610093b5886c57db6
Add quickseg.py
cyvlfeat/quickshift/quickseg.py
cyvlfeat/quickshift/quickseg.py
Python
0
@@ -0,0 +1,3196 @@ +import numpy as np%0Afrom cyvlfeat.quickshift import quickshift%0Afrom cyvlfeat.quickshift import flatmap%0Afrom cyvlfeat.quickshift import imseg%0A%0A%0Adef quickseg(image, ratio, kernel_size, max_dist):%0A %22%22%22%0A Produce a quickshift segmentation of a greyscale image.%0A%0A Paramete...