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
778393cfd2d186f9fe771218da9e42ad1eda109b
support for sharding builds
all_builds.py
all_builds.py
#!/usr/bin/python import subprocess import sys def RunCommand(command): run = subprocess.Popen(command, shell=True) output = run.communicate() if run.returncode: print "Non-zero return code: " + str(run.returncode) + " => exiting!" sys.exit(1) def list_of_experiments(): experiments = [] configure_f...
Python
0.000177
@@ -12,16 +12,30 @@ python%0A%0A +import getopt%0A import s @@ -56,16 +56,129 @@ rt sys%0A%0A +LONG_OPTIONS = %5B%22shard=%22, %22shards=%22%5D%0ABASE_COMMAND = %22./configure --enable-internal-stats --enable-experimental%22%0A%0A def RunC @@ -842,98 +842,160 @@ ain( +argv ):%0A -base_command = %22./configure -...
8976837f144bcc46ce3b0ae1f2a0ba3a75604d18
Fix __init__.py
bluesnap/__init__.py
bluesnap/__init__.py
from __future__ import absolute_import
Python
0.0011
@@ -32,8 +32,164 @@ _import%0A +%0A__all__ = %5B'constants', 'client', 'exceptions', 'models', 'resources', 'version'%5D%0A%0Afrom . import constants, client, exceptions, models, resources, version%0A
8fff587b9fd7e2cd0ca4d45e869345cbfb248045
Add encryption properties to Workspace
troposphere/workspaces.py
troposphere/workspaces.py
# Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryId': (basestring, True), ...
Python
0.000001
@@ -128,16 +128,48 @@ SObject%0A +from .validators import boolean%0A %0A%0Aclass @@ -373,18 +373,184 @@ ing, True),%0A + 'RootVolumeEncryptionEnabled': (boolean, False),%0A 'UserVolumeEncryptionEnabled': (boolean, False),%0A 'VolumeEncryptionKey': (basestring, False),%0A %7D%0A
e131916b1a713d395c38f87336974fab73a2099f
use xrange on Python 2
performance/benchmarks/bm_call_simple.py
performance/benchmarks/bm_call_simple.py
"""Microbenchmark for function call overhead. This measures simple function calls that are not methods, do not use varargs or kwargs, and do not use tuple unpacking. """ import perf.text_runner def foo(a, b, c, d): # 20 calls bar(a, b, c) bar(a, b, c) bar(a, b, c) bar(a, b, c) bar(a, b, c) ...
Python
0.000546
@@ -190,16 +190,45 @@ _runner%0A +from six.moves import xrange%0A %0A%0Adef fo @@ -1476,16 +1476,17 @@ ge_it = +x range(lo
31ee07f8b0ded04a86c694a167d64e52b2c6070c
Send index value to pull api
localise/commands.py
localise/commands.py
#!/usr/bin/env python import sys import yaml import os import requests import json from six.moves import input from colorama import Fore, Back, Style def get_url(conf): return 'https://localise.biz/api/' def config(args): from os.path import expanduser home = expanduser("~") config_file = os.getcwd...
Python
0
@@ -1053,21 +1053,78 @@ pull= -dict( +%7B%0A %22index%22: 'id',%0A %22order%22: 'id' %0A @@ -1120,33 +1120,33 @@ id'%0A -) +%7D %0A )%0A ) @@ -3678,16 +3678,25 @@ ormat=%25s +&index=%25s ' %25 (%0A @@ -3764,32 +3764,66 @@ lation%5B'format'%5D +, con...
b4e106271f96b083644b27d313ad80c240fcb0a5
Add agency chain to Booking
gapipy/resources/booking/booking.py
gapipy/resources/booking/booking.py
# Python 2 and 3 from __future__ import unicode_literals from gapipy.resources.checkin import Checkin from ..base import Resource from .transaction import Payment, Refund from .document import Invoice, Document from .override import Override from .service import Service class Booking(Resource): _resource_name =...
Python
0
@@ -135,42 +135,39 @@ om . -transaction import Payment, Refund +agency_chain import AgencyChain %0Afro @@ -263,16 +263,57 @@ Service%0A +from .transaction import Payment, Refund%0A %0A%0Aclass @@ -824,17 +824,18 @@ agen -t +cy ', 'Agen t'), @@ -830,17 +830,18 @@ ', 'Agen -t +cy '),%0A @@ -848,34 +848,71 @...
c0e27eedc045a4f32b4702f25dad1f95aa4fa37d
Correct python3 str type. Fixes #602
liquid_tags/include_code.py
liquid_tags/include_code.py
""" Include Code Tag ---------------- This implements a Liquid-style video tag for Pelican, based on the octopress video tag [1]_ Syntax ------ {% include_code path/to/code [lang:python] [Title text] [codec:utf8] %} The "path to code" is specified relative to the ``code`` subdirectory of the content directory Option...
Python
0
@@ -1204,16 +1204,27 @@ port os%0A +import sys%0A from .md @@ -4130,16 +4130,52 @@ e = ''%0A%0A + if sys.version_info%5B0%5D %3C 3:%0A sour @@ -4189,16 +4189,20 @@ pen_tag%0A + @@ -4234,16 +4234,20 @@ + + lang_i @@ -4253,16 +4253,20 @@ include%0A + @@ -4328,16...
084318f3d1130eee915959db085333d5351d1a47
Add specific support for class_, class__ to html_params, to play nice with mako and genshi. These will strip the final underscore in the output, so class_ becomes class and class__ becomes class_.
wtforms/fields.py
wtforms/fields.py
""" wtforms.fields ~~~~~~~~~~~~~~ TODO :copyright: 2007 by James Crasta, Thomas Johansson. :license: MIT, see LICENSE.txt for details. """ from datetime import datetime from cgi import escape from functools import partial from wtforms.validators import ValidationError def html_params(**p...
Python
0
@@ -316,131 +316,270 @@ s(** -params):%0A return str.jo +kwargs):%0A params = %5B%5D%0A for k,v in kwargs.iteritems():%0A if k in + (' - ', (u'%25s=%22%25s%22' %25 (unicode(k), escape(unicode(v), quote=True)) for k,v in params.iteritems()) +class_', 'class__'):%0A k = k%5B:-1%5D%0A ...
ef91aef9fc705d9e58031439ba941bc7b23ab98b
Change thread scope
svr_record.py
svr_record.py
from tkinter import * from pcf8591read import * import threading root = Tk() def testytesty(): print ('oh look we used a callback') # words from https://www.randomlists.com/random-words words = ['dusty','march','direful','complete','superb','poised','wait','quaint','save','copy','interest','separate','bright','ut...
Python
0
@@ -1697,24 +1697,168 @@ suffix = 0%0A + current_word = words%5Bcurrent%5D%0A filename = current_word + '-' + str(suffix)%0A r_t = threading.Thread(target=reader.run,args=%5Bfilename%5D)%0A if event @@ -2001,164 +2001,8 @@ ':%0A - current_word = words%5Bcurrent%5D%0A filename = current_w...
4bbf93d643dbec1e007c2b8f042d2959a84785c1
Add codec option to include_code tag
liquid_tags/include_code.py
liquid_tags/include_code.py
""" Include Code Tag ---------------- This implements a Liquid-style video tag for Pelican, based on the octopress video tag [1]_ Syntax ------ {% include_code path/to/code [lang:python] [Title text] %} The "path to code" is specified relative to the ``code`` subdirectory of the content directory Optionally, this su...
Python
0.000001
@@ -193,20 +193,33 @@ le text%5D + %5Bcodec:utf8%5D %25%7D%0A - %0AThe %22pa @@ -398,16 +398,336 @@ 'code'%0A%0A +If your input file is not ASCII/UTF-8 encoded, you need to specify the%0Aappropriate input codec by using the %60%60codec%60%60 option.%0AExample %60%60codec:iso-8859-1%60%60%0AUsing this option does n...
893f5c5b33c833a5b497caa69f72af2285f5b81c
Bump version
loveseat/__init__.py
loveseat/__init__.py
__author__ = 'Dimagi' __version__ = '0.0.5' __licence__ = 'MIT'
Python
0
@@ -38,9 +38,9 @@ 0.0. -5 +6 '%0A__
909e42fae25b8aa0c2fddf8e1ec726c74b0f8ca7
Clear new email address from session after transaction
app/main/views/manage_users.py
app/main/views/manage_users.py
from flask import ( abort, flash, redirect, render_template, request, session, url_for, ) from flask_login import current_user, login_required from notifications_python_client.errors import HTTPError from app import ( current_service, invite_api_client, service_api_client, u...
Python
0
@@ -5970,32 +5970,107 @@ abort(500, e) +%0A finally:%0A session.pop(%22team_member_email_change%22, None) %0A%0A return
c410eba986ea43be7e97082d5dcbbdc19ccec39c
add Integration with invenio-records-ui
invenio_records_files/__init__.py
invenio_records_files/__init__.py
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2019 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Integration of records and files for Invenio. Invenio-Records-Files provides basi...
Python
0
@@ -3483,16 +3483,20 @@ eserved +and cannot b @@ -3509,33 +3509,33 @@ for **setting** - +%0A metadata:%0A%0A%3E%3E%3E f @@ -4368,16 +4368,19 @@ his%0Acan +be done usi @@ -4386,18 +4386,16 @@ ing the -a record f @@ -4749,21 +4749,604 @@ is None%0A - True%0A +%0A%0AIntegration with invenio-records-ui%0A...
e01426579813507880d7a415b3f9f11cd3dceb2c
Add error to possible results
benchexec/tools/infer.py
benchexec/tools/infer.py
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import benchexec.tools.template from collections.abc import Mapping import benchexec.resul...
Python
0.000005
@@ -1369,24 +1369,97 @@ _FALSE_PROP%0A + if run_result == %22error%22:%0A return result.RESULT_ERROR%0A retu
d8ea759384ad71b2d6606e57d270a93c1551609c
Disable name lookup cache
backend/tasks.py
backend/tasks.py
# -*- encoding: utf-8 -*- # Dissemin: open access policy enforcement tool # Copyright (C) 2014 Antonin Delpeuch # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the Licen...
Python
0.000001
@@ -3205,16 +3205,17 @@ )%0A%0A # +# If it i @@ -3260,16 +3260,17 @@ her%0A +# if r.sta @@ -3285,20 +3285,16 @@ ne:%0A - - # make s @@ -3344,20 +3344,16 @@ sidered%0A - ccf.
4702b1d3ee912676f4bd8ca0032f368573c81210
add sorting to benchmark
benchmark_originality.py
benchmark_originality.py
import time import statistics import os import randomstate as rnd from multiprocessing import Pool from originality import original N_RUNS = 50 def gen_submission(predictions=45000, users=1000): # numpy's RandomSeed don't play well with multiprocessing; randomstate is a drop-in replacement return rnd.normal...
Python
0
@@ -34,16 +34,35 @@ ort os%0A%0A +import numpy as np%0A import r @@ -502,16 +502,88 @@ hape%5B0%5D%0A + sorted_submission = np.sort(new_submission.reshape(n_predictions,))%0A for @@ -631,35 +631,38 @@ original( -new +sorted _submission.resh @@ -660,32 +660,8 @@ sion -.reshape(n_predictions,) , ot...
8eb296db9a06fadca15b7f745dc8a829c75016e6
Add blocklist to FoundryTest unittest [ci-skip]
tests/unit.py
tests/unit.py
### DEPS import utils utils.require(('yaml', 'PyYAML'), 'six') import six import yaml import unittest import io import warnings import pronto ### TESTS class ProntoOntologyTest(unittest.TestCase): def assert_loaded(self, ontology): # check if not empty self.assertNotEqual(len(ontology), 0) ...
Python
0
@@ -3059,24 +3059,153 @@ product):%0A%0A + #CRASH #INF. WAIT%0A if product%5B%22id%22%5D in (%22chebi.obo%22, %22dideo.owl%22):%0A return%0A%0A url,
57db503feed5321cfa6635c86629d3f0c9fc276d
Fix python 3 support
flower/views/tasks.py
flower/views/tasks.py
from __future__ import absolute_import import copy from itertools import imap import celery from tornado import web from ..views import BaseHandler from ..utils.tasks import iter_tasks, get_task_by_id class TaskView(BaseHandler): @web.authenticated def get(self, task_id): task = get_task_by_id(sel...
Python
0.001644
@@ -45,16 +45,25 @@ rt copy%0A +try:%0A from ite @@ -80,16 +80,51 @@ ort imap +%0Aexcept ImportError:%0A imap = map %0A%0Aimport
718ee315016d10db582cfd0533c5d19657430d7e
update version of nova API
perfkitbenchmarker/openstack/utils.py
perfkitbenchmarker/openstack/utils.py
# Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
Python
0
@@ -4777,35 +4777,33 @@ oclient.Client(' -1.1 +2 ',%0A @@ -5346,11 +5346,9 @@ nt(' -1.1 +2 ',%0A
826fa0b196e8ae72a7bcd32e40b71cbaa43806fe
Update some logging
replugin/funcworker/__init__.py
replugin/funcworker/__init__.py
#!/usr/bin/env python # Copyright (C) 2014 SEE AUTHORS FILE # # 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 version. # #...
Python
0
@@ -4653,20 +4653,21 @@ _logger. -info +debug (%22Found @@ -4741,20 +4741,23 @@ _logger. -info +warning (%22Missin @@ -7043,49 +7043,8 @@ ss:%0A - print %22it was a success%22%0A @@ -7770,47 +7770,8 @@ se:%0A - print %22it was FAILURE%22%0A
b0e9b70cc2adcd818fb373f17db766b77aac78d0
add a registration date field in the artist model
chords/models.py
chords/models.py
from django.db import models from django.utils import timezone from .utils import generate_unique_slug, greek_to_english_letters class Artist(models.Model): # names are stored in the "Surname Name" format name = models.CharField(max_length=80) slug = models.SlugField(unique=True) def save(self, slug...
Python
0
@@ -248,16 +248,90 @@ gth=80)%0A + reg_date = models.DateTimeField('date registered', auto_now_add=True)%0A slug
816da6991ea6006024667173bbdff428e395f78c
Remove upload print statement
app/upload_s3.py
app/upload_s3.py
#!/usr/local/bin/python2.7 import os import hashlib import gzip import time import datetime from sys import argv from boto.s3.connection import S3Connection from boto.s3.key import Key from config import (AWS_KEY, AWS_SECRET_KEY, AWS_BUCKET, AWS_DIRECTORY, HTML_EXPIRES, STATIC_EXPIRES, IGNORE_DIRECTORIES, IGNORE_F...
Python
0
@@ -4000,126 +4000,4 @@ c()%0A -%0A print '%5CnOlympics page successfully updated'%0A print %22On %22 + datetime.datetime.now().strftime('%25Y-%25m-%25d %25H:%25M:%25S')%0A
7c74f87774ff4c9fe0ebb8335118cfa3f5e00d70
Version bump for next dev work
formadmin/__init__.py
formadmin/__init__.py
# following PEP 386, versiontools will pick it up __version__ = (0, 1, 0, "final", 0)
Python
0
@@ -65,20 +65,18 @@ (0, -1 +2 , 0, %22 -final +dev %22, 0
6ec2065b3763f5070d767753d0da1059e194c220
Version 0.0.22.
law/__init__.py
law/__init__.py
# -*- coding: utf-8 -*- # flake8: noqa """ Build large-scale task workflows using luigi, remote job submission, remote targets, and environment sandboxing. """ __author__ = "Marcel Rieger" __email__ = "python-law@googlegroups.com" __copyright__ = "Copyright 2018, Marcel Rieger" __credits__ = ["Marcel Rieger"] __cont...
Python
0
@@ -418,17 +418,17 @@ = %220.0.2 -1 +2 %22%0A%0A__all
c5f3e36583c53aec80309870bf4fb90693f2a705
fix invalid syntax
account_bank_statement_import_coda/wizard/account_bank_statement_import_coda.py
account_bank_statement_import_coda/wizard/account_bank_statement_import_coda.py
# Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import re import datetime import logging from dateutil import parser as date_parser from odoo import api, models, _ from odoo.exceptions import Warning as UserError _logger = logging.getLogger...
Python
0.000185
@@ -4325,34 +4325,16 @@ er + '-' - %5C%0A + state @@ -4360,34 +4360,16 @@ te + '-' - %5C%0A + state @@ -4399,26 +4399,8 @@ '-' - %5C%0A + i @@ -4422,16 +4422,22 @@ ort_id'%5D + #noqa %0A
2767e954c160682aed5e0dd46b7430ac0825a2a7
Clean geometry of access level before returning
girder/molecules/server/geometry.py
girder/molecules/server/geometry.py
from girder.api.describe import Description, autoDescribeRoute from girder.api import access from girder.api.rest import Resource from girder.api.rest import RestException from girder.api.rest import getCurrentUser from girder.constants import AccessType from girder.constants import TokenScope from .models.geometry i...
Python
0
@@ -662,24 +662,130 @@ tryModel()%0A%0A + def _clean(self, doc):%0A if 'access' in doc:%0A del doc%5B'access'%5D%0A%0A return doc%0A%0A @access. @@ -791,16 +791,16 @@ .public%0A - @aut @@ -1180,24 +1180,36 @@ turn %5Bself._ +clean(self._ model.filter @@ -1217,16 +1217,17 @@ x,...
81a905e4626cbcaf887813fddea686f9ae61ce6f
Fix version number
freezegun/__init__.py
freezegun/__init__.py
# -*- coding: utf-8 -*- """ freezegun ~~~~~~~~ :copyright: (c) 2012 by Steve Pulec. """ __title__ = 'freezegun' __version__ = '0.1.16' __author__ = 'Steve Pulec' __license__ = 'Apache License 2.0' __copyright__ = 'Copyright 2012 Steve Pulec' from .api import freeze_time __all__ = ["freeze_time"]
Python
0.000041
@@ -134,9 +134,9 @@ .1.1 -6 +7 '%0A__
b9b1374f6c4076cb2444f45333c203124668f970
Add test to improve coverage
skan/test/test_draw.py
skan/test/test_draw.py
""" Basic testing of the draw module. This just ensures the functions don't crash. Testing plotting is hard. ;) """ import os from skimage import io, morphology import pytest from skan import pre, draw, csr rundir = os.path.abspath(os.path.dirname(__file__)) datadir = os.path.join(rundir, 'data') @pytest.fixture de...
Python
0
@@ -119,16 +119,35 @@ port os%0A +import numpy as np%0A from ski @@ -173,16 +173,85 @@ phology%0A +import matplotlib.pyplot as plt%0Afrom matplotlib.figure import Figure%0A import p @@ -1579,20 +1579,483 @@ test_stats)%0A +%0A%0Adef test_pipeline_plot_existing_fig(test_image, test_thresholded,%0A ...
5026c87eba06de599685c7978202c1880fc536ee
Fix console output
lib/formatter.py
lib/formatter.py
#!/usr/bin/env python """ Formatter Places markdown in HTML with the specified CSS and JS etc. Licensed under MIT Copyright (c) 2014 Isaac Muse <isaacmuse@gmail.com> """ from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import import codecs import traceback ...
Python
0.000142
@@ -1889,52 +1889,8 @@ text -.encode(%22utf-8%22, errors=%22xmlcharrefreplace%22) )%0A%0A
dcfe8d7f9b8f81b4e011d1e62716c7b284514e6a
Expire tracks after a configurable interval
application.wsgi
application.wsgi
#!/usr/bin/env python3 # vim:fileencoding=utf-8:ts=8:et:sw=4:sts=4:tw=79 """ application.wsgi The "ScrobbLRR" bottle application. Copyright (c) 2015 Twisted Pear <pear at twistedpear dot at> See the file LICENSE for copying permission. """ from bottle import Bottle, request, response from bottle.ext import redis fr...
Python
0
@@ -473,16 +473,73 @@ lugin)%0A%0A +EXPIRATION_SEC = int(environ.get(%22EXPIRATION_SEC%22, 300))%0A NOWPLAYI @@ -3269,34 +3269,34 @@ user:%7Buser%7D: -submission +nowplaying %22.format(use @@ -3303,35 +3303,77 @@ r=user)%0A -rdb +with rdb.pipeline() as pipe:%0A pipe .hmset(npkey, %7B%22 @@ -339...
04398c4f91e5ceae83d4efec46f918949129867e
add timer
backup_gitlab.py
backup_gitlab.py
#!/usr/bin/env python3 import os import requests import shutil import subprocess import sys import conf def clean(dir_to_clean): if os.path.isdir(dir_to_clean): shutil.rmtree(dir_to_clean) def run(cmd): print("running", ' '.join(cmd)) subprocess.check_call(cmd) def get_projects(): params...
Python
0.000008
@@ -85,16 +85,28 @@ port sys +%0Aimport time %0A%0Aimport @@ -1051,24 +1051,48 @@ p_gitlab():%0A + start = time.time()%0A for proj @@ -1534,24 +1534,82 @@ , repo_dir)%0A + end = time.time()%0A print('took: ', end-start, 's')%0A %0A%0Adef main()
9a60a053ae59b255817839be75b7f3481839ce3e
Update cron
graph/management/commands/filldb.py
graph/management/commands/filldb.py
from django.core.management.base import BaseCommand, CommandError from graph.models import Website class Command(BaseCommand): help = 'Fill database by retrieving articles and concepts' def handle(self, *args, **options): for website in Website.objects.all(): website.download_rss_articles()
Python
0.000001
@@ -121,17 +121,20 @@ mmand):%0A -%09 + help = ' @@ -185,17 +185,20 @@ cepts'%0A%0A -%09 + def hand @@ -225,21 +225,24 @@ tions):%0A -%09 + + for webs @@ -275,9 +275,44 @@ ():%0A -%09 + print(website.name)%0A
c7c276389123fb38063ab4f524f1665a5a2b83ff
Fix displaying iframe and HTML in admin dashboard for Django>2.0
appmail/admin.py
appmail/admin.py
from django.contrib import admin from django.contrib import messages from django.contrib.postgres.fields import JSONField from django.core.exceptions import ValidationError from django.http import HttpResponseRedirect from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from .forms i...
Python
0.000001
@@ -243,16 +243,58 @@ reverse%0A +from django.utils.html import format_html%0A from dja @@ -3383,32 +3383,43 @@ %0A return +format_html (%0A %22%3C @@ -3557,16 +3557,17 @@ ab.%3C/a%3E%22 +, %0A @@ -3575,25 +3575,28 @@ -.format(url, +url,%0A url -) %0A @@ -7007,8 +7...
ed1172479388c302356af093f6dd855cab61f914
Update hipchat.py
graphite_beacon/handlers/hipchat.py
graphite_beacon/handlers/hipchat.py
import json from tornado import gen, httpclient as hc from . import AbstractHandler, LOGGER class HipChatHandler(AbstractHandler): name = 'hipchat' # Default options defaults = { 'url': 'https://api.hipchat.com', 'room': None, 'key': None, } colors = { 'critical...
Python
0.000001
@@ -1132,19 +1132,26 @@ options. +get(' url +') , room=s
0ea9172e253d36dffab40b3df64ee08cbfc908aa
remove only from the user and not from the group
models/link.py
models/link.py
#this model keeps the link from google.appengine.ext import ndb from user import User import datetime import time class Link(ndb.Model): user = ndb.KeyProperty() description = ndb.StringProperty() url_link = ndb.StringProperty() #error when write linkproperty from_link = ndb.StringProperty() time_of_enter_the_link...
Python
0
@@ -1146,150 +1146,64 @@ %09%0A%09%09 -#link=Link.query(Link.user == user , Link.description == des , Link.url_link == link_url , Link.from_link==None).get()%0A%09%09if link is not Non +if link is not None:%0A%09%09%09if link.ifInTheGroup is Fals e:%0A +%09 %09%09%09l
c1a8c6de63947758b0f9d506242653410425fbe2
Return children from timelimit module definition_from_xml in the new format (separate from definition)
common/lib/xmodule/xmodule/timelimit_module.py
common/lib/xmodule/xmodule/timelimit_module.py
import json import logging from lxml import etree from time import time from xmodule.editing_module import XMLEditingDescriptor from xmodule.xml_module import XmlDescriptor from xmodule.x_module import XModule from xmodule.progress import Progress from xmodule.exceptions import NotFoundError from xblock.core import F...
Python
0
@@ -5212,19 +5212,10 @@ rn %7B -'children': +%7D, chi @@ -5219,17 +5219,16 @@ children -%7D %0A%0A de
eb32e4290506b74a2afa463520e0a1d23c190a57
Fix bugs in emulated RideSegment properties
models/ride.py
models/ride.py
#!/usr/bin/env python3 from .base import ModelBase, Serializable from .timeandplace import TimeAndPlace from .line import Line class Ride(ModelBase): _serialize_depth = 3 def __init__(self, line=None, number=None): super().__init__() self._stops = [] self._paths = {} self.line...
Python
0
@@ -6647,29 +6647,24 @@ return self -.ride %5B0%5D.stop%0A%0A @@ -6717,29 +6717,24 @@ return self -.ride %5B-1%5D.stop%0A%0A @@ -6790,21 +6790,16 @@ urn self -.ride %5B0%5D.depa @@ -6861,21 +6861,16 @@ urn self -.ride %5B-1%5D.arr @@ -6875,24 +6875,25 @@ rrival%0A%0A +# def __getatt @@ -6909,24 +6909...
fb9b7ce79ebb95974bbb9b171322e5a415bc380e
COSMIT remove some dead code
sklearn/utils/fixes.py
sklearn/utils/fixes.py
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fixe is no longer needed. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # ...
Python
0.999086
@@ -5452,499 +5452,4 @@ X))%0A -%0Atry:%0A # check whether np.dot supports the out argument%0A np.dot(np.zeros(1), np.zeros(1), out=np.empty(1))%0A%0A # this is ok, just use the existing implementation%0A dot_out = np.dot%0A%0Aexcept (TypeError, ValueError):%0A # old version of np.dot that does not acce...
3a0aaf943e9f4a6be0ab87d9cbfb9258e5d5b6b3
Version number bump, this time tagged properly.
magazine/__init__.py
magazine/__init__.py
__version__ = '0.1.2' VERSION = tuple(map(int, __version__.split('.')))
Python
0
@@ -16,9 +16,9 @@ 0.1. -2 +3 '%0AVE
09de7d280c22b5ea6b6f4cb18fc7513a79dcabf6
Add files via upload
locations/spiders/publix.py
locations/spiders/publix.py
# -*- coding: utf-8 -*- import scrapy import re from locations.items import GeojsonPointItem class PublixSpider(scrapy.Spider): name = "publix" allowed_domains = ['publix.com'] start_urls = ( 'http://www.publix.com/sitemap.xml', ) def parse(self, response): response.selector.remo...
Python
0
@@ -735,32 +735,215 @@ elf, response):%0A +%0A if %22CLOSED%22 in response.xpath('//span%5B@class=%22store-status%22%5D/text()').extract():%0A storeHours = 'STORE CLOSED'%0A storePHONENUMBER = ''%0A%0A else:%0A storeHou @@ -1023,16 +1023,20 @@ + p = re.c ...
5265f2cc70aaed63f5fd878ce1a9a30e0720ef63
fix s.th
apps/wx/views.py
apps/wx/views.py
#coding=utf-8 import hashlib, time, json from uliweb import expose, functions import xml.etree.ElementTree as ET #解析xml @expose('/') def index(): return '<h1>Hello, Uliweb</h1>' @expose('/weixin', methods=['GET']) def weixin_access_verify(): echostr = request.args.get('echostr') if verification(reque...
Python
0.00073
@@ -423,16 +423,17 @@ , method +s =%5B'POST'
03df9d29c9c7aba76f00819ca51e08d063fb6785
Use start_requests to set accept header
locations/spiders/target.py
locations/spiders/target.py
import json import re import scrapy import logging from locations.items import GeojsonPointItem def process_hours(hours): if 'Hours' not in hours: return None opening_hours = '' days = hours['Hours'] for day in days: shortname = day['ShortName'] if '-' in shortname: ...
Python
0.000001
@@ -16,39 +16,14 @@ ort -re%0Aimport scrapy%0Aimport logging +scrapy %0Afro @@ -65,16 +65,17 @@ ntItem%0A%0A +%0A def proc @@ -248,17 +248,16 @@ rtName'%5D - %0A @@ -361,16 +361,32 @@ == %22M%22: +%0A startda @@ -423,16 +423,32 @@ == %22M%22: +%0A endday @@ -874,16 ...
18736f7ef302ee75453c41a2f08bb69ca96e4d9f
Bump version
bouncer/__about__.py
bouncer/__about__.py
"""Metadata about bouncer shared between setup.py and bouncer code.""" __all__ = ["__version__"] __version__ = "0.0.6" # PEP440-compliant version number.
Python
0
@@ -116,9 +116,9 @@ 0.0. -6 +7 %22 #
474b6b5023e487653250cff67abef13a1ae54342
Make bptestrunner work with python 2 and python 3 (#362)
bptestrunner/main.py
bptestrunner/main.py
# Copyright 2019 LinkedIn Corporation # Licensed under the BSD 2-Clause License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause # # Unless required by applicable law or agreed to in writing, softwa...
Python
0.000007
@@ -2823,16 +2823,21 @@ (config1 +, 'r' ) as f:%0A @@ -2923,16 +2923,21 @@ (config2 +, 'r' ) as f:%0A @@ -2990,24 +2990,18 @@ = %7B -key: value +%7D%0A for -( key, @@ -3010,14 +3010,12 @@ alue -) in -( cfg2 @@ -3026,25 +3026,109 @@ ms() - + cfg1.items())%7D +:%0A merged_cfg%5Bkey%5D = value%0A...
7d30c3e74d2400bb4c976a02f671880560c65b43
Update merge sort
merge_sort.py
merge_sort.py
# Implementation of merge-sort algorithm is purely for educational purposes. # This example is an intermediate for python learners and will be really helpful to better understand the programming # and algorithm paradigm and highly recommended for python learners. # Input is an list of any length and any entries and th...
Python
0.000001
@@ -380,22 +380,28 @@ econd):%0A -%09%22%22%22%0A%09 + %22%22%22%0A This fun @@ -466,17 +466,20 @@ object.%0A -%09 + Input li @@ -586,17 +586,20 @@ g order%0A -%09 + :param f @@ -604,17 +604,20 @@ first:%0A -%09 + :param s @@ -623,17 +623,20 @@ second:%0A -%09 + :return: @@ -644,28 +64...
4732cfb10dc4a7126166b340c3bc2a6023de924e
Save work on performance demo
merge_sort.py
merge_sort.py
""" Placeholder for Jonathan's ridiculously long docstring """ def merge_srt(un_list): if len(un_list) > 1: mid = len(un_list) // 2 left_half = un_list[:mid] right_half = un_list[mid:] merge_srt(left_half) merge_srt(right_half) x = y = z = 0 while x < len...
Python
0
@@ -991,139 +991,134 @@ -setup +SETUP = %22%22%22 -%0A 'merge_srt(%7B%7D)'.format(BEST_CASE),%0A 'from __main__ import BEST_CASE'%0A %22%22%22%0A%0A best = Timer(%0A +from __main__ import BEST_CASE, WORST_CASE, merge_srt%22%22%22%0A%0A best = Timer('merge_srt(%7B%7D)'.format(BEST_...
788913436e9924d6fde9e5c573f71a2f270f2bc4
Correct import
luigi/tasks/rgd/organism.py
luigi/tasks/rgd/organism.py
# -*- coding: utf-8 -*- """ Copyright [2009-2017] EMBL-European Bioinformatics Institute 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...
Python
0.000031
@@ -771,17 +771,8 @@ ort -Fetch as Fetc
0307c6bae5eaf6859ac157d53a50035cde4d6313
Update utils.py
snapchat_bots/utils.py
snapchat_bots/utils.py
import tempfile, mimetypes, datetime, subprocess, re, math from PIL import Image from constants import MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO, MEDIA_TYPE_VIDEO_WITHOUT_AUDIO, SNAP_IMAGE_DIMENSIONS def file_extension_for_type(media_type): print media_type if media_type is MEDIA_TYPE_IMAGE: return ".jpg" ...
Python
0.000001
@@ -232,29 +232,8 @@ e):%0A - print media_type%0A
d3574ab8e83fa1ca8bb86cc30b6bc29f36c78eac
Update piece.py
classes/piece.py
classes/piece.py
class piece(object): _players = {'BLANC' : -1, 'NOIR' : 1} _color = 0 _moved = False def __init__(self, color): self._color = color def move(self, pox_x, pos_y, tableau, isPossible): raise NotImplementedException() def getLetter(self): raise NotImplementedException() ...
Python
0.000001
@@ -369,73 +369,8 @@ or%0A%0A - def getImage(self):%0A raise NotImplementedException()%0A%0A
98f67705baaa732043273cbd5967daa6881e76cf
increment version
bcdata/__init__.py
bcdata/__init__.py
try: from urllib.parse import urlparse from urllib.parse import urljoin from urllib.request import urlretrieve except ImportError: from urlparse import urlparse from urlparse import urljoin from urllib import urlretrieve import os import tempfile import zipfile import requests from selenium i...
Python
0.000004
@@ -427,17 +427,17 @@ = %220.0. -2 +3 %22%0A%0A# Dat
7013867c1169c9b78abf38f400e1d97dcb36ce06
Add more categories
classify_logs.py
classify_logs.py
import re import yaml error_types = ["no package found", "missing build dependency", "invalid syntax", "test failure", "unclassified"] def has_missing_test_dependency(log): """ Return: (Status, missing packages) """ None def no_packages_fo...
Python
0
@@ -32,17 +32,55 @@ pes = %5B%22 -n +No recipe available%22,%0A %22N o packag @@ -80,22 +80,52 @@ package +s found + in current linux-64 channels %22,%0A @@ -162,16 +162,113 @@ dency%22,%0A + %22test failure: missing dependency%22,%0A %22test failure: other reasons...
884cae3265f8c6bbf5c00af6f55df2d4321e75f4
bump to v0.5.5
xenon/__init__.py
xenon/__init__.py
'''Module containing the two topmost-level functions: parse_args() and main(). The latter is the entry point for the command line program. ''' __version__ = '0.5.4' import os import sys import logging def parse_args(): '''Parse arguments from the command line and read the config file (for the REPO_TOKEN val...
Python
0.000001
@@ -160,9 +160,9 @@ 0.5. -4 +5 '%0A%0Ai
5be2b05d0aed43f8b502f1dd45558a50ca62efb5
fix error regex for older clang
plugin/completion/compiler_variant.py
plugin/completion/compiler_variant.py
"""Module contains options for various compiler variants Attributes: log (logging.Logger): logger for this module """ import re import logging log = logging.getLogger(__name__) log.debug(" reloading module") class CompilerVariant(object): """ Encapsulation of a compiler specific options """ def...
Python
0.000001
@@ -2638,18 +2638,24 @@ ompile(' -%5C%22 +%5Bb%5C%22%7C%5C%22%5D *(?P%3Cerr @@ -2657,17 +2657,20 @@ P%3Cerror%3E -. +%5B%5E%22%5D +)%5C%22*')%0A
4356b7e612dc96ba59aec7f7e41b206de0a7e757
Make the bootstrap script work with the newer salt stuff
tasks/salt.py
tasks/salt.py
from __future__ import absolute_import, division, print_function import os import invoke import fabric.api import fabric.contrib.files from .utils import cd, ssh_host SALT_MASTER = "192.168.5.1" @invoke.task(name="sync-changes") def sync_changes(): # Push our changes to GitHub # TODO: Determine what orig...
Python
0
@@ -1508,608 +1508,94 @@ add -our packages%0A fabric.api.run(%0A (%22echo 'deb %5Barch=amd64%5D https://s3.amazonaws.com/apt.psf.io/psf/ %22%0A %22%7B%7D main' %3E /etc/apt/sources.list.d/psf.list%22).format(codename)%0A )%0A fabric.api.put(%0A os.path.join(%0A ...
42d875fa267b79b3c679ac9b21e9e32bae5e035f
Read geoip database from /var/lib/cvmfs-server/geo instead of /etc/cvmfs
cvmfs/webapi/cvmfs_geo.py
cvmfs/webapi/cvmfs_geo.py
import math import string import re import bisect import cvmfs_api import GeoIP gi = GeoIP.open("/etc/cvmfs/GeoLiteCity.dat", GeoIP.GEOIP_STANDARD) positive_expire_secs = 60*60*24*3 # 3 days # function came from http://www.johndcook.com/python_longitude_latitude.html def distance_on_unit_sphere(lat1, long1, lat2, ...
Python
0
@@ -97,17 +97,32 @@ n(%22/ -etc/cvmfs +var/lib/cvmfs-server/geo /Geo
8ba94b216531f249a7097f10eb74f363af6151e2
Rename internal variables to start with a _
xmlrpc2/client.py
xmlrpc2/client.py
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import urllib.parse class BaseTransport(object): @property def scheme(self): raise NotImplementedError("Transports must have a scheme") class HTTPTransport(BaseTransport): scheme = "...
Python
0
@@ -500,32 +500,33 @@ ts%0A self. +_ transports = %7B%7D%0A @@ -599,32 +599,33 @@ self. +_ transports%5Bt.sch @@ -712,24 +712,25 @@ not in self. +_ transports:%0A @@ -866,24 +866,25 @@ %22.join(self. +_ transports)) @@ -895,24 +895,25 @@ self. +_ transport = @@ -917,16 +917,17 @@ =...
c319a5f7048b138049da011308c1bf1a9296475b
fix for profile user duplicate key crash. NOTE TO CLIENTS: those who were affected by this crash may have corrupted DB's. You need to run the create_profiles_for_users management command to fix.
pinax/local_apps/django_openidauth/regviews.py
pinax/local_apps/django_openidauth/regviews.py
import re from django import forms from django.contrib.auth import login as log_user_in, load_backend from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.template import RequestContext from django.contrib.auth.models import User from emailconfirmation.models import...
Python
0.000002
@@ -681,21 +681,17 @@ nput())%0A - %0A + def @@ -1154,21 +1154,17 @@ ther.%22)%0A - %0A + def @@ -1342,30 +1342,108 @@ -Profile(user=new_user) +%0A profile, created = Profile.objects.get_or_create(user=new_user)%0A if created: profile .sav @@ -1703,17 +1703,16 @@ plete/', -...
594194e19716b34b82b43e49d2cb56313cbcbad7
print error message if import fails
xos/api/import_methods.py
xos/api/import_methods.py
from django.views.generic import View from django.conf.urls import patterns, url, include from rest_framework.routers import DefaultRouter from xosapi_helpers import XOSIndexViewSet import os, sys import inspect import importlib try: from rest_framework.serializers import DictField except: raise Exception("Fai...
Python
0.000011
@@ -901,24 +901,37 @@ port%22, name%0A + try:%0A module = @@ -944,24 +944,335 @@ ort__(name)%0A + except:%0A # django will eat the exception, and then fail later with%0A # 'conflicting models in application'%0A # when it tries to import the module a second time.%0A print %2...
759916629b8ee4754032b7762abc8ac8eef3aeda
Fix yet another typo
xos/services/vpn/admin.py
xos/services/vpn/admin.py
import time from core.admin import ReadOnlyAwareAdmin, SliceInline from core.middleware import get_request from core.models import User from django import forms from django.contrib import admin from services.vpn.models import VPN_KIND, VPNService, VPNTenant class VPNServiceAdmin(ReadOnlyAwareAdmin): """Defines t...
Python
0.998463
@@ -4417,17 +4417,16 @@ nce.ca_c -e rt):%0A @@ -4497,17 +4497,16 @@ server_c -e rt) or (
787750bb4fb28023a1eaf3384064a7fa409ee78a
Replace TZS with CAD
app/helper.py
app/helper.py
from flask import current_app as app from flask.ext.wtf import AnyOf, Required from app import db from app.connection import Connection # For use with Connection def portify(site): site = site.split('/') if site[2] == 'localhost': site[2] = 'localhost:%s' % app.config['PORT'] return '/'.join(site) # For fla...
Python
0.999996
@@ -853,33 +853,30 @@ %09%09(' -TZS +CAD ', ' -Tanzan +Canad ian -Shilling +Dollar ', 5
5cdc6a9aaee58ad33ae08000b1b5b6b5dd771108
Update corehq/apps/case_search/utils.py
corehq/apps/case_search/utils.py
corehq/apps/case_search/utils.py
import re from casexml.apps.case.models import CommCareCase from corehq.apps.app_manager.dbaccessors import get_app_cached from corehq.apps.app_manager.util import module_offers_search from corehq.apps.case_search.models import ( CASE_SEARCH_BLACKLISTED_OWNER_ID_KEY, CASE_SEARCH_XPATH_QUERY_KEY, SEARCH_QUE...
Python
0
@@ -5257,24 +5257,60 @@ es%5B0%5D.type)%0A + if not paths:%0A return %5B%5D%0A return g
8265ac5a97e487ba690bc832e3c398365f76975f
Fix for Python 3.6
hc/api/management/commands/smtpd.py
hc/api/management/commands/smtpd.py
import asyncore import re from smtpd import SMTPServer from django.core.management.base import BaseCommand from hc.api.models import Check RE_UUID = re.compile("^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[8|9|aA|bB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$") class Listener(SMTPServer): def __init__(self, localaddr, s...
Python
0.000074
@@ -466,16 +466,54 @@ os, data +, mail_options=None, rcpt_options=None ):%0A
0cf20dfc3fbf4c6e4e8c0989dafdb84f316a0956
Fix a typo in blueprint list.
yaas/blueprint.py
yaas/blueprint.py
# coding: utf-8 from __future__ import absolute_import from __future__ import print_function import argparse import inspect import json import pprint import requests import sys from . import config def command(parser, args): """ Interact with Ambari blueprints. """ subparsers = parser.add_subparsers(dest='...
Python
0.00013
@@ -1971,17 +1971,16 @@ er.parse -s _args(ar
9548ab5b95d59b4fd55653e163ea5c9f1f53dd6e
Bump the version.
bespin/__init__.py
bespin/__init__.py
VERSION="0.5.5.7"
Python
0
@@ -12,7 +12,7 @@ 5.5. -7 +8 %22%0A
07f8ab3b7ec70ce284fb2d1fcbcb941fe4b0137b
fix issue#26
zaifbot/moving_average.py
zaifbot/moving_average.py
# moving_average.py import time from zaifapi import ZaifPublicApi from db import Tradelogs, MovingAverage import numpy as np PERIOD_SECS = {'1d': 86400, '12h': 43200, '8h': 28800, '4h': 14400, '1h': 3600, '1m': 60, '5m': 300, '15m': 900, '30m': 1800} LIMIT_COUNT = 1000 def _check_tradelogs(currency_p...
Python
0
@@ -1,25 +1,4 @@ -# moving_average.py%0A%0A impo
7d2f98eabaaccd424f5d17021ff9e90401fc8f5f
Fix line
zaifbot/trade/strategy.py
zaifbot/trade/strategy.py
import time from zaifbot.utils.observable import Observable from zaifbot.exchange.api.http import BotTradeApi from zaifbot.trade.trade import Trade from zaifbot.logger import trade_logger class Strategy(Observable): def __init__(self, entry_rule, exit_rule, stop_rule=None, name=None): super().__init__() ...
Python
0.000358
@@ -819,24 +819,50 @@ ss started', +%0A extra=%7B'str @@ -1118,32 +1118,63 @@ cess will stop', +%0A extra=%7B'strateg @@ -1289,16 +1289,46 @@ topped', +%0A extra=%7B @@ -1502,16 +1502,46 @@ alive', +%0A ...
ee43e96ad3d74a83bed5d61b78e44ac697364583
Fix the help string
zaqar/queues/bootstrap.py
zaqar/queues/bootstrap.py
# Copyright (c) 2013 Rackspace, 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 wr...
Python
0.999999
@@ -1530,17 +1530,16 @@ kends. ' -, %0A @@ -1597,17 +1597,16 @@ driver ' -, %0A @@ -1667,17 +1667,16 @@ re the ' -, %0A
5eb91e941166fe154f26122babedae152ff226d2
return points if they returned from Solr
plugin/geoparser_plugin/server/__init__.py
plugin/geoparser_plugin/server/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import mako import json import os from girder import constants, events from girder.utility.model_importer import ModelImporter from girder.utility.webroot import Webroot from girder.api.rest import Resource, loadmodel, RestException from girder.api.describe import Descri...
Python
0.000005
@@ -451,16 +451,29 @@ exLatLon +, QueryPoints %0A%0A%0Afrom @@ -911,13 +911,11 @@ , (%22 -query +get _poi @@ -927,21 +927,19 @@ ), self. -Query +get Points)%0A @@ -3771,21 +3771,19 @@ def -Query +get Points(s @@ -3860,24 +3860,375 @@ '''%0A + file_name = params%5B'file_name'%5D%0A p...
645f31a62c183a62511f57f47d73b42be8109f19
use timezones
antxetamedia/settings/settings.py
antxetamedia/settings/settings.py
from django.conf import global_settings as SETTINGS from os.path import dirname, join DIR = dirname(dirname(__file__)) #I18N TIME_ZONE = 'Europe/Paris' LANGUAGE_CODE = 'eu' FIRST_DAY_OF_WEEK = 1 USE_I18N = True USE_L10N = False DATE_INPUT_FORMATS = SETTINGS.DATE_INPUT_FORMATS + ('%Y/%m/%d',) #PATHS ROOT_URLCONF = '...
Python
0.000111
@@ -223,16 +223,30 @@ = False%0A +USE_TZ = True%0A DATE_INP
0cfb5f53f3cea5ec9cb42f205d79cd25b3034d90
clean up the admin for task log
crate_project/apps/pypi/admin.py
crate_project/apps/pypi/admin.py
from django.contrib import admin from pypi.models import ChangeLog, Log, PackageModified, TaskLog class ChangeLogAdmin(admin.ModelAdmin): list_display = ["package", "version", "timestamp", "action", "handled"] list_filter = ["timestamp", "handled"] search_fields = ["package", "action"] class LogAdmin(a...
Python
0.000001
@@ -703,12 +703,167 @@ -pass +list_display = %5B%22task_id%22, %22status%22, %22name%22, %22created%22, %22modified%22%5D%0A list_filter = %5B%22status%22, %22name%22, %22created%22, %22modified%22%5D%0A search_fields = %5B%22task_id%22%5D %0A%0A%0Aa
d01528228b647fb55b9e60f0279349adf0438ac1
Solve Module2/assignment2
Module2/assignment2.py
Module2/assignment2.py
import pandas as pd # TODO: Load up the 'tutorial.csv' dataset # # .. your code here .. # TODO: Print the results of the .describe() method # # .. your code here .. # TODO: Figure out which indexing method you need to # use in order to index your dataframe with: [2:4,'col3'] # And print the results # # .. your c...
Python
0.999999
@@ -16,160 +16,512 @@ s pd -%0A%0A# TODO: Load up the 'tutorial.csv' dataset%0A#%0A# .. your code here ..%0A%0A%0A%0A# TODO: Print the results of the .describe() method%0A#%0A# .. your code here ..%0A%0A%0A +%0D%0Aimport os%0D%0A%0D%0Aos.chdir(%22../Module1/%22)%0D%0Acwd = os.getcwd()%0D%0Aprint(cwd)%0D%0A%0D%0A# TODO...
d9d2e8ce6ef1365eaa7e722128529ad5142ca31c
Add sleep to prevent 100% CPU usage in some cases
modules/mpd.py
modules/mpd.py
import socket import signal import linelib import time import json ID = "mpd" def handler(x, y): pass signal.signal(signal.SIGUSR1, handler) signal.signal(signal.SIGALRM, handler) def mpd2dict(output): x = output.split("\n") d = dict() for item in x[:-2]: # MPD returns OK at the end, and th...
Python
0.000001
@@ -637,24 +637,46 @@ fusedError:%0A + time.sleep(1)%0A retu @@ -694,24 +694,46 @@ pt OSError:%0A + time.sleep(1)%0A retu
81e17c7d47f1fa0dcd19193dd018c4a50e69b388
Stop using six.moves for SimpleCookie.
zerver/tests/test_i18n.py
zerver/tests/test_i18n.py
# -*- coding: utf-8 -*- from typing import Any import django import mock from django.test import TestCase from django.utils import translation from django.conf import settings from django.http import HttpResponse from six.moves.http_cookies import SimpleCookie from zerver.lib.test_classes import ( ZulipTestCase,...
Python
0
@@ -217,23 +217,13 @@ rom -six.moves. http -_ +. cook @@ -2020,16 +2020,81 @@ : lang%7D) + # type: ignore # https://github.com/python/typeshed/issues/1476 %0A%0A
e5506e648926bd90919443c9d828dead42efde36
Simplify logic for operating on localhost
lib/__init__.py
lib/__init__.py
import os import sys import json import errno import shlex import functions import variables from subprocess import call from arguments import args from re import search PARAMS = [] COMMAND = 'ansible-playbook' LOCALHOST = True if variables.INSIDE_VM_OR_CI and not variables.INSIDE_PROJECT_DIR: functions.error('Th...
Python
0.000001
@@ -208,25 +208,8 @@ ook' -%0ALOCALHOST = True %0A%0Aif @@ -4607,35 +4607,8 @@ on:%0A - LOCALHOST = False%0A%0A @@ -4751,24 +4751,92 @@ VENTORY'%5D)%0A%0A + PARAMS.append(%22-i '%25s'%22 %25 os.environ%5B'ANSIBLE_INVENTORY'%5D)%0A%0A # @todo @@ -5573,20 +5573,10 @@ )%0Ael -if LOCALHOST +s...
506021dbb6750358abf8a354c235690a5117529a
test commit
move_module.py
move_module.py
import sys sys.path.append("core") from threading import Thread import os import os.path import re global context global moveConfig global shadowList global threads global moduleToMove global t global onModuleMoved def moveModuleInView(activeContext, onModuleMovedCallBack): global onModuleMoved onModuleMoved = o...
Python
0.000001
@@ -213,16 +213,31 @@ eMoved%0A%0A +# test commit%0A%0A def move
38252148a1b29b6514c7fb54f264eef789674da7
Print readPreference at MongoDB connect
mrq/context.py
mrq/context.py
from .logger import Logger import gevent import gevent.pool import urlparse import time import pymongo from .utils import LazyObject, load_class_by_path from itertools import count as itertools_count from .config import get_config # This should be MRQ's only Python object shared by all the jobs in the same process _GL...
Python
0
@@ -4417,25 +4417,65 @@ nnected. -%22 %25 (attr + (readPreference=%25s)%22 %25 (attr, db.read_preference ))%0A%0A
f8d4527f1b0ab7a899ae52d4d32648e13d676f63
Create a new class to use metadata
spec/profiles/integration_spec.py
spec/profiles/integration_spec.py
from enerdata.profiles.profile import * from expects import * def localize_season(dt, season): dst = bool(season == 'S') return TIMEZONE.normalize(TIMEZONE.localize(dt, is_dst=dst)) def convert_to_profilehour(measure): ph = ProfileHour( localize_season(measure['timestamp'], measure['season']), ...
Python
0.000001
@@ -37,30 +37,480 @@ t *%0A -%0Afrom expects import * +from enerdata.contracts.tariff import *%0A%0Afrom expects import *%0A%0A%0Aclass TGProfileHour(namedtuple('TGProfileHour',%0A ProfileHour._fields + ('meta', ))):%0A __slots__ = ()%0A%0A def __lt__(self, other):%0A return ...
5499c29164c4e579149fdce90d9886238d03831a
Sort astroid.nodes.ALL_NODE_CLASSES alphabetically
astroid/nodes.py
astroid/nodes.py
# Copyright (c) 2006-2011, 2013 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2010 Daniel Harding <dharding@gmail.com> # Copyright (c) 2014-2020 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2014 Google, Inc. # Copyright (c) 2015-2016 Ceridwen <ceridwenv@gmail.com> # Copyright (c) 2016 Jared ...
Python
0.999631
@@ -2343,45 +2343,39 @@ A -syncFunctionDef,%0A AsyncFor +nnAssign,%0A Arguments ,%0A As yncW @@ -2374,41 +2374,40 @@ As -yncWith +sert ,%0A A -wait +ssign ,%0A A -rguments +ssignAttr ,%0A @@ -2414,28 +2414,28 @@ Assign -Attr +Name ,%0A As sert,%0A @@ -2422,36 +2422,38 @@ Name,%0A...
d2e840aa75d1abf6ac23f7a143ae0d03864f5389
Add PropertyFilter class
muv/filters.py
muv/filters.py
""" MUV filters. """ import numpy as np from rdkit import Chem class EmbeddingFilter(object): """ Remove compounds that are not adaquately embedded in another dataset. Parameters ---------- threshold : float Embedding threshold; the maximum distance allowed between a compound and...
Python
0
@@ -1064,16 +1064,1895 @@ keep%0A%0A%0A +class PropertyFilter(object):%0A %22%22%22%0A Remove compounds from a dataset that have properties outside an%0A acceptable range.%0A%0A Parameters%0A ----------%0A min_value : float%0A Minimum property value.%0A max_value : float%0A Maximum ...
e64195a005be583f32754e49e870b198ee7bc396
Increase case search limit to 100 results
corehq/pillows/mappings/case_search_mapping.py
corehq/pillows/mappings/case_search_mapping.py
from corehq.pillows.mappings.case_mapping import CASE_ES_TYPE from corehq.pillows.mappings.utils import mapping_from_json from corehq.util.elastic import es_index from pillowtop.es_utils import ElasticsearchIndexInfo CASE_SEARCH_INDEX = es_index("case_search_2016-03-15") CASE_SEARCH_ALIAS = "case_search" CASE_SEARCH_...
Python
0.000002
@@ -329,16 +329,17 @@ LTS = 10 +0 %0ACASE_SE
2f5bdd9b6f4ad1317e2a1fd78b0459d9c98f1dbd
Correct Abort and AbortAndRestart import in processors
furious/processors.py
furious/processors.py
# # Copyright 2012 WebFilings, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
Python
0
@@ -722,68 +722,8 @@ le%0A%0A -from .async import Abort%0Afrom .async import AbortAndRestart%0A from @@ -807,24 +807,86 @@ rrent_async%0A +from .errors import Abort%0Afrom .errors import AbortAndRestart%0A from .job_ut
3cfa36a57087c92acc1306a38813c7d78745c129
fix an unused generic type
bidict/_orderedbidict.py
bidict/_orderedbidict.py
# Copyright 2009-2022 Joshua Bronson. All rights reserved. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # * Code review nav * # ...
Python
0.000245
@@ -4632,18 +4632,21 @@ iew%5BKT, -VT +t.Any %5D%5D%5D,%0A @@ -5041,18 +5041,21 @@ iew%5BKT, -VT +t.Any %5D%5D, *arg
d85c7e817f884ec3bc67d0e856f7312a8fc057db
add support for C++-style comments
mapcss_parser/lex.py
mapcss_parser/lex.py
#!/usr/bin/python """ MapCSS lexer """ import re import ply.lex as lex # Compute column. # input is the input text string # token is a token instance # Basically taken from the PLY documentation def find_column(input,token): last_cr = input.rfind('\n',0,token.lexpos) if last_cr < 0: last_cr =...
Python
0
@@ -602,16 +602,61 @@ OMMENT', +%0A #Comments in C++-style%0A 'CXXCOMMENT', %0A%0A #R @@ -1653,16 +1653,67 @@ = r','%0A%0A +def t_ANY_CXXCOMMENT(t):%0A r'//%5B%5E%5Cn%5D*'%0A pass%0A%0A def t_ME
3314a71b9c84624f39467d1f4ff687e0b54616f5
Fix comment quote for multi lines
towerslack.py
towerslack.py
# coding: utf-8 import sys import json import requests from werkzeug.wrappers import BaseRequest try: import gevent except ImportError: gevent = None HOMEPAGE = 'https://github.com/lepture/tower-slack' TOWER_ICON = ( 'https://tower.im/assets/mobile/icon/' 'icon@512-84fa5f6ced2a1bd53a409013f739b7ba.p...
Python
0
@@ -2984,24 +2984,125 @@ if comment:%0A + content = comment%5B'content'%5D%0A content = content.strip().replace('%5Cn', '%5Cn%3E ')%0A @@ -3129,34 +3129,23 @@ (text, -comment%5B' content -'%5D )%0A%0A
1f03c373ee64f071febe89ceb23bc9999a23b4b4
Use set instead of dict to indicate intended usage clearly
pombola/core/templatetags/breadcrumbs.py
pombola/core/templatetags/breadcrumbs.py
# modified from http://djangosnippets.org/snippets/656/ from django.template import Library from django.utils.safestring import mark_safe from django.core.urlresolvers import resolve, Resolver404 from django.conf import settings import re from urlparse import urlparse register = Library() url_name_mappings = setting...
Python
0
@@ -2346,10 +2346,13 @@ s = -%7B%7D +set() %0A%0A @@ -2398,16 +2398,24 @@ if +link in seen_lin @@ -2420,18 +2420,8 @@ inks -.get(link) :%0A @@ -2479,21 +2479,18 @@ inks -%5Blink%5D = True +.add(link) %0A%0A
e6cd526e6af8f887e833747ce5995fa10c5fe2ac
Fix extradmin tests
lemon/extradmin/tests/__init__.py
lemon/extradmin/tests/__init__.py
from django import forms from django.contrib.auth.models import Group, Permission from django.contrib.contenttypes.models import ContentType from django.test import TestCase from lemon import extradmin from lemon.extradmin import settings from lemon.extradmin.admin import GroupAdmin from lemon.extradmin.forms import G...
Python
0.000001
@@ -18,16 +18,62 @@ t forms%0A +from django.contrib.admin import autodiscover%0A from dja @@ -591,26 +591,16 @@ tiple%0A%0A%0A -extradmin. autodisc
118791239e8c4946e1425c3833d3a1460360c369
Revert a minor change
dakara_player_vlc/font_loader.py
dakara_player_vlc/font_loader.py
import os import sys import logging SHARE_DIRECTORY = "share" SHARE_DIRECTORY_ABSOLUTE = os.path.dirname(os.path.abspath(SHARE_DIRECTORY)) FONT_DIRECTORY = "fonts" logger = logging.getLogger("font_loader") def get_font_loader_class(): """Get the font loader associated to the current platform """ platf...
Python
0.000006
@@ -308,37 +308,8 @@ %22%22%22%0A - platform = sys.platform%0A%0A @@ -318,24 +318,28 @@ 'linux' in +sys. platform:%0A @@ -384,16 +384,20 @@ win' in +sys. platform
cd395e2f183ec01fd7ce8245e2de2c5bd802eac4
handle no groups on partner in admin
verellen/partner/admin.py
verellen/partner/admin.py
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from partner.models import Partner, PartnerGroup, PriceList, SalesTool class UserInline(admin.TabularInline): model = User class PartnerGroupAdmin(admin.ModelAdmin): fields = [ 'name',...
Python
0
@@ -606,16 +606,39 @@ .partner + and user.partner.group :%0A
95450d5e70122a01281992dde3319ff8e2f500d7
Concatenate file parts more efficiently when rendering
app/models.py
app/models.py
import datetime import os import unicodedata from whoosh.fields import Schema, ID, KEYWORD, STORED, TEXT from rst import rst_to_html from settings import DIRECTIVES, INDEX SCHEMA = Schema( content=TEXT(stored=True), tags=KEYWORD, title=ID(unique=True, stored=True), time=STORED, ) class Document(obj...
Python
0.00009
@@ -1767,15 +1767,17 @@ -body +parts = +%5B inde @@ -1784,18 +1784,17 @@ x.read() - + +, directi @@ -1807,10 +1807,9 @@ ad() - + +, sel @@ -1817,16 +1817,51 @@ .content +%5D%0A body = %22%22.join(parts) %0A
0a6d627d8099412b936525bbf30114aea2b44e0d
refactor get calendars
calflate/__init__.py
calflate/__init__.py
# -*- encoding: utf-8 -*- # AUTHOR: http://www.christoph-polcin.com # LICENSE: FreeBSD License # CREATED: 2014-01-16 from base64 import encodestring from optparse import OptionParser from os import path import re from urllib2 import Request, urlopen def calflate(SRC, DST, options): items = get_items(get_calenda...
Python
0.000018
@@ -307,23 +307,25 @@ ms(get_c -alendar +ollection (*SRC))%0A @@ -364,23 +364,25 @@ ms(get_c -alendar +ollection (*DST))) @@ -2569,23 +2569,25 @@ ef get_c -alendar +ollection (url, us @@ -2611,27 +2611,51 @@ *args):%0A -r = +def r_fac():%0A return url_usr_req @@ -2684,58 +2684,387 @@ gs)%0A - co...
11580c007cda3e43fe38dfe10ecc36b75eaa7c56
Add missing coma ','
purchase_order_variant_mgmt/__openerp__.py
purchase_order_variant_mgmt/__openerp__.py
# -*- coding: utf-8 -*- # Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Handle easily multiple variants on Purchase Orders', 'summary': 'Handle the addition/removal of multiple variants from ' 'product templat...
Python
0.999992
@@ -393,16 +393,17 @@ ecnativa +, '%0A
ac9b8365b3995eadf3fbe74d71b9b0b22b8157d7
Update jsonrpcdispatcher.py
rpc4django/jsonrpcdispatcher.py
rpc4django/jsonrpcdispatcher.py
''' This module implements a JSON 1.0 compatible dispatcher see http://json-rpc.org/wiki/specification ''' import inspect import json # indent the json output by this many characters # 0 does newlines only and None does most compact # This is consistent with SimpleXMLRPCServer output JSON_INDENT = 0 # These error c...
Python
0.000001
@@ -4207,16 +4207,17 @@ # + add some @@ -4236,16 +4236,17 @@ # + if reque
37671781813c5dca3c8d8eaf65c0fa9f91a6117f
Set up default request timeout to 15 seconds #18081
gold_digger/data_providers/_provider.py
gold_digger/data_providers/_provider.py
# -*- coding: utf-8 -*- import requests import requests.exceptions from abc import ABCMeta, abstractmethod from decimal import Decimal, InvalidOperation class Provider(metaclass=ABCMeta): def __init__(self, logger): self.logger = logger @property @abstractmethod def name(self): pass...
Python
0.000001
@@ -185,16 +185,97 @@ CMeta):%0A + DEFAULT_REQUEST_TIMEOUT = 15 # 15 seconds for both connect & read timeouts%0A%0A def @@ -866,16 +866,54 @@ s=params +, timeout=self.DEFAULT_REQUEST_TIMEOUT )%0A @@ -1030,38 +1030,33 @@ ogger.error(%22%25s -get %25s +- status code on @@ -1051,23 +1051,30 @@ tus...
b9729599bc1e5ab3e5e56e519f90b7bb55d68b73
add __author__
calflate/__init__.py
calflate/__init__.py
# -*- encoding: utf-8 -*- # AUTHOR: http://www.christoph-polcin.com # LICENSE: FreeBSD License # CREATED: 2014-01-16 from base64 import encodestring from os import path import re from urllib2 import Request, urlopen def calflate(SRC, DST, options): srcCollection, srcType = get_collection(*SRC) dstCollection...
Python
0.00661
@@ -24,50 +24,8 @@ *-%0A%0A -# AUTHOR: http://www.christoph-polcin.com%0A # LI @@ -70,16 +70,114 @@ -01-16%0A%0A +__author__ = 'Christoph Polcin %3Clabs@polcin.de%3E'%0A__url__ = 'https://github.com/chripo/calflate/'%0A%0A from bas
e850475e8b070aeca0bbe615270d0440ede13447
Update comment
maxminddb/decoder.py
maxminddb/decoder.py
""" maxminddb.decoder ~~~~~~~~~~~~~~~~~ This package contains code for decoding the MaxMind DB data section. """ from __future__ import unicode_literals import struct from maxminddb.compat import byte_from_int, int_from_byte, int_from_bytes from maxminddb.errors import InvalidDatabaseError class Decoder(object): ...
Python
0
@@ -5834,119 +5834,8 @@ et%0A%0A - # Using unpack rather than int_from_bytes as it is about 200 lookups%0A # per second faster here.%0A @@ -5946,24 +5946,116 @@ offset + 1%0A%0A + # Using unpack rather than int_from_bytes as it is faster%0A # here and below.%0A if s
eb2e4e8c69ed722363aa9d93ecc7c4c0c24d12b3
increase version to 0.4.1
campaign/__init__.py
campaign/__init__.py
__version__ = '0.4.0' default_app_config = 'campaign.apps.CampaignConfig'
Python
0.998535
@@ -12,17 +12,17 @@ = '0.4. -0 +1 '%0A%0Adefau
68711ec4c5ef45730b6bbde252468a05fdaf184f
FIX drop pdb
spec/Order_B07_spec.py
spec/Order_B07_spec.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from primestg.order.orders import Order from expects import expect, equal with description('Order B07 IP FTP Generation'): with it('generates expected B07 xml'): import pdb; pdb.set_trace() expected_result = '<Order IdPet="1234" IdReq="B07" Version="3....
Python
0
@@ -211,44 +211,8 @@ '):%0A - import pdb; pdb.set_trace()%0A
f202efa24934a197a45b261a403edf4fdcd4673e
fix login required decorator
blockly/views.py
blockly/views.py
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required import logging import json from .models import BlocklyBot # Get an instance of a logger logger = logging....
Python
0.000001
@@ -435,25 +435,40 @@ gin_required +(login_url='/') %0A - def program_ @@ -739,24 +739,39 @@ gin_required +(login_url='/') %0Adef blockly @@ -1516,24 +1516,39 @@ gin_required +(login_url='/') %0Adef logout_ @@ -1854,24 +1854,39 @@ gin_required +(login_url='/') %0Adef start_p @@ -2071,24 +2071,39 @@ gin_requir...
a19d09a65af1370e6c35946c720d1258072113aa
add csv as allowed format
geokey_export/urls.py
geokey_export/urls.py
from django.conf.urls import include, url from rest_framework.urlpatterns import format_suffix_patterns from views import ( IndexPage, ExportOverview, ExportCreate, ExportDelete, ExportToRenderer, ExportGetExportContributions, ExportGetProjectCategories, ExportGetProjectCategoryContrib...
Python
0.000002
@@ -544,16 +544,22 @@ ', 'kml' +,'csv' %5D)%0A%0A%0Aurl
6db2dcf180c4179cab7c273b4580e340a843aa53
Fix preconditioner return
gpytorch/lazy/added_diag_lazy_tensor.py
gpytorch/lazy/added_diag_lazy_tensor.py
#!/usr/bin/env python3 import torch import warnings from .sum_lazy_tensor import SumLazyTensor from .diag_lazy_tensor import DiagLazyTensor from .psd_sum_lazy_tensor import PsdSumLazyTensor from .root_lazy_tensor import RootLazyTensor from ..utils import broadcasting, pivoted_cholesky, woodbury from .. import setting...
Python
0.000023
@@ -2181,32 +2181,38 @@ eturn None, None +, None %0A%0A if not @@ -2702,32 +2702,38 @@ eturn None, None +, None %0A%0A if