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
206fe7c34f3f15f52c27f0b40d419e84b5a28644
Fix fabfile typo.
fabfile.py
fabfile.py
import os from fabric.api import env from nexiles.fabric.tasks import docs from nexiles.fabric.tasks import utils from nexiles.fabric.tasks import release PACKAGE_NAME = "nexiles.fabric.tasks" VERSION = utils.get_version_from_setup_py() ROOT_DIR = os.path.abspath(os.path.dirname(__file__)) BUILD_DIR = "...
Python
0.000574
@@ -149,16 +149,61 @@ release +%0Afrom nexiles.fabric.tasks import environment %0A%0APACKAG @@ -780,17 +780,16 @@ obals()) -, %0A%0Aenv.ne
a0228033a0bc089586e20ce26be0c50e943c7923
Resolve binary signals when comparing for boolean equivalence
cocotb/binary.py
cocotb/binary.py
#!/usr/bin/env python ''' Copyright (c) 2013 Potential Ventures Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, thi...
Python
0.000587
@@ -5380,13 +5380,13 @@ har -!= %220 +== %221 %22: r
482c3952213fdaef8336d3fe4abbc7ca0f78156c
Use `magick` instead of `imgconvert`
lib/animation/__init__.py
lib/animation/__init__.py
#prerequisites: ImageMagick (http://www.imagemagick.org/script/index.php) import itertools import os import os.path import subprocess import shutil import math def generate_unused_folder_name(): base = "temp_{}" for i in itertools.count(): name = base.format(i) if not os.path.exists(name): ...
Python
0
@@ -1376,105 +1376,26 @@ -# cmd = -%22imgconvert -delay %7B%7D img_*.png -layers optimize output.gif%22.format(delay)%0A cmd = %5B%22img +%5B%22magick%22, %22 conv @@ -1731,16 +1731,17 @@ rmtree(dir_name) +%0A
f6d0c4d2609d5efb55e220a51b99160aa3ab0874
Remove unused wrapper
deep_rl/network/network_utils.py
deep_rl/network/network_utils.py
####################################################################### # Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) # # Permission given to modify the code as long as you keep this # # declaration at the top # ################################...
Python
0.000002
@@ -860,3214 +860,8 @@ x%0A%0A -# class DisjointActorCriticWrapper:%0A# def __init__(self, state_dim, action_dim, actor_network_fn, critic_network_fn):%0A# self.actor = actor_network_fn(state_dim, action_dim)%0A# self.critic = critic_network_fn(state_dim, action_dim)%0A#%0A# def state_dict(sel...
405edd07187b9bc92216404fc8d290379a2b28aa
Update mongo_future_return.py
salt/returners/mongo_future_return.py
salt/returners/mongo_future_return.py
# -*- coding: utf-8 -*- ''' Return data to a mongodb server Required python modules: pymongo This returner will send data from the minions to a MongoDB server. To configure the settings for your MongoDB server, add the following lines to the minion config files: .. code-block:: yaml mongo.db: <database name> ...
Python
0.000003
@@ -3332,21 +3332,16 @@ False)%0A - %0A '''%0A @@ -3500,17 +3500,16 @@ '''%0A -%0A if f @@ -3865,37 +3865,24 @@ ndex('jid')%0A - %0A @@ -4027,21 +4027,8 @@ d')%0A - %0A @@ -4064,16 +4064,28 @@ ('jid')%0A + %0A ret
2f2bdf7df8f5608872099f12c21be0e12400f86d
Add doc
astropy/modeling/setup_package.py
astropy/modeling/setup_package.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import import os from os.path import join import sys from distutils.core import Extension from distutils import log from astropy.extern import six from astropy_helpers import setup_helpers from astropy_helpers.version_hel...
Python
0
@@ -636,16 +636,164 @@ .c')%5D%0A%0A%0A +# This defines the set of projection functions that we want to wrap.%0A# The key is the projection name, and the value is the number of%0A# parameters.%0A projecti
45e7574ef8c54833854a0042fb99b0f7f6afabf6
Exclude bridge devices by default
bumblebee/modules/nic.py
bumblebee/modules/nic.py
#pylint: disable=C0111,R0903 """Displays the name, IP address(es) and status of each available network interface. Requires the following python module: * netifaces Parameters: * nic.exclude: Comma-separated list of interface prefixes to exclude (defaults to "lo,virbr,docker,vboxnet,veth") * nic.states: C...
Python
0
@@ -291,16 +291,19 @@ net,veth +,br %22)%0A * @@ -911,16 +911,19 @@ net,veth +,br %22).split
b43e59a5389ebbd1e57d4fcf62b0958937b504df
Add OCA as author of OCA addons
__unported__/mrp_webkit/__openerp__.py
__unported__/mrp_webkit/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011-2013 Serpent Consulting Services Pvt. Ltd.(<http://www.serpentcs.com>) # # This program is free software: you can redistribute it and/or modif...
Python
0
@@ -1064,17 +1064,17 @@ uthor': -' +%22 Serpent @@ -1102,17 +1102,50 @@ vt. Ltd. -' +,Odoo Community Association (OCA)%22 ,%0A 'w
ae702778282e97c795adc466877ccb359dac7400
Use ternary instead.
avenue/web.py
avenue/web.py
# -*- coding: utf-8 -*- # Copyright (c) 2012 Michael Babich # See LICENSE.txt or http://opensource.org/licenses/MIT '''Acts as an interface between what Flask serves and what goes on in the rest of the application. ''' from avenue import app, api from avenue.database import content from flask import render_template, m...
Python
0.000001
@@ -2627,194 +2627,116 @@ -for url in urls:%0A if type(urls) == dict:%0A function_call = url_page_function(urls%5Burl%5D)%0A%0A else:%0A function_call = url_page_function( +is_dict = type(urls) == dict%0A%0A for url in urls:%0A call_text = urls...
0162e4dd31c08e2d119d03c2747cedb9951e5175
Replace os.rename with higher-level shutil.move (fixes #135)
watson/utils.py
watson/utils.py
import datetime import itertools import json import os import tempfile import click import arrow from click.exceptions import UsageError try: text_type = (str, unicode) except NameError: text_type = str def style(name, element): def _style_tags(tags): if not tags: return '' ...
Python
0
@@ -48,16 +48,30 @@ port os%0A +import shutil%0A import t @@ -5392,24 +5392,26 @@ -os.renam +shutil.mov e(path, @@ -5435,16 +5435,18 @@ -os.renam +shutil.mov e(tm
a7b5041f42a7ea621f5b484e24cc36e751776474
Add unit test for reader reconnect
kafka_influxdb/tests/test_worker.py
kafka_influxdb/tests/test_worker.py
import unittest from mock import Mock import random from kafka_influxdb.worker import Worker from kafka_influxdb.encoder import echo_encoder class Config: def __init__(self, buffer_size): self.buffer_size = buffer_size self.kafka_topic = "test" self.influxdb_dbname = "mydb" class DummyRe...
Python
0
@@ -618,16 +618,699 @@ ages)%0A%0A%0A +class FlakyReader(object):%0A %22%22%22%0A A fake reader that throws exceptions to simulate%0A connection errors%0A %22%22%22%0A def __init__(self, message, num_messages):%0A self.message = message%0A self.num_messages = num_messages%0A%0A def read...
a41905e915941df4e60924f611c3cec53e8438bb
change the order of searching the JAR in load() 1. absolute path > 2. bundle > 3. user's extension path
sikuli-script/src/main/python/sikuli/Sikuli.py
sikuli-script/src/main/python/sikuli/Sikuli.py
## # This module provides a Jython interface of Sikuli Script to automate GUI # interactions. ## from __future__ import with_statement import java.io.File import time from org.sikuli.script import SikuliScript from org.sikuli.script import Match from org.sikuli.script import Pattern from org.sikuli.script import FindFa...
Python
0.000251
@@ -1411,71 +1411,53 @@ h = -ExtensionManager.getInstance().getUserExtPath()%0A jarInExtPath +getBundlePath()%0A if path:%0A jarInBundle = p @@ -1491,16 +1491,19 @@ r + jar%0A + if _l @@ -1515,18 +1515,20 @@ arIn -ExtPath):%0A +Bundle):%0A @@ -1555,53 +1555,71 @@ h = -getBundlePath()%0A...
0ac7b18c846fe8df134a2241bb0163e9fd4b7633
Initialize empty MonadicDict by default.
wqflask/utility/monads.py
wqflask/utility/monads.py
"""Monadic utilities This module is a collection of monadic utilities for use in GeneNetwork. It includes: * MonadicDict - monadic version of the built-in dictionary * MonadicDictCursor - monadic version of MySQLdb.cursors.DictCursor that returns a MonadicDict instead of the built-in dictionary """ from collection...
Python
0
@@ -653,16 +653,19 @@ (self, d +=%7B%7D , conver
3a77e1fe91a4e3396b8cc0482b561b320d46d36e
put celery app for brain and sonde directly in config file
web/frontend.py
web/frontend.py
import re import os import celery from bottle import route, request, default_app, run from lib.irma.common.utils import IRMA_RETCODE_OK, IRMA_RETCODE_WARNING, IRMA_RETCODE_ERROR from lib.irma.fileobject.handler import FileObject from bson import ObjectId from config.config import IRMA_TIMEOUT brain_celery = celery.Cel...
Python
0
@@ -291,105 +291,51 @@ OUT%0A -%0Abrain_celery = celery.Celery('braintasks')%0Abrain_celery.config_from_object('config.brainconfig') +from config.brainconfig import brain_celery %0A%0A# @@ -1333,16 +1333,19 @@ oids%5Bf +obj ._id%5D =
06c860b317471221fb27285aa9f42ac088c96867
update Trim
bin/Trim/Trim.py
bin/Trim/Trim.py
#!/usr/bin/python2.7 ''' Created on 22 Nov. 2012 Author: Alex Hoogkamer E-mail: aqhoogkamer@outlook.com / s1047388@student.hsleiden.nl this script will trim fastq files based on the phred quality scores. ''' import Bio
Python
0.000001
@@ -207,15 +207,964 @@ '''%0A -import Bio%0A +from Bio import SeqIO%0Aimport os%0A'''%0Athis block counts the number of reads and filters reads that have more %0Athan 5%25 low quality bases.%0A'''%0Afile1 = %22data/test/s_2_1_sequence%22%0Aos.system(%22rm %7Bfile1%7D-trimmed%22.format(file1 = file1))%0Acount = 0%0Afor...
d35b9c4973cba355b1924072c992731191124722
Make image title editable in the list
comics/core/admin.py
comics/core/admin.py
from django.contrib import admin from comics.core import models class ComicAdmin(admin.ModelAdmin): list_display = ('slug', 'name', 'language', 'url', 'rights', 'start_date', 'end_date', 'active') list_filter = ['active', 'language'] readonly_fields = ('name', 'slug', 'language', 'url', 'rights',...
Python
0.029493
@@ -1060,16 +1060,47 @@ review)%0A + list_editable = ('title',)%0A list
53376dd519856d1f9917acd3b51a0e9f7dbdb3f7
Fix path
scripts/enhancedInterfaceUSBLoader.py
scripts/enhancedInterfaceUSBLoader.py
# Loads content from USB and creates the JSON / file structure for enhanced media interface print ("loader: Starting...") import json import os import pathlib import shutil # Defaults for Connectbox / TheWell mediaDirectory = "/media/usb0" templatesDirectory = "/var/www/enhanced/content/www/assets/templates/en" c...
Python
0.000018
@@ -471,11 +471,8 @@ tes/ -en/ lang
3dcba234b5c29e393d611adf88bfdca2a081f8db
fix dump_syms.py to work with python 3 (#28910)
build/dump_syms.py
build/dump_syms.py
from __future__ import print_function import collections import os import subprocess import sys import errno # The BINARY_INFO tuple describes a binary as dump_syms identifies it. BINARY_INFO = collections.namedtuple('BINARY_INFO', ['platform', 'arch', 'hash', 'name']) def get_mo...
Python
0
@@ -1282,16 +1282,44 @@ ut(args) +.decode(sys.stdout.encoding) %0A symbo
c9568f90c3605d5a8b647f01c68362f71669fa1a
Use six.moves.reduce for compatibility
timeparser.py
timeparser.py
# coding: utf-8 from __future__ import print_function import re def parse(s): ''' ''' RE_HOUR = r'([0-9]+)h(our)?' RE_MINUTE = r'([0-9]+)m(in(ute)?)?' RE_SECOND = r'([0-9]+)(s(ec(ond)?)?)?' def _parse_time_with_unit(s): retval = 0 mh = re.match(RE_HOUR, s) mm = re.matc...
Python
0
@@ -57,16 +57,45 @@ port re%0A +from six.moves import reduce%0A %0A%0Adef pa
9669fb2b733d1a4051ccd744307f358cab2737e4
Rename private fields
p_haul_criu.py
p_haul_criu.py
# # CRIU API # Includes class to work with CRIU service and helpers # import socket import struct import os import subprocess import rpc_pb2 as cr_rpc import stats_pb2 as crs criu_binary = "/root/criu/criu" req_types = { cr_rpc.DUMP: "dump", cr_rpc.PRE_DUMP: "pre_dump", cr_rpc.PAGE_SERVER: "page_server", cr_rpc....
Python
0
@@ -552,24 +552,26 @@ KET)%0A%09%09self. +__ swrk = subpr @@ -653,16 +653,18 @@ %0A%09%09self. +__ cs = css @@ -734,16 +734,18 @@ %0A%09%09self. +__ cs.close @@ -754,16 +754,18 @@ %0A%09%09self. +__ swrk.wai @@ -968,32 +968,34 @@ f._iter)%0A%09%09self. +__ cs.send(req.Seri @@ -1151,16 +1151,18 @@ ng(self. +_...
8d614f39f4abba16f0fa6b43a26c167560436a37
change read_assembly to read_fasta
src/agouti_sequence.py
src/agouti_sequence.py
import os import sys import itertools import re from lib import agouti_log as agLOG def agouti_seq_main(assemblyFile, outDir, prefix, debug=0): moduleName = os.path.basename(__file__).split('.')[0].upper() moduleOutDir = os.path.join(outDir, "agouti_seq") if not os.path.exists(moduleOutDir): os.makedirs(moduleOu...
Python
0.000002
@@ -722,32 +722,29 @@ seq in read_ +f as -sembly +ta (assemblyFil @@ -1379,32 +1379,29 @@ s%0A%0Adef read_ +f as -sembly +ta (assemblyFil @@ -2085,24 +2085,21 @@ in read_ +f as -sembly +ta (assembl
0ca8edc752a104dcb7faaa6b5c303a1a8fdbc6aa
Mark functions `{get,set}_extension_value` as internal
byceps/config.py
byceps/config.py
""" byceps.config ~~~~~~~~~~~~~ :Copyright: 2006-2022 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from enum import Enum from typing import Any, Optional from flask import current_app, Flask from .services.site.transfer.models import SiteID EXTENSION_KEY = 'byceps_config' KEY_AP...
Python
0.998859
@@ -811,24 +811,25 @@ de(app)%0A +_ set_extensio @@ -943,16 +943,17 @@ +_ set_exte @@ -993,24 +993,25 @@ app)%0A%0A%0Adef +_ get_extensio @@ -1394,16 +1394,17 @@ %5D%0A%0A%0Adef +_ set_exte @@ -2106,32 +2106,33 @@ .%22%22%22%0A return +_ get_extension_va @@ -2552,16 +2552,17 @@ return +...
339415048005a9eba957357a02459a977a2e3007
Update bazel deps to hopefully get CI happy again.
bazel_support/repositories.bzl
bazel_support/repositories.bzl
"""Definitions for handling Bazel repositories for GoogleToolboxForMac. """ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def _maybe(repo_rule, name, **kwargs): """Executes the given repository rule if it hasn't been executed already. Args: repo_rule: The repository rule to be ex...
Python
0
@@ -952,34 +952,8 @@ c%22,%0A - # Latest 08-10-20%0A @@ -1008,226 +1008,139 @@ _cc/ -archive/1477dbab59b401daa94acedbeaefe79bf9112167.tar.gz%22%5D,%0A sha256 = %22b87996d308549fc3933f57a786004ef65b44b83fd63f1b0303a4bbc3fd26bbaf%22,%0A strip_prefix = %22rules_cc-1477dbab59b401daa94acedbeaefe...
39a57195a279e0566a8ef68da53464578299c5d4
Make JSON load python 3-compatible
moto/awslambda/responses.py
moto/awslambda/responses.py
from __future__ import unicode_literals import json import re import uuid from moto.core.responses import BaseResponse from .models import lambda_backends class LambdaResponse(BaseResponse): @classmethod def root(cls, request, full_url, headers): if request.method == 'GET': return c...
Python
0.000248
@@ -1312,33 +1312,32 @@ ckend(full_url)%0A -%0A spec = j @@ -1358,16 +1358,32 @@ est.body +.decode('utf-8') )%0A
835cc8cbc939b582eea0357f11045633df531779
Use ipyparallel instead IPython.parallel
bcbiovm/docker/ipythontasks.py
bcbiovm/docker/ipythontasks.py
"""IPython interface to run bcbio distributed functions inside a docker container. Exports processing of a specific function and arguments within docker using bcbio_nextgen.py runfn. """ from IPython.parallel import require from bcbio.distributed import ipython from bcbio.distributed.ipythontasks import _setup_loggin...
Python
0.00002
@@ -190,16 +190,11 @@ rom -IPython. +ipy para
ff927e22eeff231e74c4c10817413e6923ad05e7
Remove unused import
csunplugged/tests/topics/loaders/test_programming_challenges_structure_loader.py
csunplugged/tests/topics/loaders/test_programming_challenges_structure_loader.py
import os.path from tests.BaseTestWithDB import BaseTestWithDB from tests.topics.TopicsTestDataGenerator import TopicsTestDataGenerator from topics.models import ProgrammingChallengeDifficulty from topics.models import ProgrammingChallengeLanguage from topics.management.commands._ProgrammingChallengesStructureLoader im...
Python
0.000001
@@ -359,67 +359,8 @@ der%0A -from utils.errors.KeyNotFoundError import KeyNotFoundError%0A from
7603d5e56a067fa890078d58b1cfc6a7a09370ef
fix month short name
mptracker/scraper/common.py
mptracker/scraper/common.py
import time from datetime import date, timedelta from urllib.parse import urlencode, urlparse, parse_qs import logging import re from path import path import requests from werkzeug.urls import url_decode, url_parse from pyquery import PyQuery as pq from lxml.html.clean import clean_html from lxml.html import fromstring...
Python
0.000267
@@ -4471,17 +4471,17 @@ 10, 'no -v +i ': 11, '
c7e7077a8cb81765dbf3c120fea500907d2b0c21
resolve conflict again
server/attender-mobile/EventSearch.py
server/attender-mobile/EventSearch.py
__author__ = 'itamar and olesya' import requests import codecs import sys import json from DAL import DAL import datetime # Meetup.com documentation here: http://www.meetup.com/meetup_api/docs/2/groups/ sys.path.insert(0, 'lib') #we need these two lines in order to make libraries imported from lib folder work proper...
Python
0.000003
@@ -203,126 +203,8 @@ s/%0A%0A -sys.path.insert(0, 'lib')%09#we need these two lines in order to make libraries imported from lib folder work properly%0A%0A UTF8 @@ -4186,10 +4186,8 @@ ost'%5D)%0A%0A -%0A%0A
eff9a6c7d9684e027659bdbcb01cf063919dc6d7
encodes AJAX response as JSON
muckrock/crowdfund/views.py
muckrock/crowdfund/views.py
""" Views for the crowdfund application """ from django.conf import settings from django.core.urlresolvers import reverse, NoReverseMatch from django.contrib import messages from django.db.models import Q from django.http import HttpResponse from django.shortcuts import redirect from django.utils.decorators import met...
Python
0.999999
@@ -2760,108 +2760,127 @@ -if request.is_ajax():%0A return HttpResponse(400)%0A else:%0A messages.error( +error_msg = (%0A 'There was an error making your contribution. '%0A 'Your card has not been charged.' %0A @@ -2884,24 +2884,26 @@ +)%0A ...
cc037bf0f75fc0259cbb92560020faa3274c7a37
add empty line at the end of the execution
multidl/download_manager.py
multidl/download_manager.py
# -*- coding: utf-8 -*- import os import time from queue import Queue, Empty from threading import Thread from tqdm import tqdm from multidl.constants import DownloadState, STATE_TRANSITIONS from multidl.downloaders import SCHEMES from multidl.exceptions import TransitionError class DownloadManager: def __ini...
Python
0.000091
@@ -3157,16 +3157,39 @@ finished +%0A tqdm.write('') %0A%0A de
d6866c6bc7c0c6851912f299d0160080d162c4b3
Add a lot more resiliancy/output to better_webbrowser.py. We now use webbrowser, but register a WindowsHttpDefault class
libnamebench/better_webbrowser.py
libnamebench/better_webbrowser.py
#!/usr/bin/env python # Copyright 2009 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...
Python
0.000001
@@ -823,777 +823,36 @@ ort -webbrowser%0D%0A%0D%0Ause_win32 = False%0D%0Aif sys.platform == %22win32%22:%0D%0A try:%0D%0A import _winreg%0D%0A use_win32 = True%0D%0A except ImportError:%0D%0A pass%0D%0A %0D%0A%0D%0Adef open(url):%0D%0A %22%22%22Open a URL in the users web browser.%22%22%22%0D%0A%0D%0A i...
3da445c232e01a23acca269c04cd940d8ca454a6
Añade entrada menú detalle persona
webapp/views.py
webapp/views.py
from django.shortcuts import redirect, render, reverse from django.views import generic from core import models from . import forms class Option: def __init__(self, name, viewname, args=None, kwargs=None, menu=None): self.name = name self.url = reverse(viewname, args, kwargs) if viewname else Fa...
Python
0.000001
@@ -591,32 +591,88 @@ t', menu=self),%0A + Option('Detalle persona', None, menu=self),%0A Opti @@ -742,16 +742,22 @@ 'Detalle + socio ', None, @@ -3155,24 +3155,53 @@ etail.html'%0A + name = 'Detalle persona'%0A %0A%0Aclass Memb @@ -3545,10 +3545,16 @@ 'Detalle + socio '%0A
45d21d4a6c8dd27e904b154366c96069072ecacd
Add register_as() to simplify replacing formatter implementations (if necessary).
behave/formatter/formatters.py
behave/formatter/formatters.py
# -*- coding: utf-8 -*- import sys import codecs # ----------------------------------------------------------------------------- # FORMATTER REGISTRY: # ----------------------------------------------------------------------------- formatters = {} def register(formatter): formatters[formatter.name] = formatter ...
Python
0
@@ -255,16 +255,19 @@ register +_as (formatt @@ -272,53 +272,328 @@ tter -):%0A formatters%5Bformatter.name%5D = formatter +_class, name):%0A %22%22%22%0A Register formatter class with given name.%0A%0A :param formatter_class: Formatter class to register.%0A :param name: Name for this formatter (as ...
566893e35e0e69e29fc6788dfb5ff20aa97fa629
Remove spaces
scripts/data_download/rais/create_files.py
scripts/data_download/rais/create_files.py
# -*- coding: utf-8 -*- ''' python scripts/data_download/rais/create_files.py en scripts/data/rais/en/ 2002 ''' from collections import namedtuple from datetime import datetime import pandas as pd import os import bz2 import sys import logging import imp def local_imports(): global common, dictionary f, f...
Python
0.999999
@@ -595,17 +595,16 @@ )%0A %0A%0A -%0A def sele @@ -1572,32 +1572,49 @@ ation.condition%0A + %0A @@ -1752,33 +1752,16 @@ ontinue; -%0A %0A%0A @@ -1803,33 +1803,16 @@ itions)%0A - %0A @@ -2035,17 +2035,16 @@ %0A -%0A ...
3710295bd34c23c8a2fc1f37c3523c49cf22ecf9
Bump the version.
mediacloud/__init__.py
mediacloud/__init__.py
from api import MediaCloud from storage import * __version__ = '2.22.2'
Python
0
@@ -62,14 +62,14 @@ _ = '2.2 -2.2 +3.0 '%0A%0A
c04cf02b6aeebb72966786e46d87de8c3f20f89a
add benchmarks for GaussianKDE
benchmarks/benchmarks/stats.py
benchmarks/benchmarks/stats.py
from __future__ import division, absolute_import, print_function import warnings import numpy as np try: import scipy.stats as stats except ImportError: pass from .common import Benchmark class Anderson_KSamp(Benchmark): def setup(self, *args): self.rand = [np.random.normal(loc=i, size=1000) fo...
Python
0.000145
@@ -774,19 +774,16 @@ native): - %0A @@ -1592,20 +1592,16 @@ erties'%5D - %0A par @@ -1688,20 +1688,16 @@ %5D%0A %5D%0A - %0A def @@ -3654,12 +3654,807 @@ s, axis=0)%0A%0A +%0Aclass GaussianKDE(Benchmark):%0A def setup(self):%0A np.random.seed(12345678)%0A n = 2000%0A ...
98d6b11c05dad95bdece060094baa81c4eabcfe6
Update enums.py
binance/enums.py
binance/enums.py
# coding=utf-8 SYMBOL_TYPE_SPOT = 'SPOT' ORDER_STATUS_NEW = 'NEW' ORDER_STATUS_PARTIALLY_FILLED = 'PARTIALLY_FILLED' ORDER_STATUS_FILLED = 'FILLED' ORDER_STATUS_CANCELED = 'CANCELED' ORDER_STATUS_PENDING_CANCEL = 'PENDING_CANCEL' ORDER_STATUS_REJECTED = 'REJECTED' ORDER_STATUS_EXPIRED = 'EXPIRED' KLINE_INTERVAL_1MIN...
Python
0.000001
@@ -842,21 +842,16 @@ STOP -_LOSS = 'STOP _LOS @@ -846,21 +846,16 @@ = 'STOP -_LOSS '%0AORDER_ @@ -864,25 +864,21 @@ PE_STOP_ -LOSS_LIMI +MARKE T = 'STO @@ -883,17 +883,13 @@ TOP_ -LOSS_LIMI +MARKE T'%0AO @@ -949,20 +949,21 @@ _PROFIT_ -LIMI +MARKE T = 'TAK @@ -971,20 +971,21 @@ _PROFIT_ -LIMI +MARKE T'%...
3b271300b5921753691a65236652b5c46060e882
Fix issue 36
pages/views.py
pages/views.py
from django.http import Http404 from django.shortcuts import get_object_or_404 from django.contrib.sites.models import SITE_CACHE from pages import settings from pages.models import Page, Content from pages.utils import auto_render, get_language_from_request def details(request, page_id=None, slug=None, temp...
Python
0
@@ -1076,27 +1076,21 @@ -current_page = None +raise Http404 %0A
184d6984b9c1a21dea35500edb56de2f94d66371
Split up logout and authorization checks.
comrade/test/base.py
comrade/test/base.py
from django import test from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.cache import cache from nose.tools import eq_, ok_ import json import mockito class BaseTest(test.TestCase): fixtures = ['dev'] ...
Python
0
@@ -822,16 +822,158 @@ ogout()%0A + self._test_unauthorized(method, url, next_url, allowed)%0A%0A def _test_unauthorized(self, method, url, next_url=None, allowed=False):%0A
9baa355e1224115a707c0dc507372b20d76cc322
Clear cache after each test run.
comrade/test/base.py
comrade/test/base.py
from django import test from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.contrib.auth import REDIRECT_FIELD_NAME from nose.tools import eq_, ok_ import json import mockito class BaseTest(test.TestCase): fixtures = ['dev'] def setUp(self): super(Base...
Python
0
@@ -157,16 +157,52 @@ ELD_NAME +%0Afrom django.core.cache import cache %0A%0Afrom n @@ -534,16 +534,38 @@ unstub() +%0A cache.clear() %0A%0A de
91f995c87463c82badc79d2515a769b2dd178a6d
Fix get_members.py to use correct environment variables
members/get_members.py
members/get_members.py
#!/usr/local/bin/python ''' Search for and retrieve threat indicators from ThreatExchange ''' from __future__ import print_function import json import os import re from urllib import urlencode from urllib2 import urlopen FB_APP_ID = os.environ['FB_THREATEXCHANGE_APP_ID'] FB_ACCESS_TOKEN = os.environ['FB_THREATEXCHA...
Python
0.000002
@@ -242,33 +242,18 @@ nviron%5B' -FB_THREATEXCHANGE +TX _APP_ID' @@ -288,25 +288,10 @@ on%5B' -FB_THREATEXCHANGE +TX _APP
6e526a173de970f2cc8f7cd62823a257786e348e
Add the missing category-detail urlconf to not to break bookmarked users
category/urls.py
category/urls.py
from django.conf.urls import patterns, url from .views import CategoriesList, GalleryDetail, StoryDetail urlpatterns = patterns('category.views', url(r'^gallery/categories/(?P<slug>.+)/$', GalleryDetail.as_view(), name='gallery-detail'), url(r'^stories/categories/(?P<slug>.+)/$', StoryDetail.as_view(), name='...
Python
0.000001
@@ -152,24 +152,91 @@ url(r'%5E -gallery/ +categories/$', CategoriesList.as_view(), name='category-list'),%0A url(r'%5E categori @@ -255,21 +255,19 @@ .+)/$', -Galle +Sto ryDetail @@ -284,21 +284,22 @@ , name=' -galle +catego ry-detai @@ -398,32 +398,40 @@ l'),%0A url(r'%5E +gallery/ categories/$', C @@...
e86415738066b775e8636c42cdbc8bf72eead4e7
Fix search on country code to not search with string greater than the code
bin/addons/base/res/country.py
bin/addons/base/res/country.py
############################################################################## # # Copyright (c) 2007 TINY SPRL. (http://tiny.be) All Rights Reserved. # # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # consequences resu...
Python
0.000167
@@ -2031,32 +2031,68 @@ ntext=%7B%7D%0A%09%09ids = + False%0A%09%09if len(name) %3C= 2:%0A%09%09%09ids = self.search(cr, @@ -2111,26 +2111,34 @@ de', + '=', + name)%5D + + args, - +%0A%09%09%09%09%09 limi @@ -2137,37 +2137,33 @@ %09%09%09%09limit=limit, -%0A%09%09%09%09 + context=context) @@ -2217,16 +22...
b5ecdfa02f5274d6a34da0530d3cb2f0c932f2ed
Add traverse_tree method
treetojson.py
treetojson.py
# !/usr/bin/env python # coding: utf-8 """ Converts a list or a list with a given regex grammar which contains a tree structure into a valid JSON. This module works with both Python 2 and 3. """ __version__ = '0.1' version = __version__ import logging import nltk from nltk.chunk.regexp import * LOG = logging.getL...
Python
0.000001
@@ -260,16 +260,28 @@ ort nltk +%0Aimport json %0A%0Afrom n @@ -2291,24 +2291,1064 @@ uter_json%0A%0A%0A +def traverse_tree(tree):%0A json_value = %22%22%0A index = 1%0A for subtree in tree:%0A index += 1%0A if type(subtree) == nltk.tree.Tree:%0A if subtree.height() %3E 2:%0A ...
a663437a8b4b32716d561dcdc9eb80472f75a57c
Instantiate the correct value
locust/event.py
locust/event.py
import logging from . import log import traceback from .exception import StopUser, RescheduleTask, RescheduleTaskImmediately, InterruptTaskSet class EventHook: """ Simple event class used to provide hooks for different types of events in Locust. Here's how to use the EventHook class:: my_event =...
Python
0.999999
@@ -5498,18 +5498,23 @@ -if +value = self.__ @@ -5535,16 +5535,23 @@ get(name +, value ) == Eve @@ -5556,19 +5556,31 @@ ventHook - or +%0A if value =
f41a4e00ac2def76d1ea6f149d08f16be6760b71
bump version to 0.1.2
cfpp/_version.py
cfpp/_version.py
"""0.0.1""" VERSION = __doc__
Python
0.000001
@@ -2,11 +2,11 @@ %22%220. -0.1 +1.2 %22%22%22%0A
bfc2d6a063d95688836b4213223f7dfd9a19b904
translate variable name
networkapiclient/Roteiro.py
networkapiclient/Roteiro.py
# -*- coding:utf-8 -*- # 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 "Lice...
Python
0.999417
@@ -2156,17 +2156,16 @@ t, model -o , descri @@ -3209,17 +3209,16 @@ p%5B'model -o '%5D = mod @@ -3219,17 +3219,16 @@ = model -o %0A
9ac9a54b4759aea9caa069098d69624ff440c3ca
fix bug attribute error vpp.py
networking_vpp/agent/vpp.py
networking_vpp/agent/vpp.py
# Copyright (c) 2016 Cisco Systems, 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 re...
Python
0.000001
@@ -1097,16 +1097,79 @@ try:%0A + print(%22checking return value for object: %25s%22 %25 str(t))%0A
96c33e21f6c5c5d5c6b43ec603478530ef7ada51
Modify ProfileInlineAdmin attributes.
user/admin.py
user/admin.py
from django.conf.urls import url from django.contrib import admin from django.contrib.admin.options import \ IS_POPUP_VAR from django.contrib.admin.utils import unquote from django.contrib.auth import \ update_session_auth_hash from django.contrib.auth.forms import \ AdminPasswordChangeForm from django.cont...
Python
0
@@ -886,23 +886,142 @@ -model = Profile +can_delete = False%0A model = Profile%0A exclude = ('slug',)%0A%0A def view_on_site(self, obj):%0A return obj.get_absolute_url() %0A%0A%0A@
44ff7ba2a9bc89e7a7967a73823d850498d3296a
Fix file open as unicode
bin/tools/generate_toy_data.py
bin/tools/generate_toy_data.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 Google 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 req...
Python
0.001013
@@ -865,16 +865,26 @@ py as np +%0Aimport io %0A%0APARSER @@ -3585,24 +3585,27 @@ %22))%0A%0A with +io. open(source_ @@ -3613,24 +3613,41 @@ ilename, %22w%22 +, encoding='utf8' ) as source_ @@ -3770,16 +3770,19 @@ %0A with +io. open(tar @@ -3798,16 +3798,33 @@ ame, %22w%22 +, encoding='utf8' ) as tar
7324ffe84b917ee3e02fcd9cb5002c11890f1a13
update the file push using paramiko library
bin/utils/sftp_transactions.py
bin/utils/sftp_transactions.py
import pysftp as sftp import sys import os from email_transactions import email_transactions # This addresses the issues with relative paths file_dir = os.path.dirname(os.path.realpath(__file__)) goal_dir = os.path.join(file_dir, "../") proj_root = os.path.abspath(goal_dir)+'/' sys.path.insert(0, proj_root+'bin') cla...
Python
0
@@ -86,16 +86,33 @@ actions%0A +import paramiko%0A%0A # This a @@ -564,28 +564,24 @@ ta = %5B%5D%0A - %0A def sen @@ -1108,57 +1108,83 @@ -connect = sftp.Connection(host=site_URI, +bridge = paramiko.Transport((site_URI, 22))%0A bridge.connect( username =una @@ -1171,33 +1171,35 @@ connec...
4c97b40ff15b3eb41a30d43518a8d922f7e30581
Update compat.py
mocket/compat.py
mocket/compat.py
import sys import shlex import six PY2 = sys.version_info[0] == 2 if PY2: from BaseHTTPServer import BaseHTTPRequestHandler from urlparse import urlsplit, parse_qs else: from http.server import BaseHTTPRequestHandler from urllib.parse import urlsplit, parse_qs text_type = six.text_type byte_type = si...
Python
0
@@ -358,16 +358,36 @@ _types%0A%0A +encoding = 'utf-8'%0A%0A %0Adef enc @@ -453,23 +453,24 @@ .encode( -'utf-8' +encoding )%0A re @@ -567,15 +567,16 @@ ode( -%22utf-8%22 +encoding )%0A
3fb5b55637f6835da578605d3229fb6833415420
refactor __repr__
src/bitcoinrpc/util.py
src/bitcoinrpc/util.py
# Copyright (c) 2010 Witchspace <witchspace81@gmail.com> # # 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,...
Python
0.000017
@@ -1959,121 +1959,73 @@ r -v = %5B%5D%0A for (k, v) in self.__dict__.iteritems():%0A rv.append(k+%22=%22+v.__repr__())%0A return +eturn '%7Bmodule%7D.%7Bclassname%7D(%7Bslots%7D)'.format(%0A module= self @@ -2049,13 +2049,20 @@ le__ -+%22.%22+ +, classname= self @@ -2084,28 ...
c7111e44fd2c06056d90e85a31604f3110657706
set envvar limit
mocker/run.py
mocker/run.py
import os import uuid import json from pprint import pprint import subprocess import traceback from pyroute2 import IPDB, NetNS, netns from cgroups import Cgroup from cgroups.user import create_user_cgroups from mocker import _base_dir_, log from .base import BaseDockerCommand from .images import ImagesCommand try: ...
Python
0.000003
@@ -3501,17 +3501,17 @@ it('=', -2 +1 ))%0A%0A
73e1588a0a2173fc5398c306e1b3bb5a2e68ce85
Fix reference to auth.user_id property.
carafe/ext/auth.py
carafe/ext/auth.py
import flask from flask import session, current_app from flask.ext.principal import ( Principal, identity_loaded, identity_changed, Identity, AnonymousIdentity, Permission, UserNeed, RoleNeed, TypeNeed ) login_need = TypeNeed('login') class SQLAlchemyAuthProvider(object): '''...
Python
0
@@ -3786,18 +3786,16 @@ .user_id -() and not
e30f249cba27e493ec46e3899634c3614f3e3bff
alter the sequence
mocker/run.py
mocker/run.py
import os import uuid import json import subprocess from pyroute2 import IPDB, NetNS, netns from cgroups import Cgroup from cgroups.user import create_user_cgroups from mocker import _base_dir_, log from .base import BaseDockerCommand from .images import ImagesCommand try: from pychroot import Chroot except Impor...
Python
0.999999
@@ -3060,32 +3060,121 @@ = Cgroup(name)%0A + # Set network namespace%0A netns.setns(netns_name)%0A%0A @@ -3231,17 +3231,16 @@ er_dir)%0A -%0A @@ -3255,75 +3255,52 @@ -# Set network namespace%0A netns.setns(netns_name) +%0A ...
b0ad6227299d870a7a5ca03800bc92ee24be14b7
Remove unnecessary setting of status in Orders admin
shoop/admin/modules/orders/views/detail.py
shoop/admin/modules/orders/views/detail.py
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django.contrib import messages...
Python
0.000001
@@ -4009,55 +4009,8 @@ %22))%0A - else:%0A order.set_canceled()%0A
077ad3e5227c3ad9831a6c94c14cd640f7e933d9
Use reverse function for urls in carusele app
carusele/models.py
carusele/models.py
from django.db import models class News (models.Model): """ News model represent detail description and content of each carusele element. """ title = models.CharField(max_length=400) description = models.TextField(default="") content = models.TextField() pubdate = models.DateTimeField(...
Python
0.000002
@@ -1,8 +1,53 @@ +from django.core.urlresolvers import reverse%0A from dja @@ -524,37 +524,43 @@ urn -%22/carusele/art/%25i/%22 %25 +reverse(%22article%22, args=( self.id +,)) %0A%0A%0Ac
e046b9e47d4ce26403f7bd2054460f6f671bffaf
Fix Typo
models/google.py
models/google.py
# -*- coding: utf-8 -*- from bs4 import BeautifulSoup import logging import re import requests import urllib.parse logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) logger = logging.getLogger(__name__) def google(bot, update): search = update.message.text s...
Python
0.000009
@@ -1222,17 +1222,17 @@ ogger.in -g +f o(%22Googl
2d8690dcdeef15610ae10cdb50451291fcd28d17
Fix logging of simulation parameter sweeper
simulation/simulation_parameter_sweeper.py
simulation/simulation_parameter_sweeper.py
# Copyright 2017 Balazs Nemeth # # 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
@@ -616,16 +616,61 @@ hreading +%0Aimport time%0Aimport subprocess%0Aimport logging %0A%0Afrom c @@ -738,16 +738,148 @@ phore(1) +%0Alog = logging.getLogger()%0Alogging.basicConfig(format='%25(levelname)s:%25(name)s:%25(message)s',%0A level=logging.DEBUG) %0A%0Aclass @@ -1731,23 +1731,28 @@ e()...
e3f40373978325843cc1314850739e3953a5b551
Use single "put" for ResultTimes to give app engine a chance to do them in parallel.
models/result.py
models/result.py
#!/usr/bin/python2.5 # # Copyright 2008 Google 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 ...
Python
0
@@ -4174,64 +4174,24 @@ -for test_key, values in results.items():%0A db.put( +result_times = %5B Resu @@ -4234,24 +4234,31 @@ + test=test_ke @@ -4286,16 +4286,23 @@ + + score=va @@ -4342,24 +4342,31 @@ + dirty=not is @@ -4373,16 +4373,105 @@ _...
8e1c2dc93495be023c56830ed92ddcb34b886c29
Clean logs and add logging time
module/module.py
module/module.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2016: # Frederic Mohier, frederic.mohier@gmail.com # # This file is part of Shinken. # # Shinken 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 F...
Python
0
@@ -899,16 +899,28 @@ raceback +%0Aimport time %0A%0Afrom s @@ -1165,33 +1165,33 @@ gger.info(%22%5B -Auth WS G +auth-ws-g lpi%5D Get a G @@ -1443,33 +1443,33 @@ gger.info(%22%5B -Auth WS G +auth-ws-g lpi%5D Trying @@ -1688,33 +1688,33 @@ ger.error(%22%5B -Auth WS G +auth-ws-g lpi%5D The mod @@ -1892,33 +1892,...
b3c1eecf617cf9278cbd000537f9fac1f9303c4c
Disable django-registration tests in Jenkins.
bluebottle/settings/jenkins.py
bluebottle/settings/jenkins.py
# SECRET_KEY and DATABASES needs to be defined before the base settings is imported. SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } from .base import * # # Put jenkins environ...
Python
0
@@ -1283,24 +1283,149 @@ lesforce')%0A%0A +# django-registration tests don't pass with our Django 1.5 custom user model / manager.%0APROJECT_APPS.remove('registration')%0A%0A # django_flu
1f6448b0d67d28dcca77bef1ac6bdb45d6c3f5d2
swap emphasis
modules/fetch.py
modules/fetch.py
import willie.module import re from random import randint from willie.formatting import bold @willie.module.commands('throw') @willie.module.commands('fetch') def fetch(bot, trigger): """ Fetch command """ x = randint(0,10) #inclusive words = re.split(' ' , trigger) del words[0] joined_wor...
Python
0.000001
@@ -378,32 +378,37 @@ fetches the ' + +bold( joined_words + ' @@ -399,24 +399,25 @@ joined_words +) + ' for ' + @@ -413,29 +413,24 @@ + ' for ' + -bold( trigger.nick @@ -422,33 +422,32 @@ + trigger.nick) -) %0A elif(x %3E= 5 @@ -495,16 +495,21 @@ the ' + +bold( joined_w @@ -512,16 +512,17 @@ ed_words...
dfd46c003e311b7214d742909931f1224f74b6fc
Remove constraint on toolchain name
clbundler/cli.py
clbundler/cli.py
import commands from commandparser import Subcommand import config def on_new(parser, options, args): if len(args) < 3: parser.error("too few arguments") if not (args[1] == "vc9" or args[1] == "vc12"): parser.error("only vc9, vc12 are supported at the moment") if not (args[2] == "x86" or ar...
Python
0.000006
@@ -164,127 +164,8 @@ s%22)%0A - if not (args%5B1%5D == %22vc9%22 or args%5B1%5D == %22vc12%22):%0A parser.error(%22only vc9, vc12 are supported at the moment%22)%0A
4aba708916984c61cc7f5fd205d66e8f64634589
Make compatible with python 3.4
main/widgets.py
main/widgets.py
from django_filters.widgets import RangeWidget class CustomRangeWidget(RangeWidget): def __init__(self, widget, attrs=None): attrs_start = {'placeholder': 'От', **(attrs or {})} attrs_stop = {'placeholder': 'До', **(attrs or {})} widgets = (widget(attrs_start), widget(attrs_stop)) ...
Python
0.000002
@@ -121,12 +121,10 @@ trs= -None +%7B%7D ):%0A @@ -164,34 +164,51 @@ r': '%D0%9E%D1%82' -, **(attrs or %7B%7D)%7D +%7D%0A attrs_start.update(attrs) %0A @@ -245,85 +245,41 @@ '%D0%94%D0%BE' -, **(attrs or %7B%7D)%7D%0A widgets = (widget(attrs_start), widget(attrs_stop) +%7D%0A attrs_sto...
4afb7bddc04c4056abbd09b3ec4ef8fe2950248d
fix create on systemd
ceph_deploy/mds.py
ceph_deploy/mds.py
from cStringIO import StringIO import errno import logging import os from ceph_deploy import conf from ceph_deploy import exc from ceph_deploy import hosts from ceph_deploy.util import system from ceph_deploy.lib import remoto from ceph_deploy.cliutil import priority LOG = logging.getLogger(__name__) def get_boots...
Python
0
@@ -3027,32 +3027,104 @@ out=7%0A )%0A + if distro.is_el:%0A system.enable_service(distro.conn)%0A elif init == @@ -3135,16 +3135,16 @@ stemd':%0A - @@ -3354,72 +3354,415 @@ )%0A -%0A + -if distro.is_el:%0A system.enable_service(distro.conn) + remoto.process....
16bebbf5e06c7a9a74d2c74852a4997af7989dba
Delete commented function
board/display.py
board/display.py
import pygame BLACK = (0, 0, 0) WHITE = (255, 255, 255) CELL = { "width": 20, "height": 20, "margin": 5, } class Display(object): def __init__(self, quantity): self.quantity = quantity self.width = self.size_by_name('width') self.height = self.size_by_name('height') ...
Python
0.000001
@@ -603,236 +603,8 @@ '%5D%0A%0A - # def create_grid(self):%0A # self.grid = %5B%5D%0A # for row in xrange(self.quantity):%0A # self.grid.append(%5B%5D)%0A # for column in xrange(self.quantity):%0A # self.grid%5Brow%5D.append(0)%0A%0A
1546d9909be326ebb982999a2c5dfdd1ca50327f
Remove unneeded extra code now that unicode bugs are gone.
twitterbot.py
twitterbot.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ twitterbot: Shows tweets for Twitter URLs posted on IRC. Copyright 2011 Rob McFadzean This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either v...
Python
0
@@ -3422,13 +3422,8 @@ %0A%09%09%09 -#try: %0A%09%09%09 @@ -3523,252 +3523,8 @@ %0A%09%09%09 -#except exceptions.UnicodeEncodeError:%0A%09%09%09#%09print %22Encoding error, fixing it up%22%0A%09%09%09#%09tweetUni = tweet.text.decode('utf-8').replace('%5Cn', ' ').replace('%5Cr','')%0A%09%09%09#%09print tweetUni%0A%09...
f2dfbce5d5f4384569eb621efd69c0cedfec49fd
Add protection against insufficient data for median kWh/day calculation.
monitor/views.py
monitor/views.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 yo...
Python
0
@@ -4834,16 +4834,169 @@ equest)) +%0A%0A energy_series = energy_timeseries(readings)%0A median_usage = 'ERR'%0A if len(energy_series) %3E 0:%0A median_usage = median(energy_series) * 24 / 1000 %0A retur @@ -5096,49 +5096,14 @@ dian -(energy_timeseries(readings)) * 24 / 1000 +_usage ,%0A
a930af7559b1956df1ba4f3519d085bada1a8177
Fix typo in previous commit.
moneyworks.py
moneyworks.py
#!/usr/local/bin/python2.7 from datetime import date from requests.auth import HTTPBasicAuth import requests import urllib import logging from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.utils import COMMASPACE import smtp...
Python
0
@@ -6025,16 +6025,21 @@ y, value +=None ):%0A
4059ac89644eade8b0721bc0dc144460b2b65a37
Allow customizing refinement sequence
spectralcluster/spectral_clusterer.py
spectralcluster/spectral_clusterer.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from sklearn.cluster import KMeans from spectralcluster import refinement from spectralcluster import utils class SpectralClusterer(object): def __init__( self, ...
Python
0
@@ -232,16 +232,173 @@ utils%0A%0A%0A +DEFAULT_REFINEMENT_SEQUENCE = %5B%0A %22CropDiagonal%22,%0A %22GaussianBlur%22,%0A %22RowWiseThreshold%22,%0A %22Symmetrize%22,%0A %22Diffuse%22,%0A %22RowWiseNormalize%22,%0A%5D%0A%0A%0A class Sp @@ -665,16 +665,77 @@ lue=1e-2 +,%0A refinement_sequ...
4c625d05abdeb4a048987cdc97dd22d594d1a4fb
Add comment to describe why strange else statement exists.
movie_util.py
movie_util.py
from __future__ import print_function import re # Cut out the movie name from a torrent name def movie_title_from_filename(title): # Strings that mark the end of a movie name, and start of meta data ends = ["1280p", "1080p", "720p", "r6", "bluray", "bdrip", "brrip", "blu-ray", "blu", "bd", "hd", "hdtv", "hdcam...
Python
0
@@ -3376,16 +3376,68 @@ else:%0A + # Bundles are printed as single strings%0A
efd320942614b6dda04954b79abb0fe93b275d97
print sheet creds
bot/messenger.py
bot/messenger.py
# -*- coding: utf-8 -*- import logging import random import re from stemming.porter2 import stem import yaml logger = logging.getLogger(__name__) config = yaml.load(open("config.yml", 'r')) def count(term, text): return len(re.findall(term, text, re.I)) def score(text, cat): score = 0 for term in cat['...
Python
0.000001
@@ -33,16 +33,26 @@ logging%0A +import os%0A import r @@ -193,24 +193,115 @@ ml%22, 'r'))%0A%0A +sheet_creds = os.getenv(%22SHEET_CREDS%22, %22None%22)%0A%0Alogger.info(%22SHEET_CREDS %22 + sheet_creds)%0A%0A def count(te @@ -913,16 +913,17 @@ +# print te
b420e80855a686f7cdb6211d568845563c7da18f
add parse mode to edit message
mr_bot/sender.py
mr_bot/sender.py
# -*- coding: utf-8 -*- #!/usr/bin/python import traceback from mr_logger.logger import Logger from telegram.error import BadRequest, Unauthorized logger = Logger() class Sender: """ this class will send bot messages (photo, voice, video, audio, docs) """ """ bot is instance if Telegram bot """ """ retu...
Python
0
@@ -488,32 +488,51 @@ xt, reply_markup +, parse_mode='HTML' ):%0A try:%0A @@ -696,32 +696,115 @@ kup=reply_markup +,%0A parse_mode=parse_mode )%0A re
94d66121368906b52fa8a9f214813b7b798c2b5b
Add constant for settings schema file path
lib/custom_data/settings_manager.py
lib/custom_data/settings_manager.py
"""This module provides functions for saving to and loading data from the settings XML file. Attributes: SETTINGS_PATH Filepath for the settings file. """ SETTINGS_PATH = 'settings.xml'
Python
0
@@ -121,22 +121,99 @@ ATH - F +(String): The file path for the settings file.%0A SETTINGS_SCHEMA_PATH (String): The f ile + path @@ -233,20 +233,34 @@ ings - file +'%0A XML Schema .%0A%22%22%22%0A -%0A SETT @@ -286,8 +286,46 @@ gs.xml'%0A +SETTINGS_SCHEMA_PATH = 'settings.xsd'%0A
81ee14bf004bc351061819aef20726ad13c584b5
Check date in validate function (#138)
hr_expense_adj/models/hr_expense.py
hr_expense_adj/models/hr_expense.py
# -*- coding: utf-8 -*- # Copyright 2017-2019 Quartile Limited # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, fields, api, _ from odoo.exceptions import UserError, ValidationError class HrExpense(models.Model): _inherit = 'hr.expense' name = fields.Char( str...
Python
0
@@ -3112,16 +3112,29 @@ projects + and rec.date :%0A
33f062a1f911164c533ed998c507ee4354e72058
Add a timeout to all gitlab requests
marge/gitlab.py
marge/gitlab.py
import json import logging as log from collections import namedtuple import requests class Api: def __init__(self, gitlab_url, auth_token): self._auth_token = auth_token self._api_base_url = gitlab_url.rstrip('/') + '/api/v4' def call(self, command, sudo=None): method = command.metho...
Python
0.000001
@@ -572,32 +572,309 @@ mand.call_args)%0A + # Timeout to prevent indefinitely hanging requests. 60s is very conservative,%0A # but should be short enough to not cause any practical annoyances. We just%0A # crash rather than retry since marge-bot should be run in a restart loop anyway.%0A tr...
e2419aca432fb3d4b7cfb151a5c3748437e4eb7b
remove calls to __class__ from parser.py
marko/parser.py
marko/parser.py
""" Base parser """ import itertools from .helpers import is_type_check, Source class Parser: r""" All elements defined in CommonMark's spec are included in the parser by default. Attributes: block_elements(dict): a dict of name: block_element pairs inlin_elements(dict): a dict of nam...
Python
0.000021
@@ -1571,305 +1571,39 @@ -if not element.override:%0A dest%5Belement.__name__%5D = element%0A else:%0A for cls in element.__bases__:%0A if cls.__name__ in dest:%0A dest%5Bcls.__name__%5D = element%0A break%0A else:%0A ...
8e53783953285c3d33ef55dce1c33a3bd46458a9
Add concurrency capability to client
2017/async-socket-server/simple-client.py
2017/async-socket-server/simple-client.py
import logging import socket import sys import threading import time class ReadThread(threading.Thread): def __init__(self, sockobj): super().__init__() self.sockobj = sockobj self.bufsize = 8 * 1024 def run(self): while True: buf = self.sockobj.recv(self.bufsize) ...
Python
0.000002
@@ -1,12 +1,28 @@ +import argparse%0A import loggi @@ -138,16 +138,22 @@ __(self, + name, sockobj @@ -213,16 +213,41 @@ sockobj%0A + self.name = name%0A @@ -386,16 +386,20 @@ g.info(' +%7B0%7D Received @@ -401,17 +401,17 @@ eived: %7B -0 +1 %7D'.forma @@ -412,16 +412,27 @@ .format( +self.nam...
c15d73fbd1c24e38b5d7adcbacc0a5c21bc86a4d
Add tests for sticky queue.
test/services/messaging/test_server.py
test/services/messaging/test_server.py
import socket from threading import Thread, Event, Semaphore from retask import Task import pytest from app.core.messaging import Sender, Receiver, RequiredFieldsMissing from app.core.messaging import QueueNotFound, SchemaValidationFailed from app.core.messaging import InvalidMessageStructure, BadOperation from app.c...
Python
0
@@ -5019,16 +5019,45 @@ sem +1 = Semaphore(0)%0A sem2 = Semap @@ -5265,16 +5265,17 @@ gs1, sem +1 , r1)%0A @@ -5344,32 +5344,33 @@ assert not sem +1 .acquire(timeout @@ -5465,29 +5465,8 @@ p))%0A - print(msgs1)%0A @@ -5475,24 +5475,25 @@ assert sem +1 .acquire(tim @@ -5582,16 +5...
bb9b380e93da9e9fc65d5aac2ba3650272fd2bba
print syntax.
mpi_helper.py
mpi_helper.py
from mpi4py import MPI import numpy as np from __future__ import print_function comm = MPI.COMM_WORLD def r_print(*args): """ print message on the root node (rank 0) :param args: :return: """ if comm.rank == 0: print 'ROOT:', for i in args: print((i, end=' ')) ...
Python
0.000003
@@ -1,12 +1,50 @@ +from __future__ import print_function%0A from mpi4py @@ -76,46 +76,8 @@ s np -%0Afrom __future__ import print_function %0A%0Aco @@ -248,17 +248,17 @@ rint - +( 'ROOT:', %0A @@ -253,16 +253,25 @@ 'ROOT:', + end=' ') %0A @@ -296,33 +296,32 @@ print( -( i, end=' '))%0A ...
99e2015c0c56615afc20ad2d405ae27ecd7144d2
add linear regression
htdocs/plotting/auto/scripts/p27.py
htdocs/plotting/auto/scripts/p27.py
"""Fall Minimum by Date""" import datetime from pandas.io.sql import read_sql import numpy as np from pyiem.plot.use_agg import plt from pyiem.util import get_autoplot_context, get_dbconn from pyiem.exceptions import NoDataFound def get_description(): """ Return a dict describing how to call this plotter """ ...
Python
0.999973
@@ -1,27 +1,34 @@ %22%22%22F -all Minimum by +irst Fall Threshold Date +s. %22%22%22%0A @@ -98,16 +98,51 @@ y as np%0A +from scipy.stats import linregress%0A from pyi @@ -2340,24 +2340,448 @@ #000000'))%0A%0A + h_slope, intercept, r_value, _, _ = linregress(%0A df%5B't1_doy'%5D.values, df%5B't2_doy'%5D...
baa379107e9b229830a12efecba491f63c8afe02
Order dashboard url overwrites
meinberlin/apps/dashboard/urls.py
meinberlin/apps/dashboard/urls.py
from django.conf.urls import url from meinberlin.apps.bplan.views import BplanProjectCreateView from meinberlin.apps.dashboard2.urls import \ urlpatterns as a4dashboard_urlpatterns from meinberlin.apps.extprojects.views import ExternalProjectCreateView from meinberlin.apps.projectcontainers.views import ContainerC...
Python
0
@@ -917,46 +917,367 @@ '),%0A -%0A # Overwrite the ProjectUpdateView + url(r'%5Eprojects/(?P%3Cproject_slug%3E%5B-%5Cw_%5D+)/blueprints/$',%0A views.ModuleBlueprintListView.as_view(),%0A name='module-blueprint-list'),%0A url(r'%5Eprojects/(?P%3Cproject_slug%3E%5B-%5Cw_%5D+)/blueprints/'%0A ...
8f5d83d9cf43c5fb6edeeda6106faea9de2e8220
allow passing request kargs
uncurl/api.py
uncurl/api.py
import argparse import json import re import shlex from collections import OrderedDict, namedtuple from six.moves import http_cookies as Cookie parser = argparse.ArgumentParser() parser.add_argument('command') parser.add_argument('url') parser.add_argument('-d', '--data') parser.add_argument('-b', '--data-binary', de...
Python
0
@@ -1863,27 +1863,36 @@ curl_command +, **kargs ):%0A - parsed_c @@ -2174,16 +2174,145 @@ NDENT)%0A%0A + requests_kagrs=''%0A for k,v in kargs.items():%0A requests_kagrs += %22%7B%7D%7B%7D=%7B%7D,%5Cn%22.format(BASE_INDENT,k,str(v))%0A %0A form @@ -2734,16 +2734,32 @@ %7Burl%7D%22,%0A ...
e7d68834f0ef67e1e58c03f82d2ba20b3c681c6d
version bump
mriqc/info.py
mriqc/info.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ MRIQC """ __versionbase__ = '0.8.9' __versionrev__ = '-0' __version__ = __versionbase__ + __versionrev__ __author__ = 'Oscar Esteban' __email__ = 'code@os...
Python
0.000001
@@ -214,17 +214,17 @@ v__ = '- -0 +1 '%0A__vers
7ffe699d4f146a6bf695fb544689a5f35703d368
Add startdir to files listed by os.listdir()
src/common/__init__.py
src/common/__init__.py
from __future__ import print_function from hashlib import sha1 import sys import os import os.path from subprocess import Popen, PIPE BUFSIZE = 16 * 1024 * 1024 def message(msg): print(msg, file=sys.stderr) def binary_in_path(binary): return any(os.path.exists(os.path.join(path, binary)) for path in set(...
Python
0
@@ -1534,16 +1534,67 @@ e_list = + %5Bos.path.join(start_dir, filename) for filename in os.list @@ -1603,24 +1603,25 @@ r(start_dir) +%5D %0A return
04058304e68fe88cb52402e6134ab15fa9563ad1
add new methods in ProgressMonitor
AlphaTwirl/ProgressBar/ProgressMonitor.py
AlphaTwirl/ProgressBar/ProgressMonitor.py
# Tai Sakuma <tai.sakuma@cern.ch> from ProgressReporter import ProgressReporter ##__________________________________________________________________|| class Queue(object): def __init__(self, presentation): self.presentation = presentation def put(self, report): self.presentation.present(repor...
Python
0
@@ -526,15 +526,67 @@ def -monitor +begin(self): pass%0A%0A def monitor(self): pass%0A%0A def end (sel
c089ef827954436d30b4b6718ef1bcceac11d1fa
Make 0 an invalid CEI
brazilnum/cei.py
brazilnum/cei.py
#!/usr/bin/env python from __future__ import absolute_import import re import random from .util import clean_id, pad_id """ Functions for working with Brazilian CEI identifiers. """ NONDIGIT = re.compile(r'[^0-9]') CEI_WEIGHTS = [7, 4, 1, 8, 5, 2, 1, 6, 3, 7, 4] def validate_cei(cei, autopad=True): """Check...
Python
0
@@ -528,16 +528,69 @@ e False%0A +%0A if cei == '000000000000':%0A return False%0A%0A digi
331222d553c0778840f522e21cb399226d89310e
Fix version
clog/__init__.py
clog/__init__.py
# Copyright 2015 Yelp 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 writing, so...
Python
0.000001
@@ -1701,9 +1701,10 @@ 2, -9 +11 %0A__v
38f87a266a0dbc2b09f80feb0a3eeb01db4b096b
improve cnn date reporting
parsers/cnn.py
parsers/cnn.py
from baseparser import BaseParser import re from BeautifulSoup import BeautifulSoup from datetime import datetime, timedelta DATE_FORMAT = '%B %d, %Y at %l:%M%P EDT' class CNNParser(BaseParser): domains = ['edition.cnn.com'] feeder_base = 'http://edition.cnn.com/' feeder_pat = '^http://edition.cnn.com/2...
Python
0.000004
@@ -852,32 +852,56 @@ .get('content')%0A + if datestr:%0A date = d @@ -969,16 +969,56 @@ ours=4)%0A + else:%0A datestr = ''%0A%0A
2af65cb6a202ca98ff0a951feb627608c24d50b7
Remove names from registration pod field mapping
casepro/settings_production.py
casepro/settings_production.py
from __future__ import unicode_literals import os import dj_database_url # import our default settings from settings_common import * # noqa SECRET_KEY = os.environ.get('SECRET_KEY', 'REPLACEME') if os.environ.get('DEBUG', 'False') == 'True': # envvars are strings DEBUG = True else: DEBUG = False TEMPLATE_DE...
Python
0
@@ -3218,136 +3218,8 @@ : %5B%0A - %7B%22field%22: %22mama_name%22, %22field_name%22: %22Mother Name%22%7D,%0A %7B%22field%22: %22mama_surname%22, %22field_name%22: %22Mother Surname%22%7D,%0A @@ -3614,156 +3614,8 @@ %22%7D,%0A - %7B%22field%22: %22hoh_name%22, %22field_name%22: %22Head of ...
2eb7fbd9dd3d52c10979261055aef01f04864c4b
Add docstring for load_image_and_seglabels()
ml/img/segmentation.py
ml/img/segmentation.py
import numpy as np # ============================================================================== # PIXELS_WITH_VALUE # ============================================================================== def pixels_with_value(img, val): """ Given an image ...
Python
0
@@ -1725,127 +1725,1723 @@ l%0A%0A%0A -def load_image_and_seglabels(input_files, label_files, colormap, shape=(32,32), n_channels=3, label_chanel_axis=False): +# ==============================================================================%0A# LOAD_IMAGE_AND_SEGLA...
2e14695a81f0cf85cc1c14815b4a9420d66cb227
fix lecture
mod/lecture/handler.py
mod/lecture/handler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2014-10-26 12:46:36 # @Author : yml_bright@163.com from config import * from tornado.httpclient import HTTPRequest, AsyncHTTPClient from BeautifulSoup import BeautifulSoup import tornado.web import tornado.gen import json import urllib, re class LectureHandl...
Python
0.000007
@@ -2114,16 +2114,23 @@ ', '%E6%9C%BA%E7%94%B5%E5%A4%A7' +, '%E6%A0%A1%E5%8C%BB%E9%99%A2' %5D%0A
776e628edb2f7a8aa239929f2f6b7a5b3a87102d
Remove TODO
my3status/bar.py
my3status/bar.py
#!/usr/bin/env python3 import json import threading import time import signal import sys def _out(*args, **kwargs): print(*args, flush=True, **kwargs) def _error(*args, **kwargs): print(*args, file=sys.stderr, flush=True, **kwargs) class Bar: def __init__(self, blocks): self._blocks = [b for b i...
Python
0.000004
@@ -1798,106 +1798,8 @@ ue:%0A - # todo: consider making this more efficient by checking if the value actually changed%0A
ae7776620f5138fa23e3b91fb8afc0dcf290162a
add cr_uid_ids_context decorator for ir.ui.view render method to have the select the api
addons/web_editor/models/ir_ui_view.py
addons/web_editor/models/ir_ui_view.py
# -*- coding: utf-8 -*- import copy import openerp from openerp.exceptions import AccessError from openerp.osv import osv from lxml import etree, html class view(osv.osv): _inherit = 'ir.ui.view' def render(self, cr, uid, id_or_xml_id, values=None, engine='ir.qweb', context=None): if not values: ...
Python
0
@@ -144,16 +144,40 @@ e, html%0A +from openerp import api%0A %0A%0Aclass @@ -220,16 +220,44 @@ .view'%0A%0A + @api.cr_uid_ids_context%0A def
b16b61914e1fa6ed0c3036404b913026dcc24a24
Update organizers.py
config/organizers.py
config/organizers.py
ORGANIZERS = { ('Francis Deslauriers', 'https://twitter.com/francisDeslaur'), ('Myles Braithwaite', 'https://mylesb.ca/'), ('Peter McCormick', 'https://twitter.com/pdmccormick'), ('Terry Yanchynskyy', 'https://github.com/onebit0fme'), # Add you name and url here ^ and submit a pull request # O...
Python
0
@@ -64,20 +64,13 @@ m/fr -ancisDeslaur +deso_ '),%0A
84d02292f9cc9749b619d823aac1cde88be97edd
change site name
pelicanconf.py
pelicanconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = u'jchen' AUTHOR_FULLNAME = u'Jon Chen' SITENAME = u'burrito?' SITEURL = 'http://burrito.sh' TIMEZONE = 'ETC/UTC' DEFAULT_LANG = u'en' CSS_FILE = 'style.css' # theme stuff THEME = './theme' # plugins PLUGIN_PATH = './p...
Python
0.000002
@@ -150,17 +150,22 @@ 'burrito -? +s r us '%0ASITEUR
b30eff9364cc5ca676b33af104e20196efbb988d
extracting the date, return a dictionary
myoperabkp.py
myoperabkp.py
#!/usr/bin/env python2.7 # encoding: utf-8 """ myoperabkp.py Created by Karl Dubost on 2013-01-24. Copyright (c) 2013 Grange. All rights reserved. see LICENSE.TXT """ import argparse import sys import requests import logging from lxml import etree from urlparse import urljoin # import os # import locale # variables ...
Python
1
@@ -272,16 +272,28 @@ urljoin%0A +import time%0A # import @@ -1124,23 +1124,73 @@ urn -title, postdate +dict(%5B(%22uri%22, uri), (%22title%22, title), (%22date%22, postdate), (%22html%22 , et @@ -1213,16 +1213,19 @@ tent%5B0%5D) +)%5D) %0A%0A%0Adef p @@ -1369,28 +1369,140 @@ /30/%22%22%22%0A -pass +datestr...
3087923d8ef46823f19272eb7743525d19f629ac
update site name to news.ciandcd.com
pelicanconf.py
pelicanconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = u'itech001' AUTHORS = u'itech001' SITENAME = u'ciandcd' SITEURL = 'http://ciandcd.github.io/ciandcd-web' #SITESUBTITLE = 'continuous integration and continuous delivery' SITESUBTITLE = '软件持续集成和持续发布 QQ群:172758282<a target="...
Python
0
@@ -138,23 +138,32 @@ AME = u' +news. ciandcd +.com '%0ASITEUR