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
4dc49433ad354b1530207db308f4c7b76f40db70
Add command
tf2server.py
tf2server.py
import os import libtmux class CorruptedTf2ServerInstanceError(Exception): """ Raised when an invalid TF2 server instance is found. """ class Tf2Server(object): """ The Tf2Server class represents a single Team Fortress 2 server. """ def __init__(self, name, path): """ Cr...
Python
0.001952
@@ -3,16 +3,28 @@ port os%0A +import time%0A import l @@ -329,17 +329,16 @@ Create -s the Tf2 @@ -1112,16 +1112,555 @@ log'))%0A%0A + def _has_sourcemod(self):%0A path = os.path.join(self.path, 'tf/addons/sourcemod/plugins/basechat.smx')%0A return os.path.isfile(path)%0A%0A def command(self,...
9b922f5e3e99d2fa9eb4b56ebb3ccf6b591680cc
update docstring
depfinder/cli.py
depfinder/cli.py
# Copyright (c) <2015-2016>, Eric Dill # # All rights reserved. Redistribution and use in source and binary forms, with # or without modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and ...
Python
0.000001
@@ -4013,34 +4013,44 @@ lp=%22 -Ignore pattern(s) for file +Comma separated list of file pattern s no @@ -4056,18 +4056,18 @@ ot to in -p s +p ect%22%0A
a1bda82bd06cbfd12e6074f22cb31d88f2abd96a
update py +x
tools/fuckGFW.py
tools/fuckGFW.py
''' Update hosts for *nix Author: cloud@txthinking.com Version: 0.0.1 Date: 2012-10-24 14:35:39 ''' import urllib2 import os import sys HOSTS_PATH = "/etc/hosts" HOSTS_SOURCE = "http://tx.txthinking.com/hosts" SEARCH_STRING = "#TX-HOSTS" def GetRemoteHosts(url): f = urllib2.urlopen(url, timeout=5) hosts = [l...
Python
0.000001
@@ -1,12 +1,58 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A '''%0AUpdate h
ed8fc99f0867779db8879b3f6cc142985d01fc58
change RunInstances argument
qingcloud/cli/iaas_client/actions/instance/run_instances.py
qingcloud/cli/iaas_client/actions/instance/run_instances.py
# coding: utf-8 from qingcloud.cli.misc.utils import explode_array from qingcloud.cli.iaas_client.actions.base import BaseAction class RunInstancesAction(BaseAction): action = 'RunInstances' command = 'run-instances' usage = '%(prog)s --image_id <image_id> --instance_type <instance_type> [options] [-f <c...
Python
0
@@ -414,17 +414,17 @@ ument('- -i +m ', '--im @@ -1935,25 +1935,25 @@ _argument('- -m +l ', '--login_
3d5fc893cee6b7ab1596acedb052366ce86005b7
Use requests module rather than mozsvc.http_helpers
tokenserver/assignment/sqlnode.py
tokenserver/assignment/sqlnode.py
""" SQL Mappers """ import json import sys from zope.interface import implements import time from mozsvc.util import dnslookup from tokenserver.assignment import INodeAssignment from tokenserver.util import get_logger # try to have this changed upstream: # XXX being able to set autocommit=1; # forcing it for now fro...
Python
0
@@ -87,16 +87,33 @@ t time%0A%0A +import requests%0A%0A from moz @@ -769,48 +769,8 @@ ror%0A -from mozsvc.http_helpers import get_url%0A from @@ -2033,75 +2033,316 @@ ta)%0A - status, headers, body = get_url(url, method, data, headers) +%0A try:%0A resp = requests.request(method, url, data...
8f22be125cabf38f00b360e0c6d48a5d1650bef0
Remove wrong dependency
sponsorship_compassion/__openerp__.py
sponsorship_compassion/__openerp__.py
# -*- encoding: utf-8 -*- ############################################################################## # # ______ Releasing children from poverty _ # / ____/___ ____ ___ ____ ____ ___________(_)___ ____ # / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \ # / /___/ /_/ / / / /...
Python
0.000086
@@ -1631,19 +1631,8 @@ - 'l10n_ch', 'ac
145e9141af1e1abdf0a9ab3c035ed8df6298ba0f
rebase migration dependency.
accelerator/migrations/0015_expert_bio_add_max_length_validation.py
accelerator/migrations/0015_expert_bio_add_max_length_validation.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.14 on 2018-07-25 15:00 from __future__ import unicode_literals import django.core.validators from django.db import ( migrations, models, ) class Migration(migrations.Migration): dependencies = [ ('accelerator', '0013_allocator'), ] opera...
Python
0
@@ -286,19 +286,41 @@ '001 -3_allocator +4_alter_fluent_page_type_managers '),%0A
0992a05b5f199b6ade27f19af9271e5e8556c372
Clarified an example param
apollo-ws/visualizer-services/GAIA/trunk/VisualizerServiceClient.py
apollo-ws/visualizer-services/GAIA/trunk/VisualizerServiceClient.py
# Copyright 2013 University of Pittsburgh # # 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 ...
Python
0.999483
@@ -1552,20 +1552,20 @@ = %22PSC_ -GAIA +FRED _v1.0_42
837f05228fac7f6addd28069c6387f798e01ff8c
Add checksum test.
tests/test_fs.py
tests/test_fs.py
from farmfs.fs import normpath as _normalize from farmfs.fs import userPath2Path as up2p from farmfs.fs import Path import pytest def test_create_path(): p1 = Path("/") p2 = Path("/a") p2 = Path("/a/b") p3 = Path(p1) p4 = Path("a", p1) with pytest.raises(AssertionError): p5 = Path("/a/b", p2) with py...
Python
0.000002
@@ -1321,20 +1321,838 @@ h(%22/%22) %3C Path(%22/a%22)%0A +%0A@pytest.mark.skip(reason=%22bugs not impacting development at moment.%22)%0Adef test_relative_to():%0A assert Path(%22/a/b%22).relative_to(Path(%22/%22)) == %22a/b%22%0A assert Path(%22/a/b%22).relative_to(Path(%22/a%22)) == %22b%22%0A assert Path(%22/a/...
9786c5f242f2b70240e7bb23c866c864cb4ed4ca
Add registrations to admin
expeditions/admin.py
expeditions/admin.py
from django.contrib import admin from expeditions.models import Expedition, Waypoint # Register your models here. class ExpeditionAdmin(admin.ModelAdmin): list_display = ('id', 'name', 'start_date', 'end_date', 'published') search_fields = ('name', 'start_date') list_filter = ('published', ) class Waypoi...
Python
0
@@ -77,16 +77,30 @@ Waypoint +, Registration %0A# Regis @@ -236,16 +236,56 @@ ished')%0A + list_display_links = ('id', 'name')%0A sear @@ -470,24 +470,64 @@ 'datetime')%0A + list_display_links = ('id', 'name')%0A list_fil @@ -631,16 +631,273 @@ time')%0A%0A +%0Aclass RegistrationAdmin(admin.ModelAd...
6c7ce5298f9555027dafcd36596775d4e4424d97
Add GUIDHelper class
exporter/exporter.py
exporter/exporter.py
from cfconfigurator.cf import CF from cfconfigurator.uaa import UAA, UAAException import collections import yaml import pyaml class LastUpdatedOrderedDict(collections.OrderedDict): 'Store items in the order the keys were last added' def __setitem__(self, key, value): if key in self: del sel...
Python
0
@@ -118,16 +118,26 @@ rt pyaml +%0Aimport os %0A%0Aclass @@ -445,16 +445,856 @@ pass%0A%0A +%0Aclass GUIDHelper:%0A%0A def __init__(self, config):%0A self._config = config%0A%0A def get_guids(self):%0A guids = %5Bresource%5B'metadata'%5D%5B'guid'%5D for resource in self._config%5B0%5D%5B'resou...
44c78525ee886a369be66d671523dd3258ba37d5
Remove hard FPU for Cortex M4 // Resolve #162
platformio/builder/scripts/basearm.py
platformio/builder/scripts/basearm.py
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. """ Base for ARM microcontrollers. """ from SCons.Script import Builder, DefaultEnvironment env = DefaultEnvironment() env.Replace( AR="arm-none-eabi-ar", AS="arm-none-eabi-as", CC="arm-none-eabi-gcc", CXX="arm-none-eabi-g...
Python
0
@@ -1254,431 +1254,8 @@ %0A)%0A%0A -if env.get(%22BOARD_OPTIONS%22, %7B%7D).get(%22build%22, %7B%7D).get(%0A %22cpu%22, %22%22)%5B-2:%5D == %22m4%22 and env.get(%22BOARD%22) != %22frdm_k20d50m%22:%0A env.Append(%0A CPPFLAGS=%5B%0A %22-mfloat-abi=hard%22,%0A %22-mfpu=fpv4-sp-d16%2...
98bacbc912513fa33775e2e6c2e41363aea7c793
Remove strange code
stencil/base.py
stencil/base.py
import os import optparse import sys try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict from .resources import Directory, File, Template class WrongSource(Exception): pass class Stencil(object): source = None variables = [] help = None de...
Python
0.000538
@@ -2274,39 +2274,24 @@ sources%5Bpath - %25 self.context %5D = Director @@ -2715,23 +2715,8 @@ path - %25 self.context %5D =
e748b424d2dac18fc82192be154948ff52d3aae2
future div. print
tools/roc_auc.py
tools/roc_auc.py
#!/usr/bin/env python2 """Calculate ROC AUC for parametric maps vs. Gleason scores. Optionally compare AUCs and draw the ROC curves into a file.""" import argparse import numpy as np import dwi.patient import dwi.plot import dwi.util def parse_args(): """Parse command-line arguments.""" p = argparse.Argumen...
Python
0.999998
@@ -143,16 +143,64 @@ le.%22%22%22%0A%0A +from __future__ import division, print_function%0A import a @@ -2293,17 +2293,17 @@ print - +( 'Samples @@ -2312,32 +2312,33 @@ %7Bn%7D'.format(**d) +) %0A print 'Scor @@ -2331,17 +2331,17 @@ print - +( 'Scores: @@ -2355,32 +2355,33 @@ %7Bs%7D'.format(**d) +...
e3eb155d762e7941e5cb4aa08fe580baeb2e191b
Improve doctest results parser
platformio/test/runners/doctest.py
platformio/test/runners/doctest.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
Python
0.000007
@@ -892,81 +892,8 @@ e):%0A - if line.strip().startswith(%22%5Bdoctest%5D%22):%0A return None%0A @@ -956,25 +956,24 @@ n_divider()%0A -%0A if n @@ -991,79 +991,49 @@ p_tc -:%0A self._tmp_tc = TestCase(%22%22, TestStatus.PASSED, stdout=%22 + or line.strip().startswith(%22%5...
5324cfaf23b9907f6a6cb54bf03fdc07b5d3f56c
Fix some tests
plenum/test/batching_3pc/helper.py
plenum/test/batching_3pc/helper.py
import types from binascii import hexlify from plenum.common.constants import DOMAIN_LEDGER_ID from plenum.common.messages.node_messages import ThreePhaseType from plenum.common.startable import Mode from plenum.common.txn_util import reqToTxn, append_txn_metadata from plenum.common.util import check_if_all_equal_in_l...
Python
0.000006
@@ -2255,135 +2255,82 @@ -ledger = ledger_manager.ledgerRegistry%5Bledger_id%5D.ledger%0A ledgerInfo = ledger_manager.getLedgerInfoByType(ledger_id) +catchup_rep_service = ledger_manager._catchup_gatherers%5Bledger_id%5D.service %0A%0A @@ -3128,84 +3128,37 @@ -ledger_manager._add_txn(%0A ...
ab23ea60457720d0a7414b1b84191945f529b23c
Update _version.py
fabsetup/_version.py
fabsetup/_version.py
__version__ = "0.7.9"
Python
0.000002
@@ -14,9 +14,52 @@ %220.7.9%22 + # semantic versioning: https://semver.org %0A
28c8d1cc6df216dfe1f3bcfa3eb70bb590204613
implement post_vote()
pybooru/api_danbooru.py
pybooru/api_danbooru.py
# -*- coding: utf-8 -*- """pybooru.api_danbooru This module contains all API calls of Danbooru for Pybooru. Classes: Danbooru -- Contains all API calls. """ # __future__ imports from __future__ import absolute_import # pybooru imports from .exceptions import PybooruAPIError class DanbooruApi(object): """...
Python
0.000009
@@ -1202,17 +1202,26 @@ id_: -w +REQUIRED W here id_ @@ -1506,16 +1506,25 @@ id_: + REQUIRED The id @@ -2630,16 +2630,25 @@ id_: + REQUIRED Post id @@ -2855,20 +2855,383 @@ er_post_id%7D, 'PUT')%0A +%0A def post_vote(self, id_, score):%0A %22%22%22Action lets you vote for a post (Require...
2e1aae60ba563f13d1b0aafebae534592cf0d503
Add from_cloud method
pydgraph/client_stub.py
pydgraph/client_stub.py
# Copyright 2018 Dgraph Labs, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
0.000001
@@ -3517,125 +3517,373 @@ ase. - For more details,%0A # see: https://discuss.dgraph.io/t/regarding-slash-cloud-dgraph-endpoints-in-the-clients/13492 +%0A # Use from_cloud method to connect to dgraph cloud backend.%0A @staticmethod%0A def from_slash_endpoint(cloud_end_point, api_key):%0A return from_...
8c4edd4cc8fdd6c7c470e25436b6c6b4c146ad58
Fix error casting datetime objects
data-analysis/utils.py
data-analysis/utils.py
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Bitergia # # 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 ...
Python
0.000003
@@ -1000,25 +1000,8 @@ er%0A%0A -import datetime%0A%0A impo @@ -1882,135 +1882,8 @@ lue) -%0A elif isinstance(value, datetime.datetime):%0A value = str(value)%0A else:%0A value = str(value) %0A%0A
9f405a3b4e01ee0a42a8530cfc5b509a38067250
Remove unused import
mugloar/dragon.py
mugloar/dragon.py
import json class Dragon: # By default, stay home. scaleThickness = 0 clawSharpness = 0 wingStrength = 0 fireBreath = 0 def __init__(self, weather_code): if weather_code == 'T E': # Draught requires a 'balanced' dragon, ha ha self.scaleThickness = 5 ...
Python
0.000001
@@ -1,17 +1,4 @@ -import json%0A%0A %0Acla @@ -691,25 +691,25 @@ Thickness = -6 +3 %0A @@ -760,25 +760,25 @@ gStrength = -4 +5 %0A @@ -788,33 +788,33 @@ lf.fireBreath = -4 +6 %0A elif we
b8701f04d049101c8c92b468b4fc3dc863f1e292
Add bulk accept and reject for talks
pygotham/admin/talks.py
pygotham/admin/talks.py
"""Admin for talk-related models.""" from pygotham.admin.utils import model_view from pygotham.talks import models __all__ = ('CategoryModelView', 'TalkModelView', 'TalkReviewModelView') CategoryModelView = model_view( models.Category, 'Categories', 'Talks', form_columns=('name', 'slug'), ) TalkMod...
Python
0.000038
@@ -31,16 +31,104 @@ ls.%22%22%22%0A%0A +from flask.ext.admin import actions%0Afrom flask.ext.admin.contrib.sqla import ModelView%0A%0A from pyg @@ -163,16 +163,45 @@ el_view%0A +from pygotham.core import db%0A from pyg @@ -260,26 +260,28 @@ View', ' -TalkM +talk_m odel -V +_v iew', 'T @@ -302,16 +302,965 @@ Vi...
377d729dfa7910a477f24f7fe44d3648a5f631de
add help text to tools/generate_tags_and_topics.py; close #437
tools/generate_tags_and_topics.py
tools/generate_tags_and_topics.py
#!/usr/bin/env python import sys, os, json, random if len(sys.argv) < 2: print("Usage: generate_tags_and_topics <coursedir>") sys.exit(0) course_dir = sys.argv[1] if not os.path.isdir(course_dir): print("ERROR: Not a directory: %s" % course_dir) sys.exit(1) ##########################################...
Python
0
@@ -3541,16 +3541,95 @@ output%0A%0A +print(%22New tags and topics not already present in %25s%22 %25 course_info_file_name)%0A print(%22%7B
eab0e21b1d5aac6c5be14a84fade651103f3e910
Use wchar functions consistently
pymediainfo/__init__.py
pymediainfo/__init__.py
import json import os import sys from pkg_resources import get_distribution import xml.etree.ElementTree as ET from ctypes import * __version__ = get_distribution("pymediainfo").version class Track(object): def __getattribute__(self, name): try: return object.__getattribute__(self, name) ...
Python
0
@@ -2926,129 +2926,8 @@ r_p%0A - lib.MediaInfoA_Option.argtypes = %5Bc_void_p, c_char_p, c_char_p%5D%0A lib.MediaInfoA_Option.restype = c_char_p%0A @@ -3049,25 +3049,24 @@ ib.MediaInfo -A _Open.argtyp @@ -3083,16 +3083,17 @@ id_p, c_ +w char_p%5D%0A @@ -3109,25 +3109,24 @@ ib.MediaInfo -A _Op...
54bb5a2320fb88daf9c24ad7b6a9b6cb0a6ab0cc
add send_image_url
pymessenger/send_api.py
pymessenger/send_api.py
import json import requests from requests_toolbelt import MultipartEncoder DEFAULT_API_VERSION = 2.6 class SendApiClient(object): def __init__(self, access_token, api_version=DEFAULT_API_VERSION): self.api_version = api_version self.access_token = access_token self.base_url = ( ...
Python
0.000002
@@ -983,18 +983,16 @@ sponse%0A%0A -%0A%0A def @@ -3652,16 +3652,564 @@ _header).json()%0A +%0A def send_image_url(self, recipient_id, image_url):%0A payload = %7B%0A 'recipient': json.dumps(%0A %7B%0A 'id': recipient_id%0A %7D%0A ...
ec261fdaf41bd91558e4df143be8dfd9940bde81
Rewrite bubble sort.
py/sorting/05_bubbleSort.py
py/sorting/05_bubbleSort.py
def bubbleSort(A): tempValue = 0 for k in range(1, len(A)): flag = 0 for i in range(0, len(A) - k): if A[i+1] > A[i]: tempValue = A[i+1] A[i+1] = A[i] A[i] = tempValue flag += 1 if flag == 0: break ...
Python
0.000001
@@ -16,75 +16,326 @@ A):%0A -%0A tempValue = 0%0A%0A for k in range(1, len + for k in range(len(A)-1, 0, -1):%0A for i in range(k):%0A if A%5Bi%5D %3E A%5Bi+1%5D:%0A tempValue = A%5Bi%5D%0A A%5Bi%5D = A%5Bi+1%5D%0A A%5Bi+1%5D = tempValue%0A%0A ...
2998a776a702d8d8fbd3e5f54f263fce55ba621c
Correct number of new links printed by first scrape
mutube/mutuber.py
mutube/mutuber.py
""" Script to scrape /bleep/ and post to YouTube playlist Upcoming improvements include Management of `live_threads`. This could then be presented as a combination of a module and a script, with command line argument parsing, and inserted to mutube """ from .exceptions import NoPlaylist, BadVideo from .pla...
Python
0
@@ -1426,32 +1426,60 @@ _pause%0A %0A + # Get existing id's%0A #! shoul @@ -1615,16 +1615,70 @@ ng_ids() +%0A self.scraper.yt_ids.update(self.existing_ids) %0A%0A de
4f97405c7e034a5f1deae21e6dbec427c9d1816e
Set co_lnotab to the empty string
src/tblib/__init__.py
src/tblib/__init__.py
try: from __pypy__ import tproxy except ImportError: tproxy = None try: from .cpython import tb_set_next except ImportError: tb_set_next = None if not tb_set_next and not tproxy: raise ImportError("Cannot use tblib. Runtime not supported.") import sys from types import CodeType from types import ...
Python
0.999999
@@ -3589,42 +3589,10 @@ %5D = -code%5B'co_lnotab'%5D.decode('latin1') +'' %0A @@ -4179,93 +4179,8 @@ ))%0A - frame%5B'f_code'%5D%5B'co_lnotab'%5D = frame%5B'f_code'%5D%5B'co_lnotab'%5D.encode('latin1')%0A
2490228f94b24dd45f9ee879d9ff91c5a3dc3300
Add process "running" status to log output.
pysc2/lib/sc_process.py
pysc2/lib/sc_process.py
# Copyright 2017 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 ...
Python
0.000015
@@ -4487,12 +4487,38 @@ t %25s -%22, i + (running: %25s)%22, i, is_running )%0A
f00d5073c46bc553c1d42e623b2eca5c6dfaa25c
Treat regex string as raw
tractor-purge.py
tractor-purge.py
#!/usr/bin/env python import sys import os import platform import subprocess import re import shutil import datetime import logging from optparse import OptionParser #################################### # Option parser and constants TRACTOR_PURGE_VERSION = 'v1.0.0' parser = OptionParser(version='%prog ' + TRACTOR_PU...
Python
0.999994
@@ -3234,16 +3234,17 @@ .search( +r 'J%5Cd*',
9017a30c6e6ec7b08e4793fe4e730bba447f1d59
Fix deprecation warning about unittest.assertRaisesRegexp() in Python 3.
pybtex/tests/plugin_test.py
pybtex/tests/plugin_test.py
# Copyright (c) 2014 Matthias C. M. Troffaes # # 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, pub...
Python
0
@@ -1224,16 +1224,242 @@ plain%0A%0A%0A +# unittest.assertRaisesRegexp() is deprecated and renamed to%0A# unittest.assertRaisesRegex() in Python 3%0Aif not hasattr(nose.tools, 'assert_raises_regex'):%0A nose.tools.assert_raises_regex = nose.tools.assert_raises_regexp%0A%0A%0A def test @@ -3623,17 +3623,16 @@ es_r...
c2a99a33455e3b01ccce3faebd3a541b4a76e579
Bump version
yamale/__init__.py
yamale/__init__.py
from .yamale import make_schema, make_data, validate VERSION = (1, 0, 0, 'final', 0) # Dynamically calculate the version based on VERSION. def get_version(): "Returns a PEP 386-compliant version number from VERSION." version = VERSION assert len(version) == 5 assert version[3] in ('alpha', 'beta', '...
Python
0
@@ -65,17 +65,17 @@ (1, 0, -0 +1 , 'final
33b4c181b2d9a3d74f45ee1ced971b5bca58b35b
remove unused import
treenav/admin.py
treenav/admin.py
from django.contrib import admin from django import forms from django.contrib.contenttypes import generic from treenav import models as treenav from treenav.forms import MenuItemForm, GenericInlineMenuItemForm class GenericMenuItemInline(generic.GenericStackedInline): """ Add this inline to your admin class ...
Python
0.000001
@@ -30,33 +30,8 @@ min%0A -from django import forms%0A from
29f085888ec0b44f225fda47634abee3a8e48bda
Make host.install() optional
pyblish_starter/pipeline.py
pyblish_starter/pipeline.py
import os import re import sys import types import logging import datetime from pyblish import api self = sys.modules[__name__] self._registered_data = list() self._registered_families = list() self._log = logging.getLogger() # Mock host interface host = types.ModuleType("default") host.ls = lambda: ["Asset1", "As...
Python
0.000025
@@ -290,12 +290,35 @@ ost. -ls = +__dict__.update(%7B%0A %22ls%22: lam @@ -346,22 +346,23 @@ t2%22%5D -%0Ahost. +,%0A %22 loader - = +%22: lam @@ -405,23 +405,24 @@ None -%0Ahost. +,%0A %22 creator - = +%22: lam @@ -452,16 +452,19 @@ nstance%22 +%0A%7D) %0A%0Aself._ @@ -694,22 +694,116 @@ -h...
712989db37532a7810139dd2f7007c66652a0dd7
Fix documentation
ditto/flickr/management/commands/__init__.py
ditto/flickr/management/commands/__init__.py
from django.core.management.base import CommandError from ....core.management.commands import DittoBaseCommand class FetchCommand(DittoBaseCommand): """ Parent for all classes that fetch some things from Flickr. Photos, Photosets, Files, etc. """ def add_arguments(self, parser): "All chi...
Python
0.000001
@@ -855,19 +855,13 @@ d -- -start --end +range arg
1f70cefdb94f995c3db9a29a11262aaf2cd7658e
add custom exceptions to estimators module
ndd/estimators.py
ndd/estimators.py
# -*- coding: utf-8 -*- # Copyright (C) 2016,2017 Simone Marsili # All rights reserved. # License: BSD 3 clause """Base classes module.""" from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import ( # pylint: disable=redefined-builtin, unused-impo...
Python
0
@@ -511,16 +511,65 @@ stimator +%0Afrom ndd.exceptions import PMFError, CountsError %0A%0Alogger @@ -3702,32 +3702,118 @@ ts to len(pk).%0A%0A + Raises%0A ------%0A PMFError%0A If qk is not a valid PMF.%0A%0A %22%22%22%0A @@ -3800,32 +3800,32 @@ F.%0A%0A %22%22%22...
6c8a9edb6d733ac680ea2cbcb1c8d12511aa72be
Update webserver.py
webserver.py
webserver.py
#!/usr/bin/env python # author: brendan@shellshockcomputer.com.au import ConfigParser from bottle import route, install, run, template, static_file, PasteServer from bottle_sqlite import SQLitePlugin import json import urllib import urllib2 import datetime config = ConfigParser.RawConfigParser() config.read('config....
Python
0
@@ -964,16 +964,35 @@ M blocks + WHERE totalfee %3E 0 %22)%0A r @@ -1764,8 +1764,9 @@ .0.0.0') +%0A
5f839240a4223d599ad57393097bbc19502ae213
add condition not is_retracted
website/discovery/views.py
website/discovery/views.py
import datetime from website import settings from website.project import Node from website.project.utils import recent_public_registrations from modularodm.query.querydialect import DefaultQueryDialect as Q from framework.analytics.piwik import PiwikClient def activity(): popular_public_projects = [] popul...
Python
0.001134
@@ -1279,32 +1279,58 @@ node.is_deleted + and not node.is_retracted :%0A
5820a92c7945657a38eb5b54eef5e47b2ff1ec39
Fix url coding
src/checker/plugin/links_finder_plugin.py
src/checker/plugin/links_finder_plugin.py
from bs4 import BeautifulSoup from yapsy.IPlugin import IPlugin from requests.exceptions import InvalidSchema from requests.exceptions import ConnectionError from requests.exceptions import MissingSchema import requests import urlparse import urllib import marisa_trie class LinksFinder(IPlugin): def __init__(self...
Python
0.999981
@@ -2889,16 +2889,32 @@ NoAnchor +.encode('utf-8'( ))%0A
954f89757235ae390b9c246f420d5adf909aa7de
in product listing, don't truncate description
website/helpers/product.py
website/helpers/product.py
# Copyright (c) 2012 Web Notes Technologies Pvt Ltd. # License: GNU General Public License (v3). For more information see license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import cstr from website.utils import build_html, url_for_website, delete_page_cache @webnotes.whitelist(a...
Python
0.99999
@@ -3417,138 +3417,8 @@ en%22%0A -%09if len(r.website_description.split(%22 %22)) %3E 24:%0A%09%09r.website_description = %22 %22.join(r.website_description.split(%22 %22)%5B:24%5D) + %22...%22%0A %09r.w
90981eef7d737d03b9a086b34b687f60d29d9e71
Add missing Exception
feature_ms2_clone.py
feature_ms2_clone.py
import sys import os import csv import numpy import pymzml import xml from pyteomics import mzid MS1_Precision = 1e-5 def load_feature_table(fn): table = [] with open(fn, 'r') as fh: rd = csv.reader(fh, delimiter=',') for row in rd: if row[0] == 'FEATURE': _, rt, m...
Python
0.998627
@@ -4330,32 +4330,33 @@ %0A except +( KeyError :%0A pa @@ -4335,32 +4335,45 @@ except (KeyError +, ValueError) :%0A pass
6902b88472826f6042dda6acda6f8a22d2fef64f
Change food color.
enactiveagents/model/structure.py
enactiveagents/model/structure.py
""" Module that holds classes that represent structures. """ import world class Structure(world.Entity): """ Class representing structures in the world (i.e., static but potentially interactable with by agents). """ def collidable(self): return True class Wall(Structure): """ Clas...
Python
0.000019
@@ -709,16 +709,20 @@ olor = ( +62, 179, 122 @@ -722,20 +722,16 @@ 79, 122, - 62, 255)%0A%0A
738ec72f78847bb31c89305247fcbe2d994117f0
Optimize case ObjectMixin.setUp
feder/cases/tests.py
feder/cases/tests.py
from django.core.urlresolvers import reverse from django.test import RequestFactory, TestCase from feder.monitorings.factories import MonitoringFactory from feder.cases.models import Case from feder.users.factories import UserFactory from feder.institutions.factories import InstitutionFactory from feder.main.mixins imp...
Python
0.001096
@@ -65,24 +65,8 @@ port - RequestFactory, Tes @@ -86,189 +86,35 @@ der. -monitorings.factories import MonitoringFactory%0Afrom feder.cases.models import Case%0Afrom feder.users.factories import UserFactory%0Afrom feder.institutions.factories import Institution +users.factories import User Fact @@ -169,16 +169,51 @...
8f280cece4d59e36ebfeb5486f25c7ac92718c13
Clean it up a bit
third_problem.py
third_problem.py
letters = 'bcdfghjklmnpqrtvwxyzBCDFGHJKLMNPQRTVWXYZ' phrase = input() output = '' vowels = '' phrase = phrase.replace(' ', '') for char in phrase: if char in letters: output += char else: vowels += char print(output) print(vowels)
Python
0.000027
@@ -1,15 +1,17 @@ -letters +not_vowel = 'bcdf @@ -66,16 +66,17 @@ input()%0A +%0A output = @@ -92,16 +92,32 @@ s = ''%0A%0A +# Remove sapces%0A phrase = @@ -181,15 +181,17 @@ in -letters +not_vowel :%0A @@ -210,16 +210,43 @@ += char + # Add non vowel to output %0A els @@ -270,16 +270,40 @@ += char ...
ac0d1036e56e8c24945abedbc372c717b5d7064a
improve imprort style.
zcode/constants.py
zcode/constants.py
"""Common Numerical and Physical Constants. """ import numpy as np import astropy as ap import astropy.constants import astropy.cosmology from astropy.cosmology import WMAP9 as cosmo # Fundamental Constants # --------------------- NWTG = ap.constants.G.cgs.value SPLC = ap.constants.c.cgs.value MSOL = ap.constants.M_s...
Python
0
@@ -132,16 +132,18 @@ smology%0A +# from ast @@ -178,16 +178,48 @@ as cosmo +%0Acosmo = astropy.cosmology.WMAP9 %0A%0A# Fund
4e6370bf4a76c0d510346124ea5aa49de0667372
Add motor configurations for new brushless motors
pyfrc/physics/motor_cfgs.py
pyfrc/physics/motor_cfgs.py
from collections import namedtuple MotorModelConfig = namedtuple( "MotorModelConfig", [ "name", "nominalVoltage", "freeSpeed", "freeCurrent", "stallTorque", "stallCurrent", ], ) MotorModelConfig.__doc__ = """ Configuration parameters useful for simulating...
Python
0
@@ -2907,16 +2907,458 @@ mps,%0A)%0A%0A +#: Motor configuration for NEO 550 Brushless Motor%0AMOTOR_CFG_NEO_550 = MotorModelConfig(%0A %22NEO 550%22,%0A NOMINAL_VOLTAGE,%0A 11000 * units.cpm,%0A 1.4 * units.amps,%0A 0.97 * units.N_m,%0A 100 * units.amps,%0A)%0A%0A#: Motor configuration for Falcon 500...
68206c7f6b396d03470b0499716181f978996364
implement url_fix()
feedservice/utils.py
feedservice/utils.py
# # This file is part of my.gpodder.org. # # my.gpodder.org 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. # # my.gpodder.org i...
Python
0.000018
@@ -1,10 +1,34 @@ +# -*- coding: utf-8 -*-%0A #%0A - # This f @@ -762,16 +762,47 @@ t chain%0A +import urllib%0Aimport urlparse%0A%0A %0A%0Adef pa @@ -2322,16 +2322,16 @@ ten(l):%0A - retu @@ -2356,8 +2356,897 @@ able(l)%0A +%0A%0A# http://stackoverflow.com/questions/120951/how-can-i-normalize-a-url-in-pytho...
50e1edf150a715367e46d28f15ac8958bcc18644
Remove unused import
tinymce/views.py
tinymce/views.py
# coding: utf-8 # License: MIT, see LICENSE.txt """ django-tinymce4-lite views """ from __future__ import absolute_import import json import logging from django import VERSION from django.core.urlresolvers import reverse from django.http import JsonResponse, HttpResponse from django.shortcuts import render from django...
Python
0.000001
@@ -270,44 +270,8 @@ nse%0A -from django.shortcuts import render%0A from
b64e7714e581cfc0c0a0d0f055b22c5edca27e24
Raise KeyboardInterrupt to allow the run to handle logout
susumutakuan.py
susumutakuan.py
import discord import asyncio import os import signal import sys #Set up Client State CLIENT_TOKEN=os.environ['TOKEN'] #Create Discord client client = discord.Client() #Handle shutdown gracefully def sigterm_handler(signum, frame): print("Logging out...") client.logout() print('Shutting down...') sy...
Python
0
@@ -192,16 +192,22 @@ cefully%0A +async def sigt @@ -271,23 +271,31 @@ -client.logout() +raise KeyboardInterrupt %0A
03e72a0ea5f303e7ef7dd18266ecac4fc0090cc8
Add section name in Introduction and Conclusion
zested/tutorial.py
zested/tutorial.py
import json import os from PySide import QtGui class TutorialPart: ''' A Tutorial is a recursive structure of TutorialPart. ''' def __init__(self, title, path, have_introduction=False, have_conclusion=False): self.title = title self.path = path self.have_introduction = have_in...
Python
0
@@ -182,23 +182,16 @@ ve_intro -duction =False, @@ -201,20 +201,16 @@ e_conclu -sion =False): @@ -305,23 +305,16 @@ ve_intro -duction %0A @@ -348,20 +348,16 @@ e_conclu -sion %0A @@ -1427,38 +1427,111 @@ s.path.join( -tutorial.path, +%0A tutorial.path,%0A ...
13e30fe6af93bbb48a4795ee22f4f3ba760adc14
add get_session_names
tmuxback/tmux.py
tmuxback/tmux.py
# -*- coding:utf-8 -*- def get_session_names(): """get session names""" pass
Python
0.000002
@@ -16,16 +16,124 @@ f-8 -*-%0A +import subprocess%0Aimport re%0A%0A%0A#tmux commands%0A%0A#list sessions%0ACMD_LIST_SESSIONS='tmux list-sessions -F#S'%0A%0A%0A%0A def get_ @@ -156,19 +156,38 @@ %0A %22%22%22 -get + return a list of tmux session @@ -196,16 +196,17 @@ ames + %22%22%22%0A pass @@ -205,9 +...
2e382c8bff2d0c3733b9b525168254971ca1175e
Update atexit function to avoid issues with late binding
python/pyspark/shell.py
python/pyspark/shell.py
# # 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"); you may not us...
Python
0.99902
@@ -1490,16 +1490,28 @@ egister( +(lambda sc: lambda: @@ -1520,16 +1520,21 @@ .stop()) +(sc)) %0A%0A# for
a635663dbfd164382803e201c79ce7647d0a4a1e
Mark bursting commands as not requiring an answer
txircd/server.py
txircd/server.py
from twisted.internet.protocol import Factory from twisted.protocols.amp import AMP, Command, Integer, String, AmpBox, ListOf, IncompatibleVersions from txircd.utils import CaseInsensitiveDictionary, now current_version = 200 # Protocol version 0.2.0 # The protocol version should be incremented with changes of the pro...
Python
0.000015
@@ -4807,16 +4807,43 @@ H%22%0A %7D +%0A requiresAnswer = False %0A%0Aclass @@ -4922,16 +4922,43 @@ ))%0A %5D +%0A requiresAnswer = False %0A%0Aclass @@ -5038,22 +5038,49 @@ Box()))%0A - %5D%0A + requiresAnswer = False%0A %0A%0Aclass
10e6c53a39d3ee57d855ada1aa6e9d620f094465
add 'save' command
track-cli.py
track-cli.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import sys import zmq import logging log = logging.getLogger('track_cli') def print_info(): log.info("zeromq version: %s" % zmq.zmq_version()) log.info("pyzmq version: %s" % zmq.pyzmq_version()) def send_request(request): context = zmq.Context() req_so...
Python
0.000009
@@ -1072,24 +1072,87 @@ : 'rules'%7D%0A%0A + elif args == %5B'save'%5D:%0A request = %7B'type': 'save'%7D%0A%0A elif arg
0dea5f2b6a2e6d702167c3415d10a47275e30601
update the version to 0.6.0
zignal/__init__.py
zignal/__init__.py
""" This is the zignal library @author: Ronny Andersson (ronny@andersson.tk) @copyright: (c) 2013 Ronny Andersson @license: MIT """ __version__ = "0.5.0" from .audio import * from . import filters from . import measure from . import music from . import sndcard __all__ = [ 'filters', 'measure',...
Python
0.000005
@@ -148,9 +148,9 @@ %220. -5 +6 .0%22%0A
ba5de58c2646f79c8a0fb5ec9e84b9b1d4cd0dd1
add GZipMiddleware.
pykeg/src/pykeg/settings.py
pykeg/src/pykeg/settings.py
# Pykeg main settings file. # Note: YOU SHOULD NOT NEED TO EDIT THIS FILE. Instead, see the instructions in # common_settings.py.example. INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.humanize', 'django.contrib.markup', 'django...
Python
0
@@ -2109,24 +2109,69 @@ CLASSES = (%0A + 'django.middleware.gzip.GZipMiddleware',%0A 'django.
079109b06865dfd03dc563d9606ba51767449bff
Use argparse instead of hard-coded values.
testbuild.py
testbuild.py
import os import platform import subprocess # Group these here for transparency and easy editing. USED_REPOSITORY = 'CRYENGINE' USED_TARGET = 'win_x86' USED_CONFIG = 'Profile' USED_BRANCH = 'release' USED_VS_VERSION = '14.0' TARGET_TO_SLN_TAG = { 'win_x86': 'Win32', 'win_x64': 'Win64' } def get_installed_v...
Python
0
@@ -3,16 +3,32 @@ port os%0A +import argparse%0A import p @@ -58,191 +58,8 @@ ss%0A%0A -%0A# Group these here for transparency and easy editing.%0AUSED_REPOSITORY = 'CRYENGINE'%0AUSED_TARGET = 'win_x86'%0AUSED_CONFIG = 'Profile'%0AUSED_BRANCH = 'release'%0AUSED_VS_VERSION = '14.0'%0A%0A TARG @@ -945,31 +945,30 @@ ...
3645751422fb80e45e94c6647d4ca020f5db2d4a
Add regression test case.
st2api/tests/unit/controllers/v1/test_triggertypes.py
st2api/tests/unit/controllers/v1/test_triggertypes.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Python
0.000005
@@ -2832,16 +2832,470 @@ lure.')%0A +%0A # ?pack query filter%0A resp = self.app.get('/v1/triggertypes?pack=doesnt-exist-invalid')%0A self.assertEqual(resp.status_int, http_client.OK)%0A self.assertEqual(len(resp.json), 0)%0A%0A resp = self.app.get('/v1/triggertypes?pack=%25s' %25 (T...
c91240cd43c4f714a404cf5f2ce566dad290c0c5
Add url mapping for ProjectEntrySumsAPIView
trex/urls.py
trex/urls.py
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # from django.conf.urls import patterns, url from django.views.generic import TemplateView from trex.views import project urlpatterns = patterns( '', url(r"^$", Te...
Python
0
@@ -769,32 +769,180 @@ entries-list%22),%0A + url(r%22%5Eapi/1/projects/(?P%3Cpk%3E%5B0-9%5D+)/entries/sums/?$%22,%0A project.ProjectEntrySumsAPIView.as_view(),%0A name=%22project-entries-sums%22),%0A url(r%22%5Eapi/1
80f26e7ef3987dddd0219f5500a9cdcfd6b6c51d
fix bug for searching.
torcms/handlers/search_handler.py
torcms/handlers/search_handler.py
# -*- coding:utf-8 -*- from config import CMS_CFG from torcms.core.base_handler import BaseHandler from torcms.core.tool.whoosh_tool import YunSearch from torcms.model.category_model import MCategory from torcms.core.tools import logger class SearchHandler(BaseHandler): def initialize(self): super(Search...
Python
0
@@ -1165,21 +1165,25 @@ -catid +post_data = self. @@ -1190,37 +1190,96 @@ get_ -argument('searchcat').strip() +post_data()%0A%0A catid = post_data%5B'searchcat'%5D if 'searchcat' in post_data else ''%0A %0A @@ -1297,25 +1297,17 @@ d = -self.get_argument +post_data ('ke
7cbee5e817b6d2bbf4fbcbf8cf1cf327bdbabc9c
rename locator_string to package_id
cms/djangoapps/contentstore/management/commands/migrate_to_split.py
cms/djangoapps/contentstore/management/commands/migrate_to_split.py
""" Django management command to migrate a course from the old Mongo modulestore to the new split-Mongo modulestore. """ from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from xmodule.modulestore import Location from xmodule.modulestore.django import modulesto...
Python
0.000355
@@ -1926,30 +1926,26 @@ -locator_string +package_id = args%5B @@ -1986,30 +1986,26 @@ -locator_string +package_id = None%0A @@ -2036,30 +2036,26 @@ , user, -locator_string +package_id %0A%0A de @@ -2112,30 +2112,26 @@ , user, -locator_string +package_id = self. @@ -2445,24 +2445,20 @@ ...
c61187382c968c3018f88637806874ddd0b63b71
add log for debug
web/views.py
web/views.py
import requests from django.http import Http404 from django.shortcuts import render, render_to_response, redirect # Create your views here. from django.template import RequestContext from web.fetch import Fetcher from settings import LEAN_CLOUD_ID, LEAN_CLOUD_SECRET import leancloud # @api_view(('GET',)...
Python
0.000001
@@ -933,24 +933,48 @@ uery_list:%0D%0A + print chairman%0D%0A chai
547c8c6a1aef80ce43451479e0b79b51db5b717a
Fix headers types
pyshop/views/credentials.py
pyshop/views/credentials.py
# -*- coding: utf-8 -*- """ PyShop Credentials Views. """ from __future__ import absolute_import, print_function, unicode_literals import logging import base64 from pyramid.httpexceptions import HTTPFound from pyramid.url import resource_url, route_url from pyramid.security import remember, forget from pyramid.respons...
Python
0.000002
@@ -2834,16 +2834,17 @@ rlist=%5B( +b 'WWW-Aut @@ -2888,16 +2888,17 @@ +b 'Basic r
42dfb6850be83ba17b9e649a499926d31f1afa95
Fixing command.
windmill/browser/chrome.py
windmill/browser/chrome.py
import commands import tempfile import logging import signal import subprocess import sys, os import urlparse import windmill logger = logging.getLogger(__name__) import safari class Chrome(safari.Safari): def __init__(self): self.chrome_binary = windmill.settings['CHROME_BINARY'] self.test_url = wind...
Python
0.999753
@@ -2417,41 +2417,18 @@ -self.p_h +comm and -le = -subprocess.Popen( %5Bsel @@ -2475,81 +2475,119 @@ _url -%5D, **kwargs)%0A%09 logger.info(%5Bself.chrome_binary, self.redirection_page%5D ++'/windmill-serv/start.html'%5D%0A%09 self.p_handle = subprocess.Popen(command, **kwargs)%0A%09 logger.info(co...
0921f78660b7b0784ebe2fa586dd54551704699e
Fix fix_gir.py to work with ginterfaces and to support delegates.
tools/fix_gir.py
tools/fix_gir.py
#!/usr/bin/python from xml.dom import minidom def purge_white_space_and_fix_namespace(node, indent=0): if getattr(node, "tagName", None) == "namespace": name = node.getAttribute("name") node.setAttribute("name", name.lstrip('_')) for child in [c for c in node.childNodes]: if child.node...
Python
0
@@ -586,16 +586,22 @@ tagName%22 +, None ) == nam @@ -1037,16 +1037,42 @@ %22Class%22) + or name.endswith(%22Iface%22) )%0A @@ -1103,16 +1103,42 @@ %22Class%22) + or name.endswith(%22Iface%22) )%0A%0A
2c4cf38b7251ddffaba954f71bbca9632123777c
Add start_wizbit_server function that registers and publishes a wizbit server.
wizd/wizd.py
wizd/wizd.py
#! /usr/bin/env python import sys import socket import os import SimpleXMLRPCServer import gobject from wizbit import ServicePublisher, ServiceBrowser WIZBIT_SERVER_PORT = 3492 from wizbit import Shares, Directory from wizbit import * class WizbitServer(): def getShares(self): shares = Shares.getShares() retur...
Python
0
@@ -1336,21 +1336,33 @@ ()%0A%0A +%0A def -main(args +start_wizbit_server( ):%0A%09 @@ -1811,33 +1811,82 @@ _tcp%22)%0A%0A -%09global main_loop +%0Adef main(args):%0A%09global main_loop%0A%0A start_wizbit_server()%0A %0A%09main_l
c24eeba615fee01121041faac84a106d4d5dd3cf
Add check for equality.
pypeline/common/versions.py
pypeline/common/versions.py
#!/usr/bin/python # # Copyright (c) 2012 Mikkel Schubert <MSchubert@snm.ku.dk> # # 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 #...
Python
0
@@ -5129,24 +5129,357 @@ str(self)%0A%0A%0A +class EQ(_Check):%0A def __init__(self, *version):%0A _Check.__init__(self, %22EQ%22, *version)%0A%0A def __call__(self, value, pprint):%0A if value != self._version:%0A raise VersionRequirementError(%22Version must be %25s, found %25s%22 %5C%...
5258c7d70796a03361ad865a15fd3896bb7a95f1
Fix tests
pypeman/tests/test_nodes.py
pypeman/tests/test_nodes.py
import unittest import asyncio class FakeChannel(): def __init__(self): self.uuid = 'fakeChannel' class NodesTests(unittest.TestCase): def setUp(self): self.loop = asyncio.new_event_loop() #asyncio.set_event_loop(None) def test_log_node(self): """ if Log() node is functionnal "...
Python
0.000003
@@ -24,16 +24,31 @@ asyncio%0A +import logging%0A %0A%0Aclass @@ -78,32 +78,74 @@ __init__(self):%0A + self.logger = logging.getLogger()%0A self.uui
291bdbc3eef6548a1eebe6d92c7c347f3df7e2b6
version bump
pyramid_restful/__init__.py
pyramid_restful/__init__.py
from .settings import reload_api_settings __version__ = '0.9.1' VERSION = __version__ def includeme(config): reload_api_settings(config.registry.settings)
Python
0.000001
@@ -57,11 +57,12 @@ '0. -9.1 +10.0 '%0A%0AV
175cfe45aba554d1544be3ee71bdb8a7b499d879
add radius in request
wtm/views.py
wtm/views.py
import urllib2 from lxml import etree from deform import Form from pyramid.view import view_config from wtm.schemas.home import HomeSchema @view_config(route_name='home', renderer='templates/home.pt') def home(request): """ home page """ homeForm = Form(HomeSchema(), buttons=('submit',), action=req...
Python
0
@@ -554,11 +554,10 @@ und: -250 +%25s .0,%25 @@ -607,14 +607,162 @@ ST%5B' -lat'%5D, +dist'%5D,%0A request.POST%5B'lat'%5D,%0A req
2313a796842cbe65563a62fe12edec06c4112531
Add YEARS_PEY_DAY.
pyrate/core/ifgconstants.py
pyrate/core/ifgconstants.py
# This Python module is part of the PyRate software package. # # Copyright 2017 Geoscience Australia # # 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/...
Python
0.999045
@@ -2142,16 +2142,49 @@ ar year%0A +YEARS_PER_DAY = 1 / DAY_PER_YEAR%0A SPEED_OF
d43cf2adeb5bc5e5546dbf58532bfc283fc94ea8
fix sort order of combined citation information
python/citation_vim/item.py
python/citation_vim/item.py
# -*- coding:utf-8 -*- from citation_vim.utils import compat_str, is_current class Item(object): """ Intermediary object between bibtex/zotero and unite source output. """ def combine(self): pairs = { 'Key': self.key, 'Title': self.title, 'Author(s)': self...
Python
0.000497
@@ -17,16 +17,35 @@ -8 -*-%0A%0A +import collections%0A from cit @@ -243,9 +243,33 @@ s = -%7B +collections.OrderedDict(%5B %0A @@ -281,14 +281,15 @@ +( 'Key' -: +, sel @@ -293,16 +293,17 @@ self.key +) ,%0A @@ -312,16 +312,17 @@ +( 'Title' -: +, sel @@ -328,16 +328,17 @@ lf.title +) ...
e9ecc8036661811d6103afdf074853e1a0834213
Update tf-plan.py
tools/tf-plan.py
tools/tf-plan.py
#!/usr/bin/env python3 # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
Python
0.000001
@@ -4690,16 +4690,17 @@ ('module +s /')%5D%0A m
7c787829b9c894f5c0de6dd50d6144e423d70f5c
uses ancient M2Crypto
python/cvmfs/certificate.py
python/cvmfs/certificate.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created by René Meusel This file is part of the CernVM File System auxiliary tools. """ from M2Crypto import X509 from _common import CompressedObject class Certificate(CompressedObject): """ Wraps an X.509 certificate object as stored in CVMFS repositories """ ...
Python
0.999944
@@ -132,16 +132,32 @@ s.%0A%22%22%22%0A%0A +import M2Crypto%0A from M2C @@ -169,20 +169,93 @@ import -X509 +EVP, X509, m2, util%0Afrom distutils.version import LooseVersion, StrictVersion %0A%0Afrom _ @@ -902,16 +902,824 @@ icate%0A%0A%0A + def _get_fingerprint(self, algorithm='sha1'):%0A %22%22%22 Wor...
92762566c0e80e24d8954b9a4b2f7d148a3c89da
Use google-hosted jquery for admin page
python/ecep/portal/admin.py
python/ecep/portal/admin.py
# Copyright (c) 2012 Azavea, Inc. # See LICENSE in the project root for copying permission from portal.models import Location from django.contrib.gis import admin from django import forms from portal.widgets import MapWidget from django.contrib.gis.geos import Point import re from django.conf import settings class Lo...
Python
0
@@ -2288,22 +2288,69 @@ s', -'js/jquery.js' +%22//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js%22 )%0A%0A
c86cac8c9d84d7cc797e7712c3fd5cdefeb2ca9d
Update normalize.py
pythainlp/util/normalize.py
pythainlp/util/normalize.py
# -*- coding: utf-8 -*- """ Text normalization """ import re import warnings from pythainlp import thai_tonemarks _NORMALIZE_RULE1 = [ "ะ", "ั", "็", "า", "ิ", "ี", "ึ", "่", "ํ", "ุ", "ู", "ใ", "ไ", "โ", "ื", "่", "้", "๋", "๊", "ึ", ...
Python
0.000002
@@ -452,16 +452,17 @@ %22, %22%E0%B8%B3%22), + # %E0%B8%99%E0%B8%B4%E0%B8%84%E0%B8%AB%E0%B8%B4 @@ -479,17 +479,16 @@ -%3E %E0%B8%AA%E0%B8%A3%E0%B8%B0%E0%B8%AD%E0%B8%B3 - %0A (%22%E0%B9%8D
20fa992576a80dceba5cee4a50c50f620362b5a2
include request body into VespaResult
python/vespa/vespa/query.py
python/vespa/vespa/query.py
# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. from typing import Callable, List, Optional, Dict # # Match phase # class MatchFilter(object): """ Abstract class for match filters. """ def create_match_filter(self, query: str) -> str: ...
Python
0
@@ -6675,16 +6675,35 @@ a_result +, request_body=None ):%0A @@ -6706,24 +6706,25 @@ self. +_ vespa_result @@ -6730,32 +6730,169 @@ t = vespa_result +%0A self._request_body = request_body%0A%0A @property%0A def request_body(self) -%3E Optional%5BDict%5D:%0A return self._request_body ...
7fa8db8b52f6d066dc369912b0f9b227d71fa939
Fix wex.value docsring
wex/value.py
wex/value.py
""" Extracted data values are represented with tab-separated fields. The right-most field on each line is the value, all preceding fields are labels that describe the value. The labels and the value are all JSON encoded. So for example, a value 9.99 with a labels ``product`` and ``price`` would look like:: "prod...
Python
0.000017
@@ -537,16 +537,17 @@ split('%5C +%5C t')%5D%0A
bf044427c7df101d11d779b1935f728ba93a0e75
Fix default logger in command runner.
src/main/python/apache/aurora/client/api/command_runner.py
src/main/python/apache/aurora/client/api/command_runner.py
# # 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, software # distributed under ...
Python
0
@@ -3710,13 +3710,11 @@ log. -error +log ):%0A
23f09ac800b40d54b2bbcded0ae57c3b2368b4be
Improve navigate path for series detail page
www/views.py
www/views.py
from django.shortcuts import render from django.template import Context from django.http import HttpResponse, Http404 from django.core.urlresolvers import reverse import api from mod import dispatch_module_hook PAGE_SIZE = 50 def render_page(request, template_name, **data): dispatch_module_hook("render_page_hook"...
Python
0
@@ -6346,16 +6346,87 @@ age_id,%0A + (%22project_detail%22, %7B%22project%22: project%7D, project),%0A @@ -6471,31 +6471,33 @@ : project%7D, -project +%22Patches%22 ))%0A searc
fb786e6fa254bf9b041b58ae3ba524257892bea8
Make payloads larger for tests.
timelines.py
timelines.py
from sentry.utils.runner import configure configure() import contextlib import functools import logging import random import sys import time import uuid from sentry.app import timelines from sentry.timelines.redis import Record logging.basicConfig(level=logging.DEBUG) @contextlib.contextmanager def timer(preambl...
Python
0.000001
@@ -514,16 +514,38 @@ argv%5B2%5D) +%0Apayload = ' ' * 12000 %0A%0Acalls @@ -774,17 +774,15 @@ ex, -' payload -' , ti
4e3ebcf98e2bfb2cea1f92b66e5205194744482a
add level 11
pythonchallenge/level_11.py
pythonchallenge/level_11.py
import unittest import urllib import requests import logging import re import urllib import os import os.path import Image import ImageDraw # Default is warning, it's to suppress requests INFO log logging.basicConfig(format='%(message)s') def solution(): url = 'http://www.pythonchallenge.com/pc/return/cave.jpg' ...
Python
0.000496
@@ -132,16 +132,46 @@ mageDraw +%0Afrom StringIO import StringIO %0A%0A# Defa @@ -351,42 +351,51 @@ -urllib.urlretrieve(url, 'cave.jpg' +r = requests.get(url, auth=('huge', 'file') )%0A @@ -424,18 +424,27 @@ pen( -'cave.jpg' +StringIO(r.content) )%0A @@ -553,24 +553,25 @@ for y in +x range(480):%0A...
fb5ad293c34387b1ab7b7b7df3aed3942fdd9282
Add default to max_places in proposal form
src/webapp/activities/forms.py
src/webapp/activities/forms.py
# -*- encoding: utf-8 -*- from django import forms class ActivitySubscribeForm(forms.Form): id = forms.IntegerField( min_value = 0, required=True, widget = forms.HiddenInput, ) title = forms.CharField( max_length=100, required=True, widget = forms.HiddenInput, ) clas...
Python
0.000001
@@ -654,32 +654,45 @@ , required=True, + initial = 0, %0A )%0A show_
447f24720757175f5a54291d8cb7f5aa3b0fab92
test LesionsAnalysis.valid attribute, not LesionAnalysis.valid_dataset
arfi_histology_analysis.py
arfi_histology_analysis.py
from lesion_analysis import LesionAnalysis Ptotal = [] Pexact = [] Pnn = [] Patrophy = [] Pbph = [] Pmiss = [] Pclinsig = [] Pclinsigsens = [] Pfalsepositive = [] for p in range(56, 107): P = LesionAnalysis(p) if P.valid_dataset: Ptotal.append(p) if P.index_match['exact']: Pexact.a...
Python
0.000003
@@ -227,16 +227,8 @@ alid -_dataset :%0A
3b5f322d8fe76251b322b2d81cecf6abbee5e4bd
rename python class method
python/dllib/src/bigdl/dllib/feature/image/imagePreprocessing.py
python/dllib/src/bigdl/dllib/feature/image/imagePreprocessing.py
# # Copyright 2016 The BigDL Authors. # # 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 ...
Python
0.99888
@@ -1261,16 +1261,17 @@ stdB)%0A%0A +%0A class Ma @@ -1427,16 +1427,17 @@ _type)%0A%0A +%0A class Ce @@ -1634,16 +1634,9 @@ pHeight) - +%0A
6a84b885be67e8a9f424c2b36f50e8fe9347dbc9
Remove duplicate constant in ipmi.py
rackattack/physical/ipmi.py
rackattack/physical/ipmi.py
import subprocess import time import logging import multiprocessing.pool class IPMI: IPMITOOL_FILENAME = "ipmitool" _CONCURRENCY = 4 IPMITOOL_FILENAME = "ipmitool" _pool = None def __init__(self, hostname, username, password): self._hostname = hostname self._username = username ...
Python
0.002215
@@ -140,43 +140,8 @@ = 4%0A - IPMITOOL_FILENAME = %22ipmitool%22%0A
356a7c4d83a5289e7b30a07b0f76829e274b7481
Fix Eventlet transport on Python 3
raven/transport/eventlet.py
raven/transport/eventlet.py
""" raven.transport.eventlet ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import sys from raven.transport.http import HTTPTransport try: import eventlet from eventl...
Python
0.000002
@@ -298,16 +298,29 @@ ventlet%0A + try:%0A from @@ -370,16 +370,110 @@ urllib2%0A + except ImportError:%0A from eventlet.green.urllib import request as eventlet_urllib2%0A has_
b30befbf39009ed566dbb7ff725de05bad2be990
Add link to permissions management doc for ExportTables. (#520)
rdr_client/export_tables.py
rdr_client/export_tables.py
# Exports the entire contents of database tables to Unicode CSV files stored in GCS. # Used instead of Cloud SQL export because it handles newlines and null characters properly. # # Usage: ./run_client.sh --project <PROJECT> --account <ACCOUNT> \ # --service_account exporter@<PROJECT>.iam.gserviceaccount.com export_tab...
Python
0
@@ -173,16 +173,143 @@ erly.%0A#%0A +# Documentation of permissions management:%0A# https://docs.google.com/document/d/1vKiu2zcSy97DQTIuSezr030kTyeDthome9XzNy98B6M%0A#%0A # Usage:
f210ef3e6b4122c75b4df9eee6be6ee4ac81efa4
Remove a useless table from the db
www/scripts/generate_db.py
www/scripts/generate_db.py
#!/usr/bin/python # This script has to generate the sqlite database # # Requirements (import from): # - sqlite3 # # Syntax: # ./generate_db.py import sqlite3 import sys from os import path SCRIPT_PATH = path.dirname(__file__) DEFAULT_DB = path.join(SCRIPT_PATH, "../mymoney.db") def generate_tables(db=DEFAULT_D...
Python
0.000001
@@ -494,69 +494,8 @@ '')%0A - c.execute('''DROP TABLE IF EXISTS node_hierarchy''')%0A @@ -743,170 +743,8 @@ EY,%0A - title TEXT NOT NULL)''')%0A c.execute('''CREATE TABLE IF NOT EXISTS node_hierarchy (%0A id INTEGER PRIMARY KEY,%0A @@ -810,24 +81...
4c88b3f5daa1e8e147dedfa4a103216565469f93
Fix timezone-naive datetime being compared to aware datetime.
zerver/lib/logging_util.py
zerver/lib/logging_util.py
from __future__ import absolute_import from django.utils import timezone import hashlib import logging import traceback from datetime import datetime, timedelta from zerver.lib.str_utils import force_bytes # Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010) class _RateLimitFilter(objec...
Python
0
@@ -346,16 +346,45 @@ time.min +.replace(tzinfo=timezone.utc) %0A%0A de
296fd12b86cfffa0d1c239c248d6a3efca4759c3
Remove debug log
zou/app/utils/thumbnail.py
zou/app/utils/thumbnail.py
import os import shutil import math from zou.app.utils import fs from PIL import Image Image.MAX_IMAGE_PIXELS = 20000 * 20000 RECTANGLE_SIZE = 150, 100 SQUARE_SIZE = 100, 100 PREVIEW_SIZE = 1200, 0 BIG_SQUARE_SIZE = 400, 400 def save_file(tmp_folder, instance_id, file_to_save): """ Save file in given folde...
Python
0
@@ -2888,58 +2888,8 @@ ize) -%0A print(size, im.size, %22turn_into_thumbnail 2%22) %0A%0A
c02036f26bfd1eb6b1fed2dc10c73c91e97dae0b
Update __init__.py
tendrl/node_agent/objects/cluster_message/__init__.py
tendrl/node_agent/objects/cluster_message/__init__.py
from tendrl.commons import etcdobj from tendrl.commons.message import Message as message from tendrl.commons import objects class ClusterMessage(message, objects.BaseObject): internal = True def __init__(self, **cluster_message): self._defs = {} super(ClusterMessage, self).__init__(**cluster_m...
Python
0.000072
@@ -144,17 +144,8 @@ age( -message, obje @@ -158,16 +158,25 @@ seObject +, message ):%0A i @@ -269,35 +269,15 @@ -super(ClusterMessage, self) +message .__i @@ -282,16 +282,22 @@ _init__( +self, **cluste @@ -307,16 +307,66 @@ essage)%0A + objects.BaseObject.__init__(self)%0A %0A ...
551dddbb80d512ec49d8a422b52c24e98c97b38c
Add waiting for new data to parse
tsparser/main.py
tsparser/main.py
from tsparser import config from tsparser.parser import BaseParser, ParseException from tsparser.parser.gps import GPSParser from tsparser.parser.imu import IMUParser from tsparser.sender import Sender def parse(input_file=None): """ Parse the file specified as input. :param input_file: file to read inpu...
Python
0
@@ -1,20 +1,43 @@ +from time import sleep%0A from tsparser import @@ -642,24 +642,48 @@ f not line:%0A + sleep(0.01)%0A
787db3ccc3d63d408a9b081a376343805b887368
Allow using VERBOSE env var to enable debug logs
tsrc/cli/main.py
tsrc/cli/main.py
""" Main tsrc entry point """ import argparse import functools import importlib import sys import textwrap import colored_traceback import ui import tsrc def fix_cmd_args_for_foreach(args, foreach_parser): """ We want to support both: $ tsrc foreach -c 'shell command' and $ tsrc foreach -- som...
Python
0.000003
@@ -74,16 +74,26 @@ portlib%0A +import os%0A import s @@ -1811,16 +1811,232 @@ apped%0A%0A%0A +def setup_ui(args):%0A verbose = None%0A if os.environ.get(%22VERBOSE%22):%0A verbose = True%0A if args.verbose:%0A verbose = args.verbose%0A ui.setup(verbose=verbose, quiet=args.quiet, color=args...
d2a0c928b9cdb693ca75731e1ae2cefb4c7ae722
fix Episode JSON export
tvd/core/json.py
tvd/core/json.py
#!/usr/bin/env python # encoding: utf-8 # # The MIT License (MIT) # # Copyright (c) 2013-2014 CNRS (Hervé BREDIN -- http://herve.niderb.fr/) # # 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...
Python
0.000008
@@ -1538,17 +1538,17 @@ ON%5D == ' -e +E pisode': @@ -1646,16 +1646,17 @@ turn d%0A%0A +%0A def load
240d697f378f85271278c47640d3328996db606e
Fix error message reporting.
tweepy/binder.py
tweepy/binder.py
# Tweepy # Copyright 2009 Joshua Roesslein # See LICENSE import httplib import urllib import time from . parsers import parse_error from . error import TweepError try: import json #Python >= 2.6 except ImportError: try: import simplejson as json #Python < 2.6 except ImportError: try: ...
Python
0
@@ -4259,16 +4259,27 @@ e_error( +json.loads( resp.rea @@ -4274,32 +4274,33 @@ ads(resp.read()) +) %0A exc
cd4da2e0fbed7bbadd4b110f45b7356795075aeb
add min_level to Logger
twiggy/Logger.py
twiggy/Logger.py
from Message import Message import Levels class Logger(object): __slots__ = ['_fields', 'emitters'] def __init__(self, fields = None, emitters = None): self._fields = fields if fields is not None else {} self.emitters = emitters if emitters is not None else {} def fields(self, **kwargs): ...
Python
0.000001
@@ -96,16 +96,29 @@ mitters' +, 'min_level' %5D%0A%0A d @@ -165,16 +165,42 @@ s = None +, min_level = Levels.DEBUG ):%0A @@ -318,16 +318,51 @@ else %7B%7D +%0A self.min_level = min_level %0A%0A de @@ -500,16 +500,32 @@ emitters +, self.min_level )%0A%0A d @@ -710,32 +710,75 @@ rgs, **kwar...
a50c7c32f28d6f6e0ba369fc91f67f90edda7a66
Add a processing function to the server to simplify end of burst
txircd/server.py
txircd/server.py
from twisted.internet import reactor from twisted.internet.defer import Deferred from twisted.internet.task import LoopingCall from twisted.words.protocols.irc import IRC class IRCServer(IRC): def __init__(self, ircd, ip, received): self.ircd = ircd self.serverID = None self.name = None ...
Python
0.000001
@@ -2069,24 +2069,241 @@ return%0A %0A + def endBurst(self):%0A self.bursted = True%0A for command, prefix, params in self.cache%5B%22burst_queue%22%5D:%0A self.handleCommand(command, prefix, params)%0A del self.cache%5B%22burst_queue%22%5D%0A %0A def conn
8d125eec9faa0da86ea3557cd7a618a173bc4f47
fix for gettext headers in help
external/django-ajax-selects-1.1.4/ajax_select/__init__.py
external/django-ajax-selects-1.1.4/ajax_select/__init__.py
"""JQuery-Ajax Autocomplete fields for Django Forms""" __version__ = "1.1.4" __author__ = "crucialfelix" __contact__ = "crucialfelix@gmail.com" __homepage__ = "http://code.google.com/p/django-ajax-selects/" from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.models.f...
Python
0.000012
@@ -2763,16 +2763,42 @@ estring) + and field.help_text != '' :%0A
04f2c9005a04559a48ad0919b840d709c0f4eeaa
Update version.
neupy/__init__.py
neupy/__init__.py
""" NeuPy is the Artificial Neural Network library implemented in Python. """ __version__ = '0.1.1a'
Python
0
@@ -93,11 +93,10 @@ = '0.1.1 -a '%0A