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
8e35a5f5e7da38105961178478c33e92c81caf62
Use new homely._ui.system() instead of subprocess
homely/pipinstall.py
homely/pipinstall.py
from subprocess import check_output, check_call from homely._engine2 import Helper, Cleaner, getengine from homely._utils import haveexecutable from homely._ui import isinteractive def pipinstall(packagename, which, user=True): engine = getengine() for version in which: assert version in (2, 3) ...
Python
0.000001
@@ -1,53 +1,4 @@ -from subprocess import check_output, check_call%0A%0A from @@ -125,16 +125,24 @@ eractive +, system %0A%0A%0Adef p @@ -418,20 +418,14 @@ t = -check_output +system (%5Bpi @@ -468,17 +468,53 @@ -check'%5D -) +,%0A stdout=True)%5B1%5D %0A fin @@ -1919,34 +1919,30 @@ r')%0A ...
52eebb215f52ae73a881e3d4e9a695139c260d3b
Empty names should be called @
lexicon/providers/transip.py
lexicon/providers/transip.py
from __future__ import absolute_import from .base import Provider as BaseProvider from transip.client import DomainClient def ProviderParser(subparser): subparser.add_argument("--auth-username", help="specify username used to authenticate") subparser.add_argument("--auth-api-key", help="specify API private ke...
Python
0.998725
@@ -2776,24 +2776,197 @@ nt this!%22)%0A%0A + def _relative_name(self, record_name):%0A name = super(Provider, self)._relative_name(record_name)%0A if not name:%0A name = %22@%22%0A return name%0A%0A def _fil
c3f872f306a0ff516e4dae227e6f963cb3841bf2
save excluded users in presence payload
channelstream/channel.py
channelstream/channel.py
import copy import logging import six import uuid from datetime import datetime from channelstream import server_state from channelstream.utils import process_catchup log = logging.getLogger(__name__) class Channel(object): """ Represents one of our chat channels - has some config options """ config_keys ...
Python
0.000001
@@ -1954,16 +1954,17 @@ ontinue%0A +%0A @@ -4211,32 +4211,40 @@ xclude_users%22: %5B +username %5D,%0A %22 @@ -4637,25 +4637,39 @@ e_users= -%5Busername +payload%5B%22exclude_users%22 %5D)%0A
c0da9801f726ab3ac5c360f77598f1d14c615c2e
make sure windrose_utils._make_plot gets exercised!
pyiem/tests/test_windrose_utils.py
pyiem/tests/test_windrose_utils.py
import unittest import datetime import psycopg2 from pyiem.windrose_utils import windrose, _get_timeinfo class Test(unittest.TestCase): def test_timeinfo(self): """Exercise the _get_timeinfo method""" res = _get_timeinfo(range(1, 10), 'hour', 24) self.assertEquals(res['labeltext'], '(1, 2...
Python
0
@@ -925,157 +925,30 @@ -# plot.windrose('AMW2', fp='/tmp/test_plot_windrose.png',%0A # cursor=cursor)%0A fig = windrose('AMW2',%0A +fig = windrose('AMW2', cur @@ -959,29 +959,28 @@ cursor, -justdata=True +sname='Ames' )%0A @@ -1169,17 +1169,70 @@ e(20 -...
d32d57fc07b595c4dc0a24a04ac4589ad5d16918
Make modules uninstallable
hotel/__openerp__.py
hotel/__openerp__.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
Python
0
eca18d440d37e3caebe049617910420e6d37d507
remove execute bit from compare_ir python script
src/compiler/glsl/tests/compare_ir.py
src/compiler/glsl/tests/compare_ir.py
#!/usr/bin/env python # coding=utf-8 # # Copyright © 2011 Intel Corporation # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to...
Python
0
39d89982a2a2bba810e51614158bf474cba500dc
Add more ComputerPlayer names
computer_player.py
computer_player.py
import random import sys import time from player import Player from solving_algorithm import generate_solutions class ComputerPlayer(Player): def __init__(self): super(ComputerPlayer, self).__init__() self.PAUSE = 0.1 self.names = ['Chell', 'GLaDOS', 'Companion Cube', 'Curiosity Core', 'W...
Python
0
@@ -281,62 +281,96 @@ , 'C -ompanion Cub +uriosity Cor e', ' -Curiosity Core', 'Wheatley', 'Carolin +Turret', 'Companion Cube', 'Wheatley', 'Cave Johnson', 'Caroline', 'Cak e'%5D%0A
8f8dbfef262021b377974f5fa8fecd6c89cebed4
Install missing deps.
ci/appveyor-bootstrap.py
ci/appveyor-bootstrap.py
""" AppVeyor will at least have few Pythons around so there's no point of implementing a bootstrapper in PowerShell. This is a port of https://github.com/pypa/python-packaging-user-guide/blob/master/source/code/install.ps1 with various fixes and improvements that just weren't feasible to implement in PowerShell. """ f...
Python
0
@@ -3932,64 +3932,26 @@ '%5D, -%22setuptools%3E=18.0.1%22, %22 +'tox- wheel -%22, %22tox%22, %22virtualenv%3E=13.1.0%22 +', 'twine' )%0A
b59c1299dab672f4670e2fdbe7ae4f959deab118
Version bump
conans/__init__.py
conans/__init__.py
# Allow conans to import ConanFile from here # to allow refactors from conans.client.build.autotools_environment import AutoToolsBuildEnvironment from conans.client.build.cmake import CMake from conans.client.build.meson import Meson from conans.client.build.msbuild import MSBuild from conans.client.build.visual_enviro...
Python
0.000001
@@ -1073,11 +1073,11 @@ = '1.13. -2 +3 '%0A
c2c2c99326938a6c0064b4bdb80c37bd05fbd013
fix url namespace
corehq/apps/linked_domain/remote_accessors.py
corehq/apps/linked_domain/remote_accessors.py
from __future__ import absolute_import import requests from couchdbkit.exceptions import ResourceNotFound from django.urls.base import reverse from requests import ConnectionError from corehq.apps.app_manager.dbaccessors import wrap_app from corehq.apps.hqmedia.models import CommCareMultimedia from corehq.apps.linked_...
Python
0.999895
@@ -622,22 +622,29 @@ equest(' -remote +linked_domain :toggles @@ -739,22 +739,29 @@ everse(' -remote +linked_domain :custom_ @@ -1034,22 +1034,29 @@ equest(' -remote +linked_domain :custom_ @@ -1148,22 +1148,29 @@ equest(' -remote +linked_domain :user_ro
068e12ebb0fc36fc3bfa397a58c54aa92e361f9a
Clean up unit test in test_notifier
st2actions/tests/unit/test_notifier.py
st2actions/tests/unit/test_notifier.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Python
0
@@ -3780,14 +3780,32 @@ ier( -None, +connection=None, queues= %5B%5D,
cf35695481b703e49fbc00e286ef6380a8aec394
Remove invalid test
corehq/apps/notifications/tests/test_views.py
corehq/apps/notifications/tests/test_views.py
from unittest.mock import patch from corehq.apps.accounting.models import Subscription from corehq.apps.groups.models import Group from ..views import NotificationsServiceRMIView def test_should_hide_feature_notifs_for_pro_with_groups(): with case_sharing_groups_patch(['agroupid']): hide = Notifications...
Python
0
@@ -800,360 +800,8 @@ %22%0A%0A%0A -def test_should_hide_feature_notifs_for_non_pro_with_groups():%0A with case_sharing_groups_patch(%5B'agroupid'%5D), active_service_type_patch(%22not_IMPLEMENTATION_or_SANDBOX%22):%0A hide = NotificationsServiceRMIView._should_hide_feature_notifs(%22test%22, None)%0A ...
a5bfcca31ea3d8ed1f55cee96b5652c789f6600e
Fix #1801: contact downtime log spam ...
shinken/contactdowntime.py
shinken/contactdowntime.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you c...
Python
0
@@ -2500,12 +2500,13 @@ ger. -info +debug (%22CH
b769c027b1db7a419f916e3961d0b746eef7c666
move import SimpleITK back into function
src/datareader.py
src/datareader.py
#! /usr/bin/python # -*- coding: utf-8 -*- """ Module for readin 3D dicom data """ # import funkcí z jiného adresáře import sys import os.path path_to_script = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(path_to_script, "../extern/pyseg_base/src")) sys.path.append(os.path.join(path_to_scri...
Python
0
@@ -593,33 +593,8 @@ mr%0A%0A -import SimpleITK as sitk%0A impo @@ -1895,16 +1895,57 @@ aw file%0A + import SimpleITK as sitk%0A
9df00bbfa829006396c2a6718e4540410b27c4c6
Clear the job queue upon kolibri initialization.
kolibri/tasks/apps.py
kolibri/tasks/apps.py
from __future__ import absolute_import, print_function, unicode_literals from django.apps import AppConfig class KolibriTasksConfig(AppConfig): name = 'kolibri.tasks' label = 'kolibritasks' verbose_name = 'Kolibri Tasks' def ready(self): pass
Python
0
@@ -263,9 +263,74 @@ -pass +from kolibri.tasks.api import client%0A client.clear(force=True) %0A
6a6cb75ad2c29435d74768aa88c5d925570a6ad0
Add some meta
flask_environments.py
flask_environments.py
import os import yaml from flask import current_app class Environments(object): def __init__(self, app=None, var_name=None, default_env=None): self.app = app self.var_name = var_name or 'FLASK_ENV' self.default_env = default_env or 'DEVELOPMENT' self.env = os.environ.get(self.va...
Python
0.000134
@@ -1,16 +1,249 @@ +# -*- coding: utf-8 -*-%0A%22%22%22%0A flask_environments%0A ~~~~~~~~~~~~~~~~~~%0A%0A Environment tools and configuration for Flask applications%0A%0A :copyright: (c) 2012 by Matt Wright.%0A :license: MIT, see LICENSE for more details.%0A%22%22%22%0A %0Aimport os%0A%0Aimpo
cff83c316663975af2e838cbd8c365a68079c369
In plugin child_plugin_instances may be None
shop/cascade/extensions.py
shop/cascade/extensions.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from cms.plugin_pool import plugin_pool from cmsplugin_cascade.plugin_base import TransparentContainer from .plugin_base import ShopPluginBase class ShopExtendableMixin(object): """ Add th...
Python
0.999998
@@ -452,32 +452,99 @@ xtension(self):%0A + if self.child_plugin_instances is None:%0A return%0A result = @@ -714,32 +714,99 @@ xtension(self):%0A + if self.child_plugin_instances is None:%0A return%0A result =
77e5dcc8592686202045a79cea293af602ed5d49
delete is trickle-down, so I think this is more precise
corehq/apps/reminders/tests/test_recipient.py
corehq/apps/reminders/tests/test_recipient.py
from django.test import TestCase from corehq.apps.domain.models import Domain from corehq.apps.locations.models import SQLLocation, LocationType from corehq.apps.reminders.models import CaseReminder, CaseReminderHandler from corehq.apps.users.models import CommCareUser from corehq.form_processor.tests.utils import run_...
Python
0.000012
@@ -2408,45 +2408,8 @@ ion%0A - parent_location.delete()%0A @@ -2475,24 +2475,61 @@ tion.save()%0A + parent_location.delete()%0A @@ -2701,64 +2701,8 @@ ion%0A - self.user = CommCareUser.get(self.user._id)%0A
bb5cbae79ef8efb8d0b7dd3ee95e76955317d3d7
Fix for broken container security test
tests/integration/api/test_sc_test_jobs.py
tests/integration/api/test_sc_test_jobs.py
from tests.base import BaseTest from tenable_io.api.models import ScTestJob class TestScTestJobsApi(BaseTest): def test_status(self, client, image): jobs = client.sc_test_jobs_api.list() assert len(jobs) > 0, u'At least one job exists.' test_job = client.sc_test_jobs_api.status(jobs[0].j...
Python
0
@@ -662,32 +662,39 @@ obs_api.by_image +_digest (image%5B'digest'%5D
db6e23671a82a76afc13b4a69422a6b0d3c381df
Rearrange tests
h5py/tests/high/test_hlobject.py
h5py/tests/high/test_hlobject.py
from tempfile import mktemp from h5py import tests import h5py class Base(tests.HTest): def setUp(self): self.name = mktemp() self.f = h5py.File(self.name, 'w') def tearDown(self): import os try: if self.f: self.f.close() finally: ...
Python
0.000015
@@ -1085,20 +1085,17 @@ TestProp -File +s (Base):%0A @@ -1154,31 +1154,8 @@ ile -property on subclasses %22%22%22%0A @@ -1363,24 +1363,304 @@ , g2.file)%0A%0A + def test_parent(self):%0A %22%22%22 (HLObject) .parent %22%22%22%0A self.assertEqual(self.f.parent, self.f%5B'/'%5D)%0A g = self...
6594bb843998ee22b0a12036a0e16c1fd625fd03
Revert "Catch Validation error"
shop/context_processors.py
shop/context_processors.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.forms.utils import ValidationError from shop.models.customer import CustomerModel def customer(request): """ Add the customer to the RequestContext """ msg = "The request object does not conta...
Python
0
@@ -57,17 +57,16 @@ iterals%0A -%0A from dja @@ -94,55 +94,8 @@ ngs%0A -from django.forms.utils import ValidationError%0A from @@ -751,25 +751,8 @@ rror -, ValidationError ):%0A
ff97879ca25eb1e9e4a90308236e367354900da8
Add count_include_pad argument to flax.linen.pooling.avg_pool
flax/linen/pooling.py
flax/linen/pooling.py
# Copyright 2022 The Flax Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
Python
0.000012
@@ -3348,18 +3348,109 @@ de_pad: -.. +a boolean whether to include padded tokens%0A in the average calculation (default: %60True%60) .%0A Retu
e0b90786a815fdc154aecc1057485e712a6286ad
use assertRegexpMatches instead of assertRegex to support python 2.7
cpt/test/integration/update_some_deps_test.py
cpt/test/integration/update_some_deps_test.py
import unittest from conans.client.tools import environment_append from conans.test.utils.tools import TestClient, TestServer from cpt.test.unit.utils import MockCIManager from cpt.test.test_client.tools import get_patched_multipackager class UpdateTest(unittest.TestCase): conanfile_bar = """from conans import...
Python
0
@@ -4337,32 +4337,40 @@ self.assertRegex +pMatches (str(self._clien @@ -4433,32 +4433,40 @@ self.assertRegex +pMatches (str(self._clien @@ -4530,32 +4530,40 @@ self.assertRegex +pMatches (str(self._clien @@ -4635,16 +4635,24 @@ ertRegex +pMatches (str(sel
80caa173028e0252a6e51e57b6cb9c423df6ad59
Access type name via __name__.
stellargraph/mapper/graph_generator.py
stellargraph/mapper/graph_generator.py
# -*- coding: utf-8 -*- # # Copyright 2020 Data61, CSIRO # # 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.000003
@@ -4270,16 +4270,25 @@ ch_size) +.__name__ %7D%22%0A
162474c612f8e9d6a4f6d21640cd33b525fe440d
add cache busting
app/settings.py
app/settings.py
""" Django settings for testP project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
Python
0.000001
@@ -4698,16 +4698,102 @@ ic%22)),%0A%5D +%0ASTATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage' %0A%0A# Fil
0cb7f9c41c7ae0a7f487188721f56adf2ff9999d
add type hints.
lib/acli/services/route53.py
lib/acli/services/route53.py
# -*- coding: utf-8 -*- from __future__ import (absolute_import, print_function, unicode_literals) from boto3.session import Session from acli.output.route53 import (output_route53_list, output_route53_info) import botocore.exceptions def get_boto3_session(aws_config): return Session(region_name=aws_config.region...
Python
0
@@ -265,16 +265,61 @@ onfig):%0A + %22%22%22%0A @type aws_config: Config%0A %22%22%22%0A retu @@ -527,24 +527,69 @@ nfig=None):%0A + %22%22%22%0A @type aws_config: Config%0A %22%22%22%0A session
b747391c748c94cd8433dfacd935d131b484a29c
Improve error handling and refactor base path
java/ql/src/utils/model-generator/RegenerateModels.py
java/ql/src/utils/model-generator/RegenerateModels.py
#!/usr/bin/python3 # Tool to regenerate existing framework CSV models. from pathlib import Path import json import os import requests import shutil import subprocess import tempfile import sys lgtmSlugToModelFile = { # "apache/commons-beanutils": "java/ql/lib/semmle/code/java/frameworks/apache/BeanUtilsGenerate...
Python
0
@@ -190,16 +190,77 @@ t sys%0A%0A%0A +defaultModelPath = %22java/ql/lib/semmle/code/java/frameworks%22%0A lgtmSlug @@ -314,48 +314,8 @@ %22: %22 -java/ql/lib/semmle/code/java/frameworks/ apac @@ -377,48 +377,8 @@ %22: %22 -java/ql/lib/semmle/code/java/frameworks/ apac @@ -435,48 +435,8 @@ %22: %22 -java/ql/lib/s...
f3fd4d098ef5465776cd3e71a8e6c889a2b74ff6
Update proxy.py
lazada_scsdk/proxy.py
lazada_scsdk/proxy.py
# -*- coding: utf-8 -*- # @Author: Phu Hoang # @Date: 2017-05-23 09:40:32 # @Last Modified by: Phu Hoang # @Last Modified time: 2017-06-16 10:53:12 import logging from requests.exceptions import ReadTimeout from http_request_randomizer.requests.proxy.requestProxy import RequestProxy from http_request_randomizer.re...
Python
0.000001
@@ -1455,18 +1455,16 @@ %0A - # parsers
394d5f9cd7c911fa790a63332101b784f67f8b55
Add dual variables to constraints
cvxpy/constraints/leq_constraint.py
cvxpy/constraints/leq_constraint.py
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CVXPY is distributed i...
Python
0
@@ -718,16 +718,126 @@ s as lu%0A +# Only need Variable from expressions, but that would create a circular import.%0Afrom cvxpy import expressions%0A from cvx @@ -1117,26 +1117,72 @@ elf. -_ dual_va -lue = None +riable = expressions.variables.Variable(*self._expr.size) %0A @@ -4160,30 +4160,38 @@ return self. ...
1e1e2793bad3db9201e51c5038edde5373424ad6
Put infrastructure in place for javascript targetting
client/compile.py
client/compile.py
#!/usr/bin/env python import os.path from HTMLParser import HTMLParser import re """ Certain runtimes (like AIR) don't support dynamic function creation. Parse the JavaScript and create the template beforehand. """ class Compiler(HTMLParser): script = '' scripts = {} inScript = False scriptName = '' ...
Python
0.000001
@@ -272,16 +272,37 @@ ts = %7B%7D%0A + javascripts = %7B%7D%0A inSc @@ -925,21 +925,17 @@ -found = False +name = '' %0A @@ -935,36 +935,38 @@ ''%0A -name +target = ''%0A @@ -1020,33 +1020,237 @@ ype' - and i%5B1%5D == 'text/html': +:%0A if i%5B1%5D == 'te...
233916de4fae7430ac28856939767f639fefd19d
Fix issue with FileRefField.
cms/apps/media/models.py
cms/apps/media/models.py
"""Models used by the static media management application.""" from __future__ import unicode_literals from PIL import Image from django.db import models from django.contrib import admin from django.contrib.admin.widgets import ForeignKeyRawIdWidget from django.utils.encoding import python_2_unicode_compatible import...
Python
0
@@ -2565,28 +2565,75 @@ +if 'to' in kwargs:%0A del kwargs%5B -%22to%22%5D +'to'%5D%0A%0A to = File%0A
7dffc7115b5e91ba13de8cb3e306832be7f8e185
print result in show components
client/jiraffe.py
client/jiraffe.py
import urllib import os SERVICE_URL = "http://jiraffe.cloudhub.io/api" CREATE_SERVICE = SERVICE_URL + "/issues" DEFAULT_SERVICE = SERVICE_URL + "/defaults" COMPONENT_SERVICE = SERVICE_URL + "/components" def get_valid_reporter(reporter): if reporter == "": return os.environ['JIRA_ID'] return reporter def cre...
Python
0
@@ -1963,16 +1963,42 @@ d_args)%0A + print(response.read()) %0A%0Adef sh
a7e45cc5cd9ec9d706b4160f988616d87e185cb8
FIX survey validate_questions
survey_conditional_questions/survey.py
survey_conditional_questions/survey.py
# -*- coding: utf-8 -*- from openerp import fields, models class survey_question(models.Model): _inherit = 'survey.question' conditional = fields.Boolean( 'Conditional Question', copy=False, # we add copy = false to avoid wrong link on survey copy, # should be improoved ) ...
Python
0
@@ -52,16 +52,70 @@ models%0A +import logging%0A%0A_logger = logging.getLogger(__name__)%0A %0A%0Aclass @@ -674,85 +674,8 @@ %0A - # NO HACEMOS ESTA MOD GENERICA PORQUE DA ERROR AL ALMACENAR LOS CHOICE%0A # def @@ -689,34 +689,32 @@ te_question(%0A - # self, c @@ -771,357 +771,165 @@ %0A ...
f6be438e01a499dc2bde6abfa5a00fb281db7b83
Add account_id as the element of this class
kamboo/core.py
kamboo/core.py
import botocore from kotocore.session import Session class KambooConnection(object): """ Kamboo connection with botocore session initialized """ session = botocore.session.get_session() def __init__(self, service_name="ec2", region_name="us-east-1", credentials=None): se...
Python
0.000001
@@ -267,16 +267,50 @@ ast-1%22,%0A + account_id=None,%0A @@ -371,16 +371,53 @@ on_name%0A + self.account_id = account_id%0A
a76b866862874ce52c762b4e0381b233917a977a
Increment version
karld/_meta.py
karld/_meta.py
version_info = (0, 2, 6) version = '.'.join(map(str, version_info))
Python
0.000002
@@ -19,9 +19,9 @@ 2, -6 +7 )%0Ave
8868f2715e4e2d0c2554af4d7b08074574c9543f
Adopt RoundFunction class to work around (real*I).is_real is None
sympy/functions/elementary/integers.py
sympy/functions/elementary/integers.py
from __future__ import print_function, division from sympy.core.basic import C from sympy.core.singleton import S from sympy.core.function import Function from sympy.core import Add from sympy.core.evalf import get_integer_part, PrecisionExhausted ######################################################################...
Python
0.999728
@@ -676,32 +676,65 @@ arg.is_imaginary + or (S.ImaginaryUnit*arg).is_real :%0A re @@ -1452,24 +1452,25 @@ is_real and +( spart.is_ima @@ -1478,16 +1478,52 @@ inary or + (S.ImaginaryUnit*spart).is_real) or %0A @@ -1983,16 +1983,51 @@ maginary + or (S.ImaginaryUnit*spart).is_real :%0A
31d7df470dbaf996f4f3c7639107ec04afda1ec4
Update runcount.py
bin/runcount.py
bin/runcount.py
#!/usr/bin/python import os from count import countfile import common def runAll(args): print('\n\n\nYou have requested to count unique sam files') print('\tWARNING:') print('\t\tIF USING ANY REFERENCES OTHER THAN THOSE I PROVIDE I CANNOT GUARANTEE RESULT ACCURACY') print('\n') #set up environm...
Python
0.000001
@@ -831,12 +831,17 @@ all -mapp +bin count ing
e6520bb2c2f016f39ae76bfb15dd62cfdb2fdf63
update rcomp CLI index printing, given new serv format
frontend/rcomp/cli.py
frontend/rcomp/cli.py
"""command-line interface (CLI) For local development, use the `--rcomp-server` switch to direct this client at the localhost. E.g., rcomp --rcomp-server http://127.0.0.1:8000 """ import argparse import sys import json import requests from . import __version__ def main(argv=None): parser = argparse.Argume...
Python
0
@@ -2218,16 +2218,25 @@ mmands'%5D +.values() :%0A
710dc66b04b5864fc4321e273eada1cce202c9cf
Refactor LineOnMesh.py
src/Python/DataManipulation/LineOnMesh.py
src/Python/DataManipulation/LineOnMesh.py
#!/usr/bin/env python import vtk import random import numpy # Make a 32 x 32 grid size = 32 # Define z values for the topography topography = numpy.zeros([size, size]) for i in range(size): for j in range(size): topography[i][j] = random.randrange(0, 5) # Define points, triangles and colors colors = vt...
Python
0.000001
@@ -38,27 +38,19 @@ ort -random%0Aimport numpy +numpy as np %0A%0A%0A# @@ -122,143 +122,103 @@ phy%0A -topography = numpy.zeros(%5Bsize, size%5D)%0Afor i in range(size):%0A for j in range(size):%0A topography%5Bi%5D%5Bj%5D = random.randrange(0, 5 +z_min = 0%0Az_max = 5%0Atopography = (z_max * np.random.ra...
c4a0a83fe4a028b1d571058aed755be5b4714531
fix logging
includes/SteamGroupMembers.py
includes/SteamGroupMembers.py
import logging import urllib2 import xml.etree.ElementTree as ElementTree logger = logging.getLogger() class SteamGroupMembers(object): """ Retrives all members of the specified group. """ _members = None def __init__(self, group_id): self._group_id = group_id def __len__(self): ...
Python
0.000002
@@ -701,70 +701,83 @@ -while True:%0A logger.debug('Requesting %25s', url) +logger.debug('Loading steam group members %25s', url)%0A while True: %0A @@ -953,106 +953,8 @@ 4')%0A - logger.info('Found %25d members in group %25d', len(members_elements), self._group_id) ...
3b2dcfff78d5c330937c4b75f34f79f8e991d8e3
Fix logging bug in EDU handling over replication
synapse/replication/http/federation.py
synapse/replication/http/federation.py
# -*- coding: utf-8 -*- # Copyright 2018 New Vector Ltd # # 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 la...
Python
0
@@ -5019,9 +5019,9 @@ rom -$ +%25 s%22,%0A
ff0f3b359e4de08cfdc20eede28bf6f02705f211
Fix admin account creation dialog
indico/modules/users/forms.py
indico/modules/users/forms.py
# This file is part of Indico. # Copyright (C) 2002 - 2022 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from operator import itemgetter from pytz import common_timezones, common_timezones_set from wtforms.fiel...
Python
0
@@ -6235,33 +6235,8 @@ gs)%0A - del self.comment%0A
ab4d375010220c4dac97116e2f1bffeca2f0bedc
use another handler for user-created redirecting to fix up the test.
brownant/app.py
brownant/app.py
from __future__ import absolute_import, unicode_literals from six import string_types from six.moves import urllib from werkzeug.utils import import_string from werkzeug.urls import url_decode, url_encode from werkzeug.routing import Map, Rule, NotFound, RequestRedirect from .request import Request from .exceptions i...
Python
0
@@ -3383,156 +3383,8 @@ h()%0A - handler = import_string(endpoint)%0A request = Request(url=url, args=query_args)%0A return handler(request, **kwargs)%0A @@ -3605,16 +3605,263 @@ w_url)%0A%0A + try:%0A handler = import_string(endpoint)%0A request = R...
c00c83ad1ef24a117a682d48e15d5f0c452c77fb
fix test
system_tests/manager/test_docker_plugin.py
system_tests/manager/test_docker_plugin.py
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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...
Python
0.000002
@@ -1221,25 +1221,44 @@ ocal -. +(%0A ' install -_ +- plugins -( +', %0A
5ffa9f7054f9fcced99e366cfb8ea6de4dd1a01c
Recognize "Sinhala" as an Indic script
hindkit/constants/linguistics.py
hindkit/constants/linguistics.py
INDIC_SCRIPTS = { 'devanagari': { 'abbreviation': 'dv', 'indic1 tag': 'deva', 'indic2 tag': 'dev2', }, 'bangla': { 'abbreviation': 'bn', 'indic1 tag': 'beng', 'indic2 tag': 'bng2', 'alternative name': 'Bengali', }, 'gurmukhi': { 'abb...
Python
0.998315
@@ -1121,11 +1121,89 @@ ,%0A %7D, +%0A%0A 'sinhala': %7B%0A 'abbreviation': 'si',%0A 'tag': 'sinh',%0A %7D, %0A%7D%0A
81fba21d0788d95c44496ca327c2df68cdf34163
terminate processes before exit
core/parse.py
core/parse.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import multiprocessing import time import os import datetime import random import string import sys from core.targets import analysis from core.attack import start_attack from core.alert import info from core.alert import warn from core.alert import error from core.alert i...
Python
0.000001
@@ -5199,16 +5199,114 @@ errupt:%0A + for process in multiprocessing.active_children():%0A process.terminate()%0A
0b7a5929208bddb9e850f10ff40f1521363283fd
decrease map_stats precision
ichnaea/map_stats.py
ichnaea/map_stats.py
import csv from cStringIO import StringIO from ichnaea.db import Measure def map_stats_request(request): session = request.database.session() query = session.query(Measure.lat, Measure.lon) unique = set() for lat, lon in query: unique.add(((lat // 10000) / 1000.0, (lon // 10000) / 1000.0)) ...
Python
0.000007
@@ -265,32 +265,33 @@ d(((lat // 10000 +0 ) / 1000.0, (lon @@ -295,24 +295,25 @@ lon // 10000 +0 ) / 1000.0))
3def5ee6b6ffbb60260130deedee65cfc0e186f0
add missing super() constructor in IosAccelerometer
plyer/platforms/ios/accelerometer.py
plyer/platforms/ios/accelerometer.py
''' iOS accelerometer ----------------- Taken from: https://pyobjus.readthedocs.org/en/latest/pyobjus_ios.html#accessing-accelerometer ''' from plyer.facades import Accelerometer from pyobjus import autoclass class IosAccelerometer(Accelerometer): def __init__(self): self.bridge = autoclass('bridge').a...
Python
0.000001
@@ -262,32 +262,81 @@ __init__(self):%0A + super(IosAccelerometer, self).__init__()%0A self.bri
2fecbb4be4ade123d51e0bd8b70b016fbf9639f0
fix double ast output
src/c2p.py
src/c2p.py
from antlr4_generated.SmallCLexer import SmallCLexer from antlr4_generated.SmallCParser import SmallCParser from AbstractSyntaxTree import * from Listener import * from ErrorHandler import * from SymbolTable import * from VisitorDefinitionProcessor import * from VisitorDeclarationProcessor import * from VisitorTypeChe...
Python
0.003161
@@ -4363,48 +4363,8 @@ t)%0A%0A - output(str(abstractSyntaxTree))%0A
b041b16c1db2da49cd4814d4165fc372bdd3903f
Handle absence of LinuxFileChooser backend
plyer/platforms/linux/filechooser.py
plyer/platforms/linux/filechooser.py
''' Linux file chooser ------------------ ''' from plyer.facades import FileChooser from distutils.spawn import find_executable as which import os import subprocess as sp import time class SubprocessFileChooser(object): '''A file chooser implementation that allows using subprocess back-ends. Normally you...
Python
0.000425
@@ -7114,16 +7114,21 @@ rride = +self. desktop%0A
a536da0d925201fc652b08ad27985f37c5bd4b6c
Fix relative_urls helper for call from initialization code
src/adhocracy/lib/helpers/site_helper.py
src/adhocracy/lib/helpers/site_helper.py
from pylons import config, app_globals as g from pylons.i18n import _ from paste.deploy.converters import asbool from adhocracy.model import instance_filter as ifilter CURRENT_INSTANCE = object() def get_domain_part(domain_with_port): return domain_with_port.split(':')[0] def domain(): return get_domain_p...
Python
0.000006
@@ -444,16 +444,29 @@ ve_urls( +config=config ):%0A r @@ -1172,16 +1172,22 @@ ve_urls( +config ):%0A%0A
3f8a29efa3128f8167306b46e47e7ac18cf592ab
set broker pool limit
celeryconfig.py
celeryconfig.py
import os import sys import urlparse from kombu import Exchange, Queue sys.path.append('.') redis_url = os.environ.get('REDIS_URL', "redis://127.0.0.1:6379/") if not redis_url.endswith("/"): redis_url += "/" BROKER_URL = redis_url + "1" # REDIS_CELERY_TASKS_DATABASE_NUMBER = 1 CELERY_RESULT_BACKEND = redis_url...
Python
0
@@ -957,12 +957,11 @@ T = -None +100 %0A%0ACE
2ffea9e4d8c802c86261cf9819657e8a38c906a9
return the resource after saving it
genericclient/__init__.py
genericclient/__init__.py
import requests from . import exceptions _version = "0.0.12" __version__ = VERSION = tuple(map(int, _version.split('.'))) MultipleResourcesFound = exceptions.MultipleResourcesFound ResourceNotFound = exceptions.ResourceNotFound HTTPError = exceptions.HTTPError NotAuthenticatedError = exceptions.NotAuthenticatedErr...
Python
0.000079
@@ -2051,16 +2051,36 @@ results +%0A return self %0A%0A de
3abbba864df16e06a768b761baefd3d705008114
Update vigenereCipher: fixed typo
books/CrackingCodesWithPython/Chapter18/vigenereCipher.py
books/CrackingCodesWithPython/Chapter18/vigenereCipher.py
# Vigenere Cipher (Polyalphabetic Substitution Cipher) # https://www.nostarch.com/crackingcodes/ (BSD Licensed) from books.CrackingCodesWithPython.pyperclip import copy LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' def main(): # This text can be downloaded from https://www.nostarch.com/crackingcodes/: myMessage = "...
Python
0.000001
@@ -2255,16 +2255,17 @@ name__ = += '__main
41126795dec28c8c81f225f65589ba7aa264b4a6
allow any test sample size for cold start scenario
polara/recommender/coldstart/data.py
polara/recommender/coldstart/data.py
from collections import namedtuple import numpy as np import pandas as pd from polara.recommender.data import RecommenderData class ItemColdStartData(RecommenderData): def __init__(self, *args, **kwargs): random_state = kwargs.pop('random_state', None) super(ItemColdStartData, self).__init__(*args...
Python
0
@@ -1231,45 +1231,8 @@ %3E 0%0A - assert self._test_sample %3E 1%0A
abf8f8638e84992a8a290534074d999c817d5ae7
Add token refresh support
src/b2share_server.py
src/b2share_server.py
# -*- coding: utf-8 -*- from flask import Flask from flask import request from flask.ext.jsonpify import jsonify from flask import Response, g, redirect, url_for, make_response from werkzeug.routing import Rule from functools import wraps from model import User, Deposit import json, sys app = Flask(__name__) # def...
Python
0
@@ -515,16 +515,64 @@ ation',%0A + 'Access-Control-Expose-Headers': 'X-Token',%0A 'Ser @@ -607,16 +607,16 @@ 1.1.1'%7D%0A - %0A# helpe @@ -2599,32 +2599,34 @@ ls%22)%0A + # return user.to_ @@ -2633,24 +2633,188 @@ json(), 200%0A + resp = Response(user.to_json())%0A resp.c...
ae92abffcbe792d41ee7aafb08e59ba874f3a4c4
Fix migration dependencies
longclaw/basket/migrations/0003_auto_20170207_2053.py
longclaw/basket/migrations/0003_auto_20170207_2053.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-02-07 20:53 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('basket', '0002_basketitem_product'), ] operations = [ migrations.RenameField( ...
Python
0.000013
@@ -230,28 +230,17 @@ '000 -2_basketitem_product +1_initial '),%0A
0f70333ec715b75c5c5e0883e0c7a62584c13a70
add extentions to hire me route
portfolio/portfolio/views/default.py
portfolio/portfolio/views/default.py
"""Views for profolio app.""" import datetime import json import markdown from bs4 import BeautifulSoup from pyramid.httpexceptions import HTTPFound from pyramid.response import Response from pyramid.security import remember, forget from pyramid.view import view_config from sqlalchemy.exc import DBAPIError from ..mod...
Python
0
@@ -5405,18 +5405,18 @@ ons= -%5B'tables'%5D +extensions )%0A
4177655955f38eae919627bd75e0ee7a0c37c0c5
Simplify loading logger
calaccess_raw/management/commands/loadcalaccessrawfile.py
calaccess_raw/management/commands/loadcalaccessrawfile.py
import csv from django.db import connection from django.db.models.loading import get_model from django.core.management.base import LabelCommand from calaccess_raw.management.commands import CalAccessCommand class Command(CalAccessCommand, LabelCommand): help = 'Load a cleaned CalAccess file for a model into the d...
Python
0.000025
@@ -2481,17 +2481,17 @@ if cnt -= +! = csv_re @@ -2504,91 +2504,8 @@ nt:%0A - self.success(%22 Table record count matches CSV%22)%0A else:%0A
20003796eb8f3949d931a4b8752fb07f2be39136
Update utils.py
church/utils.py
church/utils.py
from functools import lru_cache from os.path import ( join, dirname, abspath ) PATH = abspath(join(dirname(__file__), 'data')) __all__ = ['priest'] @lru_cache(maxsize=None) def pull(filename, lang='en_us'): """ Function for getting data from text files in data/ 1. de_de - Folder for Germany....
Python
0.000001
@@ -138,29 +138,8 @@ ))%0A%0A -__all__ = %5B'priest'%5D%0A %0A%0A@l @@ -490,16 +490,17 @@ return _result +%0A
7433bc7f2cb0e71d8b9440ec5df8164533917fb3
Use global options for determining dry_run
inspectors/utils/inspector.py
inspectors/utils/inspector.py
from utils import utils import os import re import logging import datetime import urllib.parse # Save a report to disk, provide output along the way. # # 1) download report to disk # 2) extract text from downloaded report using report['file_type'] # 3) write report metadata to disk # # fields used: file_type, url, ins...
Python
0
@@ -403,22 +403,8 @@ port -, options=None ):%0A @@ -418,38 +418,23 @@ s = -%7B%7D if not options else +utils. options +() %0A%0A
3c978eab962ed8a6158df2266852a1b1a47c4ec7
add more terminal nodes
gdcdatamodel/query.py
gdcdatamodel/query.py
from psqlgraph import Node, Edge traversals = {} terminal_nodes = ['annotations', 'centers', 'archives', 'tissue_source_sites', 'files', 'related_files', 'describing_files'] def construct_traversals(root, node, visited, path): recurse = lambda neighbor: ( neighbor # no backtrack...
Python
0
@@ -184,16 +184,505 @@ g_files' +,%0A 'clinical_metadata_files', 'experiment_metadata_files', 'run_metadata_files',%0A 'analysis_metadata_files', 'biospecimen_metadata_files', 'aligned_reads_metrics',%0A 'read_group_metrics', 'pathology_reports', 'simple_germline_vari...
7c6c8e9ed2b89c7fa15992b5b68c793a53b327d8
fix test case to run on_commit hook before assertion
django_datawatch/tests/test_trigger_update.py
django_datawatch/tests/test_trigger_update.py
# -*- coding: UTF-8 -*- from __future__ import unicode_literals, print_function from django_datawatch.backends.base import BaseBackend try: from unittest import mock except ImportError: import mock from django.test.testcases import TestCase, override_settings from django_datawatch.datawatch import datawatch...
Python
0.000001
@@ -78,64 +78,8 @@ on%0A%0A -from django_datawatch.backends.base import BaseBackend%0A%0A try: @@ -146,16 +146,50 @@ t mock%0A%0A +from django.db import transaction%0A from dja @@ -243,16 +243,71 @@ ttings%0A%0A +from django_datawatch.backends.base import BaseBackend%0A from dja @@ -1478,32 +1478,535 @@ update.c...
26549566bc502dece76ad596126b219dc5c8991c
Fix for IPv6 Python sockets binding localhost problem
lib/py/src/transport/TSocket.py
lib/py/src/transport/TSocket.py
#!/usr/bin/env python # # Copyright (c) 2006- Facebook # Distributed under the Thrift Software License # # See accompanying file LICENSE or visit the Thrift site at: # http://developers.facebook.com/thrift/ from TTransport import * import socket class TSocket(TTransportBase): """Socket implementation of TTransport...
Python
0.000001
@@ -853,24 +853,46 @@ .SOCK_STREAM +, 0, socket.AI_PASSIVE )%0A for
2323699ae6b266823b30784293b2d1d900d94700
Bump aioTV version.
rest_framework_swagger/__init__.py
rest_framework_swagger/__init__.py
VERSION = '0.3.5-aio-v2' 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, ...
Python
0
@@ -19,9 +19,9 @@ io-v -2 +3 '%0A%0AD
e4c1a22c9f4681ffdd2156eb8634ed1a79995d19
Fix a bug.
datapipe/optimization/bruteforce.py
datapipe/optimization/bruteforce.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2016 Jérémie DECOCK (http://www.jdhp.org) # This script is provided under the terms and conditions of the MIT license: # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (th...
Python
0
@@ -1358,16 +1358,37 @@ import +ObjectiveFunction as WaveletO @@ -1470,16 +1470,37 @@ import +ObjectiveFunction as TailcutO
00bf40ba386d7d1ffebcc1a41766250e0fc975ac
Add related name fields
src/core/models/base.py
src/core/models/base.py
from django.db import models from django.contrib.auth.models import User class Location(models.Model): class Meta: app_label = "core" x = models.DecimalField(max_digits=10, decimal_places=5) y = models.DecimalField(max_digits=10, decimal_places=5) def __str__(self): return "x:" + str(self.x) + ", y:" + str...
Python
0.000001
@@ -499,16 +499,38 @@ ank=True +, related_name='ideas' )%0A%09owner @@ -574,22 +574,17 @@ me='idea -_owner +s ')%0A%09user @@ -636,16 +636,49 @@ gestion' +, related_name='idea_suggestions' )%0A%09activ @@ -1181,16 +1181,44 @@ Key(User +, related_name='suggestions' )%0A%09idea @@ -1241,16 +1241,44 @@ Key(Idea ...
ffb9c7c7f2d3b957c6b3eb458a647653f55af7d3
version number
invoice_webkit/__openerp__.py
invoice_webkit/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) # @author Guewen Baconnier, Bessi Nicolas, Vincent Renaville # # This program is free software: you can redistribute it and/or modify # it und...
Python
0.000003
@@ -1064,16 +1064,18 @@ on': '1. +1. 0',%0A
2edb2145f6f7447a7c659d7eeb51c7b75aa0c6d4
Add generate username signal
rhinocloud/contrib/auth/signals.py
rhinocloud/contrib/auth/signals.py
from django.contrib.auth.models import User from rhinocloud.utils import random_generator def username_shorten(sender, instance, **kwargs): if sender == User: if len(instance.username) > 30: instance.username = random_generator(instance.username[:25]) def first_name_shorten(sender, instance, ...
Python
0.000297
@@ -85,16 +85,271 @@ rator%0A%0A%0A +def generate_username_from_email(sender, instance, **kwargs):%0A if sender == User:%0A username = instance.email%0A if len(username) %3E 30:%0A username = random_generator(username%5B:25%5D)%0A instance.username = username%0A %0A def u...
c15dbc39505de93770fd89cab4f4ae9a2a72b4e1
fix test
tensorflow/python/kernel_tests/norm_op_test.py
tensorflow/python/kernel_tests/norm_op_test.py
# Copyright 2015 The TensorFlow Authors. 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 applica...
Python
0.000002
@@ -1372,33 +1372,33 @@ for ord_ in %22f -o +r o%22, -7, -1.1, 0: @@ -1558,21 +1558,20 @@ ix, ord= -%22fro%22 +ord_ )%0A%0A f @@ -1583,17 +1583,17 @@ d_ in %22f -o +r o%22, -7, @@ -1797,14 +1797,28 @@ in +%22foo%22, -7, -1.1, 1.1 -, 2 :%0A
916638e11ef20e2976c81f0e8230079cf96a3c3a
Set DJANGO_SETTINGS_MODULE env variable.
ibms_project/wsgi.py
ibms_project/wsgi.py
""" WSGI config for IBMS project. It exposes the WSGI callable as a module-level variable named ``application``. """ import dotenv from django.core.wsgi import get_wsgi_application import os from pathlib import Path # These lines are required for interoperability between local and container environments. d = Path(__fi...
Python
0
@@ -440,16 +440,89 @@ t_env)%0A%0A +os.environ.setdefault(%22DJANGO_SETTINGS_MODULE%22, %22ibms_project.settings%22)%0A applicat
2636d76fa4d9dd820fd673bc6044f4c3ccdfd0b1
Fix permissions fixture problem.
src/encoded/tests/test_permissions.py
src/encoded/tests/test_permissions.py
import pytest @pytest.datafixture def users(app): from webtest import TestApp environ = { 'HTTP_ACCEPT': 'application/json', 'REMOTE_USER': 'TEST', } testapp = TestApp(app, environ) from .sample_data import URL_COLLECTION url = '/labs/' for item in URL_COLLECTION[url]: ...
Python
0
@@ -16,20 +16,16 @@ @pytest. -data fixture%0A @@ -38,178 +38,17 @@ ers( +test app): -%0A from webtest import TestApp%0A environ = %7B%0A 'HTTP_ACCEPT': 'application/json',%0A 'REMOTE_USER': 'TEST',%0A %7D%0A testapp = TestApp(app, environ)%0A %0A
1a6c6228927b343071d0fc5e1959920bf30e6252
clean up
darkoob/social/models.py
darkoob/social/models.py
from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save from neomodel import StructuredNode, IntegerProperty, RelationshipTo, RelationshipFrom from darkoob.book.models import Quote, Book import datetime from django.utils.timezone import utc SEX_CHOICES = ...
Python
0.000001
@@ -602,32 +602,82 @@ self, user_id):%0A + ''' follow person that user.id=user_id'''%0A followed @@ -708,32 +708,32 @@ ser_id=user_id)%0A - self.fol @@ -805,16 +805,17 @@ ow())%7D)%0A +%0A def @@ -1025,16 +1025,17 @@ e False%0A +%0A def @@ -1173,32 +1173,32 @@ ser_id=user_id)%0...
d51a13ed70c157d90c2d77461ad1747f7ce12e7c
Improve comment syntax
openfisca_country_template/variables/taxes.py
openfisca_country_template/variables/taxes.py
# -*- coding: utf-8 -*- # This file defines the variables of our legislation. # A variable is property of a person, or an entity (e.g. a household). # See http://openfisca.org/doc/variables.html # Import from openfisca-core the common python objects used to code the legislation in OpenFisca from openfisca_core.model_...
Python
0.000015
@@ -2658,17 +2658,19 @@ use the -. +%60.%60 notatio
da1df870f5d5b7703c4c4c3a6b8cb7d140778469
Set default task target to 100.
source/vistas/core/task.py
source/vistas/core/task.py
from threading import RLock class Task: STOPPED = 'stopped' RUNNING = 'running' INDETERMINATE = 'indeterminate' COMPLETE = 'complete' SHOULD_STOP = 'should_stop' tasks = [] def __init__(self, name, description=None, target=0, progress=0): self.name = name self.description...
Python
0.00002
@@ -248,16 +248,18 @@ target= +10 0, progr
28634376d83595783a52255baee172c88dc33b71
fix find_user
oclubs/objs/user.py
oclubs/objs/user.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- # from __future__ import absolute_import, unicode_literals from flask_login import UserMixin from passlib.context import CryptContext from xkcdpass import xkcd_password as xp from oclubs.access import database, email from oclubs.enums import UserType from oclubs.exceptio...
Python
0.999159
@@ -3598,39 +3598,44 @@ ry:%0A -data = +return User( database.fetch_o @@ -3628,35 +3628,37 @@ tabase.fetch_one -row +entry (%0A @@ -3675,33 +3675,32 @@ -%7B 'user_id': 'id', @@ -3696,54 +3696,27 @@ _id' -: 'id', 'user_passport_name': 'passportname'%7D, +,%0A ...
8fbef5b55d5ac5d288582a7395e37c963843852b
Add exception handling
devicehive/transports/websocket_transport.py
devicehive/transports/websocket_transport.py
from devicehive.transports.transport import Transport from devicehive.transports.transport import TransportRequestException import websocket import threading import time class WebsocketTransport(Transport): """Websocket transport class.""" def __init__(self, data_format_class, data_format_options, handler_cl...
Python
0.000005
@@ -151,16 +151,27 @@ reading%0A +import sys%0A import t @@ -926,32 +926,49 @@ timeout', None)%0A + try:%0A self._co @@ -997,16 +997,20 @@ + if pong_ @@ -1018,16 +1018,20 @@ imeout:%0A + @@ -1123,24 +1123,28 @@ + args=(pong_t @@ -1157,32 +1157,36 @...
f0732e9ffd8ba84707d0805bf1b15c5ff9270971
Update storage.py
lib/carbon/storage.py
lib/carbon/storage.py
"""Copyright 2009 Chris Davis Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dist...
Python
0.000001
@@ -4058,20 +4058,16 @@ if -not aggregat @@ -4076,16 +4076,20 @@ nMethod +not in state
b7e1346306465e096f74d4e912d5a29be5ee9e93
Remove this todo text.
kyoukai/app.py
kyoukai/app.py
# Somewhere along the line, I had decided that I can't interact with others. That I have no choice but to be alone, # but I've found a new reason to stay. It's because everyone is alone. Everyone is all alone. # ~~~ import asyncio import logging from asphalt.core import Context from kyoukai.asphalt import HTTPReques...
Python
0.000032
@@ -4657,43 +4657,8 @@ st.%0A - # TODO: ERROR HANDLING%0A
285d5f43b112354f1d5c05f9dd6b050e30f517e4
Remove country=DE parameter
geocoder/gisgraphy.py
geocoder/gisgraphy.py
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import import logging from geocoder.location import BBox from geocoder.base import OneResult, MultipleResultsQuery class GisgraphyResult(OneResult): @property def lat(self): return self.raw.get('lat') @property def lng(se...
Python
0.00039
@@ -1495,37 +1495,8 @@ n',%0A - 'country': 'DE',%0A
9f725eae63a7851498a82d3bc06414dc788c0ed7
Update comment style in admin.py
impersonate/admin.py
impersonate/admin.py
# -*- coding: utf-8 -*- '''Admin models for impersonate app.''' import logging from django.conf import settings from django.contrib import admin from .models import ImpersonationLog logger = logging.getLogger(__name__) MAX_FILTER_SIZE = getattr(settings, 'IMPERSONATE_MAX_FILTER_SIZE', 100) def friendly_name(user...
Python
0
@@ -533,32 +533,33 @@ ilter):%0A%0A ''' + Custom admin fil @@ -591,16 +591,20 @@ state.%0A%0A + Prov @@ -656,16 +656,24 @@ mplete'. +%0A A sessi @@ -674,20 +674,16 @@ session -%0A that ha @@ -716,16 +716,24 @@ stamp is +%0A conside @@ -752,20 +752,16 @@ te. This -%0A fie...
951214d00e29fff46fe9294dadea1b7587db564f
fix dangerous bug about var representation on the console which led to non-backtracked path compression
prolog/interpreter/translatedmain.py
prolog/interpreter/translatedmain.py
import os, sys from pypy.rlib.parsing.parsing import ParseError from pypy.rlib.parsing.deterministic import LexerError from prolog.interpreter.interactive import helptext, StopItNow, \ ContinueContinuation from prolog.interpreter.parsing import parse_file, get_query_and_vars from prolog.interpreter.parsing import get_e...
Python
0
@@ -867,32 +867,38 @@ gine, self.write +, heap )%0A while @@ -1417,16 +1417,22 @@ lf.write +, heap )%0A @@ -1571,24 +1571,30 @@ ngine, write +, heap ):%0A from @@ -1837,23 +1837,16 @@ etvalue( -engine. heap))%0A
6d9efe005e346aaef359f369c89d007da1b83189
add more untested changes for slack integration
lampeflaske.py
lampeflaske.py
#!/usr/bin/env python3 import pprint import os import lamper from flask import Flask, request from flask_api import status app = Flask(__name__) @app.route("/", methods=['POST', 'GET']) def hello(): pprint.pprint(request.form) if request.form.get('command') != '/lamper': return "wrong command" , s...
Python
0
@@ -89,16 +89,25 @@ request +, jsonify %0Afrom fl @@ -977,29 +977,22 @@ r -eturn %22%22%22 + = %7B %0A -%7B%0A -%22 +' resp @@ -1000,20 +1000,20 @@ nse_type -%22: %22 +': ' in_chann @@ -1018,153 +1018,49 @@ nnel -%22 +' ,%0A -%22text%22: %22Light switched to %7B%7D%22,%0A %22attachments%22...
70aab65ba167cfd4e24452ca7dd03fe1cabaf6a1
create block on node2
test/functional/feature_asset_reorg.py
test/functional/feature_asset_reorg.py
#!/usr/bin/env python3 # Copyright (c) 2019-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import SyscoinTestFramework from test_framework.util import assert_equ...
Python
0.000002
@@ -980,17 +980,17 @@ on node -3 +2 and we @@ -1907,32 +1907,88 @@ fo, self.asset)%0A + # node 2 should have the asset in mempool again%0A self.nod @@ -1982,33 +1982,33 @@ self.nodes%5B -0 +2 %5D.generate(1)%0A
1f9dea20b433e5b2a69f348d1a842d71a99bc56e
Modify tests
tests/chainerx_tests/unit_tests/routines_tests/test_evaluation.py
tests/chainerx_tests/unit_tests/routines_tests/test_evaluation.py
import chainer from chainer import functions as F import numpy import chainerx from chainerx_tests import dtype_utils from chainerx_tests import op_utils _in_out_eval_dtypes = dtype_utils._permutate_dtype_mapping([ (('float16', 'float16'), 'float16'), (('float32', 'float32'), 'float32'), (('float64', 'f...
Python
0.000001
@@ -177,45 +177,8 @@ s = -dtype_utils._permutate_dtype_mapping( %5B%0A @@ -189,28 +189,26 @@ 'float16', ' -floa +in t16'), 'floa @@ -208,18 +208,18 @@ , 'float -16 +32 '),%0A @@ -228,28 +228,26 @@ 'float32', ' -floa +in t32'), 'floa @@ -271,20 +271,18 @@ at64', ' -floa +in t64'), ' @@ -306,28 +306,26 @...
8c6ffc4e1ed6b7a7f0c3cd4cd28234541bbf91a0
Add test for missing testnet section in conf file
test/functional/feature_config_args.py
test/functional/feature_config_args.py
#!/usr/bin/env python3 # Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test various command line arguments and configuration file parameters.""" import os from test_framewo...
Python
0
@@ -1132,24 +1132,295 @@ eading -')%0A%0A + with open(inc_conf_file_path, 'w', encoding='utf8') as conf:%0A conf.write(%22wallet=foo%5Cn%22)%0A self.nodes%5B0%5D.assert_start_raises_init_error(expected_msg='Error: Config setting for -wallet only applied on regtest network when in %5Bregtest%5D...
67adba196ed29a2a17911e154dc814dae89953ec
Correct log level choices
coalib/parsing/DefaultArgParser.py
coalib/parsing/DefaultArgParser.py
import argparse from coalib.misc.i18n import _ default_arg_parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, description=_("coala is a simple COde AnaLysis Application. Its goal is " "to make static code analysis easy and convenient for all " ...
Python
0
@@ -1598,15 +1598,20 @@ 'ERR +OR ','WARN +ING ','D @@ -1637,16 +1637,38 @@ of log +%22%0A %22 output%22) @@ -1843,16 +1843,18 @@ 'ERR +OR ', 'WARN ', ' @@ -1849,16 +1849,19 @@ ', 'WARN +ING ', 'DEBU
72e91e55d62f4fc3e947a37181590a0e31fe5e9b
fix LengthOfVari missing error
lib/stagers/windows/macro.py
lib/stagers/windows/macro.py
from lib.common import helpers import random import random, string class Stager: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Macro', 'Author': ['@enigma0x3', '@harmj0y'], 'Description': ('Generates an office macro for Empire, compatible with offic...
Python
0.000001
@@ -3286,28 +3286,57 @@ es)%0A - +LengthOfVari=random.randint(1,35) %0A Str
8cf3e7a822517ba12abe72def6d4a2cd0180fb19
Fix autonomous mode merge
robot/robot/src/autonomous/main.py
robot/robot/src/autonomous/main.py
try: import wpilib except ImportError: from pyfrc import wpilib class main(object): '''autonomous program''' DEFAULT = True MODE_NAME = "Tim's Mode" def __init__ (self, components): ''' initialize''' super().__init__() self.drive = components['d...
Python
0.000083
@@ -1658,242 +1658,51 @@ wn() -%0D%0A%3C%3C%3C%3C%3C%3C%3C HEAD%0A if time_elapsed %3E 0.5:%0D%0A self.catapult.autowinch()%0D%0A elif time_elapsed %3C 1.5:%0D%0A=======%0A %0D%0A elif time_elapsed %3C 1.4:%0D%0A%3E%3E%3E%3E%3E%3E%3E branch 'master' of https://github.com/frc1418/...
c435f6039b344829380db4bf92f80ff4d5de8972
fixes scrolling_benchmark.
tools/telemetry/telemetry/core/chrome/android_platform_backend.py
tools/telemetry/telemetry/core/chrome/android_platform_backend.py
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os import sys from telemetry.core.chrome import platform from telemetry.core.chrome import platform_backend # Get build/android s...
Python
0.999861
@@ -1978,27 +1978,72 @@ lf):%0A ret -urn + = self._raw_display_frame_rate_measurements%0A self._raw_d @@ -2072,16 +2072,36 @@ urements + = %5B%5D%0A return ret %0A%0A def
7bfb4a2d7daf5baaa3eb88f1d85edd813ea2aaed
enable gobject option in cairo (#21404)
var/spack/repos/builtin/packages/gobject-introspection/package.py
var/spack/repos/builtin/packages/gobject-introspection/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * import spack.hooks.sbang as sbang class GobjectIntrospection(Package): """The GObject Introspect...
Python
0
@@ -1157,16 +1157,24 @@ n(%22cairo ++gobject %22)%0A d
9963642c1cc05fb6d9dfe397b9ed811d4f7e3d26
add 4.6.1 and 3.10.1 (#24701)
var/spack/repos/builtin/packages/py-importlib-metadata/package.py
var/spack/repos/builtin/packages/py-importlib-metadata/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyImportlibMetadata(PythonPackage): """Read metadata from Python packages.""" homepag...
Python
0
@@ -427,16 +427,209 @@ ar.gz%22%0A%0A + version('4.6.1', sha256='079ada16b7fc30dfbb5d13399a5113110dab1aa7c2bc62f66af75f0b717c8cac')%0A version('3.10.1', sha256='c9356b657de65c53744046fa8f7358afe0714a1af7d570c00c3835c2d724a7c1')%0A vers
a2749190545a6765a479777b1ea97d2f9090593f
clean up project config a bit
jailscraper/project_config.py
jailscraper/project_config.py
"""ProPublica specific configuration and utilities""" import os PROJECT_SLUG = 'cookcountyjail2' INMATE_URL_TEMPLATE = 'http://www2.cookcountysheriff.org/search2/details.asp?jailnumber={0}' """Sets the maximum jail number to scan for by default. If the subsequent jail number returns a 2xx status code, it will be inc...
Python
0
@@ -58,424 +58,53 @@ ort -os%0A%0APROJECT_SLUG = 'cookcountyjail2'%0AINMATE_URL_TEMPLATE = 'http://www2.cookcountysheriff.org/search2/details.asp?jailnumber=%7B0%7D'%0A%0A%22%22%22Sets the maximum jail number to scan for by default.%0A%0AIf the subsequent jail number returns a 2xx status code, it will be incremented%...
dde62362955ca4b10f3c1fec4e3b7777b03141f5
remove ContextDict since std has ChainMap
jasily/collection/__init__.py
jasily/collection/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2017~2999 - cologler <skyoflw@gmail.com> # ---------- # # ---------- from collections import KeysView, ValuesView, ItemsView, MutableMapping _NO_VALUE = object() class ContextDict(MutableMapping): '''context dict can override base_dict.''' def ...
Python
0.000013
@@ -130,1538 +130,4 @@ ---%0A -%0Afrom collections import KeysView, ValuesView, ItemsView, MutableMapping%0A%0A_NO_VALUE = object()%0A%0Aclass ContextDict(MutableMapping):%0A '''context dict can override base_dict.'''%0A%0A def __init__(self, base_dict: dict, *args, **kwargs):%0A if base_dict is None:%0A ...
a7c94079f3fde0550d65eabbadb575fddbb31939
Add vm_util
perfkitbenchmarker/linux_packages/aerospike_server.py
perfkitbenchmarker/linux_packages/aerospike_server.py
# Copyright 2014 PerfKitBenchmarker Authors. 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 appli...
Python
0
@@ -810,16 +810,55 @@ t flags%0A +from perfkitbenchmarker import vm_util%0A from per
544c009b9cd0fa7d540e955567b533d6bc87f155
Fix rewrite config to addon on restart (#71)
hassio/addons/__init__.py
hassio/addons/__init__.py
"""Init file for HassIO addons.""" import asyncio import logging import shutil from .data import AddonsData from .git import AddonsRepoHassIO, AddonsRepoCustom from ..const import STATE_STOPPED, STATE_STARTED from ..dock.addon import DockerAddon _LOGGER = logging.getLogger(__name__) class AddonManager(AddonsData): ...
Python
0
@@ -6671,32 +6671,175 @@ return False%0A%0A + if not self.write_addon_options(addon):%0A _LOGGER.error(%22Can't write options for addon %25s%22, addon)%0A return False%0A%0A return a
21624d6434f2c47577d464ec57d44c479c9b43d7
Edit settings
spacelaunchnow/settings.py
spacelaunchnow/settings.py
""" Django settings for spacelaunchnow project. Generated by 'django-admin startproject' using Django 1.11.1. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ im...
Python
0.000001
@@ -4006,74 +4006,8 @@ %0A%5D%0A%0A -EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'%0A%0A MIDD
e635d6a1c4ca8c138a5bd288250f94bcd82bb8a8
Remove unnecessary imports.
vistrails/tests/resources/upgrades/init.py
vistrails/tests/resources/upgrades/init.py
from vistrails.core.modules.vistrails_module import Module from vistrails.core.modules.config import IPort, OPort from vistrails.core.upgradeworkflow import UpgradeWorkflowHandler, \ UpgradePackageRemap, UpgradeModuleRemap class TestUpgradeA(Module): _input_ports = [IPort("aaa", "basic:String")] _output_po...
Python
0.000001
@@ -154,58 +154,8 @@ ort -UpgradeWorkflowHandler, %5C%0A UpgradePackageRemap, Upg
5f13d0a73a040b3a78842a8bae8dbf2df6e58d05
Fix typo and formating of warning message for No AUID entries.
test/frameworks/clean_up_daemon/clean_cache.py
test/frameworks/clean_up_daemon/clean_cache.py
#!/usr/bin/env python # $Id: clean_cache.py,v 1.5 2011-04-12 19:01:19 barry409 Exp $ # Copyright (c) 2011 Board of Trustees of Leland Stanford Jr. University, # all rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (...
Python
0.999994
@@ -46,9 +46,9 @@ v 1. -5 +6 201 @@ -63,11 +63,11 @@ 19:0 -1:1 +2:0 9 ba @@ -5326,17 +5326,18 @@ ories ha -s +ve no AUID @@ -5391,16 +5391,30 @@ r%5B'dir'%5D +%0A print %0A%0A de
a2b19e7fd6b0004e4fa18b6d1b20f7347ca1964c
Fix wrong indentation
command/export.py
command/export.py
#!/usr/bin/env python2 # coding=utf-8 import json import urllib2 import logging import base64 from config import global_config from bddown_core import Pan, GetFilenameError def export(links): for link in links: pan = Pan(link) count = 1 while count != 0: link, filename, count...
Python
0.810919
@@ -1314,9 +1314,16 @@ ss:%0A -%09 +