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
4c29471af61989e852a813999cf37aa9a8acf76d
test anon to /users endpoint
onadata/apps/api/tests/viewsets/test_user_viewset.py
onadata/apps/api/tests/viewsets/test_user_viewset.py
import json from onadata.apps.api.tests.viewsets.test_abstract_viewset import\ TestAbstractViewSet from onadata.apps.api.viewsets.user_viewset import UserViewSet class TestUserViewSet(TestAbstractViewSet): def setUp(self): super(self.__class__, self).setUp() def test_user_list(self): vie...
Python
0.000001
@@ -568,32 +568,327 @@ n.dumps(data))%0A%0A + def test_user_list_anon(self):%0A view = UserViewSet.as_view(%7B'get': 'list'%7D)%0A request = self.factory.get('/')%0A response = view(request)%0A data = %5B%7B'username': u'bob', 'first_name': u'Bob', 'last_name': u''%7D%5D%0A self.a...
84eff383a42784400261c39c87b9455133771bea
correct role & add image
data/upload/backend/parser.py
data/upload/backend/parser.py
import re import csv from data.upload.backend.xlrd import xlrd_dict_reader from data.upload.backend.csv import csv_dict_reader from data.upload.models import (SpreadsheetUpload, SpreadsheetPerson, SpreadsheetSource, SpreadsheetLink, SpreadsheetContactDetai...
Python
0
@@ -1135,24 +1135,46 @@ t(label= +%22%25s, %25s%22 %25 (position, district , role=p @@ -1165,16 +1165,17 @@ district +) , role=p @@ -2424,32 +2424,106 @@ ct'),%0A )%0A + if 'Image' in person:%0A who.image = person.pop(%22Image%22)%0A who.save
9e30bc38cfa3cb000ab2d84730552d50ea604ac1
configure wsgi file to use whitenoise
heroku-libsass-python/wsgi.py
heroku-libsass-python/wsgi.py
""" WSGI config for project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` setting...
Python
0
@@ -1287,43 +1287,135 @@ ion%0A -application = get_wsgi_application( +from whitenoise.django import DjangoWhiteNoise%0A%0Aapplication = get_wsgi_application()%0Aapplication = DjangoWhiteNoise(application )%0A%0A#
92f0256a1a8c44cf9ed7e5966f254de1d2f5c72b
fix HsJoinFairShare.selectedOneHot driver
hwtLib/handshaked/joinFair.py
hwtLib/handshaked/joinFair.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from copy import copy from hwt.code import Or, rol, SwitchLogic from hwt.hdl.types.bits import Bits from hwt.interfaces.std import VldSynced from hwt.interfaces.utils import addClkRstn from hwt.synthesizer.param import Param from hwt.synthesizer.vectorUtils import iterBi...
Python
0
@@ -3641,20 +3641,35 @@ neHot = -None +self.selectedOneHot %0A @@ -3704,35 +3704,20 @@ neHot = -self.selectedOneHot +None %0A
e5b1221598e27c0b871f6afa34bd9dfa06a72845
clean up artifacts at the end of doc build
docs/build.py
docs/build.py
#!/usr/bin/env python """Build scriptharness documentation. At some point it would be good to automate all CI/Release tasks for scriptharness; this is a good start. """ from __future__ import print_function, division, absolute_import, \ unicode_literals from jinja2 import Template import os impo...
Python
0
@@ -3542,16 +3542,87 @@ EADME%22%5D) +%0A if os.path.exists(%22artifacts%22):%0A shutil.rmtree(%22artifacts%22) %0A%0Aif __n
8e0550d405230be25a2e8fe19cf86a4f27881ffa
add energy_per_formula_unit to ComputedEntry
pymatgen/entries/computed_entries.py
pymatgen/entries/computed_entries.py
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import json from monty.json import MontyEncoder, MontyDecoder from pymatgen.core.composition import Composition from monty.json import MSONable """ This module implements equivalents of the basic ComputedEn...
Python
0.00006
@@ -3376,16 +3376,156 @@ _atoms%0A%0A + @property%0A def energy_per_formula_unit(self):%0A return self.energy / self.composition.get_reduced_composition_and_factor()%5B1%5D%0A%0A def
087b73ea523213d29430801eac4156d789b78bbc
Remove redundant select parameters
models/hr_complaint.py
models/hr_complaint.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 the G...
Python
0.000002
@@ -1371,21 +1371,8 @@ rue, - select=True, def @@ -4846,21 +4846,8 @@ sed' -, select=True )%0A
0306b2631260c115f99b8a1f73322277e1c50989
Remove fetal anomaly scans from ARPKD
scripts/fixtures/radar_fixtures/cohorts.py
scripts/fixtures/radar_fixtures/cohorts.py
from radar.models.groups import Group, GROUP_TYPE from radar.pages import PAGE from radar_fixtures.utils import add COHORTS = [ { 'code': 'BONEITIS', 'name': 'Bone-itis', 'short_name': 'Bone-itis', 'pages': [ PAGE.PRIMARY_DIAGNOSIS, PAGE.DIAGNOSES, ...
Python
0
@@ -1742,46 +1742,8 @@ DS,%0A - PAGE.FETAL_ANOMALY_SCANS,%0A
db8061ebd89b889c08f2710f851d1086dcacffe2
add comment
models/pypi_project.py
models/pypi_project.py
from app import db from sqlalchemy.dialects.postgresql import JSONB from models.github_api import ZipGetter import requests import re import pickle from pathlib import Path from time import time from util import elapsed class PypiProject(db.Model): project_name = db.Column(db.Text, primary_key=True) owner_name...
Python
0
@@ -2734,16 +2734,25 @@ (cls): +%0A # only n @@ -2796,16 +2796,96 @@ idiness%0A + # checked the result into source control as python_standard_libs.pickle%0A
d6371341c13ffe623755cf89ff03733c111bb994
change to rga2
profile_collection/startup/12-rga.py
profile_collection/startup/12-rga.py
from ophyd import Device, Component as Cpt class RGA(Device): startRGA = Cpt(EpicsSignal, 'Cmd:MID_Start-Cmd') stopRGA = Cpt(EpicsSignal, 'Cmd:ScanAbort-Cmd') mass1 = Cpt(EpicsSignalRO, 'P:MID1-I') mass2 = Cpt(EpicsSignalRO, 'P:MID2-I') mass3 = Cpt(EpicsSignalRO, 'P:MID3-I') mass4 = Cpt(EpicsS...
Python
0.998462
@@ -1,8 +1,84 @@ +### This is RGA:2 configured for ExQ new RGA connected at 10.28.2.142 #####%0A from oph @@ -692,16 +692,17 @@ plan###%0A +%0A %22%22%22%0A @@ -1055,17 +1055,17 @@ 28ID -A +C -VA%7BRGA: 1%7D', @@ -1060,17 +1060,17 @@ -VA%7BRGA: -1 +2 %7D',%0A
99c02cfc36660838e5250e62d1c6f390994dda9b
Attach metadata class instance to class attribute.
pyramid_jsonapi/metadata/__init__.py
pyramid_jsonapi/metadata/__init__.py
"""This package contains metadata 'plugin' modules that provide extra information related to the API being generated, such as documentation, schemas etc. Such plugins can optionally be offered as pyramid routes and views under the 'metadata' endpoint.""" import collections import importlib import os.path import pkgut...
Python
0
@@ -2023,16 +2023,132 @@ lf.api)%0A + # Attach the instance as an attribute named after the class%0A setattr(self, mod_name, mclass)%0A
ec46226b0ae5e9d2c29aa07f2ec6749f96a36804
add str isValidPalindrome
str/string_function.py
str/string_function.py
#!/usr/bin/env python # -*- coding:utf-8 -*- from __future__ import division from __future__ import unicode_literals from __future__ import print_function def reverseStr(input_str, begin, end): # Pythonic way should be input_str[::-1] str_list = list(input_str) while begin < end: str_list[begin], ...
Python
0.999996
@@ -1497,16 +1497,398 @@ result%0A%0A +%0Adef isPalindrome(self, s):%0A start = 0%0A end = len(s) - 1%0A%0A while start %3C end:%0A while not s%5Bstart%5D.isalnum() and start %3C end:%0A start += 1%0A%0A while not s%5Bend%5D.isalnum() and start %3C end:%0A end -= 1%0A%0A ...
95a8a85aab19cad08703ec1adbb42ca1437119b0
Fix gprof2dot not found error
pytest-profiling/pytest_profiling.py
pytest-profiling/pytest_profiling.py
from __future__ import absolute_import import sys import os import cProfile import pstats import pipes import errno from hashlib import md5 import six import pytest LARGE_FILENAME_HASH_LEN = 8 def clean_filename(s): forbidden_chars = set('/?<>\:*|"') return six.text_type("".join(c if c not in forbidden_cha...
Python
0.000002
@@ -714,16 +714,20 @@ if +not os.path.
e7bc550f3631d9fc447fa30cc925e271ad72063e
Rename misnamed test
provider/tests/test_provider.py
provider/tests/test_provider.py
import pytest from provider.provider import Provider, Item from provider.exceptions import UnknownArgumentException from . import fixture @pytest.fixture def provider(): return Provider() def test_provider_register_callable(provider): def abc(): pass provider.register(abc, name='fixture') ...
Python
0.000004
@@ -3870,22 +3870,16 @@ ef test_ -apply_ unsatisf
72171897071bf4b88013b74a13e45231fbc8d7ff
Remove feedback from response serializer.
studies/serializers.py
studies/serializers.py
from accounts.models import Child, DemographicData, Organization, User from api.serializers import (ModelSerializer, UUIDResourceRelatedField, UUIDSerializerMixin) from rest_framework_json_api import serializers from studies.models import Response, Study, Feedback class StudySerializer(UU...
Python
0
@@ -2502,257 +2502,8 @@ )%0A%0A - feedback = UUIDResourceRelatedField(%0A queryset=Feedback.objects,%0A many=True,%0A related_link_view_name='response-feedback-list',%0A related_link_url_kwarg='response_uuid',%0A related_link_lookup_field='uuid',%0A )%0A%0A @@ -3624,32 +...
c128355193d3f0339e24ee70f685d31dbf5b6bb9
Add stub for search()
sudoku/puzzlesolver.py
sudoku/puzzlesolver.py
""" puzzlesolver.py :created on: 20160624 __author__ = 'Frederic Dupont' :License: GPL3 """ __author__ = 'Fred Dupont' import sys from sudoku import puzzleconstants as p_const from sudoku.puzzle import Puzzle, make_grid_from_string class PuzzleSolver(object): """ class that solves a sudoku puzzle tak...
Python
0
@@ -3630,32 +3630,325 @@ return True%0A%0A + def search(self):%0A %22%22%22%0A clones the puzzle%0A creates a new solver%0A assigns the next candidate value to the empty square with the less candidates%0A recursively calls solve() on the new puzzle%0A :return: a solved p...
7874cb87583e32d5597d0c9884e89408997ce9a1
Fix missing self in geomaps
geomaps.py
geomaps.py
""" Cyril Robin -- LAAS-CNRS -- 2014 TODO Descriptif """ import gdal import random import bisect import operator as operator import numpy as np from math import sqrt VERBOSE = False def accumulate(iterable, func=operator.add): 'Return running totals (itertools.accumulate() in Python2)' # accumulate([1,2,3,...
Python
0.009318
@@ -2907,16 +2907,21 @@ p = +self. point_pi @@ -3108,16 +3108,22 @@ pix2idx( +self, x, y):%0A
4c55c5f52ba719702accacef387f23bbb4048734
normalize command dispatch to a single function
git-sap.py
git-sap.py
#!/usr/bin/python import git import gitsap import optparse import os def usage(message, *args): print message % args exit(1) def open_repo(): try: return git.Repo() except git.exc.InvalidGitRepositoryError: usage("Must be inside a git repository") def open_config(repo): config_path = os.path.join(...
Python
0.000018
@@ -986,26 +986,21 @@ ))%0A%0Adef -get_ split -s (split_c @@ -1015,22 +1015,36 @@ ames +, verbose ):%0A +for split -s = + in ( spli @@ -1058,18 +1058,22 @@ g.splits -%0A +%5Bname%5D for nam @@ -1081,20 +1081,16 @@ in -set( names):%0A @@ -1089,83 +1089,8 @@ s):%0A - yield splits%5Bname%5D%0...
df56f113b35b011382930ceea0453e46adc8acb2
Update the cookies dict, do not replace it
eduxator/io.py
eduxator/io.py
import re import os from lxml import etree import requests COOKIE = '~/.edux.cookie' EDUX = 'https://edux.fit.cvut.cz/' COURSES = 'courses/' CLASSIFICATION = '/classification/view/' EDIT = '?do=edit' class EduxIO: '''Class providing the interface for reading and writing Edux classification''' def __init_...
Python
0
@@ -1524,19 +1524,24 @@ .cookies - = +.update( r.cookie @@ -1552,16 +1552,17 @@ t_dict() +) %0A%0A
39bf1b019897b71a3269e46816f11eefa32de507
Fix argument order
elm_package.py
elm_package.py
#! /usr/bin/env python """ Load and save elm-package.json safely. """ # from typing import Dict, Tuple, IO import copy from collections import OrderedDict import json def load(fileobj): # type: (IO[str]) -> Dict return json.load(fileobj, object_pairs_hook=OrderedDict) def dump(package, fileobj): # type...
Python
0.002367
@@ -1280,32 +1280,38 @@ %7D from version %7B +other_ package_version%7D @@ -1315,22 +1315,16 @@ on%7D to %7B -other_ package_
9f5e93ec317f79f6428d25b2ed3980074590b12d
Disable project commands when missing config
elm_project.py
elm_project.py
import sublime import sublime_plugin import json import os.path as fs PROJECT_NOT_FOUND_MSG = 'Valid elm-package.json NOT found for updating' PROJECT_UPDATED_MSG = 'elm-package.json updated : {0} = {1}' class ElmProjectCommand(sublime_plugin.TextCommand): def run(self, edit, prop_name=None, choices=None, caption...
Python
0.000002
@@ -325,166 +325,8 @@ e):%0A - self.project = ElmProject(self.view.file_name())%0A if not self.project.exists:%0A return sublime.status_message(PROJECT_NOT_FOUND_MSG)%0A @@ -1060,16 +1060,135 @@ index)%0A%0A + def is_enabled(self):%0A self.project = ElmProject(self.view.file_n...
c4670a1b6eb1bbd546369be185cd1fb69dfa3ec0
fix race condition that would drop certain messages on the floor.
emailparser.py
emailparser.py
#!/usr/bin/python import imaplib, time, email.utils, email.parser, calendar import re class EmailParser: def __init__(self, server, username, password, port=None, use_ssl=False, last_check=time.time()): self.server = server if not port: if use_ssl: self.port = 993 else: sel...
Python
0
@@ -1794,26 +1794,44 @@ -if +response, %5Bnmesgs%5D = self.imap.s @@ -1849,19 +1849,40 @@ r, True) -%5B0%5D +%0A if response == %22NO%22 @@ -2566,25 +2566,73 @@ -%0A +uid_text = self.imap.fetch(nmesgs, %22UID%22)%5B1%5D%5B0%5D%0A self.set @@ -2623,33 +2623,32 @@ ...
e33f4bf8aab41a3bcb564e582c64e2d5e1986187
Fix name/username match
modules/sfp_myspace.py
modules/sfp_myspace.py
#------------------------------------------------------------------------------- # Name: sfp_myspace # Purpose: Query MySpace for username and location information. # # Author: Brendan Coles <bcoles@gmail.com> # # Created: 2018-10-07 # Copyright: (c) Brendan Coles 2018 # Licence: GPL #------...
Python
0.033851
@@ -1879,32 +1879,249 @@ return None%0A%0A + # Extract HTML containing potential profile matches%0A profiles = re.findall(r'%3Ca href=%22/%5Ba-zA-Z0-9_%5D+%22%3E%5B%5E%3C%5D+%3C/a%3E%3C/h6%3E', res%5B'content'%5D)%0A%0A if not profiles:%0A return None%0A%0A ...
552a9e958443ffdff4b28e6e432c09e7d011df6a
Update tesselate_shapes_frame docstring
svg_model/tesselate.py
svg_model/tesselate.py
# coding: utf-8 import types import pandas as pd from .seidel import Triangulator def tesselate_shapes_frame(df_shapes, shape_i_columns): ''' Tesselate each shape path into one or more triangles. Return `pandas.DataFrame` with columns storing the following fields for each row (where each row corresp...
Python
0
@@ -209,94 +209,468 @@ -Return %60pandas.DataFrame%60 with columns storing the following fields%0A for each row ( +Parameters%0A ----------%0A df_shapes : pandas.DataFrame%0A Table containing vertices of shapes, one row per vertex, with the *at%0A least* the following columns:%0A - ...
9a744080454cd2577af0935ca9e8b5efccabeb8c
Fix typo hexify -> hexlify
stratatools/helper/rpi_daemon.py
stratatools/helper/rpi_daemon.py
#!/usr/bin/env python2 import argparse import binascii import pyudev import sys import time import traceback from stratatools import * from stratatools import machine,cartridge,manager,crypto,checksum,cartridge_pb2 from google.protobuf.text_format import MessageToString, Merge cartridge_manager = None machine_number...
Python
0.000336
@@ -769,16 +769,17 @@ scii.hex +l ify(eepr
dfee7e1c89df879f187921752485153fd6214445
Fix typo
IPython/extensions/cythonmagic.py
IPython/extensions/cythonmagic.py
# -*- coding: utf-8 -*- """ The cython magic has been integrated into Cython itself, which is now released in version 0.21. cf github `Cython` organisation, `Cython` repo, under the file `Cython/Build/IpythonMagic.py` """ #----------------------------------------------------------------------------- # Copyright (C) ...
Python
0.000073
@@ -981,16 +981,17 @@ een move +d to the @@ -1069,17 +1069,17 @@ ecated; -P +p lease us
9f56f877705bdc0171c3afddadc6d58fb867cefc
Fix PEP 8 issue.
test/units/modules/system/test_systemd.py
test/units/modules/system/test_systemd.py
import os import tempfile from ansible.compat.tests import unittest from ansible.modules.system.systemd import parse_systemctl_show class ParseSystemctlShowTestCase(unittest.TestCase): def test_simple(self): lines = [ 'Type=simple', 'Restart=no', 'Requires=system.slic...
Python
0
@@ -1202,16 +1202,44 @@ ho foo%5Cn +'%0A ' bar ; ig
40f1374cab0f8188036993875ce82512828f177d
allow 0 offset
testbeam_analysis/tools/data_selection.py
testbeam_analysis/tools/data_selection.py
''' Helper functions to select and combine data ''' import numpy as np import tables as tb import numexpr as ne import re import logging import progressbar from numba import njit from testbeam_analysis.tools import analysis_utils # Hit data dtype hit_dcr = np.dtype([('event_number', np.int64), ('frame', np.uint8), ...
Python
0.000393
@@ -1782,16 +1782,28 @@ s%5Bindex%5D + is not None :%0A
2150ced1552c0d8cfcb537962fb19159b0480767
improve plugin error messages
imgfac/PluginManager.py
imgfac/PluginManager.py
# encoding: utf-8 # Copyright 2012 Red Hat, 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 applica...
Python
0.000008
@@ -5512,16 +5512,157 @@ rget%5D))%0A + if not plugin_name:%0A raise ImageFactoryException(%22No plugin .info file loaded for target: %25s%22 %25 (target))%0A @@ -6395,18 +6395,57 @@ ortError + as e :%0A + self.log.exception(e)%0A @@ -6491,12 +6491,14 ...
9bdb3a5e6e2f241a39269d992f1ca5c9f37440ae
add wlm source
importer/SeFornminSv.py
importer/SeFornminSv.py
from Monument import Monument import importer_utils as utils from os import path MAPPING_DIR = "mappings" class SeFornminSv(Monument): def update_labels(self): if len(self.namn) == 0: self.add_label("sv", self.raa_nr) else: self.add_label("sv", self.namn) def set_de...
Python
0
@@ -742,32 +742,62 @@ ism%0A %22%22%22%0A + ref = self.wlm_source%0A self.add @@ -840,27 +840,11 @@ fs=%5B -self.registrant_url +ref %5D)%0A%0A @@ -1289,24 +1289,58 @@ pattern%5D%5B0%5D%0A + ref = self.wlm_source%0A @@ -1385,16 +1385,28 @@ cipality +, refs=%5Bref%5D ...
a5c34443353cc9dcfed4b567a240eb22c02d6496
Use correct add method
core/src/main/scripts/cbioportalImporter.py
core/src/main/scripts/cbioportalImporter.py
#! /usr/bin/env python # ------------------------------------------------------------------------------ # Script which imports portal data. # # ------------------------------------------------------------------------------ import os import sys import getopt from cbioportal_common import * # -------------------------...
Python
0.000065
@@ -4131,17 +4131,20 @@ afiles.a -d +ppen d(f)%0A%0A
ce1e52336fa298d52aac264d8ccd3887fc8e18e4
Bump binaryen to version 81.
src/funfuzz/js/with_binaryen.py
src/funfuzz/js/with_binaryen.py
# coding=utf-8 # # 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 https://mozilla.org/MPL/2.0/. """Run seeds with binaryen to get a wasm file, then run the shell with the translated wasm binary usin...
Python
0
@@ -559,10 +559,10 @@ N = -72 +81 %0ABIN
52c6efa0a84334522cdd76e1e85ffe6bf601ea02
Annotate commands/export_single_user.py.
zerver/management/commands/export_single_user.py
zerver/management/commands/export_single_user.py
from __future__ import absolute_import from __future__ import print_function from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ValidationError import os import shutil import subprocess import tempfile import ujson from zerver.lib.export import do_export_user from ze...
Python
0
@@ -67,24 +67,84 @@ t_function%0A%0A +from typing import Any%0A%0Afrom argparse import ArgumentParser%0A from django. @@ -803,24 +803,65 @@ f, parser):%0A + # type: (ArgumentParser) -%3E None%0A pars @@ -1261,16 +1261,54 @@ tions):%0A + # type: (*Any, **Any) -%3E None%0A
2a2309bb4f3a8ae231106123855959d44a0e7551
Fix linter
cartoframes/viz/helpers/size_continuous_layer.py
cartoframes/viz/helpers/size_continuous_layer.py
from __future__ import absolute_import from ..layer import Layer def size_continuous_layer(source, value, title='', size=None, color=None): return Layer( source, style={ 'point': { 'width': 'ramp(linear(sqrt(${0}), sqrt(globalMin(${0})), sqrt(globalMax(${0}))), {1})'.f...
Python
0.000002
@@ -311,32 +311,53 @@ ), %7B1%7D)'.format( +%0A value, size or %5B
c426ae514227adaf9dd86f6ada6ce05bc76298c2
Make portal_config fetch config from a URL
catkin/src/portal_config/scripts/serve_config.py
catkin/src/portal_config/scripts/serve_config.py
#!/usr/bin/env python import rospy from portal_config.srv import * class ConfigRequestHandler(): def __init__(self, url): self.url = url def get_config(self): return '{"foo": "bar"}' def handle_request(self, request): config = self.get_config() return PortalConfigRespons...
Python
0.000002
@@ -29,16 +29,31 @@ t rospy%0A +import urllib2%0A from por @@ -77,16 +77,80 @@ port *%0A%0A +# XXX TODO: return an error if the config file isn't valid JSON%0A %0Aclass C @@ -265,29 +265,73 @@ re -turn '%7B%22foo%22: %22bar%22%7D' +sponse = urllib2.urlopen(self.url)%0A return response.read() %0A%0A @@ ...
3023600701d64da42534fdc0050c473450e9e5f7
Bump the dart version used on the infra bots to 1.14.1
infra/download_dart_sdk.py
infra/download_dart_sdk.py
#!/usr/bin/python # Copyright 2015 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. """Pulls down the current dart sdk to third_party/dart-sdk/. You can manually force this to run again by removing third_party/dart-sdk/STA...
Python
0
@@ -742,11 +742,11 @@ '1.1 -3.0 +4.1 /sdk
cb96065fcf1f31dfbecfbb064c9414ffbc69217f
Remove all relative imports. We have always been at war with relative imports.
forms.py
forms.py
""" GB-specific Form helpers """ import re from django.forms.fields import CharField, Select from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ class GBPostcodeField(CharField): """ A form field that validates its input is a UK postcode. The regular expressi...
Python
0.002027
@@ -31,18 +31,149 @@ %22%22%0A%0A -import re%0A +from __future__ import absolute_import%0A%0Aimport re%0A%0Afrom django.contrib.localflavor.gb.gb_regions import GB_NATIONS_CHOICES, GB_REGION_CHOICES %0Afro @@ -317,16 +317,17 @@ y as _%0A%0A +%0A class GB @@ -1664,57 +1664,8 @@ e):%0A - from gb_regions impor...
c78c6f7e9cc305b96eb35a5a0c8f7353db5a3ed2
Update _share.py
tago/account/_share.py
tago/account/_share.py
import requests # Used to make HTTP requests import os import json API_TAGO = os.environ.get('TAGO_SERVER') or 'https://api.tago.io' def invite(type, ref_id, data, default_options): data = data if data else {} if ref_id is None or ref_id == '': raise ValueError('ref_id must be set') elif data['ema...
Python
0
@@ -1477,35 +1477,4 @@ n()%0A -%0A# Not sure what exports do...%0A
f2a2f6268e11086ece3c311dd3e93e11672de03b
Comment addition.
Lib/distutils/command/build_py.py
Lib/distutils/command/build_py.py
"""distutils.command.build_py Implements the Distutils 'build_py' command.""" # created 1999/03/08, Greg Ward __rcsid__ = "$Id$" import string, os from distutils.core import Command from distutils.errors import * from distutils.util import mkpath, newer, make_file, copy_file class BuildPy (Command): options ...
Python
0
@@ -639,16 +639,205 @@ 'dir'))%0A + # 'package' is an alias option in Distribution (hmmm, we%0A # really should change to %22pull%22 options from Distribution%0A # rather than %22pushing%22 them out to commands...)%0A
929fbcf6b41feb620c2ddb713b0b239bd01be0f2
Simplify status code check
technic/solder/base.py
technic/solder/base.py
import hashlib import json import os import os.path import requests import requests.exceptions import shutil import zipfile # Provide Python 2 and Python 3 support try: import urlparse except ImportError: # pylint: disable=import-error, no-member, no-name-in-module import urllib.parse urlparse = urllib.parse # py...
Python
0.000004
@@ -2952,24 +2952,54 @@ thod, url)%0A%0A +%09%09# pylint: disable=no-member%0A %09%09if not res @@ -3019,11 +3019,25 @@ == -200 +requests.codes.OK :%0A%09%09 @@ -3111,16 +3111,45 @@ s_code)) +%0A%09%09# pylint: enable=no-member %0A%0A%09%09json
bbae716c79307bd477925fc1fe9cdc9df7c1884c
Replace self.nodes[0].p2p with conn
test/functional/p2p_feefilter.py
test/functional/p2p_feefilter.py
#!/usr/bin/env python3 # Copyright (c) 2016-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 processing of feefilter messages.""" from decimal import Decimal import time from test_framework...
Python
0.001081
@@ -1850,32 +1850,39 @@ odes%5B0%5D%0A%0A + conn = self.nodes%5B0%5D.a @@ -2187,52 +2187,26 @@ ds, -self.nodes%5B0%5D.p2p)%0A self.nodes%5B0%5D.p2p +conn)%0A conn .cle @@ -2282,33 +2282,20 @@ -self.nodes%5B0%5D.p2p +conn .send_an @@ -2579,52 +2579,26 @@ ds, -self.nodes%5B0%5D.p2p...
3575415592fbd215de02e139d95ad5780bccadd2
Add greeting method that returns given parameter
hello.py
hello.py
print("Hello")
Python
0.000146
@@ -1,15 +1,85 @@ -print(%22H +%0Adef greeting(msg):%0A print(msg)%0A%0Aif __name__ == %22__main__%22:%0A greeting('h ello -%22 +' )%0A
fe004672d79f74b939e812985639924d605d45c9
Clear Site cache upon SiteConfiguration change.
ecommerce/core/models.py
ecommerce/core/models.py
import logging from analytics import Client as SegmentClient from django.conf import settings from django.contrib.auth.models import AbstractUser from django.core.exceptions import ValidationError from django.db import models from django.utils.functional import cached_property from django.utils.translation import uget...
Python
0
@@ -140,16 +140,61 @@ actUser%0A +from django.contrib.sites.models import Site%0A from dja @@ -5363,16 +5363,208 @@ DEBUG)%0A%0A + def save(self, *args, **kwargs):%0A # Clear Site cache upon SiteConfiguration changed%0A Site.objects.clear_cache()%0A super(SiteConfiguration, self).save(*args, ...
f2e8f2ef957a6053345f72889c1048a871988bc0
Add octario library path to the plugin helper
ir-plugin/osp_version_name.py
ir-plugin/osp_version_name.py
#!/usr/bin/env python # Copyright 2017 Red Hat, 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 # ...
Python
0.000002
@@ -667,16 +667,46 @@ port sys +%0Asys.path.append('../octario') %0A%0Afrom o
6565c4852c2a26f385cf9a422a914ee110b25b4b
Remove cruft from activity_WorkflowConflictCheck.py
activity/activity_WorkflowConflictCheck.py
activity/activity_WorkflowConflictCheck.py
import boto.swf import json import random import datetime import calendar import time import activity import boto.ses import provider.swfmeta as swfmetalib """ WorkflowConflictCheck activity """ class activity_WorkflowConflictCheck(activity.activity): def __init__(self, settings, logger, conn = None, token = ...
Python
0
@@ -1885,2147 +1885,4 @@ one%0A -%0A def get_email_body(self, time_period, history_text):%0A %22%22%22%0A Format the body of the email%0A %22%22%22%0A %0A body = %22%22%0A %0A date_format = '%25Y-%25m-%25dT%25H:%25M:%25S.000Z'%0A datetime_string = time.strftime(date_format, time.gmtime())%0A ...
5a5418a9e5f817c3c3f426f57aeefe800c45cc96
Implement tuples.
jaspyx/visitor/types.py
jaspyx/visitor/types.py
import json from jaspyx.visitor import BaseVisitor class Types(BaseVisitor): def visit_Num(self, node): self.output(json.dumps(node.n)) def visit_Str(self, node): self.output(json.dumps(node.s)) def visit_List(self, node): self.group(node.elts, prefix='[', infix=', ', suffix=']')...
Python
0.000004
@@ -314,8 +314,38 @@ ix='%5D')%0A +%0A visit_Tuple = visit_List%0A
c902c135a2e3e7d91d2a57cfa67df1a083f048c6
Add name attribute to linters
jenkins_job_linter/linters.py
jenkins_job_linter/linters.py
# Copyright (C) 2017 Daniel Watkins <daniel@daniel-watkins.co.uk> # # 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 app...
Python
0.000001
@@ -2071,24 +2071,179 @@ a: nocover%0A%0A + @property%0A def name(self) -%3E str:%0A %22%22%22Name for this linter (used in configuration).%22%22%22%0A raise NotImplementedError # pragma: nocover%0A%0A %0Aclass Ensur @@ -2373,16 +2373,47 @@ stamps'%0A + name = 'ensure_timestamps'%0A _xpa...
5cda63163acec59a43c3975f1320b7268dcf337b
Add parameter for log level
devito/parameters.py
devito/parameters.py
"""The parameters dictionary contains global parameter settings.""" __all__ = ['Parameters', 'parameters'] # Be EXTREMELY careful when writing to a Parameters dictionary # Read here for reference: http://wiki.c2.com/?GlobalVariablesAreBad # If any issues related to global state arise, the following class should # be ...
Python
0.000001
@@ -234,16 +234,109 @@ sAreBad%0A +# https://softwareengineering.stackexchange.com/questions/148108/why-is-global-state-so-evil%0A # If any @@ -1605,20 +1605,80 @@ f(key, value)%0A +%0Aparameters = Parameters()%0Aparameters%5B%22log_level%22%5D = 'info'%0A
57fcbfc8b93dca8ffe2e27fd1004e4ee0b396a65
Add 256 token setting to forgotten test in 18f2f684e82c0e807a80
disk_balance_test.py
disk_balance_test.py
import os import os.path from assertions import assert_almost_equal from dtest import DISABLE_VNODES, Tester from jmxutils import JolokiaAgent, make_mbean, remove_perf_disable_shared_mem from tools import create_c1c2_table, insert_c1c2, new_node, query_c1c2, since @since('3.2') class TestDiskBalance(Tester): """...
Python
0.000001
@@ -550,32 +550,137 @@ : 'keyspace1'%7D)%0A + if not DISABLE_VNODES:%0A cluster.set_configuration_options(values=%7B'num_tokens': 256%7D)%0A cluster.
87e1e998c155731c44ca6e9cf1f97831d09f18a0
Make 46elks Alerter Python 3 flavoured
Alerters/fortysixelks.py
Alerters/fortysixelks.py
try: import requests requests_available = True except: requests_available = False from alerter import Alerter class FortySixElksAlerter(Alerter): """Send SMS alerts using the 46elks SMS service. Account required, see https://www.46elks.com/""" def __init__(self, config_options): if ...
Python
0.998421
@@ -93,16 +93,17 @@ e%0A%0Afrom +. alerter @@ -355,17 +355,17 @@ print - +( %22Request @@ -424,16 +424,17 @@ lerter.%22 +) %0A @@ -443,17 +443,17 @@ print - +( %22Try: pi @@ -482,16 +482,17 @@ nts.txt%22 +) %0A @@ -1179,17 +1179,17 @@ print - +( %22warning @@ -1229,16 +1229,17 @@...
8555fc56b72dc86f266055da4b903cda7986654b
Update utils.py to prevent downcasting
emdp/utils.py
emdp/utils.py
import numpy as np # 1D utilities. def convert_int_rep_to_onehot(state, vector_size): s = np.zeros(vector_size) s[state] = 1 return s def convert_onehot_to_int(state): if type(state) is not np.ndarray: state = np.array(state) return state.argmax().astype(np.int8) # # def xy_to_flatten_stat...
Python
0
@@ -275,22 +275,13 @@ x(). -astype(np.int8 +item( )%0A#%0A
76aa0d680f85298ca66de7bbcd0dbdc2342c9955
Update Vikidia versions
pywikibot/families/vikidia_family.py
pywikibot/families/vikidia_family.py
# -*- coding: utf-8 -*- """Family module for Vikidia.""" from __future__ import absolute_import, unicode_literals __version__ = '$Id$' from pywikibot import family class Family(family.SubdomainFamily): """Family class for Vikidia.""" name = 'vikidia' domain = 'vikidia.org' codes = ['ca', 'en', '...
Python
0
@@ -305,16 +305,22 @@ = %5B'ca', + 'de', 'en', ' @@ -356,16 +356,114 @@ 'scn'%5D%0A%0A + # Sites we want to edit but not count as real languages%0A test_codes = %5B'central', 'test'%5D%0A%0A def
5d3b2a794cee8f440209636359dc00cff3180bb9
Use comment style variable annotations for python 3.5 support.
aerospike_helpers/expressions/resources.py
aerospike_helpers/expressions/resources.py
''' Resources used by all expressions. ''' from itertools import chain from typing import List, Optional, Tuple, Union, Dict, Any import aerospike from aerospike_helpers import cdt_ctx class _Keys: VALUE_TYPE_KEY = "value_type" BIN_KEY = "bin" RETURN_TYPE_KEY = "return_type" CTX_KEY = "ctx" VALUE...
Python
0
@@ -2152,25 +2152,54 @@ _op -: int = 0%0A _rt + = 0%0A # type: int%0A _rt = None%0A # type : Ty @@ -2210,16 +2210,27 @@ sultType +%0A _fixed = None%0A @@ -2233,22 +2233,22 @@ one%0A -_fixed +# type : TypeFi @@ -2246,31 +2246,24 @@ e: TypeFixed - = None %0A _childr @@ -2264,16 +2264,32 @@...
f1c4b6c9a4bc5a34c6b63b0b96e170f7d2b7fa17
Move comment for min_conflicts algorithm
ai_graph_color/algorithms/min_conflicts.py
ai_graph_color/algorithms/min_conflicts.py
""" Color a graph using min-conflicts: First generate a random coloring for the graph. Until there are no conflicts in the graph, choose a random node in the graph, and change it to have the color which reduces the number of conflicts in the graph the most. :param colors: the number of colors to color the gra...
Python
0
@@ -1,12 +1,80 @@ -%22%22%22%0A +import random%0A%0Aparams = %7B%7D%0A%0A%0Adef run(graph, setup, params):%0A %22%22%22%0A Color a @@ -101,16 +101,20 @@ licts:%0A%0A + First ge @@ -153,16 +153,20 @@ graph.%0A + Until th @@ -204,16 +204,20 @@ ph,%0A + + choose a @@ -279,16 +279,20 @@ lor...
7f14a3a1babf102a090a7541038e88337ef14c46
Remove unused import from test
tests/functional/test_customer_account.py
tests/functional/test_customer_account.py
from django.core.urlresolvers import reverse from oscar.test.testcases import WebTestCase from oscar.test.factories import create_order from oscar_support.models import Ticket from oscar_support.defaults import SUPPORT_INITIAL_STATUS from tests import factories class TestACustomer(WebTestCase): is_anonymous = ...
Python
0
@@ -87,54 +87,8 @@ Case -%0Afrom oscar.test.factories import create_order %0A%0Afr
df6d39ba6de91c9c67322395a14dffd613507493
print more
shcmd/proc.py
shcmd/proc.py
# -*- coding: utf8 -*- import contextlib import io import logging import subprocess import threading import time from .errors import ShCmdError logger = logging.getLogger(__name__) LINE_CHUNK_SIZE = 1024 def kill_proc(proc, cmd, started_at): """kill proc if started returns True if proc is killed actually...
Python
0.000003
@@ -4603,32 +4603,94 @@ ead(chunk_size)%0A + print(%22chunk is %7B0%7D%22.format(repr(chunk)))%0A @@ -5024,32 +5024,104 @@ yield chunk%0A + print(%22end block chunk is %7B0%7D%22.format(repr(chunk)))%0A
abfd8fbd858e79793988c6b29941e3af81085e3a
Fix test_get_zonecode
tests/integration/modules/mac_timezone.py
tests/integration/modules/mac_timezone.py
# -*- coding: utf-8 -*- ''' Integration tests for mac_timezone ''' # Import python libs from __future__ import absolute_import from datetime import datetime # Import Salt Testing libs from salttesting.helpers import ensure_in_syspath, destructiveTest ensure_in_syspath('../../') # Import salt libs import integration ...
Python
0.00007
@@ -125,22 +125,8 @@ ort%0A -from datetime impo @@ -4137,38 +4137,38 @@ %5B'America/ -Denver +Panama '%5D))%0A sel @@ -4230,9 +4230,9 @@ '-0 -6 +5 00') @@ -4658,30 +4658,30 @@ %5B'America/ -Denver +Panama '%5D))%0A
213c400c033c83412127c4988e502e8248bb4b57
Fix timezone test
tests/integration/modules/mac_timezone.py
tests/integration/modules/mac_timezone.py
# -*- coding: utf-8 -*- ''' Integration tests for mac_timezone ''' # Import python libs from __future__ import absolute_import from datetime import datetime # Import Salt Testing libs from salttesting.helpers import ensure_in_syspath ensure_in_syspath('../../') # Import salt libs import integration import salt.utils...
Python
0.004105
@@ -3490,35 +3490,35 @@ %5C'timezone.set_ -tim +zon e%5C': '%0A
35e45049e269b46940a812c2f70cafb90439e0d8
use a ruby gem that doesn't have dependencies
tests/integration/modules/gem.py
tests/integration/modules/gem.py
# -*- coding: utf-8 -*- ''' Integration tests for Ruby Gem module ''' # Import Python libs from __future__ import absolute_import # Import Salt Testing libs from salttesting import skipIf from salttesting.helpers import ensure_in_syspath, destructiveTest ensure_in_syspath('../../') # Import salt libs import integrat...
Python
0.000001
@@ -401,20 +401,21 @@ _GEM = ' -test +brass '%0AOLD_VE @@ -427,11 +427,11 @@ = ' -0.2 +1.0 .0'%0A @@ -447,19 +447,19 @@ ON = '1. -0.0 +2.1 '%0AGEM_LI
5138db4353edf7414c79ca8e1e42c73b35313b15
Remove various now unused interfaces.
morepath/interfaces.py
morepath/interfaces.py
# -*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod class Interface(object): __meta__ = ABCMeta class IConsumer(Interface): """A consumer consumes steps in a stack to find an object. """ @abstractmethod def __call__(self, obj, stack, lookup): """Returns a boolean meaning that...
Python
0
@@ -108,16 +108,18 @@ CMeta%0A%0A%0A +# class IC @@ -130,32 +130,34 @@ mer(Interface):%0A +# %22%22%22A consume @@ -203,16 +203,18 @@ object.%0A +# %22%22%22%0A @@ -206,32 +206,34 @@ ect.%0A# %22%22%22%0A%0A +# @abstractmet @@ -228,32 +228,34 @@ @abstractmethod%0A +# def __call__ @@ -...
d7f17d7d8592f016d8c46ac530338e11b366896d
make randomizer standalone
mpf/core/randomizer.py
mpf/core/randomizer.py
from uuid import uuid4 import random class Randomizer(object): def __init__(self, machine, items, memory='player'): self.force_different = True self.force_all = False self.disable_random = False # self.loop - property which sets force_all=True if loop==False self.items = ...
Python
0.000029
@@ -86,39 +86,13 @@ lf, -machine, items, memory='player' +items ):%0A%0A @@ -338,24 +338,17 @@ elf. -_machine = machi +data = No ne%0A @@ -378,69 +378,8 @@ d4() -%0A self._data = None%0A self._player_memory = True %0A%0A @@ -488,29 +488,35 @@ if -hasattr(i, '__iter__' +isinstance(i, (tuple, l...
e58686442750afeae70dd3f669070c1342af0bbe
Fix error in qrepeatall()
ControlFlow.py
ControlFlow.py
from BlockLabel import label, endlabel from functools import wraps ## QGL control-flow statements ## def qif(mask, ifSeq, elseSeq=None): if elseSeq: endlabel(elseSeq) # make sure to populate label of elseSeq before using it return [CmpEq(mask), Goto(label(ifSeq))] + elseSeq + [Goto(endlabel(ifSeq))] + ifSeq el...
Python
0.000009
@@ -1146,16 +1146,19 @@ qrepeat( +n, seqs%5Bct%5D @@ -1158,16 +1158,29 @@ eqs%5Bct%5D) +%0A%09return seqs %0A%0A## Seq
44847ab2843167352a599e7f8bf468c1c0037541
fix crash with EOS switch
mpf/devices/flipper.py
mpf/devices/flipper.py
""" Contains the base class for flippers.""" from mpf.devices.driver import ReconfiguredDriver from mpf.core.system_wide_device import SystemWideDevice class Flipper(SystemWideDevice): """Represents a flipper in a pinball machine. Subclass of Device. Contains several methods for actions that can be performe...
Python
0
@@ -5524,16 +5524,21 @@ switch'%5D +.name ,%0A
70ecc48e9fb4d936d9c72d89ccbeec51f42b5252
fix get master ip
docker/k8s_tools.py
docker/k8s_tools.py
#!/bin/env python import os import sys import time import socket from kubernetes import client, config PADDLE_JOB_NAME = os.getenv("PADDLE_JOB_NAME") NAMESPACE = os.getenv("NAMESPACE") PORT = os.getenv("PSERVER_PORT") if os.getenv("KUBERNETES_SERVICE_HOST", None): config.load_incluster_config() else: config.loa...
Python
0
@@ -1095,18 +1095,17 @@ eep for -10 +5 seconds @@ -1132,10 +1132,9 @@ eep( -10 +5 )%0A%0A%0A @@ -1370,24 +1370,44 @@ aster_ip():%0A + while True:%0A label_se @@ -1452,32 +1452,36 @@ LE_JOB_NAME%0A + + pod_list = fetch @@ -1503,24 +1503,28 @@ l_selector)%0A + master_i @@ -1530,16 +...
a0791372d7943a785ae55ed31044d0316b53a2ac
Patch release
elephantblog/__init__.py
elephantblog/__init__.py
from __future__ import absolute_import, unicode_literals VERSION = (1, 0, 0) __version__ = '.'.join(map(str, VERSION))
Python
0.000001
@@ -68,17 +68,17 @@ (1, 0, -0 +1 )%0A__vers
34a6ccce1d93843d53efb5985ff5bbb7ea063e31
add force_text a la Django
babel/_compat.py
babel/_compat.py
import sys import array PY2 = sys.version_info[0] == 2 _identity = lambda x: x if not PY2: text_type = str string_types = (str,) integer_types = (int, ) unichr = chr text_to_native = lambda s, enc: s iterkeys = lambda d: iter(d.keys()) itervalues = lambda d: iter(d.values()) iterit...
Python
0.00049
@@ -108,16 +108,40 @@ e = str%0A + binary_type = bytes%0A stri @@ -158,16 +158,16 @@ (str,)%0A - inte @@ -189,25 +189,8 @@ t, ) -%0A unichr = chr %0A%0A @@ -224,16 +224,33 @@ , enc: s +%0A unichr = chr %0A%0A it @@ -593,16 +593,38 @@ unicode%0A + binary_type = str%0A stri @@ -112...
b65b359402b2f38dad043b1b6d1840f0ef6d8e72
Fix constants
openprocurement/auctions/dgf/constants.py
openprocurement/auctions/dgf/constants.py
from datetime import datetime, timedelta from openprocurement.api.models import TZ, ORA_CODES def read_json(name): import os.path from json import loads curr_dir = os.path.dirname(os.path.realpath(__file__)) file_path = os.path.join(curr_dir, name) with open(file_path) as lang_file: data =...
Python
0.000021
@@ -1130,14 +1130,12 @@ 18, -01, 22 +2, 9 , tz
fbefb3b9d0273e02f5f8f2c708d9c76b57127df0
add provean_read
nsdm/fileparse.py
nsdm/fileparse.py
# -*- coding: utf-8 -*- import vcf import re import glob import os.path import hashlib param = re.compile("LOW|MODIFIER") class Vcf: def __init__(self, data): # 'CHROM', 'POS', 'ID', 'REF', 'ALT', # 'QUAL', 'FILTER', 'INFO', 'FORMAT', # 'start', 'end', 'alleles', 'samples', # '_sa...
Python
0
@@ -2220,24 +2220,572 @@ reference%0A%0A%0A +def provean_read(filename):%0A f = open(filename, %22r%22)%0A gene = %22%22%0A result = dict()%0A p1 = re.compile(%22%5E# Query%22)%0A p2 = re.compile(%22%5E#%7C%5E%5C%5B%22)%0A for i in f:%0A i = i.strip()%0A if re.match(p1, i) is not None:%...
8a110323a41635597f8891aa04c51d7784aa0195
Remove commented-out code.
multi_schema/models.py
multi_schema/models.py
from django.conf import settings from django.contrib import auth from django.db import models, connection, transaction from django.utils.translation import ugettext as _ from django.core.validators import RegexValidator from django.forms import ValidationError from model_utils.managers import PassThroughManager from m...
Python
0
@@ -4627,590 +4627,4 @@ __%22) -%0A%0A# class UserSchema(models.Model):%0A# %22%22%22%0A# A relationship between a User and a Schema. A User may be able to%0A# access the data from many schemata, and in that case should be%0A# provided with tools to do so.%0A# %0A# See templates/multi_schema/ch...
2fb1c14f9ad0b72f1f059d7e5e233b8001c2b60b
Update auth tests
app/tests/integration/test_twitter_api.py
app/tests/integration/test_twitter_api.py
# -*- coding: utf-8 -*- """ Twitter API test module. """ from unittest import TestCase from lib.twitter_api import authentication class TestAuth(TestCase): def test_generateAppToken(self): auth = authentication._generateAppAccessToken() def test_getTweepyConnection(self): auth = authenticat...
Python
0.000003
@@ -45,16 +45,163 @@ module. +%0A%0ADo requests to the Twitter API using configured credentials. NB. These require%0Avalid tokens for a Twitter dev account, plus a network connection. %0A%22%22%22%0Afro @@ -228,16 +228,47 @@ stCase%0A%0A +from lib.config import AppConf%0A from lib @@ -303,16 +303,34 @@ cation%0A%...
65948c9759abe85aee3cda4befc0fca9c49ce069
add get_color function
explorer/rc.py
explorer/rc.py
import re from .catalog import CoaddCatalog, VisitCatalog, ColorCatalog, MultiMatchedCatalog visits = {'cosmos' : {'HSC-G' : "11690..11712:2^29324^29326^29336^29340^29350^29352", 'HSC-R' : "1202..1220:2^23692^23694^23704^23706^23716^23718", 'HSC-I' : "1228..1232:2^1236..124...
Python
0.000003
@@ -3034,8 +3034,223 @@ egistry) +%0A%0Adef get_color(butler, field, filt, description=None, **kwargs):%0A dataIds = %5B%7B'tract':t, 'filter':filt%7D for t in get_tractList(field)%5D%0A return ColorCatalog(butler, dataIds, description=description, **kwargs)%0A
cdfc808383d0c3a0b722a67febb0d41bdd23a12c
Remove craziness
roushagent/plugins/lib/bashscriptrunner.py
roushagent/plugins/lib/bashscriptrunner.py
import os import string import subprocess from threading import Thread from Queue import Queue, Empty def name_mangle(s, prefix=""): # we only support upper case variables and as a convenience convert # - to _, as - is not valid in bash variables. prefix = prefix.upper() r = s.upper().replace("-", "_"...
Python
0.000015
@@ -3879,30 +3879,24 @@ eue_output, -args=( c.stdout, st @@ -3900,17 +3900,16 @@ stdout) -) %0A @@ -3945,14 +3945,8 @@ ut, -args=( c.st @@ -3958,17 +3958,16 @@ stderr) -) %0A @@ -4643,24 +4643,11 @@ in -iter(out, queue) +out :%0A
6ba94b87e11b994b02457e57d71eab9b80d28167
fix import for django 1.8
tests/notification/test_sites.py
tests/notification/test_sites.py
from mock import patch from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.sites.models import Site from django.test import TestCase, override_settings from django.urls import reverse from callisto.delivery.models import Report from callisto.notification.models import E...
Python
0.000001
@@ -158,47 +158,40 @@ ngo. -test import TestCase, override_settings +core.urlresolvers import reverse %0Afro @@ -203,20 +203,20 @@ ngo. -urls +test import reve @@ -211,23 +211,43 @@ import -reverse +TestCase, override_settings %0A%0Afrom c
0b7b9f95ab2efd16b75dd7d5689ba2329c879b28
fix default
drillsrs/cmd/study.py
drillsrs/cmd/study.py
import argparse import random from datetime import datetime from typing import List from drillsrs.cmd.command_base import CommandBase from drillsrs import db, scheduler, util from drillsrs.cli_args import Mode def _learn_single_card( index: int, num_cards_to_study: int, card: db.Card, ...
Python
0.000004
@@ -57,32 +57,8 @@ ime%0A -from typing import List%0A from @@ -1494,16 +1494,19 @@ ult= -%22 +Mode. direct -%22 ,%0A
f91fc2a8858c243b62d1a9a369d45216fb15f443
Change auth selenium test to use wait_element_become_present
tests/webui/steps/authentication_steps.py
tests/webui/steps/authentication_steps.py
# -*- coding: utf-8 -*- import time from behave import when, then, given from toxicbuild.ui import settings from tests.webui.steps.base_steps import ( # noqa f811 given_logged_in_webui, user_sees_main_main_page_login) # Scenario: Someone try to access a page without being logged. @when('someone tries to access...
Python
0.000001
@@ -689,32 +689,68 @@ context.browser%0A +%0A def fn():%0A try:%0A el = browser @@ -782,24 +782,142 @@ tUsername')%0A + except Exception:%0A el = None%0A%0A return el%0A%0A el = browser.wait_element_become_present(fn)%0A%0A assert e
9c8bfb78a1e45ab9cb78fc18318b2a39153103db
use the level arg to populate the operations list instead of appending. This allows the operation list to be changed on every iteration and keep a better record
numbers_solver.py
numbers_solver.py
#!/usr/bin/env python numbers = [25, 7, 9, 3, 1, 8] target = 642 # target = 225 def mult(x, y): return x * y def divide(x, y): if(x > y): return x / y else: return y / x def add(x, y): return x + y def sub(x, y): if(x > y): return x - y else: return y - x OP...
Python
0
@@ -1833,16 +1833,99 @@ numbers%5D +%0A if not operations:%0A operations = %5BNone for num in self.numbers%5D %0A%0A @@ -2205,16 +2205,156 @@ bo%5B1%5D)%0A%0A + operations%5Blevel%5D = CalcOperation(val)%0A operations%5Blevel - 1%5D.update(op=op, next=ope...
1ab8224372a5f839c8f0f74f3cafe7926905a7ec
Update __init__.py
nupic/__init__.py
nupic/__init__.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
Python
0.000072
@@ -1014,87 +1014,4 @@ v0%22%0A -%0ANUPIC_ROOT = os.environ.get('NUPIC', os.path.dirname(os.path.realpath(__file__)))%0A
39986540e1ad1c4712405e46b988459f2abbf6e9
Update for new python
Communication/testUDP.py
Communication/testUDP.py
# ------------------------------------------------------- import socket, traceback import time host = '' port = 12345 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) s.bind((host, port)) filein = open...
Python
0
@@ -99,16 +99,42 @@ st = ''%0A +#host = '192.168.201.251'%0A port = 1 @@ -136,17 +136,16 @@ t = 1234 -5 %0A%0As = so @@ -460,24 +460,39 @@ 00)%0A -%09 + print - +( message -%0A%09 +)%0A file @@ -571,16 +571,17 @@ %0A + raise%0A @@ -594,9 +594,16 @@ pt:%0A -%09 + trac
862c42a8abf0836604f56a9008018f34c405ca13
update version number
f5/__init__.py
f5/__init__.py
# Copyright 2016 F5 Networks 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 writi...
Python
0.000002
@@ -593,11 +593,11 @@ = '0.1. -5 +6 '%0A
cd1d576b7c0e1c75b0c890b4a0829a1018dadff6
Load list elements in the correct order
redisdl.py
redisdl.py
#!/usr/bin/env python import json import redis def dumps(host='localhost', port=6379, db=0, pretty=False): r = redis.Redis(host=host, port=port, db=db) kwargs = {} if not pretty: kwargs['separators'] = (',', ':') else: kwargs['indent'] = 2 kwargs['sort_keys'] = True encoder...
Python
0.000002
@@ -2483,17 +2483,17 @@ r. -l +r push(key
5ec3da094bd9d6d1517425b27223ad5da6bfe804
Use run_su in the restart command as well
fabfile/app.py
fabfile/app.py
#:coding=utf8: import pipes from fabric.api import ( env, task, roles, prefix, local as localexec, sudo, run, execute, put, runs_once, settings, ) env.venv_path = '/var/www/venvs/homepage' env.deploy_user = 'supervisord' def run_su(cmd, user=None): # The Google Compute Engine images prompt for a p...
Python
0
@@ -105,14 +105,8 @@ xec, - sudo, run @@ -1694,20 +1694,22 @@ %22%22%22%0A +run_ su -do ('superv
0614f520aba191d0992bde4f4de227f2c943e20d
tweak settings to remove secretkey and allowed hosts from base
config/settings/base.py
config/settings/base.py
# -*- coding: utf-8 -*- """ Django settings for config project. Generated by 'django-admin startproject' using Django 1.10.6. 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/s...
Python
0
@@ -587,120 +587,8 @@ R)%0A%0A -SECRET_KEY = 'test'%0A%0AALLOWED_HOSTS = %5B'192.168.1.7', '0.0.0.0', 'localhost', '127.0.0.1', 'a4a78554.ngrok.io'%5D%0A%0A # Ap
b181ad6d8d54a8e72a5a1838f42746b5d592732f
update documentation and add support for more dictionaries.
index.py
index.py
# Author: Colton Sweeney # Date: August 10, 2017 # Name: TrustRadius Review Scraper # # Lang: Python # Dependencies: BeautifulSoup4 # Requests # # Description: As part of my current workload, I have to create # weekly reports gathered from reviews on TrustRadius. # In order to ex...
Python
0
@@ -562,16 +562,48 @@ reports. +%0A%0A# import required dependencies %0Afrom bs @@ -1134,16 +1134,57 @@ ref'))%0A%0A +print %22%25d links found.%5Cn%22 %25 len(links)%0A%0A%0A # Functi @@ -3479,24 +3479,25 @@ ts%5B0%5D.text)%0A +%0A # Return @@ -3594,42 +3594,232 @@ ))%0A%0A -dictionary = findMaterials(links...
db36e08a81d16463d8c76b896593aaeb91c057a0
Refactor into get_check_digit_from_checkable_int method
falcom/luhn.py
falcom/luhn.py
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. def convert_into_luhn_checkable_int (number): if number: return int(number) else: return None def rotate_digit (dig...
Python
0.002407
@@ -176,33 +176,36 @@ s.%0A%0Adef -convert_into_luhn +get_check_digit_from _checkab @@ -229,76 +229,70 @@ -if number:%0A return int(number)%0A%0A else:%0A return None +return (9 * ((number // 10) + rotate_digit(number %25 10))) %25 10 %0A%0Ade @@ -446,34 +446,54 @@ +if number - = conv...
29be4cad4ab90fe5d1fc087f0de2e8a575ced40b
Bump version
nanoservice/version.py
nanoservice/version.py
VERSION = '0.3.0'
Python
0
@@ -8,11 +8,11 @@ = '0.3. -0 +1 '%0A
f66e3e965c00c455608dba994575098e1cd246ae
Update request_tracking_codes.py
samples/request_tracking_codes.py
samples/request_tracking_codes.py
from ..correios.client import Correios from ..correios.models.user import User, Service def get_tracking_codes(service, quantity): olist_user = User('Your Company\'s Name', 'Your Company\'s CNPJ') client = Correios('Your Correio\'s username', 'Your correio\'s password') tracking_codes = client.request_tra...
Python
0.000003
@@ -1,24 +1,603 @@ +# Copyright 2017 Adler Medrado%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required b...
aa558384cdefdadc8141736a4168d9d096a3f1b3
Fix loaded apps
config/settings/base.py
config/settings/base.py
""" Django settings for scuole project. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ from __future__ import absolute_import, unicode_literals from os import env...
Python
0.000001
@@ -5337,16 +5337,158 @@ z%0AUSE_TZ = True%0A +%0A#########################%0A# GENERAL CONFIGURATION #%0A#########################%0A%0ADATA_FOLDER = env('DATA_FOLDER', path.join(ROOT_DIR, 'data'))%0A
f3791ea0ed11d46edf9998b80fd1ddd54d7e9b20
Bump to pre-release version 1.0.rc2.
farcy/const.py
farcy/const.py
"""Constants used throughout Farcy.""" import os import re __version__ = '1.0.rc1' VERSION_STR = 'farcy v{0}'.format(__version__) CONFIG_DIR = os.path.expanduser('~/.config/farcy') MD_VERSION_STR = ('[{0}](https://github.com/appfolio/farcy)' .format(VERSION_STR)) FARCY_COMMENT_START = '_{0}_'.for...
Python
0
@@ -74,17 +74,17 @@ '1.0.rc -1 +2 '%0A%0AVERSI
2a6a6703aa63e75b7961d14d09a3472fe321f5de
Use safe json dump when serializing parameters (closes #96)
backslash/api.py
backslash/api.py
import copy import gzip import json import random import time import requests from requests.exceptions import ConnectionError, ReadTimeout from munch import munchify from sentinels import NOTHING from urlobject import URLObject as URL from .__version__ import __version__ as BACKSLASH_CLIENT_VERSION from ._compat imp...
Python
0
@@ -5035,32 +5035,46 @@ n.dumps(returned +, default=repr )%0A if len
035d5feee8ea0691e5777a7b96c362877bcf01ca
Add logging
consumerSQS/consumer.py
consumerSQS/consumer.py
import boto3 import logging from config import config import answer import json import time import librarian def work(message): message = json.loads(message) print(type(message)) print(message) return sendToManager(message) def sendToManager(message): if("entry" in message): um = librarian...
Python
0.000002
@@ -1767,16 +1767,31 @@ except + Exception as e :%0A @@ -1801,11 +1801,15 @@ p -ass +rint(e) %0A
e14b8c6b06c75414f42f730e4c1e1a9208e335b0
correct shebang
fetch/fetch.py
fetch/fetch.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Greedy climate data fetch """ filename = 'wwis.json' indexurl = 'http://worldweather.wmo.int/en/json/full_city_list.txt' baseurl = 'http://worldweather.wmo.int/en/json/{0}_en.xml' guideurl = 'http://worldweather.wmo.int/en/dataguide.html' notice = 'Please note the guidelin...
Python
0.997942
@@ -8,14 +8,19 @@ bin/ +env python +3 %0A# -
47555ef5589ccc07a44d9589c93be4fa193625c7
change qe setting
tests/test_ase_setup/qe_setup.py
tests/test_ase_setup/qe_setup.py
import os from ase.calculators.espresso import Espresso # set up executable label = 'AgI' input_file_name = label+'.pwi' output_file_name = label+'.pwo' no_cpus = 1 npool = 1 pw_loc = os.environ.get('PWSCF_COMMAND') #pw_loc = '/n/home08/xiey/q-e/bin/pw.x' #os.environ['ASE_ESPRESSO_COMMAND'] = 'srun -n {0} --mpi=pmi2 {...
Python
0.000001
@@ -1163,17 +1163,17 @@ : 1.0e-0 -3 +2 ,%0A @@ -1316,17 +1316,17 @@ eta': 0. -5 +7 %7D%7D%0A%0A# ps @@ -1682,44 +1682,4 @@ )) %0A -dft_calc.parameters%5B'parallel'%5D = False%0A
f935f6dceb86b2bf68a7b873f51c44534d626162
fix typo in release notes test
tests/test_make_release_notes.py
tests/test_make_release_notes.py
from datetime import datetime from mock import patch import os from StringIO import StringIO from unittest import TestCase from make_release_notes import ( DEVEL, get_bugs, get_purpose, make_notes, make_resolved_text, make_release_date, main, parse_args, PROPOSED, save_notes, ) ...
Python
0.000009
@@ -2617,16 +2617,21 @@ tory ppa +:juju /devel',
aeca55a5ca5a8b15314cc7bd31a3c89361436318
Add return type check test
tests/test_pandas_integration.py
tests/test_pandas_integration.py
from unittest import TestCase, main import numpy as np import pandas as pd import numpy.testing as npt from nimble import Events class TestAsPandasCondition(TestCase): def setUp(self): conditional_series = pd.Series([0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1]) condition = (conditional_series > 0) ...
Python
0.000001
@@ -555,32 +555,99 @@ lidation_series) +%0A self.assertEqual(pd.core.series.Series, type(test_series)) %0A%0A def test_a @@ -808,16 +808,77 @@ rray())%0A + self.assertEqual(np.ndarray, type(validation_array))%0A %0A%0Aclass @@ -1304,16 +1304,83 @@ _series) +%0A self.assertEqual(pd.core.ser...
d6a2e89736932988650c9244139aae1c1b543a88
Stop skipping tests of secondary reads in Sharded mode.
tests/test_slave_okay_sharded.py
tests/test_slave_okay_sharded.py
# Copyright 2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
Python
0
@@ -1833,90 +1833,8 @@ f):%0A - if mode == 'secondary':%0A raise unittest.SkipTest('PYTHON-868')%0A @@ -1939,58 +1939,8 @@ y':%0A - raise unittest.SkipTest('PYTHON-868')%0A
bb330514b5a18389c451cf3ba58a72d7711c2ceb
Add unit tests
tests/unit/modules/test_event.py
tests/unit/modules/test_event.py
# -*- coding: utf-8 -*- """ :codeauthor: Rupesh Tare <rupesht@saltstack.com> """ # Import Python libs from __future__ import absolute_import, print_function, unicode_literals # Import Salt Libs import salt.modules.event as event import salt.utils.event from tests.support.mixins import LoaderModuleMockMixin from te...
Python
0.000001
@@ -2767,8 +2767,1162 @@ ), %22B%22)%0A +%0A def test_send_use_master_when_local_false(self):%0A %22%22%22%0A Test for Send an event when opts has use_master_when_local and its False%0A %22%22%22%0A patch_master_opts = patch.dict(event.__opts__, %7B%22use_master_when_local%22: False%7D)%...
42dd21708e9f03850af3359dd0ffed15b6c08e0e
Include redirects in autopatrols
reports.py
reports.py
import mwclient import MySQLdb import datetime from displayTable import * class Reports: def __init__( self, site, db, wiki ): self.db = db self.site = site self.wiki = wiki # Oldest edited articles # Run time on enwiki 5 hours 23 minutes as of 8 Sept 2015 def forgotten_articles( self ): # Make the query...
Python
0
@@ -3210,16 +3210,40 @@ ace = 0 +OR page_is_redirect = 1 )%0A%09%09%09%09
3405f16f9e687507a1428e3add0326ab0f2130a2
fix bug
apps/user.py
apps/user.py
# coding: utf-8 import uuid, datetime from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound from sqlalchemy.orm.state import InstanceState from apps import BaseRequestHandler from apps.models import User, Loud from utils.decorator import authenticated, availabelclient from utils.constants import Fail, S...
Python
0.000001
@@ -4097,20 +4097,16 @@ not user - and :%0A
4680812bcefe32a113547485fae692ee5f6d7a52
Fix typing bugs in loss utils.
enn_acme/losses/utils.py
enn_acme/losses/utils.py
# Copyright 2022 DeepMind Technologies Limited. 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 a...
Python
0.002287
@@ -932,34 +932,45 @@ b%0A%0A%0A -# Specific types%0A_LossFn = +def add_l2_weight_decay(%0A loss_fn: age @@ -1024,126 +1024,8 @@ put%5D -%0A_Enn = enn_base.EpistemicNetwork%5Bagent_base.Input, agent_base.Output%5D%0A%0A%0Adef add_l2_weight_decay(%0A loss_fn: _LossFn ,%0A @@ -1158,31 +1158,78 @@ None,%0A)...
24847fc9842776e08e7acdf08711e9b778bdf47f
fix regacy code
skiski/ski.py
skiski/ski.py
from helper import Typename class VirtualCurry: def __b__(self, x): return self.dot(x) class I(metaclass=Typename("I")): """ the identity operator (lambda x: x)(5) => 5 >>> I(5).b() 5 """ def __init__(self, x): self.x = x def b(self): return self.x ...
Python
0.000015
@@ -1318,19 +1318,29 @@ if -x.is_class: +isinstance(x, type): %0A @@ -1360,18 +1360,16 @@ return x -.d (z)%0A @@ -1417,63 +1417,8 @@ t(z) -%0A except AttributeError:%0A return x(z) %0A%0A