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
255202553c4fe336cfc3e2526806ae41cec2556c
Set default timezone on windows every time
module/web/settings.py
module/web/settings.py
# -*- coding: utf-8 -*- # Django settings for pyload project. DEBUG = True TEMPLATE_DEBUG = DEBUG import os.path import sys import django SERVER_VERSION = "0.3.2" PROJECT_DIR = os.path.dirname(__file__) #chdir(dirname(abspath(__file__)) + sep) PYLOAD_DIR = os.path.join(PROJECT_DIR,"..","..") sy...
Python
0.000001
@@ -108,21 +108,16 @@ mport os -.path %0D%0Aimport @@ -2501,16 +2501,17 @@ ne.%0D%0Aif +( django.V @@ -2548,16 +2548,37 @@ N%5B1%5D %3E 1 +) and os.name != %22nt%22 :%0D%0A z
1f59ad4a5fa14a420c683cfd8713c0eb31a9acec
Bump version number for aio.
rest_framework_swagger/__init__.py
rest_framework_swagger/__init__.py
VERSION = '0.3.2' DEFAULT_SWAGGER_SETTINGS = { 'exclude_namespaces': [], 'api_version': '', 'api_key': '', 'token_type': 'Token', 'enabled_methods': ['get', 'post', 'put', 'patch', 'delete'], 'is_authenticated': False, 'is_superuser': False, 'permission_denied_handler': None, 'resou...
Python
0
@@ -12,9 +12,16 @@ 0.3. -2 +5-aio-v1 '%0A%0AD
59d98ffb3fb376826084682ebbbcaba43886619e
fix bug in SPLIT_PATCH_TXT_RE
restfulgit/porcelain/converters.py
restfulgit/porcelain/converters.py
# coding=utf-8 from __future__ import absolute_import, unicode_literals, print_function, division import re from flask import url_for from restfulgit.plumbing.retrieval import get_commit from restfulgit.plumbing.converters import convert_commit as _plumbing_convert_commit from restfulgit.porcelain.retrieval import g...
Python
0.000001
@@ -496,17 +496,21 @@ %5C+%5C b%5C/( -. +%5B%5E%5Cn%5D *?)%5Cn(@@
62a978256476754a7f604b2f872b7bd221930ac2
add test_debian_repo and test_nested_debian_repo
merfi/tests/test_repocollector.py
merfi/tests/test_repocollector.py
from merfi.collector import RepoCollector from os.path import join, dirname class TestRepoCollector(object): def setup(self): self.repos = RepoCollector(path='/', _eager=False) def test_simple_tree(self, deb_repotree): repos = RepoCollector(path=deb_repotree) # The root of the deb_re...
Python
0
@@ -34,17 +34,26 @@ ollector +, DebRepo %0A - from os. @@ -610,16 +610,226 @@ h('/')%0A%0A + def test_debian_repo(self, deb_repotree):%0A repos = RepoCollector(deb_repotree)%0A # The root of the deb_repotree fixture is itself a repository.%0A assert repos == %5BDebRepo(deb_repotree)%5D%0A%0A...
461bb058e19495dd0f6b56e701631de79cec39ad
reorder arguements passed to jinja2_cli.utils.parse_and_load_contexts to omit passing enc parameter
jinja2_cli/utils.py
jinja2_cli/utils.py
""" :copyright: (c) 2012 - 2015 by Satoru SATOH <ssato@redhat.com> :license: BSD-3 """ from __future__ import absolute_import import codecs import glob import os.path import sys from .compat import ENCODING, from_iterable try: from anyconfig.api import container, load except ImportError: container = dict ...
Python
0.000001
@@ -3301,16 +3301,28 @@ ntexts, +werr=False, enc=ENCO @@ -3325,28 +3325,16 @@ ENCODING -, werr=False ):%0A %22 @@ -3388,70 +3388,8 @@ ecs%0A - :param enc: Input encoding of context files (dummy param)%0A @@ -3449,16 +3449,16 @@ occurrs%0A - @@ -3481,24 +3481,86 @@ ntext files%0A + :par...
ecece212605bb588212a70588dc7fd4b67e85cc9
Corrected first two lines
roles/common/tests/test_default.py
roles/common/tests/test_default.py
import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( '.molecule/ansible_inventory').get_hosts('all') def test_hosts_file(File): f = File('/etc/hosts') assert f.exists assert f.user == 'root' assert f.group == 'root'
Python
0.999691
@@ -1,10 +1,8 @@ -import +from tes @@ -32,59 +32,48 @@ nner -%0A%0Atestinfra_hosts = testinfra.utils.ansible_runner. + import AnsibleRunner%0Atestinfra_hosts = Ansi @@ -82,21 +82,16 @@ eRunner( -%0A '.molecu
19fd0b75e07311bb3eb863d132125325e3478424
Fix typo in docstring
byceps/services/user_avatar/models.py
byceps/services/user_avatar/models.py
""" byceps.services.user_avatar.models ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2017 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from collections import namedtuple from datetime import datetime from pathlib import Path from flask import current_app, url_for from sqlalchemy.ex...
Python
0.013244
@@ -507,16 +507,17 @@ %22%22%22A +n avatar
fae78c016fd3c5fdbcb9a5f6365c9b93586de36e
Update generation.py
cea/optimization/master/generation.py
cea/optimization/master/generation.py
""" Create individuals """ from __future__ import division import random from cea.optimization.constants import DH_CONVERSION_TECHNOLOGIES_SHARE, DC_CONVERSION_TECHNOLOGIES_SHARE from cea.optimization.master.validation import validation_main __author__ = "Jimeno A. Fonseca" __copyright__ = "Copyright 2015, Architec...
Python
0.000001
@@ -4779,78 +4779,8 @@ ():%0A - lim_inf = limits%5B%22liminf%22%5D%0A lim_sup = limits%5B%22limsup%22%5D%0A @@ -4851,24 +4851,16 @@ orm( -lim_inf, lim_sup +0.0, 1.0 ),2)
ef03541b2b25ab9cf34deec554a19a32dad7fbec
Add new line to end of init file for Meta Writer application
tools/python/odin_data/meta_writer/__init__.py
tools/python/odin_data/meta_writer/__init__.py
from pkg_resources import require require('pygelf==0.3.1') require("h5py==2.8.0") require('pyzmq==16.0.2')
Python
0
@@ -99,8 +99,9 @@ 16.0.2') +%0A
5eaf4ed148f36f6cf578c9d943ee32652628de64
Fix broken tests
xero/exceptions.py
xero/exceptions.py
from six.moves.urllib.parse import parse_qs from xml.dom.minidom import parseString import json class XeroException(Exception): def __init__(self, response, msg=None): self.response = response super(XeroException, self).__init__(msg) class XeroNotVerified(Exception): # Credentials haven't be...
Python
0.000555
@@ -762,32 +762,74 @@ %5D%0A %5D%0A + self.problem = self.errors%5B0%5D%0A supe @@ -1077,32 +1077,74 @@ ,%0A %5D%0A + self.problem = self.errors%5B0%5D%0A supe @@ -1619,32 +1619,74 @@ %5D%0A %5D%0A + self.problem = self.error...
514074dee639b30fb56ec664804bdd3f533befda
Apply `cacheonceproperty` on props of Tree & Chunk.
xmlpumpkin/tree.py
xmlpumpkin/tree.py
# encoding: utf-8 from lxml import etree XML_ENCODING = 'utf-8' class Tree(object): """Tree accessor for CaboCha xml.""" def __init__(self, cabocha_xml): self._element = etree.fromstring( cabocha_xml.encode(XML_ENCODING), ) @property def chunks(self): chunk_ele...
Python
0
@@ -35,16 +35,53 @@ t etree%0A +from .utils import cacheonceproperty%0A %0A%0AXML_EN @@ -294,32 +294,41 @@ )%0A%0A @ +cacheonce property%0A def @@ -490,24 +490,33 @@ hunks%0A%0A @ +cacheonce property%0A @@ -1065,24 +1065,33 @@ ement%0A%0A @ +cacheonce property%0A @@ -1150,32 +1150,41 @...
7aae3f244f15d31e4d5a0c844df5cbbb5a594e84
update mongostring
mongo.py
mongo.py
import os import sys import pymongo from bson import BSON from bson import json_util MONGODB_URI_REMOTE = 'mongodb://Lars_2009:Lars65535@euve76271.serverprofi24.de:21060/larscgmtest' MONGODB_URI_LOCAL = 'mongodb://aps:aps@127.0.0.1:27017/aps' def getlast3(): try: client = pymongo.MongoClient(MONGODB_URI_LOCAL) ...
Python
0.000001
@@ -83,107 +83,8 @@ il%0A%0A -MONGODB_URI_REMOTE = 'mongodb://Lars_2009:Lars65535@euve76271.serverprofi24.de:21060/larscgmtest' %0A MONG
46f3869465ff939bdc667c3e787a415197e679c2
fix device busy bugs
PyDockerMonitor/containerScheduler.py
PyDockerMonitor/containerScheduler.py
#!/usr/bin/python import logging from hostStatusUpdateResponse import ContainerCommand, HostResponse, ContainerResponse from hostToContainerManager import CTContainerStatus from collections import deque from YarnCommand import YarnCommandType log=logging.getLogger("RMDocker.ContainerScheduler") MAX_BOOST=1 class C...
Python
0.000001
@@ -5399,16 +5399,20 @@ value = +int( memory_v @@ -5421,16 +5421,17 @@ ue * 0.9 +) %0A
de3b4775b7dbcecc9c42e18c59b35485f83ca74a
Update max-chunks-to-make-sorted-i.py
Python/max-chunks-to-make-sorted-i.py
Python/max-chunks-to-make-sorted-i.py
# Time: O(n) # Space: O(1) class Solution(object): def maxChunksToSorted(self, arr): """ :type arr: List[int] :rtype: int """ result, max_i = 0, 0 for i, v in enumerate(arr): max_i = max(max_i, v) if max_i == i: result += 1 ...
Python
0.000001
@@ -22,16 +22,894 @@ : O(1)%0A%0A +# Given an array arr that is a permutation of %5B0, 1, ..., arr.length - 1%5D,%0A# we split the array into some number of %22chunks%22 (partitions), and individually sort each chunk.%0A# After concatenating them, the result equals the sorted array.%0A#%0A# What is the most number of ...
846a683a4bd3b14d6585d9daad1a3790816719c8
set initial and default for byhour, byminute and bysecond to 0
planner/serializers/serializers.py
planner/serializers/serializers.py
from rest_framework import serializers from planner.models.models import SimpleRule, RuleSetElement, \ RuleSet, BaseRule, DateTimeRule import re def pattern_validate(nbmax): """ returns a validator function for an interger or a list of integers ; the length of the list is lower than nbmax+2 """ ...
Python
0.000001
@@ -1050,32 +1050,58 @@ allow_blank=True +, default='0', initial='0' )%0A byminute = @@ -1131,32 +1131,58 @@ allow_blank=True +, default='0', initial='0' )%0A bysecond = @@ -1212,32 +1212,58 @@ allow_blank=True +, default='0', initial='0' )%0A byeaster =
32fccb04bac6be7e79f6b05b727e5e847fef498c
Update misc.py
misc/misc.py
misc/misc.py
Python
0
@@ -1 +1,996 @@ +import discord%0Afrom discord.ext import commands%0Aimport random%0Aimport time%0A%0Aclass misc:%0A %22%22%22My custom cog that does stuff%22%22%22%0A def __init__(self, bot):%0A self.bot = bot%0A self.bank = Bank(bot, %22data/economy/bank.json%22)%0A%0A def role_colour():%0A ...
4ec433f504bc6659889daff4097732287b4b563a
Allow for executeCommand to take the stdin input.
utils/lit/lit/util.py
utils/lit/lit/util.py
import errno import itertools import math import os import platform import signal import subprocess import sys def to_bytes(str): # Encode to UTF-8 to get binary data. return str.encode('utf-8') def to_string(bytes): if isinstance(bytes, str): return bytes return to_bytes(bytes) def convert_s...
Python
0.000002
@@ -1335,17 +1335,16 @@ me(path) - %0A if @@ -4801,24 +4801,36 @@ ne, env=None +, input=None ):%0A p = s @@ -5091,24 +5091,35 @@ communicate( +input=input )%0A exitCo
4b9948e665c78df468917b0906afc288244fa303
add doc back in.
osbs/exceptions.py
osbs/exceptions.py
""" Exceptions raised by OSBS """ class OsbsException(Exception): pass class OsbsResponseException(OsbsException): def __init__ (self, message, status_code, *args, **kwargs): super (OsbsResponseException, self).__init__ (message, *args, **kwargs) self.status_code = status_code class OsbsNetwo...
Python
0
@@ -106,32 +106,91 @@ OsbsException):%0A + %22%22%22 OpenShift didn't respond with OK (200) status %22%22%22%0A%0A def __init__
a7c11da50ecea2bbf8983ebbea0c3e91fcfb500a
Fix typo.
swig/python/package/test/codegen/codegen.py
swig/python/package/test/codegen/codegen.py
# simple code generation example # note: to keep things simple, unused arithmetic operators # for the format description are not implemented # a realistic example would implement all operators import formast def api_name(name): return "_".join(part.lower() for part in name.split()) class CodeGenIndent: """I...
Python
0.001604
@@ -3795,13 +3795,12 @@ def -write +read (sel
e9a1ee7faef9b208e83173c39c62926553ab6b5f
mark issue as closed if resolution type is finished or fixed
src/survivor/tasks/sync.py
src/survivor/tasks/sync.py
""" Synchronises local database with JIRA. """ import argparse import iso8601 import itertools from jira.client import JIRA from survivor import config, init from survivor.models import User, Issue # max number of issues to have jira return for the project MAX_ISSUE_RESULTS = 99999 def create_user(jira_user): ...
Python
0
@@ -1409,16 +1409,152 @@ ondate:%0A + resolution_type = jira_issue.fields.resolution.name%0A if resolution_type == %22Finished%22 or resolution_type == %22Fixed%22:%0A
4c2b854354c14c7a00b3b3efb7ecbfd0712e6a16
make parse.py importable
parse.py
parse.py
#!/usr/bin/env python import logging import argparse import os import datetime import re import mmap import contextlib import multiprocessing import itertools from xml.sax import SAXException import sys sys.path.append( '.' ) sys.path.append( './lib/' ) from grant_handler import PatentGrant from patSQL import * from...
Python
0.000134
@@ -2735,16 +2735,327 @@ mit();%0A%0A +def main(directories, patentroot, xmlregex, verbosity):%0A logging.basicConfig(filename=logfile, level=verbosity)%0A files = list_files(directories, patentroot, xmlregex)%0A parsed_xmls = parallel_parse(files)%0A parsed_grants = parse_patent(parsed_xmls)%0A build_t...
0903a4227cc8facc6edc9e6dab43ef79a211f24c
Fix logic error in reporting
zuul/lib/gerrit.py
zuul/lib/gerrit.py
# Copyright 2012 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
Python
0.001162
@@ -3864,18 +3864,18 @@ if v -== +is True:%0A
bbf8886a2cbf4fa371f0a67157fdd3df3dfa47dd
Fix broken MLflow DB README link in CLI docs (#2377)
mlflow/db.py
mlflow/db.py
import click import mlflow.store.db.utils @click.group("db") def commands(): """ Commands for managing an MLflow tracking database. """ pass @commands.command() @click.argument("url") def upgrade(url): """ Upgrade the schema of an MLflow tracking database to the latest supported version. ...
Python
0
@@ -608,16 +608,19 @@ s/README +.md , descri
f3439c00fbc5e2379150afd777ee29b92bf02b73
make executable
piopticon.py
piopticon.py
from picamera.array import PiRGBArray from picamera import PiCamera import imutils import cv2 import sys import os import datetime import time import json import argparse import dropbox from dropbox.files import WriteMode from dropbox.exceptions import ApiError, AuthError from twilio.rest import TwilioRestClient con...
Python
0.99998
@@ -1,20 +1,39 @@ +#!/usr/bin/python%0A%0A from picamera.array @@ -152,24 +152,25 @@ import time%0A +%0A import json%0A
d5f979236089e7cb3de90b03303e1c3af967331c
add UW-Madison, minor formatting
uw_si2/rest/rester.py
uw_si2/rest/rester.py
from __future__ import division, unicode_literals import six, bson, os from bson.json_util import dumps, loads from mpcontribs.rest.rester import MPContribsRester from mpcontribs.io.core.utils import get_short_object_id from mpcontribs.io.archieml.mpfile import MPFile from pandas import Series class UWSI2Rester(MPCont...
Python
0.00243
@@ -991,14 +991,39 @@ t': -'LBNL' +%7B'$in': %5B'LBNL', 'UW-Madison'%5D%7D %7D,%0A @@ -1287,25 +1287,24 @@ l.', 'D0 %5Bcm -%5E 2/s%5D', 'Q %5Be
2482cfc3eb18b892e47960321af851d7e8797a74
Fix potential KeyError
samantha/plugins/twitch_plugin.py
samantha/plugins/twitch_plugin.py
"""A service to test loading services. It doesn't do anything.""" ############################################################################### # # TODO: [ ] # ############################################################################### # standard library imports import json import logging import time # relate...
Python
0.998171
@@ -877,17 +877,17 @@ = %221.3.2 -0 +1 %22%0A%0A# Ini @@ -5810,32 +5810,132 @@ nelname), item)%0A + if channelname in STREAM_LIST:%0A # refilled with the new data%0A @@ -5998,49 +5998,8 @@ - # refilled with the new data%0A
af54f9666b15cd68e5404b60f495f6d51c1470b1
Fix upload_manual_flac command to add its arguments
WhatManager2/management/commands/upload_manual_flac.py
WhatManager2/management/commands/upload_manual_flac.py
#!/usr/bin/env python from __future__ import unicode_literals import time from django.core.management.base import BaseCommand import requests from WhatManager2.utils import wm_unicode from home.models import get_what_client from what_transcode.tasks import TranscodeSingleJob def _add_to_wm_transcode(what_id): ...
Python
0
@@ -55,16 +55,33 @@ literals +%0A%0Aimport requests %0Aimport @@ -85,17 +85,16 @@ rt time%0A -%0A from dja @@ -142,25 +142,8 @@ nd%0A%0A -import requests%0A%0A from @@ -180,17 +180,16 @@ unicode%0A -%0A from hom @@ -1152,65 +1152,257 @@ def -handle(self, *args, **options):%0A if len(args) != 1 +add_ar...
fdeb06bdf33a55413f1f8f8cd780c84438ad2277
add missing import
src/zeit/content/cp/browser/blocks/av.py
src/zeit/content/cp/browser/blocks/av.py
# Copyright (c) 2009 gocept gmbh & co. kg # See also LICENSE.txt import zeit.content.cp.interfaces import zope.app.pagetemplate import zope.formlib.form class EditProperties(zope.formlib.form.SubPageEditForm): template = zope.app.pagetemplate.ViewPageTemplateFile( 'av.edit-properties.pt') form_fiel...
Python
0.000042
@@ -59,16 +59,69 @@ SE.txt%0A%0A +from zeit.content.cp.i18n import MessageFactory as _%0A import z
db1f0556f72eb84e4273ff8925494de81bf21898
rename paths / meta not needed
src/learn/dev_ben/generate_training_data.py
src/learn/dev_ben/generate_training_data.py
import os import sgf from time import strftime from os.path import dirname, abspath from src.play.model.Board import Board size = 9 EMPTY_val = 0 # 0.45 BLACK_val = 1 # -1.35 WHITE_val = -1 # 1.05 data_dir = os.path.join(dirname(dirname(dirname(dirname(abspath(__file__))))), 'data') paths = [ os.p...
Python
0
@@ -294,20 +294,24 @@ data')%0D%0A -path +sgf_file s = %5B%0D%0A @@ -667,20 +667,24 @@ str(len( -path +sgf_file s)) + '_ @@ -754,20 +754,24 @@ path in -path +sgf_file s:%0D%0A @@ -947,16 +947,51 @@ %5B0%5D%0D%0A + moves = game_tree.nodes%5B1:%5D%0D%0A # meta = @@ -1025,41 +1025,8 @@ es%0D%0A - ...
9e86d12e1135d16b32da5f130e14cfde4ffe9a95
Support CloudFlare "email" protection
module/plugins/hoster/UpleaCom.py
module/plugins/hoster/UpleaCom.py
# -*- coding: utf-8 -*- import re import urlparse from module.plugins.internal.XFSHoster import XFSHoster class UpleaCom(XFSHoster): __name__ = "UpleaCom" __type__ = "hoster" __version__ = "0.17" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?uplea\.com/dl/\w{15}' __config...
Python
0
@@ -103,16 +103,206 @@ oster%0A%0A%0A +def decode_cloudflare_email(value):%0A email = %22%22%0A%0A key = int(value%5B:2%5D, 16)%0A for i in xrange(2, len(value), 2):%0A email += chr(int(value%5Bi:i+2%5D, 16) %5E key)%0A%0A return email%0A%0A%0A class Up @@ -402,9 +402,9 @@ %220.1 -7 +8 %22%0A @...
f9e63022eb975c131bef86a81655885ea0563857
Capitalise constants
saau/sections/geology/elevation.py
saau/sections/geology/elevation.py
# geology-elevation1 from os.path import basename import cartopy.crs as ccrs from ..image_provider import ImageProvider from ...utils.download import get_binary from ...utils.shape import shape_from_zip url = 'http://www.ga.gov.au/corporate_data/48006/48006_shp.zip' filename = basename(url) class ElevationImagePro...
Python
0.999886
@@ -199,19 +199,19 @@ om_zip%0A%0A -url +URL = 'http @@ -263,24 +263,24 @@ hp.zip'%0A -filename +FILENAME = basen @@ -283,19 +283,19 @@ asename( -url +URL )%0A%0A%0Aclas @@ -405,24 +405,24 @@ _exists( -filename +FILENAME )%0A%0A d @@ -473,11 +473,11 @@ ary( -url +URL , se @@ -489,32 +489,32 @@ ta_dir_jo...
327fcfd4c6b0ad10b25c286f271c577afd741099
set width for login details to 50 chars.
Source/Hg/wb_hg_credential_dialogs.py
Source/Hg/wb_hg_credential_dialogs.py
''' ==================================================================== Copyright (c) 2016 Barry A Scott. All rights reserved. This software is licensed as described in the file LICENSE.txt, which you should have received as part of this distribution. ===========================================================...
Python
0
@@ -995,55 +995,8 @@ M' ) -%0A self.username.setMinimumWidth( 50*em ) %0A%0A @@ -1123,16 +1123,33 @@ username +, min_width=50*em )%0A
bd66185722417cfc24f348b7538e189636c75352
Fix full node in VoresourceRendererMixin
daiquiri/core/renderers/voresource.py
daiquiri/core/renderers/voresource.py
from datetime import datetime from . import XMLRenderer from .vosi import CapabilitiesRendererMixin, TablesetRendererMixin class VoresourceRendererMixin(CapabilitiesRendererMixin, TablesetRendererMixin): def render_voresource(self, metadata): self.start('ri:Resource', { 'created': self.rende...
Python
0.000001
@@ -1826,65 +1826,8 @@ ))%0A%0A - full = metadata.get('full')%0A if full:%0A @@ -1871,16 +1871,25 @@ t('full' +, 'false' ))%0A%0A
f6a80e8717e398eb02bd0aeb023f554f1e514363
remove group name to group ID conversion
oauthenticator/gitlab.py
oauthenticator/gitlab.py
""" Custom Authenticator to use GitLab OAuth with JupyterHub Modified for GitLab by Laszlo Dobos (@dobos) based on the GitHub plugin by Kyle Kelley (@rgbkrk) """ import json import os import sys from tornado.auth import OAuth2Mixin from tornado import gen, web import requests from tornado.httputil import url_conca...
Python
0.016446
@@ -275,16 +275,54 @@ equests%0A +from tornado.escape import url_escape%0A from tor @@ -4622,16 +4622,32 @@ group in + map(url_escape, self.gi @@ -4670,67 +4670,11 @@ list +) :%0A - group_id = _get_group_id(group, headers)%0A @@ -4703,17 +4703,17 @@ groups/%25 -d +s /members @@ -4737,19 +4...
272e5e79941bbd3293a2285dd35242b5d5f3b4d5
remove debug stuff
publisher.py
publisher.py
from wiki import * from aggregate import * import logging class wikipublisher(object): def __init__(self, dw, export_ns = []): self.dw = dw self.export_ns = export_ns def public_page(self, page, rel_ns = []): fullname = self.dw.resolve(page, rel_ns) fullname = fullname.replace(':', '.').strip('.') ...
Python
0.000001
@@ -1107,21 +1107,8 @@ %0A%0A%09%09 -# DEBUG:%0A%09%09# self @@ -2582,23 +2582,8 @@ %09%09%09%09 -# DEBUG:%0A%09%09%09%09# data @@ -2615,18 +2615,16 @@ me)%0A%09%09%09%09 -# if not s @@ -2662,18 +2662,16 @@ ):%0A%09%09%09%09%09 -# logging.
504d484d85ebb577943899b5589eeff9d2a67d5a
FIX : fix negative triggers due to old neuromag system
mne/event.py
mne/event.py
"""IO with fif files containing events """ # Authors: Alexandre Gramfort <gramfort@nmr.mgh.harvard.edu> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # # License: BSD (3-clause) import numpy as np from .fiff.constants import FIFF from .fiff.tree import dir_tree_find from .fiff.tag import read_tag from .fiff....
Python
0
@@ -181,16 +181,32 @@ lause)%0A%0A +import warnings%0A import n @@ -4104,16 +4104,253 @@ ick, :%5D%0A + if np.any(data %3C 0):%0A warnings.warn('Trigger channel contains negative values. '%0A 'Taking absolute value.')%0A data = np.abs(data) # make sure trig channel is positive%...
c44cc51f08aba57703bbc5513c9e5808be78d4b0
fix change of API for the method get_from_label_and_partner_field
account_statement_completion_label/statement.py
account_statement_completion_label/statement.py
# -*- coding: utf-8 -*- ############################################################################### # # account_statement_completion_label for OpenERP # Copyright (C) 2013 Akretion (http://www.akretion.com). All Rights Reserved # @author Benoît GUILLOT <benoit.guillot@akretion.com> # # This program is free ...
Python
0.000001
@@ -2145,39 +2145,39 @@ (self, cr, uid, +st_ line -_id , context=None): @@ -2731,24 +2731,86 @@ st_obj = + self.pool.get('account.bank.statement')%0A st_line_obj = self.pool.g @@ -2914,21 +2914,23 @@ st -_line +atement = st_ob @@ -2947,23 +2947,42 @@ r, uid, +st_ line -_id +%5B'statement_i...
fe7d5ec956f0277d0689dec57d9e145fcd19f79f
Modify svm
mnist_svm.py
mnist_svm.py
import numpy as np import matplotlib.pyplot as plt GRAY_SCALE_RANGE = 255 import pickle data_filename = 'data_deskewed.pkl' print('Loading data from file \'' + data_filename + '\' ...') with open(data_filename, 'rb') as f: train_labels = pickle.load(f) train_images = pickle.load(f) test_labels = pickle.l...
Python
0.000426
@@ -834,16 +834,18 @@ etrics%0A%0A +# clf = sv @@ -864,16 +864,49 @@ = 0.001) +%0Aclf = svm.SVC(kernel = 'linear') %0A%0Aclf.fi @@ -919,16 +919,23 @@ n_images +%5B:1000%5D , train_ @@ -940,16 +940,23 @@ n_labels +%5B:1000%5D )%0A%0Apredi
ec7411f409f07bd04778c9baf509adb10f446f10
allow cross origin requests
mock/mock.py
mock/mock.py
import cherrypy class MockController: def poi(self, location): with open("poi.json") as poifile: return poifile.read() def faq(self, location): with open("faq.json") as faqfile: return faqfile.read() def phrasebook(self, location): with open("phrasebook.json") a...
Python
0
@@ -53,32 +53,103 @@ elf, location):%0A + cherrypy.response.headers%5B'Access-Control-Allow-Origin'%5D = '*'%0A with ope @@ -226,32 +226,103 @@ elf, location):%0A + cherrypy.response.headers%5B'Access-Control-Allow-Origin'%5D = '*'%0A with ope @@ -409,32 +409,103 @@ elf, location):%0A...
fa58cda42afaf1ed80352d9b59cf473a16706436
work around, closes #464
vent/helpers/paths.py
vent/helpers/paths.py
import errno import os from vent.api.templates import Template class PathDirs: """ Global path directories for vent """ def __init__(self, base_dir=os.path.join(os.path.expanduser("~"), ".vent/"), plugins_dir="plugins/", meta_dir=os.path.join(os.path.expandus...
Python
0
@@ -15,16 +15,32 @@ mport os +%0Aimport platform %0A%0Afrom v @@ -1616,32 +1616,175 @@ file exists %22%22%22%0A + if platform.system() == 'Darwin':%0A default_file_dir = os.path.join(os.path.expanduser(%22~%22), %22vent_files%22)%0A else:%0A default_
504f57bcecb2cc35b1efd742e60e75d458f68d4a
Remove test block
munch.py
munch.py
import sys class KaleInterp: ''' TODO - Write self.if_call - solve problems related self.if_call - specifically, the .next in said call ''' def __init__(self): #self.keywords is a dictionary of keywords and function calls self.keywords = {'write:' : self.write, 'var:' : self.variable, 'if:' : s...
Python
0.000001
@@ -3622,226 +3622,8 @@ e)%0A%0A -%0A%0A%0A%09%09# TEST%0A%09%09eval_buffer = eval_buffer.split()%0A%09%09for character in range(len(eval_buffer)):%0A%09%09%09if eval_buffer%5Bcharacter%5D == '/':%0A%09%09%09%09eval_buffer%5Bcharacter%5D == '//'%0A%09%09eval_buffer = ''.join(eval_buffer)%0A%09%09# END TEST%0A%0A%0A%0A...
7f248f252b0a846e39c60d66485f796576b2179e
fix doctest
aoc2016/day9.py
aoc2016/day9.py
import re def parse(lines): return ''.join([x.strip() for x in lines]) class Marker(object): def __init__(self, chars, repeats): self.chars = chars self.repeats = repeats @classmethod def parse(clazz, text): """ >>> m, rest = Marker.parse('(10x2)abc') >>> m...
Python
0.000001
@@ -1226,16 +1226,25 @@ compress +ed_length 2('ADVEN @@ -1247,32 +1247,25 @@ DVENT')%0A -'ADVENT' +6 %0A %3E%3E%3E dec @@ -1271,16 +1271,25 @@ compress +ed_length 2('X(8x2 @@ -1309,30 +1309,10 @@ -'XABCABCABCABCABCABCY' +20 %0A
6b0c9c9a06884535450c81b7da8f22d82e5ffbb0
Fix folders initialization in the Refree
onitu/referee/referee.py
onitu/referee/referee.py
import os import functools import zmq from logbook import Logger from onitu.escalator.client import Escalator, EscalatorClosed from onitu.utils import get_events_uri from .cmd import UP, DEL, MOV class Referee(object): """Referee class, receive all events and deal with them. The events are represented as...
Python
0.000001
@@ -1367,23 +1367,55 @@ ')%5B-1%5D: +%7B' options +': options, 'services': set()%7D %0A @@ -1467,17 +1467,17 @@ ('folder -s +: ')%0A @@ -1478,24 +1478,278 @@ %0A %7D%0A%0A + for service in self.services:%0A folders = self.escalator.get(%0A 'service:%7B%7D:folde...
cef46656955cca0a5b0a83487418cc733a79e52b
fix profile url (#849)
open_discussions/urls.py
open_discussions/urls.py
"""project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
Python
0
@@ -2350,33 +2350,16 @@ profile/ -(?P%3Cchannel_name%3E %5BA-Za-z0 @@ -2363,17 +2363,16 @@ -z0-9_%5D+ -) /', inde
6b8de33dbd50243d566e095005699f0611a38d8b
add new fail message during commit
netmiko/vyos/vyos_ssh.py
netmiko/vyos/vyos_ssh.py
from __future__ import print_function from __future__ import unicode_literals import time from netmiko.cisco_base_connection import CiscoSSHConnection class VyOSSSH(CiscoSSHConnection): """Implement methods for interacting with VyOS network devices.""" def session_preparation(self): """Prepare the se...
Python
0
@@ -2359,16 +2359,17 @@ arker = +%5B 'Failed @@ -2397,16 +2397,34 @@ config' +, 'Commit failed'%5D %0A @@ -2752,16 +2752,41 @@ if +any(x in output for x in error_ma @@ -2789,26 +2789,17 @@ r_marker - in output +) :%0A
069ef2ae7d43c8afaee66d35ff03b4673c92e42e
Use a set to get unique dirs, and sorted to make the output stable
mopidy/core/library.py
mopidy/core/library.py
from __future__ import unicode_literals import collections import urlparse import pykka class LibraryController(object): pykka_traversable = True def __init__(self, backends, core): self.backends = backends self.core = core def _get_backend(self, uri): uri_scheme = urlparse.url...
Python
0
@@ -53,16 +53,32 @@ ections%0A +import operator%0A import u @@ -2294,16 +2294,23 @@ -root = %5B +unique_dirs = %7B b.li @@ -2353,17 +2353,17 @@ backends -%5D +%7D %0A @@ -2378,50 +2378,58 @@ urn -list(collections.OrderedDict.fromkeys(root +sorted(unique_dirs, key=operator.attrgetter('name' ))%0A%0A...
eaae2a1e88572e224621e242be1d15e92065f15e
Use new extension setup() API
mopidy_nad/__init__.py
mopidy_nad/__init__.py
from __future__ import unicode_literals import os import pygst pygst.require('0.10') import gst import gobject from mopidy import config, ext __version__ = '1.0.0' class Extension(ext.Extension): dist_name = 'Mopidy-NAD' ext_name = 'nad' version = __version__ def get_default_config(self): ...
Python
0
@@ -430,40 +430,28 @@ def -register_gstreamer_elements(self +setup(self, registry ):%0A
daf577f1e4bab13f9d5f2e3fdad8765dbab70dfe
refactor settings
openstax/settings/dev.py
openstax/settings/dev.py
from .base import * DEBUG = True EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # BASE_URL required for notification emails BASE_URL = 'http://localhost:8000' try: from .local import * except ImportError: pass ################################## # ACCOUNTS SETTINGS # ########...
Python
0.000002
@@ -234,17 +234,16 @@ pass%0A%0A -%0A ######## @@ -273,20 +273,24 @@ ###%0A# - +OVERRIDE ACCOUNT @@ -302,20 +302,16 @@ TINGS - #%0A###### @@ -342,17 +342,17 @@ ####%0A%0A# -U +u se defau @@ -363,17 +363,21 @@ ogin -, +g and logout and @@ -376,24 +376,41 @@ out -and profile urls +urls,%...
9a24356641d5729aa0df347e19cf1cd1f8c979a5
Fix SVN updating
observatory/dashboard/models/Repository.py
observatory/dashboard/models/Repository.py
# Copyright (c) 2010, Nate Stedman <natesm@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUT...
Python
0
@@ -5098,32 +5098,155 @@ if fresh_clone:%0A + # make the repo's directory%0A try:%0A os.makedirs(destination_dir, 0770)%0A except OSError as e:%0A pass%0A %0A clone_cmdlin @@ -5347,38 +5347,8 @@ vn%22, - %22--git-dir%22, destination_dir, %22fe @@ -5390,16 +5390,39 @@ _cmdline +, cwd = de...
3a26ad7b5c24e025a92e5ebaa88c19e4b63a33a3
Correct trainer_lib_test setup and lower its BUILD deps.
tensor2tensor/utils/trainer_lib_test.py
tensor2tensor/utils/trainer_lib_test.py
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
Python
0
@@ -742,74 +742,8 @@ on%0A%0A -from tensor2tensor import models # pylint: disable=unused-import%0A from @@ -857,16 +857,94 @@ lem_lib%0A +from tensor2tensor.models import transformer # pylint: disable=unused-import%0A from ten @@ -2770,39 +2770,82 @@ es(self):%0A # -HParams +Use existing hparams and override...
945c93fa91cb7b3b14f002e37e2a8bd2ee915fdd
Clean the mako cache between runs, because it breaks theme switching
nikola/mako_templates.py
nikola/mako_templates.py
######################################## # Mako template handlers ######################################## import os import shutil from mako import util, lexer from mako.lookup import TemplateLookup lookup = None cache = {} def get_deps(filename): text = util.read_file(filename) lex = lexer.Lexer(text=text,...
Python
0
@@ -600,46 +600,8 @@ s):%0A - print %22Directories:%22, directories%0A @@ -983,36 +983,8 @@ me)%0A - print template.filename%0A
c21d7bee740fe27012d9affed27b6c489e5f6cac
add logging types
avalanche/evaluation/metric_results.py
avalanche/evaluation/metric_results.py
################################################################################ # Copyright (c) 2021 ContinualAI. # # Copyrights licensed under the MIT License. # # See the accompanying LICENSE file for terms. ...
Python
0.000001
@@ -990,16 +990,38 @@ t Tensor +%0Afrom enum import Enum %0A%0Aif TYP @@ -1123,16 +1123,743 @@ ue%22%5D%5D%0A%0A%0A +class LoggingType(Enum):%0A %22%22%22A type for MetricValues.%0A%0A It can be used by MetricValues to choose how they want to be visualize.%0A For example, a 2D tensor could be a line plot or...
4912027d6cb0f27c736e46498231595f50a36cd3
add cv element
mriqc/classifier/cv.py
mriqc/classifier/cv.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: oesteban # @Date: 2015-11-19 16:44:27 # @Last Modified by: oesteban # @Last Modified time: 2016-05-12 17:46:31 """ MRIQC Cross-validation """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from _...
Python
0.000001
@@ -501,16 +501,70 @@ port svm +%0Afrom sklearn.cross_validation import LeaveOneLabelOut %0A%0Adef ma @@ -1602,23 +1602,21 @@ )%5D%0A%09 -X_df%5B' site -'%5D +s = +list( y_df @@ -1627,16 +1627,17 @@ e.values +) %0A%09X_df%5B' @@ -1746,16 +1746,52 @@ alues%5D%0A%0A + lolo = LeaveOneLabelOut(labels)%0A ...
2aeda5c12710e197282f015f7e4b8519f1d8bcc5
Update tests.py
verification/tests.py
verification/tests.py
""" TESTS is a dict with all you tests. Keys for this will be categories' names. Each test is dict with "input" -- input data for user function "answer" -- your right answer "explanation" -- not necessary key, it's using for additional info in animation. """ TESTS = { "Basics": [ { ...
Python
0.000001
@@ -348,21 +348,25 @@ %22 -two%22: %22$5.34%22 +answer%22: lambda:0 %0A
1d8909fab3db0b7b1ac0b40fea93e35480581bac
test transparent access for nix.S
nix/test/test_section.py
nix/test/test_section.py
# Copyright (c) 2014, German Neuroinformatics Node (G-Node) # # All rights reserved. # # Redistribution and use in section and binary forms, with or without # modification, are permitted under the terms of the BSD License. See # LICENSE file in the root of the Project. import unittest from nix import * import nix c...
Python
0
@@ -2846,16 +2846,194 @@ trode')%0A + subject = self.section%5B'subject'%5D = nix.S('subject')%0A %0A assert(self.section%5B'subject'%5D == subject)%0A assert(self.section%5B'subject'%5D.id == subject.id)%0A
decab6827b5dacc21f0263af7e5d895e5a737726
Update tests.py
verification/tests.py
verification/tests.py
""" TESTS is a dict with all you tests. Keys for this will be categories' names. Each test is dict with "input" -- input data for user function "answer" -- your right answer "explanation" -- not necessary key, it's using for additional info in animation. """ TESTS = { "Basics": [ { ...
Python
0.000001
@@ -1835,25 +1835,24 @@ Zack Greinke -r $27.000.0 @@ -1999,17 +1999,16 @@ Greinke -r $27,0
0626c8db3f2287d78c467c194e01cf004f0c7e78
Convert simple-mapped results back to Series.
pandas/util/map.py
pandas/util/map.py
import numpy as np from pandas import _tseries as lib from pandas import notnull, Series from functools import wraps class repeat(object): def __init__(self, obj): self.obj = obj def __getitem__(self, i): return self.obj class azip(object): def __init__(self, *args): self.cols...
Python
0.000129
@@ -1320,20 +1320,19 @@ re -turn +s = lib.map @@ -1367,24 +1367,80 @@ otherargs))%0A + return Series(res, index=arr.index, copy=False)%0A %0A n_o @@ -1836,16 +1836,17 @@ ed(arr, +* otherarg @@ -1850,11 +1850,8 @@ args -=() , n_
42f74f304d0ac404f17d6489033b6140816cb194
Implement Stonesplinter Trogg, Burly Rockjaw Trogg, Ship's Cannon
fireplace/cards/gvg/neutral_common.py
fireplace/cards/gvg/neutral_common.py
from ..utils import * ## # Minions # Explosive Sheep class GVG_076: def deathrattle(self): for target in self.game.board: self.hit(target, 2) # Clockwork Gnome class GVG_082: deathrattle = giveSparePart # Micro Machine class GVG_103: def TURN_BEGIN(self, player): # That card ID is not a mistake self....
Python
0
@@ -31,16 +31,618 @@ inions%0A%0A +# Stonesplinter Trogg%0Aclass GVG_067:%0A%09def CARD_PLAYED(self, player, card):%0A%09%09if player is not self.controller and card.type == CardType.SPELL:%0A%09%09%09self.buff(%22GVG_067a%22)%0A%0Aclass GVG_067a:%0A%09Atk = 1%0A%0A%0A# Burly Rockjaw Trogg%0Aclass GVG_068:%0A%09def CA...
0bd2fffcab47c79999e5bf20b881a69193855bd9
Fix install script
dstat_plugins/__init__.py
dstat_plugins/__init__.py
import shutil import sys import pkg_resources as pr def install(): destdir = sys.argv[1] datadir = pr.resource_filename(__name__, 'plugins/dstat_mysql5_innodb.py') shutil.copytree(datadir, destdir)
Python
0.000001
@@ -1,16 +1,28 @@ +import glob%0A import shutil%0Aim @@ -29,16 +29,41 @@ port sys +%0Aimport os%0Aimport os.path %0A%0Aimport @@ -164,52 +164,350 @@ ame( -__name__, 'plugins/dstat_mysql5_innodb.py')%0A +'dstat_plugins', 'plugins')%0A try:%0A os.makedirs(destdir)%0A except OSError:%0A if not os.p...
2cc505d3a3c54f3ce1e91941a905c6a298a46d05
Fix classifiers.
narcissus.hub/setup.py
narcissus.hub/setup.py
# This file is part of Narcissus # Copyright (C) 2011-2013 Ralph Bean # # 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 version 3 of the # License, or (at your option) any later v...
Python
0.000007
@@ -1515,16 +1515,17 @@ ization%22 +, %0A @@ -1553,16 +1553,17 @@ Logging%22 +, %0A
624599bc0172e9166536abfc6be254b5117ac64c
Add error handling in plugin installation process
nailgun/nailgun/plugin/process.py
nailgun/nailgun/plugin/process.py
# -*- coding: utf-8 -*- import traceback import time from multiprocessing import Queue, Process from nailgun.task.helpers import TaskHelper from nailgun.logger import logger from nailgun.db import make_session import nailgun.plugin.manager PLUGIN_PROCESSING_QUEUE = None def get_queue(): global PLUGIN_PROCESSING...
Python
0
@@ -90,16 +90,82 @@ Process%0A +from sqlalchemy import update%0A%0Afrom nailgun.api.models import Task %0Afrom na @@ -764,16 +764,45 @@ e True:%0A + task_uuid = None%0A @@ -967,20 +967,46 @@ -# TaskHelper +if task_uuid:%0A self .set @@ -1111,8 +1111,203 @@ leep(2)%0A +...
9a2b4cfe9b1c683671cb3b4951aa014f3f49d45c
put back parsing the english wiki
parseWikt.py
parseWikt.py
#!/usr/bin/env python # -*- coding: utf-8 -* import xml.etree.ElementTree import xml.dom.minidom import re import cPickle as pickle from mwlib.uparser import parseString from mwlib.xhtmlwriter import MWXHTMLWriter import xml.etree.ElementTree as ET import bz2 import wiktionaryGet def parseBGwikt(): wiktionaryGet....
Python
0.000004
@@ -6798,17 +6798,16 @@ _':%0A -# parseENw
13ae2f3a50fb75555e763f7c41be9519d6d711e4
Use the right var name
js/loopjsfunfuzz.py
js/loopjsfunfuzz.py
#!/usr/bin/env python from __future__ import with_statement import os import random import shutil import subprocess import sys import time from optparse import OptionParser import compareJIT import jsInteresting import pinpoint import shellFlags p0 = os.path.dirname(os.path.abspath(__file__)) interestingpy = os.pat...
Python
0.016055
@@ -2968,19 +2968,16 @@ (wtmpDir -Num )) == 0: @@ -3013,11 +3013,8 @@ pDir -Num )%0A
49ab81275b0e29281703257000c62a54f9627df8
fix property usage
polyjit/buildbot/builders/slurm.py
polyjit/buildbot/builders/slurm.py
import sys from polyjit.buildbot.builders import register from polyjit.buildbot import slaves from polyjit.buildbot.utils import (builder, define, git, cmd, trigger, ip, mkdir, s_sbranch, s_force, s_trigger, hash_download_from_master, clean_unpack...
Python
0.000002
@@ -2839,32 +2839,23 @@ kdir=P(' -%25(prop: scratch -)s ')),%0A
3a910621b36f0555b4a16f22582313333e162093
Check for icons when displaying thumbnails
paw/admin.py
paw/admin.py
from django.contrib import admin from paw.models import TextLink, IconLink, IconFolder, Page, PageTextLink, PageIconDisplay, IconFolderIcon, EntryPoint from adminsortable.admin import NonSortableParentAdmin, SortableStackedInline, SortableTabularInline, SortableAdmin class PageTextLinkInline(SortableStackedInline): ...
Python
0
@@ -547,24 +547,52 @@ l(self, o):%0A + if o.icon.display_icon:%0A return @@ -874,32 +874,62 @@ bnail(self, o):%0A + if o.icon.display_icon:%0A return '%3Cimg @@ -1500,32 +1500,57 @@ _icon(self, o):%0A + if o.display_icon:%0A return '%3Cimg @@ -1638,32 +1638,57 @@ _icon(self, o):%0A + ...
00556c84e23dd86eb4ca08ba4c6238425a3eba7e
Create Preparation model
project_fish/whats_fresh/models.py
project_fish/whats_fresh/models.py
from django.contrib.gis.db import models import os from phonenumber_field.modelfields import PhoneNumberField class Image(models.Model): """ The Image model holds an image and related data. The Created and Modified time fields are created automatically by Django when the object is created or modified...
Python
0
@@ -2218,25 +2218,124 @@ input.%0A %22%22%22%0A -pass +name = models.TextField()%0A description = models.TextField()%0A additional_info = models.TextField() %0A
6c89b28d63df06020805ef8d16e9a084037cecf7
fix egg-path bug
projects/imbu/engine/fluent_api.py
projects/imbu/engine/fluent_api.py
# ---------------------------------------------------------------------- # Copyright (C) 2015, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or...
Python
0.000015
@@ -1691,16 +1691,45 @@ setPath) + and %22egg%22 not in datasetPath :%0A #
5d9f83c06e3418cbb4bd5314136bd4700d7e26c3
Remove print statement
paasta_tools/cli/cmds/performance_check.py
paasta_tools/cli/cmds/performance_check.py
#!/usr/bin/env python # Copyright 2015-2016 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 ...
Python
0.007015
@@ -2535,25 +2535,8 @@ ir)%0A - print service %0A
2b9f6a4c1dfdef393588ac5c430735528d276a50
Add neat headers with column title
habiter/tui.py
habiter/tui.py
import itertools __author__ = 'moskupols' from habiter import habit_api, models from habiter.settings import user_id, api_key, ACCEL_QUIT, ACCEL_TOGGLE_LIST_MODE import urwid class UserInfoBar(urwid.Text): def __init__(self, user): super().__init__(user.name, align=urwid.CENTER, wrap=urwid.CLIP) class...
Python
0
@@ -1302,15 +1302,13 @@ wid. -ListBox +Frame ):%0A @@ -1367,24 +1367,31 @@ init__(self, + title, task_wids, @@ -1430,56 +1430,278 @@ s -uper().__init__(urwid.SimpleFocusListWalker(%5B%5D)) +elf.header = urwid.Pile(%5B%0A urwid.Text(('bold', title), align=urwid.CENTER),%0A urwid.Divider(...
0de2aace2a493d0d760b1ceec3b67f5a6c3f86e6
fix exceptin 'TypeError: a float is required'
vmchecker/coursedb.py
vmchecker/coursedb.py
#!/usr/bin/env python """Manage the course database""" from __future__ import with_statement import sqlite3 from contextlib import contextmanager, closing class CourseDb(object): """A class to encapsulate the logic behind updates and querries of the course's db""" def __init__(self, db_cursor): ...
Python
0
@@ -3469,32 +3469,48 @@ onnect(db_file, +isolation_level= isolation_level)
c0259abdd1b34cd195e3f1ffcb7fb5479d76a0fe
bump version to 1.0.0
vncdotool/__init__.py
vncdotool/__init__.py
__version__ = "1.0.0dev"
Python
0
@@ -17,9 +17,6 @@ .0.0 -dev %22%0A
4e6207361d7ef08a20e343cb5dab500c2c9cdf28
Update AppleApple!.py
AppleApple!/AppleApple!.py
AppleApple!/AppleApple!.py
import pygame, random from pygame.locals import * costPerTree = 0 class Item(object): def __init__(self, itemName, isMaterial, isFood, isWeapon, isCraftable, cost, recipe=()): self.name = str(itemName) self.isMaterial = isMaterial self.isFood = isFood self.isWeapon = isWeapon ...
Python
0.000001
@@ -1985,24 +1985,26 @@ per ingot', +!%0A True, 5, (ro @@ -2259,17 +2259,124 @@ False, -2 +1)%0Aberry = Food('blue berry',5,False,2)%0Aegg = Food('egg',%0Acake = Food('cake',20,True,10,(egg,egg,milk,flour) )%0A# mobs
aec24db030e92ff8ede3a79aab28b36b6e74f356
Update table_generator marshmallow config
great_expectations/datasource/generator/table_generator.py
great_expectations/datasource/generator/table_generator.py
import os import logging from string import Template from marshmallow import Schema, fields, post_load, ValidationError from .batch_generator import BatchGenerator from great_expectations.exceptions import BatchKwargsError, GreatExpectationsError from great_expectations.datasource.types import SqlAlchemyDatasourceTab...
Python
0.000001
@@ -726,16 +726,33 @@ ost_load +(pass_many=False) %0A def @@ -787,16 +787,26 @@ lf, data +, **kwargs ):%0A @@ -2029,18 +2029,20 @@ assets= -%7B%7D +None ):%0A @@ -2115,16 +2115,63 @@ source)%0A + if not assets:%0A assets = %7B%7D%0A
7d1463fc732cdc6aef3299c6d2bbe916418e6d6e
Add full_name field to API
hkisaml/api.py
hkisaml/api.py
from django.contrib.auth.models import User from rest_framework import permissions, routers, serializers, generics, mixins from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope class UserSerializer(serializers.ModelSerializer): def to_representation(self, obj): ret = super(UserSerializer, ...
Python
0.000001
@@ -80,17 +80,8 @@ ons, - routers, ser @@ -434,16 +434,134 @@ nt_name%0A + if obj.first_name and obj.last_name:%0A ret%5B'full_name'%5D = '%25s %25s' %25 (obj.first_name, obj.last_name)%0A
119cd82b6454a8b2ac2177d31105561a991e1ef2
Add arg to hide diff
push/edit.py
push/edit.py
# -*- coding: utf-8 -*- import argparse import os from config import cfg # pylint: disable=E0611,W0614 from func import file_get_contents os.environ['TZ'] = 'UTC' parser = argparse.ArgumentParser() parser.add_argument('--auto', action='store_true') parser.set_defaults(auto=False) args = parser.parse_args() print(ar...
Python
0.000001
@@ -246,16 +246,70 @@ _true')%0A +parser.add_argument('--no-diff', action='store_true')%0A parser.s @@ -330,16 +330,31 @@ to=False +, no_diff=False )%0Aargs = @@ -3821,32 +3821,65 @@ tinue%0A else:%0A + if not args.no_diff:%0A pywikibo
7fb0e28ad6ef1190e61fc38bfb19744739b2e096
Remove unused deps from admin view
scoring_engine/web/views/admin.py
scoring_engine/web/views/admin.py
from flask import Blueprint, flash, redirect, render_template, request, url_for, from flask_login import current_user, login_required from operator import itemgetter from scoring_engine.models.user import User from scoring_engine.models.team import Team mod = Blueprint('admin', __name__) @mod.route('/admin') @mod.r...
Python
0
@@ -25,15 +25,8 @@ int, - flash, red @@ -52,25 +52,16 @@ ate, - request, url_for ,%0Afr @@ -56,17 +56,16 @@ url_for -, %0Afrom fl
a900501804a5a07ed9cea77d5d5348be5e100d67
Use Acapela TTS if available
src/robots/actions/speech.py
src/robots/actions/speech.py
# coding=utf-8 import logging; logger = logging.getLogger("robot." + __name__) logger.setLevel(logging.DEBUG) from robots.action import * @action def say(robot, msg): """ Says loudly the message. Speech synthesis relies on the ROS wrapper around Festival. :param msg: a text to say. """ def exec...
Python
0
@@ -161,16 +161,49 @@ bot, msg +, callback = None, feedback =None ):%0A %22 @@ -240,66 +240,192 @@ S -peech synthesis relies on the ROS wrapper around Festival. +everal TTS systems are tested:%0A - first, try the Acapela TTS (through the acapela-ros Genom module)%0A - then the ROS 'sound_play' node%0A ...
b00ae9a1023bb649171776f9cfdbf8675621272d
Use of `@api.multi`.
base_custom_info/models/custom_info.py
base_custom_info/models/custom_info.py
# -*- coding: utf-8 -*- # © 2015 Antiun Ingeniería S.L. - Sergio Teruel # © 2015 Antiun Ingeniería S.L. - Carlos Dauden # © 2015 Antiun Ingeniería S.L. - Jairo Llopis # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import api, fields, models class CustomInfoTemplate(models.Model): "...
Python
0
@@ -2797,16 +2797,31 @@ ties')%0A%0A + @api.multi%0A @api
fb236790b7569eef764ecf3a23776f37345d0f89
remove some verbosity
GestureAgents/Agent.py
GestureAgents/Agent.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import Reactor from Events import Event from Policy import PolicyRuleset class Agent: """This class represents something that generates Events. When receiving an event with an Agent associated, call acquire to show your interest. If you are an appl...
Python
0.999731
@@ -4091,24 +4091,25 @@ zer%0A +# print %22CCC%22,
74101a9f24b218c036cf32c540cfb911e601080b
fix freeze of ppo2 (#849)
baselines/common/mpi_adam_optimizer.py
baselines/common/mpi_adam_optimizer.py
import numpy as np import tensorflow as tf from mpi4py import MPI class MpiAdamOptimizer(tf.train.AdamOptimizer): """Adam optimizer that averages gradients across mpi processes.""" def __init__(self, comm, **kwargs): self.comm = comm tf.train.AdamOptimizer.__init__(self, **kwargs) def compu...
Python
0
@@ -45,25 +45,169 @@ rom -mpi4py import MPI +baselines.common import tf_util as U%0Afrom baselines.common.tests.test_with_mpi import with_mpi%0Atry:%0A from mpi4py import MPI%0Aexcept ImportError:%0A MPI = None %0A%0Acl @@ -882,17 +882,16 @@ shapes%5D%0A -%0A @@ -973,81 +973,8 @@ t32) -%0A%0A ...
a2982804011e808bd8bf8d9781d9b7bb20328ddc
remove import test line
noteorganiser/tests/test_utils.py
noteorganiser/tests/test_utils.py
"""tests for utilities""" import os import shutil import datetime from PySide import QtGui from PySide import QtCore import test #utils to test from ..utils import fuzzySearch from .custom_fixtures import parent def test_fuzzySearch(): ### these should return True #starts with the searchstring assert f...
Python
0.000001
@@ -114,20 +114,8 @@ Core -%0Aimport test %0A%0A#u
6e42e355d6ae60f115c9027ff6fcb17814b346c2
use mah special charm helpers
hooks/setup.py
hooks/setup.py
import subprocess def pre_install(): """ Do any setup required before the install hook. """ install_charmhelpers() def install_charmhelpers(): """ Install the charmhelpers library, if not present. """ try: import charmhelpers # noqa except ImportError: subprocess...
Python
0
@@ -419,16 +419,73 @@ tall', ' +-e', 'git+https://github.com/whitmo/charmhelpers.git#egg= charmhel
a02624cdbacd666d4e0cdba6230e2ee67837f874
add AsText to __all__ list
geoalchemy2/functions.py
geoalchemy2/functions.py
from sqlalchemy.sql import functions from . import types __all__ = [ 'GenericFunction', 'GeometryType', 'Buffer' ] class GenericFunction(functions.GenericFunction): def __init__(self, *args, **kwargs): expr = kwargs.pop('expr', None) if expr is not None: args = (expr...
Python
0.000861
@@ -90,16 +90,24 @@ nction', +%0A 'Geomet @@ -114,16 +114,42 @@ ryType', +%0A 'AsText',%0A 'Buffer
9fb1c2781582e52c6618b61d4a8a60c3363ee711
bump controller API to v1.1
api/__init__.py
api/__init__.py
""" The **api** Django app presents a RESTful web API for interacting with the **deis** system. """ __version__ = '1.0.0'
Python
0.000001
@@ -111,13 +111,13 @@ __ = '1. -0 +1 .0'%0A
60e60c9d7c5551701eafbfe15dd3931d45b594b6
Handle Accept headers
api/__init__.py
api/__init__.py
# try and keep Flask imports to a minimum, going to refactor later to use # just werkzeug, for now, prototype speed is king from flask import Flask, request import yaml import os import re from datetime import datetime from api.config import config, ConfigException import api.repo import api.utils app = Flask(__name_...
Python
0
@@ -1049,18 +1049,248 @@ is -not None:%0A + match = request.accept_mimetypes.best_match(%5B'application/json'%5D)%0A if match is None:%0A return utils.err(406)%0A else:%0A if match.group(2) is None:%0A version = latest_version%0A else:%0A @@ -1315,9 +1...
a652e43ca73eacda7e42e27afb0d91d75000b4df
Fix typing errors
gerber_to_scad/vector.py
gerber_to_scad/vector.py
# Basic vector maths class import math class V(object): def __init__(self, x=0, y=0): self.x = float(x) self.y = float(y) def __unicode__(self): return "(%s, %s)" % (self.x, self.y) __repr__ = __unicode__ @classmethod def from_tuple(cls, coordinates): x, y = coord...
Python
0.00611
@@ -206,24 +206,25 @@ .x, self.y)%0A +%0A __repr__ @@ -473,17 +473,16 @@ %22%22%22 - Find int @@ -513,17 +513,16 @@ , if any - %22%22%22%0A @@ -594,16 +594,33 @@ 1.y) / ( +%0A d2.y - d @@ -636,16 +636,29 @@ y / d1.x +%0A )%0A @@ -841,17 +841,16 @@ %22%22%...
ab3f331246e844812fd91b51908a0d0972a9793f
improve run_bin (#885)
gfauto/gfauto/run_bin.py
gfauto/gfauto/run_bin.py
# -*- coding: utf-8 -*- # Copyright 2019 The GraphicsFuzz Project 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
Python
0
@@ -826,16 +826,49 @@ gs_util%0A +from gfauto.gflogging import log%0A %0A%0Adef ma @@ -998,16 +998,80 @@ on file. + %22%0A %22Use -- to separate args to run_bin and your binary. %22%0A )%0A @@ -1791,16 +1791,29 @@ uments%0A%0A + try:%0A sett @@ -1863,16 +1863,205 @@ s_path)%0A + except s...
15f22d7c0ac9ddce6cb14cb0cbb35c4d630605d2
Remove period so input corresponds to output.
api/ud_helper.py
api/ud_helper.py
import re from ufal.udpipe import Model, Pipeline, ProcessingError class Parser: MODELS = { "swe": "data/swedish-ud-2.0-170801.udpipe", } def __init__(self, language): model_path = self.MODELS.get(language, None) if not model_path: raise ParserException("Cannot find mod...
Python
0.999999
@@ -575,24 +575,128 @@ xt.strip()%0A%0A + # Adding a period improves detection on especially short sentences%0A period_added = False%0A last @@ -725,16 +725,16 @@ p()%5B-1%5D%0A - @@ -810,16 +810,48 @@ t += %22.%22 +%0A period_added = True %0A%0A @@ -1126,16 +1126,1...
9a1d7bf0ce54c8a405282686ae8307335321d1d0
allow environment to supply paths to dumpbin and nm
waflib/extras/syms.py
waflib/extras/syms.py
#! /usr/bin/env python # encoding: utf-8 """ this tool supports the export_symbols_regex to export the symbols in a shared library. by default, all symbols are exported by gcc, and nothing by msvc. to use the tool, do something like: def build(ctx): ctx(features='c cshlib syms', source='a.c b.c', export_symbols_rege...
Python
0
@@ -409,16 +409,26 @@ d.%0A%22%22%22%0A%0A +import os%0A import r @@ -429,16 +429,16 @@ port re%0A - from waf @@ -637,16 +637,26 @@ puts%5B0%5D%0A +%09%09kw = %7B%7D%0A %09%09if 'ms @@ -785,32 +785,103 @@ regex + r')%5Cb')%0A +%09%09%09if 'DUMPBIN' in self.env:%0A%09%09%09%09cmd = %5Bself.env%5B'DUMPBIN'%5D%5D%0...
ccef871b45f78845a12c3209b463e861244a107e
Fix the moin parser.
external/moin-parser.py
external/moin-parser.py
# -*- coding: utf-8 -*- """ The Pygments MoinMoin Parser ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is a MoinMoin parser plugin that renders source code to HTML via Pygments; you need Pygments 0.7 or newer for this parser to work. To use it, set the options below to match your setup and put this file in ...
Python
0.000001
@@ -1800,22 +1800,21 @@ import -Object +Class NotFound @@ -2586,38 +2586,37 @@ except -Object +Class NotFound:%0A @@ -3226,14 +3226,13 @@ ept -Object +Class NotF
dffcfa42fbf4f200a22b739a0cd24f36317b054c
Fix so that /api/login/ follow the specified api documentation.
api/userview.py
api/userview.py
from flask import abort, request, jsonify, make_response, session from datetime import datetime, timedelta from api import app from api.user import * @require_csrf_token @app.route('/api/signup/', methods = ['POST']) def api_user_signup(): generate_csrf_token(session) status = {} httpcode = 200 if 'em...
Python
0
@@ -940,24 +940,93 @@ er_login():%0A + generate_csrf_token(session)%0A status = %7B%7D%0A httpcode = 200%0A%0A if 'emai @@ -1192,56 +1192,8 @@ ne:%0A - session = app.open_session(request)%0A @@ -1274,236 +1274,133 @@ -response = make_response(jsonify(%7B 'status': 'OK', 'message':...
f8111a0219eb4a5bd4fdc47ddffa2a77b51c9a10
Make code compatible with Python 3
extract_id_title_url.py
extract_id_title_url.py
#!/usr/bin/env python2.7 # encoding: utf-8 ''' extract_id_title.py Created by Hallvord R. M. Steen on 2014-10-25. Modified by Karl Mozilla Public License, version 2.0 see LICENSE Dumps data from webcompat.com bug tracker by default creates one CSV file (webcompatdata.csv) and one JSON file (webcompatdata-bzlike.json)...
Python
0.00021
@@ -517,22 +517,121 @@ sys%0A -import urllib2 +try:%0A from urllib.request import urlopen, Request%0Aexcept ImportError:%0A from urllib2 import urlopen, Request %0A%0A# @@ -865,24 +865,16 @@ req = -urllib2. Request( @@ -1016,24 +1016,24 @@ b.v3+json')%0A + bzrespon @@ -1041,16 +1041,8 @@ e = -urll...
b76b67cf72e001dd4b41677d0dc48c90d4602000
Add some comments
app/app/views.py
app/app/views.py
import os import sys sys.path.append('landsat-util/landsat') import subprocess import boto from boto.s3.key import Key from pyramid.view import view_config from homura import download from image import Process from pyramid.httpexceptions import HTTPFound from shutil import rmtree from models import Rendered_Model impor...
Python
0
@@ -807,16 +807,24 @@ process +preview image''' @@ -5231,32 +5231,105 @@ except:%0A + # If error in processing image, render aws image as default.%0A # de
bfb4ba8cb863d80cdd558ebad25f630fef5dc190
Stop to use the __future__ module.
oslo_middleware/debug.py
oslo_middleware/debug.py
# Copyright 2011 OpenStack Foundation. # 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 req...
Python
0.999929
@@ -658,47 +658,8 @@ %22%22%0A%0A -from __future__ import print_function%0A%0A impo
2e8a2d2ac8b90a0806bea90c25d9b06ce8cc3a96
check roi for each layer
dicom_tools/myroi2roi.py
dicom_tools/myroi2roi.py
import numpy as np from skimage.measure import grid_points_in_poly from dicom_tools.roiFileHandler import roiFileHandler def myroi2roi(myrois, shape, verbose=False): if verbose: print("myroi2roi: called \n") outroi = np.full(shape,False,dtype=bool) if len(myrois) != len(outroi): print("err...
Python
0
@@ -408,32 +408,66 @@ myrois,outroi):%0A + if not myroi is None:%0A layer =
d671acb2c8a381fa49e98c50d967122738ebbd7b
Remove extra slash problem
app/comicbook.py
app/comicbook.py
import os import sys from natsort import natsorted class comicbook(object): filelist = [] def __init__(self, name, filename=None): self.name = name self.path = name + "/" self.localpath = "res/" + name + "/" self.filename = filename self.generate_filelist() if s...
Python
0.000009
@@ -179,16 +179,17 @@ .path = +( name + %22 @@ -182,32 +182,51 @@ th = (name + %22/%22 +).replace('//','/') %0A self.lo @@ -424,52 +424,8 @@ t%5B0%5D - %0A self.path.replace('//','/') %0A%0A
0b3de872d0078ef7f32fc64ed6b110f65c7f3983
Add Release#upload_asset to create asset files
github3/repos/release.py
github3/repos/release.py
import json from github3.decorators import requires_auth from github3.models import GitHubCore from uritemplate import URITemplate class Release(GitHubCore): """The :class:`Release <Release>` object. It holds the information GitHub returns about a release from a :class:`Repository <github3.repos.repo.R...
Python
0
@@ -4440,16 +4440,751 @@ =etag)%0A%0A + @requires_auth%0A def upload_asset(self, content_type, name, asset):%0A %22%22%22Upload an asset to this release.%0A%0A All parameters are required.%0A%0A :param str content_type: The content type of the asset. Wikipedia has%0A a list of com...
dd583dce4124bea13a1f0bd1d037acda0344c2eb
Remove old db-related code
ppbot.py
ppbot.py
"""ppbot.py A modular python bot that utilizes/will utilize postgresql as a data source. TODO: Lots """ import traceback from optparse import OptionParser import irc.client import gevent from gevent import monkey; monkey.patch_all() from gevent import wsgi from handlers.modulehandler import ModuleHandler from handl...
Python
0.000069
@@ -351,16 +351,17 @@ andler%0A%0A +# from mod @@ -399,16 +399,17 @@ uration%0A +# from mod @@ -435,16 +435,17 @@ Network%0A +# from mod @@ -469,16 +469,17 @@ Server%0A +# from mod @@ -564,40 +564,27 @@ ort -Db%0A%0Afrom config import BotConfig +db%0Aimport settings%0A %0A%0Acl @@ -910,154 +910,8 @@ %5B%5D...
29754db3313c6a41a2d12677afd2f4abd55284f4
Clarify use of imperial.enable()
astropy/units/imperial.py
astropy/units/imperial.py
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines colloquially used Imperial units. By default, they are not enabled. To enable them, do:: >>> from astropy.units import imperial >>> imperial.enable() # doctest: +SKIP """ from __future__ import...
Python
0.000041
@@ -144,59 +144,129 @@ its. - By default, they%0Aare not enabled. To enable them +%0A%0ATo include them in %60~astropy.units.UnitBase.compose%60 and the results of%0A%60~astropy.units.UnitBase.find_equivalent_units%60 , do @@ -277,20 +277,22 @@ %3E%3E%3E -from +import astropy @@ -302,23 +302,12 @@ its -im...
ba5edd102ddd53f2e95da8b673bf14bdd72dc012
Add quotes around user-provided values
pw_cli/py/pw_cli/argument_types.py
pw_cli/py/pw_cli/argument_types.py
# Copyright 2021 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Python
0.000001
@@ -838,14 +838,16 @@ r(f' +%22 %7Bpath%7D +%22 is @@ -1035,16 +1035,17 @@ f' +%22 %7Barg.upp @@ -1049,16 +1049,17 @@ upper()%7D +%22 is not