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
9a3050bafe3b794fe0f175ff37c7ee51f4eb87de
Fix Windows import error (#3709)
tensorflow_datasets/vision_language/wit/wit.py
tensorflow_datasets/vision_language/wit/wit.py
# coding=utf-8 # Copyright 2022 The TensorFlow Datasets 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 appl...
Python
0
@@ -674,16 +674,27 @@ mport os +%0Aimport sys %0A%0Aimport @@ -762,117 +762,8 @@ ds%0A%0A -# Limit to 100 MB. Value must be smaller than the C long maximum value.%0Acsv.field_size_limit(100 * 1024**3)%0A%0A _DES @@ -5175,16 +5175,134 @@ ename):%0A + # Limit to 100 MB. Value must be smaller than the C long max...
8317fa02393b0247b367ecb48186afc23a5da7cd
Update unit test to not require rdf types on about and type fields.
test/components/rdf_publish/test_rdf_stanza.py
test/components/rdf_publish/test_rdf_stanza.py
""" Unit tests for the RDF Stanza generation and manipulation. """ import unittest from sleekxmpp.test import SleekTest import mock from sleekxmpp import Message from sleekxmpp.xmlstream import register_stanza_plugin import sleekxmpp.plugins.xep_0004 as xep_0004 from rhobot.components.rdf_publish import RDFStanza, RDFS...
Python
0
@@ -1547,32 +1547,36 @@ %3Crdf xmlns=%22 +urn: rho:rdf%22 type=%22c @@ -1579,24 +1579,24 @@ e=%22create%22%3E%0A - @@ -1745,70 +1745,8 @@ ue%3E%0A - %3Crdftype xmlns=%22rho:rdf%22 type=%22%25s%22 /%3E%0A @@ -1917,70 +1917,8 @@ ue%3E%0A - %3Crdft...
81195e2c15e99e5281085afeebdb19c5e8dcdace
Update _script.py
src/kubetop/_script.py
src/kubetop/_script.py
# Copyright Least Authority Enterprises. # See LICENSE for details. """ The command-line interface. Theory of Operation =================== #. Convert command line arguments to structured configuration, supplying defaults where necessary. #. Construct the top-level kubetop service from the configuration. #. Run the ...
Python
0.000001
@@ -675,16 +675,17 @@ ubetop%0A%0A +%0A configPa @@ -693,97 +693,49 @@ h = -%22~/.kube/config%22%0A%0Aif os.environ%5B'KUBECONFIG'%5D:%0A configPath = os.environ%5B'KUBECONFIG'%5D%0A +os.getenv('KUBECONFIG', %22~/.kube/config%22) %0ACON @@ -1977,8 +1977,9 @@ Service) +%0A
72d62c40972c85bd41dacb5bb417cd15577e7534
Use updated extension loader interface
lava_server/settings/common.py
lava_server/settings/common.py
# Copyright (C) 2010, 2011 Linaro Limited # # Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org> # # This file is part of LAVA Server. # # LAVA Server is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License version 3 # as published by the Free Software F...
Python
0
@@ -716,16 +716,59 @@ es/%3E.%0A%0A%0A +from lava_server.extension import loader%0A%0A%0A # Admini @@ -2313,16 +2313,70 @@ ic%22,%0A)%0A%0A +PREPEND_LABEL_APPS = %5B%0A %22django.contrib.admin%22,%0A%5D%0A%0A LOGIN_RE @@ -3756,25 +3756,24 @@ ue%0A%0A -%0A # -XXX: E +Load e xtension int @@ -3772,140 +3772,4...
801c2233b61a96fa9a620c3c740cdce8dad3d490
Complete iter sol
lc0941_valid_mountain_array.py
lc0941_valid_mountain_array.py
"""Leetcode 941. Valid Mountain Array Easy URL: https://leetcode.com/problems/valid-mountain-array/ Given an array A of integers, return true if and only if it is a valid mountain array. Recall that A is a mountain array if and only if: - A.length >= 3 - There exists some i with 0 < i < A.length - 1 such that: * A...
Python
0.999986
@@ -581,16 +581,20 @@ Solution +Iter (object) @@ -696,55 +696,918 @@ ool%0A - %22%22%22%0A pass%0A%0A%0Adef main():%0A pass +%0A Time complexity: O(n).%0A Space complexity: O(1).%0A %22%22%22%0A # Edge case.%0A if len(A) %3C= 2:%0A return False%0A%0A ...
fe8e11ffcfd798a585a69e7bd6fdae799950dbde
Change the order of ifs in Response.from_raw to favor Message types
nsq/response.py
nsq/response.py
import inspect import struct from . import constants from . import exceptions from contextlib import contextmanager import socket import sys class Response(object): '''A response from NSQ''' FRAME_TYPE = constants.FRAME_TYPE_RESPONSE __slots__ = ('connection', 'frame_type', 'data') @staticmethod ...
Python
0.00001
@@ -491,32 +491,143 @@ if frame_type == + constants.FRAME_TYPE_MESSAGE:%0A return Message(conn, frame_type, message)%0A elif frame_type == constants.FRAME @@ -808,119 +808,8 @@ ge)%0A - elif frame_type == constants.FRAME_TYPE_MESSAGE:%0A return Message(conn, frame_type, message)%...
e113228d008b78ff45db52f4917fef392c38b5e3
Fix https://github.com/pyload/pyload/issues/1201
module/plugins/hoster/FilerNet.py
module/plugins/hoster/FilerNet.py
# -*- coding: utf-8 -*- # # Test links: # http://filer.net/get/ivgf5ztw53et3ogd # http://filer.net/get/hgo14gzcng3scbvv import pycurl import re from urlparse import urljoin from module.plugins.internal.CaptchaService import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo cla...
Python
0.000001
@@ -422,9 +422,9 @@ %220.1 -7 +8 %22%0A%0A @@ -2216,16 +2216,216 @@ cha()%0A%0A%0A + def checkFile(self, rules=%7B%7D):%0A if self.checkDownload(%7B'Html file': re.compile(r'%5CA%5Cs*%3C!DOCTYPE html')%7D):%0A self.offline()%0A return super(FilerNet, self).checkFile(rules)%0A%0A%0A getI...
433d9b2c1c29f32a7d5289e84673308c96302d8d
FIX a bug, you fuck'in forgot to rename the new function
controlers/access.py
controlers/access.py
'''Copyright(C): Leaf Johnson 2011 This file is part of makeclub. makeclub 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 versi...
Python
0
@@ -887,16 +887,27 @@ %22finish%22 +,%0A%09%22newact%22 %0A%5D%0A%0AactO @@ -920,27 +920,16 @@ ins = %5B%0A -%09%22create%22,%0A %09%22view%22, @@ -1058,36 +1058,35 @@ rn True%0A%0Adef has -Club +Act Privilige (user,
a861238786a71fe6f0bea5f0d5a8f6b21cb68a62
add TODO
numpyro/util.py
numpyro/util.py
from __future__ import division def dual_averaging(t0=10, kappa=0.75, gamma=0.05): def init_fn(prox_center=0.): x_t = 0. x_avg = 0. # average of primal sequence g_avg = 0. # average of dual sequence t = 0 return (x_t, x_avg, g_avg, t, prox_center) def update_fn(g, st...
Python
0
@@ -78,16 +78,37 @@ =0.05):%0A + # TODO: add docs%0A def
36cd68912202e04d533a26bcec3b0aa8514ba5fa
fix performance issues of purify
src/lutino/persian.py
src/lutino/persian.py
# -*- coding: utf-8 -*- __author__ = 'vahid' _character_map = { 'ي': 'ی', 'ك': 'ک', 'ة': 'ه', 'ۀ': 'ه', # Eastern Arabic-Indic digits (Persian and Urdu) U+06Fn: ۰۱۲۳۴۵۶۷۸۹ '۰': '0', '۱': '1', '۲': '2', '۳': '3', '۴': '4', '۵': '5', '۶': '6', '۷': '7', '۸': '8', ...
Python
0.000001
@@ -21,28 +21,8 @@ -*-%0A -__author__ = 'vahid' %0A_ch @@ -35,16 +35,30 @@ r_map = +str.maketrans( %7B%0A '%D9%8A @@ -321,17 +321,16 @@ : '9',%0A%0A -%0A # Ar @@ -509,16 +509,17 @@ '9',%0A%0A%7D +) %0A%0A%0Adef p @@ -538,157 +538,40 @@ re -s = ''%0A for c i +tur n s. -s tr -ip():%0A if c...
6fcdfbea98d2770d770122ef10bcc4bb349f64e9
Remove stub
tests/api_resources/test_source_transaction.py
tests/api_resources/test_source_transaction.py
from __future__ import absolute_import, division, print_function import stripe from tests.helper import StripeTestCase class SourceTransactionTest(StripeTestCase): def test_is_listable(self): # TODO: remove stub once stripe-mock supports source_transactions self.stub_request( 'get', ...
Python
0.000001
@@ -196,394 +196,8 @@ f):%0A - # TODO: remove stub once stripe-mock supports source_transactions%0A self.stub_request(%0A 'get',%0A '/v1/sources/src_123/source_transactions',%0A %7B%0A 'object': 'list',%0A 'data': %5B%7B%0A ...
f49c5fe7a757cf34f836353e29a476dcdf8c13d9
Add test for previous runs
tests/changes/api/test_project_test_details.py
tests/changes/api/test_project_test_details.py
from uuid import uuid4 from changes.constants import Result, Status from changes.config import db from changes.models import AggregateTestGroup, TestGroup from changes.testutils import APITestCase class ProjectTestDetailsTest(APITestCase): def test_simple(self): fake_id = uuid4() project = self....
Python
0
@@ -330,16 +330,226 @@ oject()%0A +%0A previous_build = self.create_build(%0A project=project,%0A status=Status.finished,%0A result=Result.passed,%0A )%0A previous_job = self.create_job(previous_build)%0A%0A @@ -867,32 +867,41 @@ first_job= +previo...
e4699fdb4a054f858df624b2f86fbf8f81122f80
Improve test case for bug #1229 so it checks that Person still exists.
tests/management/commands/test_graph_models.py
tests/management/commands/test_graph_models.py
# -*- coding: utf-8 -*- import json import os import tempfile from contextlib import contextmanager from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase from django.utils.six import StringIO def assert_looks_like_dotfile(output): as...
Python
0
@@ -5434,32 +5434,112 @@ out.getvalue()%0A + assert 'tests_testapp_models_Person -%3E tests_testapp_models_Name' in output%0A assert 'test
a78a15764cd8480894b4675e0dce828bf45f80ec
Set the redirects from a stored result
oct/__init__.py
oct/__init__.py
#!/usr/bin/python -B # -*- coding: utf-8 -*- # # __init__.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditio...
Python
0
@@ -4390,16 +4390,64 @@ t None:%0A +%09%09%09jvars%5B'redirects'%5D = search_result.redirects%0A %09%09%09jvars
1a32bd6d797ebff3c447f865274d809d1b058a13
test BQ download_to_file download_to_dataframe
tests/unit/data/client/test_bigquery_client.py
tests/unit/data/client/test_bigquery_client.py
import os import csv from unittest.mock import Mock, patch from cartoframes.auth import Credentials from cartoframes.data.clients.bigquery_client import BigQueryClient class ResponseMock(list): def __init__(self, data, **kwargs): super(ResponseMock, self).__init__(data, **kwargs) self.total_rows...
Python
0
@@ -13,16 +13,36 @@ port csv +%0Aimport pandas as pd %0A%0Afrom u @@ -1259,16 +1259,24 @@ ownload_ +to_file_ full(sel @@ -1951,16 +1951,16 @@ columns%0A - @@ -2000,8 +2000,663 @@ lues())%0A +%0A @patch.object(BigQueryClient, 'get_table_column_names')%0A @patch.object(BigQueryClient, '_download_by_...
5677fdf70b1f0fa88d210b630da512b374a48e07
Add osmajorversion grain to test_kernelpkg_linux_yum
tests/unit/modules/test_kernelpkg_linux_yum.py
tests/unit/modules/test_kernelpkg_linux_yum.py
# -*- coding: utf-8 -*- ''' :synopsis: Unit Tests for 'module.yumkernelpkg' :platform: Linux :maturity: develop .. versionadded:: 2018.3.0 ''' # pylint: disable=invalid-name,no-member # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals try: # Import Salt T...
Python
0.000007
@@ -1171,16 +1171,42 @@ 'RedHat' +%0A OS_MAJORRELEASE = '7' %0A%0A de @@ -1349,16 +1349,76 @@ S_NAME,%0A + 'osmajorrelease': self.OS_MAJORRELEASE,%0A
a8459207810eceee101e32787a7254e689041dad
debug travis py 3.3 2.6
core/load_modules.py
core/load_modules.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from glob import glob from core.alert import messages from core.alert import info from core.alert import warn from core._die import __die_failure def load_all_graphs(): graph_names = [] for lib in glob('lib/graph/*/engine.py'): lib = lib.rsplit...
Python
0.000024
@@ -2301,16 +2301,18 @@ + # __die_f
467d692d91e8c9570eac552aba90457d959cb0a4
fix express syntax
mpf/config_players/show_player.py
mpf/config_players/show_player.py
"""Show config player.""" from copy import deepcopy from mpf.core.config_player import ConfigPlayer class ShowPlayer(ConfigPlayer): """Plays, starts, stops, pauses, resumes or advances shows based on config.""" config_file_section = 'show_player' show_section = 'shows' device_collection = None ...
Python
0.998971
@@ -3147,14 +3147,25 @@ urn -dict() +%7B%22action%22: value%7D %0A%0Apl
e12244fbee3aed767107b9426ad2118a603eab39
Fix DI network name and domain
mysite/scripts/setup_test_data.py
mysite/scripts/setup_test_data.py
"""Script to set up test data for a ditto instance. As before we tried to do this with migrations but ran into problems early on with custom permissions not being created. In any case, it's probably easier/better to have a single bootstrap script instead of a bunch of data migrations. """ from django.conf import set...
Python
0.000004
@@ -847,16 +847,55 @@ up_site( +name='DITTO.TECHNOLOGY', subdomain=None ):%0A s @@ -947,36 +947,17 @@ e = -'DITTO.TECHNOLOGY'%0A site. +name%0A doma @@ -1010,24 +1010,89 @@ ame.lower()%0A + if subdomain:%0A domain = '%25s.%25s' %25 (subdomain, domain)%0A site.sav @@ -3556,8 +3556,63 @@ '...
9ba42d1c8f88d3e1871fc9e3ec10ade128477292
Update Restict Access by Location title
corehq/privileges.py
corehq/privileges.py
from django.utils.translation import ugettext_lazy as _ LOOKUP_TABLES = 'lookup_tables' API_ACCESS = 'api_access' CLOUDCARE = 'cloudcare' ACTIVE_DATA_MANAGEMENT = 'active_data_management' CUSTOM_BRANDING = 'custom_branding' CUSTOM_REPORTS = 'custom_reports' # Legacy privilege associated with Pro plan REPORT_BUILDE...
Python
0
@@ -3272,16 +3272,32 @@ n-based +data export and user man
64f887399dcd27693dcc54be4a7a33717f89b1b3
create application.host already during self.add(applications...
coshsh/datasource.py
coshsh/datasource.py
#!/usr/bin/env python #-*- encoding: utf-8 -*- # # This file belongs to coshsh. # Copyright Gerhard Lausser. # This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). import sys import os import re import imp import inspect import logging import coshsh from coshsh.util...
Python
0
@@ -2287,16 +2287,175 @@ )%5D = obj +%0A if objtype == 'applications':%0A if self.find('hosts', obj.host_name):%0A setattr(obj, 'host', self.get('hosts', obj.host_name)) %0A%0A de
af952c9347e63b109fe14b70d120787e2fbf2793
Fix version detection code.
couchbase_version.py
couchbase_version.py
#!/usr/bin/env python from __future__ import print_function import subprocess import datetime import os.path import warnings import re from cbuild_config import couchbase_core class CantInvokeGit(Exception): pass class VersionNotFound(Exception): pass class MalformedGitTag(Exception): pass RE_XYZ ...
Python
0.000013
@@ -345,16 +345,17 @@ d+)%5C.(%5Cd ++ )(?:-(.*
2c2d5c54688411de35c42664ad446ef2f51e0777
fix initialization of recordingchannelgroup channel_indexes and channel_names
neo/core/recordingchannelgroup.py
neo/core/recordingchannelgroup.py
from neo.core.baseneo import BaseNeo import numpy as np class RecordingChannelGroup(BaseNeo): """ This container have sereval purpose: * Grouping all :py:class:`AnalogSignalArray` inside a :py:class:`Block` across :py:class:`Segment` * Grouping :py:class:`RecordingChannel` inside a :py:cla...
Python
0.000001
@@ -3425,16 +3425,30 @@ array(%5B%5D +, dtype=np.int )%0A @@ -3514,16 +3514,27 @@ array(%5B%5D +, dtype='S' )%0A%0A
97710a45761ff6220b94df4d518151e31eb8ef5d
Make CI happy
netbox/extras/api/customfields.py
netbox/extras/api/customfields.py
from django.contrib.contenttypes.models import ContentType from rest_framework import serializers from extras.models import CF_TYPE_SELECT, CustomField, CustomFieldChoice # # Custom fields # class CustomFieldSerializer(serializers.BaseSerializer): """ Extends ModelSerializer to render any CustomFields and ...
Python
0.000002
@@ -1436,8 +1436,9 @@ 'value'%5D +%0A
ecc3541df1fc79a1331ef288cfb1ac7818c35c9c
Add smoke test when there is no mapping.
networkx/utils/tests/test_misc.py
networkx/utils/tests/test_misc.py
# -*- encoding: utf-8 -*- from nose.tools import * from nose import SkipTest import networkx as nx from networkx.utils import * def test_is_string_like(): assert_true(is_string_like("aaaa")) assert_false(is_string_like(None)) assert_false(is_string_like(123)) def test_iterable(): assert_false(iterable...
Python
0
@@ -2336,24 +2336,97 @@ ay(%5B2,1%5D))%0A%0A + a = dict_to_numpy_array1(d)%0A assert_allclose(a.sum(), 3)%0A%0A def test @@ -2446,32 +2446,32 @@ y_array2(self):%0A - d = %7B'a' @@ -2664,24 +2664,98 @@ %5D,%5B2,1%5D%5D))%0A%0A + a = dict_to_numpy_array2(d)%0A assert_allclose(...
16279444647ebcd9333fe0a46393d9ae71ea8bd0
Update for Python 3 encoding
crankycoin/wallet.py
crankycoin/wallet.py
import coincurve import json import random from crankycoin import logger from crankycoin.node import NodeMixin from crankycoin.models.transaction import Transaction class Client(NodeMixin): __private_key__ = None __public_key__ = None def __init__(self, peers, api_client, private_key=None): if ...
Python
0
@@ -1,12 +1,23 @@ +import sys%0A import coinc @@ -171,16 +171,74 @@ action%0A%0A +_PY3 = sys.version_info%5B0%5D %3E 2%0Aif _PY3:%0A import codecs%0A %0Aclass C @@ -874,32 +874,115 @@ e).encode('hex') + if not _PY3 else codecs.encode(self.__public_key__.format(compressed=True), 'hex') %0A%0A def get_pr
63310b5417b39bcc8d98bef3a6e82e9488c60d57
Refactor code
createCoverLetter.py
createCoverLetter.py
from django.template import Template,Context from django.conf import settings import pyperclip import sys argsList = None if sys.argv[0] == "createCoverLetter.py": argsList = sys.argv[1:] else: argsList = sys.argv company_name="" if len(argsList) != 1: print "Invalid number of arguments passed,"+str(len...
Python
0.000002
@@ -104,25 +104,337 @@ ys%0A%0A -argsList = None%0A%0A +'''%0Acreating a python script that will read in the coverLetter template%0Aadd the company name, and save it to a new file and the system's clipboard%0AAlso append the current date to the letters as well%0Athe compnay_name variable in the tempate is passed to th...
e47fa24ac7d5f56f2e1884247d2aa3068fa265e2
fix loading ntlk and wordnet exception
nlpaug/model/word_dict/wordnet.py
nlpaug/model/word_dict/wordnet.py
try: import nltk from nltk.corpus import wordnet except ImportError: # No installation required if not using this function pass from nlpaug.model.word_dict import WordDictionary class WordNet(WordDictionary): def __init__(self, lang, is_synonym=True): super().__init__(cache=True) ...
Python
0
@@ -371,41 +371,8 @@ onym -%0A self.model = self.read() %0A%0A @@ -519,45 +519,8 @@ k%60') -%0A%0A @classmethod%0A def read(cls): %0A @@ -631,87 +631,8 @@ r')%0A - except ImportError:%0A nltk.download('wordnet')%0A%0A try:%0A @@ -742,24 +742,61 @@ mportError:%0A + ...
3b2a7b392522cbbb34586affd1ba1826145a2cb5
Fix passing of parameters.
nn_patterns/explainer/__init__.py
nn_patterns/explainer/__init__.py
from .base import * from .gradient_based import * from .misc import * from .pattern_based import * from .relevance_based import * def create_explainer(name, output_layer, patterns=None, to_layer=None, **kwargs): return { # Gradient based "gradient": GradientExplainer, ...
Python
0
@@ -727,36 +727,40 @@ layer, patterns= -None +patterns , to_layer=None, @@ -746,32 +746,36 @@ terns, to_layer= -None +to_layer , **kwargs)%0A
2cfac152d39686fd0d04d3bdeaac7a908d18b365
remove redundant method.
cryptotik/bittrex.py
cryptotik/bittrex.py
import requests from .common import APIError, headers import time import hmac, hashlib class Bittrex: url = 'https://bittrex.com/api/v1.1/' delimiter = "-" headers = headers taker_fee, maker_fee = 0.0025, 0.0025 private_commands = ('getopenorders', 'cancel', 'sellmarket', 'selllimit', ...
Python
0.000001
@@ -3813,245 +3813,10 @@ + %7D -%0A%0A @classmethod%0A def get_markets_summaries(cls):%0A '''return basic market information for all supported pairs'''%0A%0A return cls.api(cls.url + %22public%22 + %22/getmarketsummaries%22,%0A params=%7B%7D)%5B%22result%22%5D %0A%0A ...
81755129279326ce55a844607ba2b237db8553f0
Remove MinValueValidator from model fields
cspreports/models.py
cspreports/models.py
# STANDARD LIB from __future__ import unicode_literals import json from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator from django.db import models from django.utils.html import escape from django.utils.safestring import mark_safe DISPOSITIONS = ( ('enforce', '...
Python
0
@@ -117,61 +117,8 @@ ror%0A -from django.core.validators import MinValueValidator%0A from @@ -2914,45 +2914,10 @@ True -, validators=%5BMinValueValidator(0)%5D )%0A + @@ -3041,43 +3041,8 @@ True -, validators=%5BMinValueValidator(0)%5D )%0A @@ -3112,43 +3112,8 @@ True -, validators=%5BMinValueValidator(0...
bb9307ae43bab623f895db7c4040f736f545e8fc
Bump version number to 0.11.
Cython/Compiler/Version.py
Cython/Compiler/Version.py
version = '0.11.rc3'
Python
0
@@ -12,10 +12,6 @@ 0.11 -.rc3 '%0A
fff7d745ece073c1f8a2931384d31233e3467cba
Update noxfile.
noxfile.py
noxfile.py
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Python
0
@@ -768,15 +768,12 @@ def -blacken +lint (ses @@ -794,51 +794,122 @@ Run -black.%0A%0A Format code to uniform standard +linters.%0A%0A Returns a failure if the linters find linting errors or sufficiently%0A serious code quality issues .%0A @@ -935,22 +935,45 @@ nstall(%22 -black%22 +flake8%22, %22blac...
59ce22d604241d5092096a8aea0a6d25fc1325f3
Remove dangling Docker images
fabfile.py
fabfile.py
from fabric.api import * from fabric.contrib.files import * import os from ConfigParser import SafeConfigParser parser = SafeConfigParser() parser.read(os.path.join(os.path.dirname(__file__), 'config.ini')) import time # Configure server admin login credentials if parser.get('production', 'USE_PASSWORD'): env.pass...
Python
0.000001
@@ -1012,16 +1012,124 @@ er ps')%0A + print 'Removing dangling Docker images...'%0A run('docker rmi $(docker images -f %22dangling=true%22 -q)')%0A prin
7c0823ad76e0b38dd31df59eccd0e3d7e0e3a4e0
Remove comment in fabfile
fabfile.py
fabfile.py
# coding: utf-8 from __future__ import unicode_literals, print_function import contextlib from pathlib import Path from fabric.api import local, lcd, env, settings, prefix from os import path, environ import shutil PWD = path.dirname(__file__) ENV = environ['VENV_DIR'] if 'VENV_DIR' in environ else '.env' VENV_DIR =...
Python
0
@@ -860,695 +860,8 @@ se)%0A - #env_vars = ' '.join(env_vars)%0A #if cmd.split()%5B0%5D == 'python':%0A # cmd = cmd.replace('python', str(env_py))%0A # return local(env_vars + ' ' + cmd, capture=capture)%0A #elif direct:%0A # cmd, args = cmd.split(' ', 1)%0A # ...
71bd2a755ff246880bd84c4ee50181c9b34f3644
Update area.py
pabiana/area.py
pabiana/area.py
""" Use this module to start a new Pabiana Area. Each Area is initialized with a Receiver Interface. The Receiver Interface accepts Requests for remote Triggers. Subscription Interfaces are created as defined. Subscription Interfaces call defined Reactions. The Area name must not contain "_" characters. A Publishing In...
Python
0.000001
@@ -2371,16 +2371,12 @@ == ' -shutdown +exit ':%0A%09 @@ -2484,33 +2484,33 @@ ptions, -pulse +clock _name, -pulse +clock _slot):%0A @@ -2564,21 +2564,21 @@ _name = -pulse +clock _name%0A%09_ @@ -2590,21 +2590,21 @@ _slot = -pulse +clock _slot%0A%09f @@ -2715,25 +2715,25 @@ nd(( -pulse +clock _name, -pul...
addc1e83911f72282eca9603e2c483ba6ef5ef7c
Update to the latest XSP.
packages/xsp.py
packages/xsp.py
GitHubTarballPackage('mono', 'xsp', '2.11', 'd3e2f80ff59ddff68e757a520655555e2fbf2695', configure = './autogen.sh --prefix="%{prefix}"')
Python
0
@@ -34,56 +34,58 @@ ', ' -2 +3.0 .11', ' -d3e2f80ff59ddff68e757a520655555e2fbf2695 +4587438369691b9b3e8415e1f113aa98b57d1fde ', c
f02586f9f355f4683bca5c832782e00e62717973
Fix spelling.
src/matlabGitBisect.py
src/matlabGitBisect.py
#!/usr/bin/python # encoding: utf-8 ''' matlabGitBisect -- a git bisect run script for Matlab projects @author: Twan Koolen ''' import sys import signal import os import subprocess from argparse import ArgumentParser from argparse import RawDescriptionHelpFormatter from matplotlib.compat.subprocess import Called...
Python
0.001428
@@ -1813,18 +1813,18 @@ elp=%22bui -d l +d directo
cb702893ef902f120b1548057d2b433b48a5b04b
add filters for payment admin
src/payments/admin.py
src/payments/admin.py
from ajax_select.fields import AutoCompleteSelectField from django import forms from django.contrib import admin from api.admin import admin_site from payments import models class PaymentForm(forms.ModelForm): person = AutoCompleteSelectField( "people", required=True, label="Personne" ...
Python
0
@@ -546,16 +546,144 @@ 'price', + 'status', )%0A readonly_fields = ('person', 'email', 'first_name', 'last_name', 'price', 'status')%0A list_filter = ('price', 'status
f8e30e1f69976829de2d473fecb6e32264a8fa59
Add canonical urls for pages model #21
pages/models.py
pages/models.py
from django.db import models from django.contrib.auth.models import User from ckeditor.fields import RichTextField from django.utils import timezone # Create your models here. class Page(models.Model): STATUS_CHOICES = ( ('draft', 'Draft'), ('published', 'Published'), ) menu_title = mo...
Python
0
@@ -22,16 +22,61 @@ models%0A +from django.core.urlresolvers import reverse%0A from dja @@ -794,24 +794,136 @@ ull=True)%0A%0A%0A + def get_absolute_url(self):%0A return reverse('page_detail',%0A args=%5Bself.slug%5D)%0A%0A class Me
e6239a12112a51333f93409fd55571187c3f0f36
stupid missing comma
src/ml_service/init.py
src/ml_service/init.py
import os import time import nltk from sys import exit from util.constant import Path from util.log import Log import subprocess nltk.download('punkt') nltk.download('stopwords') nltk.download('perluniprops') ADDRESS_INDEX = 0 FILE_SIZE_INDEX = 1 binary_urls = [ 'https://capstone.cyberjustice.ca/data/bin/classi...
Python
0.999994
@@ -719,16 +719,17 @@ ors.bin' +, %0A 'ht
043823dca66ff0f0edcb8a1f62b366f2d608b584
Handle missing user agents on all endpoints
park_api/app.py
park_api/app.py
from datetime import datetime from os import getloadavg from flask import Flask, jsonify, abort, request import psycopg2 from park_api import scraper, util, env from park_api.forecast import find_forecast app = Flask(__name__) @app.route("/") def get_meta(): app.logger.info("GET / - " + request.headers.get("Use...
Python
0.000011
@@ -264,70 +264,164 @@ -app.logger.info(%22GET / - %22 + request.headers.get(%22User-Agent%22) +user_agent = %22no user-agent%22 if request.headers.get(%22User-Agent%22) is None else request.headers.get(%22User-Agent%22)%0A app.logger.info(%22GET / - %22 + user_agent )%0A%0A @@ -1021,16 +1021,35 @@ _agent =...
d8b29fd094a7a2d74c74e32b05a810930655fb47
Fix raw_input() error in python 3
src/modules/phython.py
src/modules/phython.py
import json import runpy import sys def run(): args = sys.argv if len(args) < 3: raise Exception('Both module name and function name are required.') module, function = args[1:3] module = runpy.run_module(module) if function not in module: raise Exception(function + ' is not defin...
Python
0.998993
@@ -392,24 +392,135 @@ ction):%0A +# raw_input() is removed in python 3%0A try:%0A input = raw_input%0A except NameError:%0A pass%0A arguments = @@ -519,20 +519,16 @@ ments = -raw_ input().
c915c7dfdd6cb18eadb940693f4e8d786848b0d4
Use --version instead of -v
conoha/library/pm2.py
conoha/library/pm2.py
#!/usr/bin/python # -*- coding: utf-8 -*- import os from ansible.module_utils.basic import AnsibleModule ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.0'} class _TaskFailedException(Exception): def __init__(self, rc, msg): ...
Python
0.000007
@@ -717,17 +717,24 @@ _pm2(%5B%22- -v +-version %22%5D)%0A
64740ca4ed15a7f63ecdb74aaa23a81c10bc4c4b
Fix more logging for upload.
contacts/consumers.py
contacts/consumers.py
import datetime import logging from email.utils import parseaddr import os import requests import vobject from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.conf import settings from django.core.cache import cache from django.core.mail import EmailMultiAlternatives fro...
Python
0
@@ -3101,31 +3101,16 @@ cessing%22 -, extra=message )%0A tr
056756655d2a2a2e03c54c344349f6b3a2a7538f
Add parenthesis for python3 support
src/py/generatelib/add_heatkernel_vtk.py
src/py/generatelib/add_heatkernel_vtk.py
import argparse import inputData import glob import os import vtk import scipy.io as sio import numpy as np from vtk.util import numpy_support #from pyevtk.hl import imageToVTK parser = argparse.ArgumentParser(description='Shape Variation Analyzer') parser.add_argument('--dataPath', action='store', dest='dirwithSub...
Python
0.000001
@@ -1493,18 +1493,19 @@ %09%09%09print - i +(i) %0A%09%09%09%09rea
97159b7c9ed2203ed0d3ff409835781cc57b3fe7
Update documentation
src/pybel/struct/filters/edge_filters.py
src/pybel/struct/filters/edge_filters.py
# -*- coding: utf-8 -*- """ Edge Filters ------------ A edge predicate is a function that takes five arguments: a :class:`BELGraph`, a source node tuple, a target node tuple, a key, and a data dictionary. It returns a boolean representing whether the edge passed the given test. This module contains a set of default ...
Python
0
@@ -626,24 +626,8 @@ port - has_provenance, kee @@ -3104,16 +3104,33 @@ pe: iter +%5Btuple,tuple,int%5D %0A %22%22%22
e283abb39364723ae6a75177e68ce216ebb79281
Enable logging on verbose flag.
st2reactor/st2reactor/cmd/rule_tester.py
st2reactor/st2reactor/cmd/rule_tester.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
@@ -829,16 +829,30 @@ port os%0A +import pprint%0A import s @@ -854,16 +854,16 @@ ort sys%0A - %0Afrom st @@ -1355,24 +1355,146 @@ uired=True)%0A + parser.add_argument('-v', '--verbose', help='increase output verbosity',%0A action='store_true')%0A return p @@ -2125,16 +2125,41 @@ _a...
262bb53597268145f18dfb42fbb20fe7a37c6671
Fix error under windows when generating a UID.
src/pyhmsa/type/uid.py
src/pyhmsa/type/uid.py
#!/usr/bin/env python """ ================================================================================ :mod:`uid` -- Generate unique identifier id ================================================================================ .. module:: uid :synopsis: Generate unique identifier id .. inheritance-diagram:: p...
Python
0
@@ -1561,16 +1561,37 @@ th key:%0A + try:%0A @@ -1651,24 +1651,28 @@ + lastuid += 1 @@ -1672,16 +1672,64 @@ id += 1%0A + except:%0A lastuid = 0%0A
7d7bce976d45e32709c9eccfa4d0df6c99f55c8e
support responses with missing aux bytes
src/pyipmi/msgs/bmc.py
src/pyipmi/msgs/bmc.py
import constants from pyipmi.msgs import Message from pyipmi.msgs import ByteArray from pyipmi.msgs import UnsignedInt from pyipmi.msgs import UnsignedIntMask from pyipmi.msgs import Timestamp from pyipmi.msgs import Bitfield from pyipmi.msgs import CompletionCode from pyipmi.msgs import Conditional class GetDeviceId...
Python
0
@@ -294,16 +294,49 @@ itional%0A +from pyipmi.msgs import Optional%0A %0A%0Aclass @@ -1544,16 +1544,25 @@ +Optional( ByteArra @@ -1578,16 +1578,17 @@ ary', 4) +) %0A )%0A%0A
c2f6f2c2ed32d715ff65ae332e83be5ff55238f5
Disable startup.warm.chrome_signin on Android
tools/perf/benchmarks/chrome_signin_startup.py
tools/perf/benchmarks/chrome_signin_startup.py
# 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. from core import perf_benchmark from measurements import startup import page_sets from telemetry import benchmark class _StartupWarm(perf_benchmark.PerfBen...
Python
0.000064
@@ -596,24 +596,102 @@ )%0A# -crbug.com/499312 +On android logging in is done through system accounts workflow.%0A@benchmark.Disabled('android') %0A@be @@ -719,16 +719,35 @@ erence') + # crbug.com/499312 %0Aclass S
a077efb9d8ce85132222e73d25e3471a9af14f45
Revert back to broader exception clause.
src/mattermostdriver/websocket.py
src/mattermostdriver/websocket.py
import json import ssl import asyncio import logging import websockets log = logging.getLogger('mattermostdriver.websocket') log.setLevel(logging.INFO) class Websocket: def __init__(self, options, token): self.options = options if options['debug']: log.setLevel(logging.DEBUG) self._token = token self._al...
Python
0
@@ -1643,11 +1643,15 @@ ive) - : +:%0A%09%09%09%09%09 brea @@ -1666,17 +1666,8 @@ ept -WebSocket Exce
19ef05cb827f5bd4614e5d6ec70e69a6e5f73827
update penti simple
penti/simple.py
penti/simple.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: mcxiaoke # @Date: 2015-08-14 08:35:05 from __future__ import print_function from bs4 import BeautifulSoup import requests from requests import exceptions import re import os import sys import codecs import time import Queue as queue from multiprocessing import ...
Python
0
@@ -3731,17 +3731,16 @@ try %3C 10 -0 :%0A @@ -4051,26 +4051,8 @@ ept -exceptions.Request Exce
7726f50ee966d4f1ed542e6653907e2433b448b8
set URI variable within conditional
getFeed.py
getFeed.py
#!/usr/bin/env python # get feed data from url import urllib import sys import xml.dom.minidom # URI of the feed #URI = 'https://www.npr.org/rss/rss.php?id=1019' #allow URI to be passed to script URI = sys.argv[1] # actual xml document document = xml.dom.minidom.parse(urllib.urlopen(URI)) # create empty string to s...
Python
0.000001
@@ -112,21 +112,57 @@ eed%0A -# URI = + sys.argv%5B1%5D if len(sys.argv) %3E 1 else 'http -s ://w @@ -198,41 +198,83 @@ 9'%0A# -allow URI to be passed to script%0A +URI = 'http://www.npr.org/rss/rss.php?id=1019'%0A#if len(sys.argv) %3E 1:%0A # URI @@ -1018,20 +1018,27 @@ %0A%0A# -check +show result + as ...
6053d2eee7fdbbac633dfe4aec4249270e468876
fix checking for surfaces
mne/commands/mne_make_scalp_surfaces.py
mne/commands/mne_make_scalp_surfaces.py
#!/usr/bin/env python # Authors: Denis A. Engemann <denis.engemann@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # # simplified bsd-3 license """Create high-resolution head surfaces for coordinate alignment. example ...
Python
0
@@ -3260,24 +3260,29 @@ +this_ surf = op.jo @@ -3327,15 +3327,53 @@ sts( +this_ surf):%0A + surf = this_surf%0A
58d477ed433639153cc785297b1cf0160bdd42e2
Take 2 at properly linting merge commits.
githook.py
githook.py
#!/usr/bin/env python """Commit hook for git that does lint testing. It runs the lint checker (runlint.py) on all the open files in the current commit. To install (for git >= 1.7.1), run the following: % git config --global init.templatedir '~/.git_template' and then create a symlink from ~/.git_template/hooks...
Python
0.990179
@@ -2212,57 +2212,166 @@ # -This seems to be the magic incantation that lis +I used to run%0A # git diff-tree -r --cc --name-only --diff-filter=AMR -z HEAD%0A # but this wouldn't catch changes made to resolve conflic ts +, so %0A @@ -2381,206 +2381,403 @@ # -conflict-only files. Normally ...
dfa15bf7b1b396d500ee709fbe59b82ea4affbef
deprecate redis in sqlalchemy, change to pairwise jaro-winkler
lib/assignee_disambiguation.py
lib/assignee_disambiguation.py
#!/usr/bin/env Python """ Performs a basic assignee disambiguation """ import itertools from collections import defaultdict import uuid from collections import Counter from Levenshtein import jaro_winkler from alchemy import fetch_session # gives us the `session` variable from alchemy.schema import * from handlers.xml_...
Python
0.998593
@@ -1047,16 +1047,56 @@ gnees):%0A + print 'Creating assignee blocks...'%0A assi @@ -1098,32 +1098,32 @@ assignees = %5B%5D%0A - for assignee @@ -1465,16 +1465,21 @@ econdary +, 0.0 ) %3E= THR @@ -1579,16 +1579,53 @@ condary) +%0A print 'Assignee blocks created!' %0A%0Adef di @@ -2423,26 +2423,37...
c41e8f805ec8298c600fdf76c8f48d96ab4200b7
update registerUser and unregisterUser functions
pikyak_app.py
pikyak_app.py
#!/usr/bin/python2 from flask import Flask, request, g, jsonify, url_for from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.httpauth import HTTPBasicAuth from sqlalchemy import exc, exists from sqlalchemy.orm.exc import NoResultFound from passlib.hash import sha256_crypt as crypt import os app = Flask(__name_...
Python
0
@@ -1084,16 +1084,29 @@ b.String +(maxIDlength) )%0A de @@ -1311,16 +1311,57 @@ = False +%0A self.gcm_id = args.get('gcm_id') %0A%0A # @@ -3327,34 +3327,34 @@ %22%5D)%0Adef register -Pe +Us er(userID):%0A @@ -3425,32 +3425,87 @@ rization is None + %5C%0A or request.authorization%5B'userna...
5ba1ee67df42d00eb336cadd4748469121c17ad5
Remove "settings" function
pirx/utils.py
pirx/utils.py
import os def setting(name): return name.upper() def path(*p): import __main__ project_root = os.path.dirname(os.path.realpath(__main__.__file__)) return os.path.join(project_root, *p)
Python
0.000158
@@ -9,52 +9,8 @@ s%0A%0A%0A -def setting(name):%0A return name.upper()%0A%0A def
051e7ea666aa987334a2243756a2c97484037b61
Update boundaries to main_curve ones
plot_s_curve.py
plot_s_curve.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import matplotlib.pyplot as plt from numpy import array, log import sys import os import matplotlib.animation as animation fig = plt.figure() inpath = sys.argv[1] if os.path.isfile(inpath): print('Visiting {}'.format(inpath)) filenames = [inpath] else: _fil...
Python
0
@@ -1439,16 +1439,16 @@ lim( -1.8 +0.9 , 3. -2 +1 )%0A @@ -1462,9 +1462,11 @@ lim( -6 +5.5 , 8)
a51b53e16707045955cd4305dc637ae0b6c343dd
Disable web renderer
src/sentry/api/base.py
src/sentry/api/base.py
from __future__ import absolute_import from datetime import datetime, timedelta from pytz import utc from rest_framework.authentication import SessionAuthentication from rest_framework.parsers import JSONParser from rest_framework.response import Response from rest_framework.views import APIView from urllib2 import qu...
Python
0.000001
@@ -205,16 +205,66 @@ NParser%0A +from rest_framework.renderers import JSONRenderer%0A from res @@ -708,16 +708,55 @@ cation)%0A + renderer_classes = (JSONRenderer,)%0A pars
dde62a1bc100ba4be16489e4171f0c78593d95af
Add tests to http plugin
plugins/http.py
plugins/http.py
import requests import sys class Plugin: def on_command(self, bot, msg): url = None if len(sys.argv) >= 3: url = sys.argv[2] else: url = sys.stdin.read().strip() if url: headers = {"User-Agent": "SmartBot"} page = requests.get(url, h...
Python
0
@@ -1,12 +1,22 @@ +import io%0A import reque @@ -26,19 +26,24 @@ %0Aimport -sys +unittest %0A%0A%0Aclass @@ -84,16 +84,38 @@ bot, msg +, stdin, stdout, reply ):%0A @@ -143,24 +143,27 @@ if len( -sys.argv +msg%5B%22args%22%5D ) %3E= 3:%0A @@ -184,16 +184,19 @@ l = -sys.argv +msg%5B%22args%22%5D %5B2%5D%...
83d36b81766c0b0be749daa9c4ea34a5b9e6560b
fix a bug
plugins/pano.py
plugins/pano.py
from time import time from plugin import Plugin, PluginDocument from database import TableBase, Column, Text, Integer, Boolean from database import engine, session class PanoDocument(TableBase, PluginDocument): __tablename__ = 'pano' def __init__(self, owner, title='Untitled', text=''): super().__...
Python
0.000016
@@ -5022,16 +5022,52 @@ ments))) +%0A return dict(project=events) %0A%0A__plug
645466e367b0d7b706df887ca1ff73b3cff32281
set last_modified/cache-control in 304 response as well..
pngtile/tile.py
pngtile/tile.py
""" Raw tile handling. """ from werkzeug import Request, Response, exceptions from werkzeug.utils import redirect import werkzeug.urls import pngtile.application import pypngtile import datetime ## Coordinates # width of a tile TILE_SIZE = 256 # maximum zoom out MAX_ZOOM = 4 # max. output resolution to allow ...
Python
0
@@ -4480,20 +4480,24 @@ re -turn +sponse = Respons @@ -4514,29 +4514,34 @@ 04)%0A +else:%0A -%0A # re @@ -4544,17 +4544,22 @@ # render -%0A + %0A @@ -4609,23 +4609,8 @@ - # response%0A @@ -4664,16 +4664,45 @@ e/png')%0A + %0A # cache out%0A ...
db1a951d7d1708546f1df1def92b6764135ff3cc
change the url base for lists
crate_project/urls.py
crate_project/urls.py
from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() import evaluator evaluator.autodiscover import ji18n.translate ji18n.translate.patch() from pinax.apps.account.openid_consumer import PinaxConsumer from search.views import Sea...
Python
0.000002
@@ -817,23 +817,20 @@ url(r%22%5E -package +user s/%22, inc @@ -835,23 +835,20 @@ nclude(%22 -package +list s.urls%22) @@ -842,32 +842,33 @@ %22lists.urls%22)),%0A +%0A url(r%22%5Elists @@ -862,20 +862,23 @@ url(r%22%5E -list +package s/%22, inc @@ -875,36 +875,39 @@ ges/%22, include(%22 -list +package ...
8ff1206db08a53f5085f95eed3e85b8812723408
validate url
core/analyzer.py
core/analyzer.py
from urllib import parse from .islands import island_netloc_table, island_class_table, IslandNotDetectError __author__ = 'zz' def determine_island_name(url): netloc = parse.urlparse(url).netloc for url, name in island_netloc_table.items(): if url == netloc: return name else: ra...
Python
0.009115
@@ -538,16 +538,457 @@ (url)%0A%0A%0A +def validate_url(url):%0A %22%22%22%0A :param url:%0A :return:status code%0A%0A status code ---%3E info%0A ---------------------------%0A 0 success%0A 1 no scheme%0A 2 island not support%0A%0A%0A ...
f3f439e2ef73d07f2e3c16abe3874823f4ebc983
Update kalman_fil.py
code/kalman_fil.py
code/kalman_fil.py
""" kalman_fil.py Classic Kalman filter for statistical noise mitigation. Naoufal Mahfoudi (c) 2016 mohamed-naoufal.mahfoudi@inria.fr """ import pandas as pd from hampel import * def kalman_fil(csv): """Kalman filter Args: csv: csv file containing the AoA and AoD. Returns: array ...
Python
0.000001
@@ -559,16 +559,18 @@ dt = +0. 1%0A u @@ -600,10 +600,9 @@ 0.0 -09 +3 %0A @@ -2017,9 +2017,25 @@ DOA, DOD +,angles1,angles2 %0A
dd76e1b70f63cb5aa2c720c734b244789426abb8
Add artful; stop building for yakkety
dabuildsys/config.py
dabuildsys/config.py
#!/usr/bin/python """ Shared configuration-level variables. """ from glob import glob import os import os.path # If you edit these releases and tags, please also update # debian-versions.sh in scripts.git (checked out at /mit/debathena/bin). debian_releases = ['wheezy', 'jessie', 'stretch'] ubuntu_releases = ['prec...
Python
0.000001
@@ -344,24 +344,23 @@ ', ' -yakke +zes ty', ' -zesty +artful '%5D%0Ar @@ -619,13 +619,11 @@ ,%0A%09' -yakke +zes ty' @@ -636,12 +636,12 @@ ntu1 -6.10 +7.04 ~0.1 @@ -637,37 +637,38 @@ tu17.04~0.1',%0A%09' -zesty +artful ' : 'ubuntu17.04 @@ -661,26 +661,26 @@ : 'ubuntu17. +1 0 -4 ~0.1',%0A%7D%0Arel
b60d4d5a93f0f24e119f856c7877b8d386d0eee5
make sure to return the state
daikon/connection.py
daikon/connection.py
import requests import anyjson as json import urlparse class Connection(object): _state = None _health = None def __init__(self, host, port): self.host = host self.port = port self.url = 'http://%s:%s' % (host, port) def get(self, path, raise_for_status=True): url = ur...
Python
0.000183
@@ -1417,20 +1417,47 @@ adata'%5D%5Bu'indices'%5D%0A + return self._state%0A
bc1d19800d58291f4c4392d041a7913602fe8c7d
Fix sorting dict items in python 3
dallinger/jupyter.py
dallinger/jupyter.py
from ipywidgets import widgets from jinja2 import Template from traitlets import ( observe, Unicode, ) from dallinger.config import get_config header_template = Template(u""" <h2>{{ name }}</h2> <div>Status: {{ status }}</div> {% if app_id %}<div>App ID: {{ app_id }}</div>{% endif %} """) config_template = T...
Python
0.000095
@@ -996,16 +996,21 @@ items = +list( config.a @@ -1025,16 +1025,17 @@ .items() +) %0A
020bca819d0e6e2d40136c3e819383baab11699f
return split in LDA.
lib/LDA.py
lib/LDA.py
#!/usr/bin/env python import numpy from lib.content_based import ContentBased from sklearn.decomposition import LatentDirichletAllocation from sklearn.feature_extraction.text import CountVectorizer class LDARecommender(ContentBased): def __init__(self, abstracts, evaluator, config, verbose=False): super(L...
Python
0.000002
@@ -874,32 +874,39 @@ (self):%0A +return super(LDARecomme
a9fcf91df8920c1916921cd93d607ab623908a50
Version Bump
aashestrap/__init__.py
aashestrap/__init__.py
VERSION = (0, 1, 14) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version = '%s.%s' % (version, VERSION[2]) return version
Python
0.000001
@@ -15,9 +15,9 @@ 1, 1 -4 +5 )%0A%0A%0A
568c4a65a08fab3bdf1e7b3dc190eaf86204f531
fix none-type passed to os.path
modoboa_installer/scripts/backup.py
modoboa_installer/scripts/backup.py
"""Backup script for pre-installed instance""" import os import shutil from .. import database from .. import utils #TODO: have version of each modoboa componenents saved into the config file to restore the same version class Backup(): #Backup structure ( {optional} ): #{{backup_folder}} #|| #||--> installer.cf...
Python
0.000002
@@ -815,33 +815,36 @@ RY:%0A -o +util s.mkdir(self.des @@ -952,25 +952,42 @@ irectory%22%22%22%0A -%0A + try: %0A if o @@ -999,32 +999,36 @@ h.isfile(path):%0A + prin @@ -1083,16 +1083,117 @@ tory!%22)%0A + return False%0A except:%0A ...
8d34b26b3c9d17f7657af37f975f6e60018d30d2
add PREMIUM_ONLY_PATTERN
module/plugins/hoster/UploadedTo.py
module/plugins/hoster/UploadedTo.py
# -*- coding: utf-8 -*- import re import time import urlparse from module.network.RequestFactory import getURL as get_url from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class UploadedTo(SimpleHoster): __name__ = "UploadedTo...
Python
0.000001
@@ -368,9 +368,9 @@ %220.9 -6 +7 %22%0A @@ -1008,16 +1008,123 @@ tenance' +%0A PREMIUM_ONLY_PATTERN = r'This file exceeds the max%5C. filesize which can be downloaded by free users%5C.' %0A%0A LI @@ -2785,16 +2785,44 @@ sponse%7D) +%0A self.check_errors() %0A%0A
48d8053cc03041ce74587f86947e1911d531abaa
missing s
advgoogle/advgoogle.py
advgoogle/advgoogle.py
import discord import aiohttp from discord.ext import commands from .utils import checks from __main__ import send_cmd_help from random import choice import re from cogs.utils.chat_formatting import * import urllib class AdvancedGoogle: def __init__(self, bot): self.bot = bot self.option = {'User-...
Python
0.999823
@@ -4327,16 +4327,17 @@ , header +s = self.
6273aa694516cb38bdebc80886fa78497473b275
update ip plugin
plugins/ip.py
plugins/ip.py
# !/usr/bin/env python3 # -*- coding: utf-8 -*- # ----------------------------- # Author: Bruce Zhang # Email: zy183525594@163.com # Version: 0.1 # ----------------------------- '''ip lookup plugin''' import re import json import requests def ip(args, nick, channel, c, e): if not args: return "%s: %s" ...
Python
0
@@ -374,13 +374,31 @@ urn -False +%22%25s: %25s%22 %25 (nick, args) %0A%0A%0Ad @@ -762,11 +762,31 @@ %EF%BC%81%E6%A3%80%E6%9F%A5%E6%98%AF%E5%90%A6%E5%B7%B2%E9%9A%90%E8%BA%AB -%EF%BC%81 +%E6%88%96IP%E6%A0%BC%E5%BC%8F%E4%B8%8D%E6%AD%A3%E7%A1%AE%EF%BC%81- %E6%9A%82%E5%8F%AA%E6%94%AF%E6%8C%81IPv4%E5%9C%B0%E5%9D%80 %22...
95cc9657fb1dd9ca48541cdf93e81bb284c50452
Support filtering by house
pmg/api/v2.py
pmg/api/v2.py
from flask import request, Blueprint, abort from sqlalchemy import desc from sqlalchemy.orm import defer, noload from sqlalchemy.sql.expression import nullslast from pmg.models import Committee, CommitteeMeeting, CommitteeMeetingAttendance, CallForComment, Bill from pmg.api.v1 import get_filters, paginate_request_quer...
Python
0
@@ -649,24 +649,467 @@ _filters():%0A + key = f.keys()%5B0%5D%0A%0A # support filtering by house, via committee if necessary%0A if key == 'house':%0A model = query._entity_zero().entity_zero.entity%0A if not hasattr(model, 'house'):%0A if hasattr(model, 'commit...
6167a7c49fe1d2f0cd73c9d1259cc1c9824eeb68
Add test for DeprecationWarning
tardis/montecarlo/tests/test_spectrum.py
tardis/montecarlo/tests/test_spectrum.py
import pytest import numpy as np import pandas as pd from astropy import ( units as u, constants as c ) import astropy.tests.helper as test_helper from tardis.montecarlo.spectrum import TARDISSpectrum BIN = 5 TESTDATA = [ { 'nu': u.Quantity(np.linspace(1, 50, BIN + 1), 'Hz...
Python
0
@@ -1890,32 +1890,83 @@ stance', None):%0A + with pytest.warns(DeprecationWarning):%0A test_hel @@ -2003,32 +2003,36 @@ + + spectrum.flux_nu @@ -2029,24 +2029,28 @@ um.flux_nu,%0A + @@ -2074,32 +2074,36 @@ nosity_to_flux(%0A + @@ -215...
b04add2a065f0715cc86f119fe5479cce25ec4db
Delete old test
tardis/plasma/tests/test_plasmas_full.py
tardis/plasma/tests/test_plasmas_full.py
import os import pytest import warnings import copy import pandas as pd import pandas.util.testing as pdt from tardis.simulation import Simulation from tardis.io.config_reader import Configuration config_files = { 'lte': 'tardis/plasma/tests/data/plasma_test_config_lte.yml', 'nlte': 'tardis/plasma/te...
Python
0.000164
@@ -2337,397 +2337,4 @@ ds)%0A -%0A def test_high_temperature(self, simulation):%0A simulation = copy.deepcopy(simulation)%0A with warnings.catch_warnings(record=True) as w:%0A simulation.plasma.update_radiationfield(%0A t_rad=%5B100000.%5D, ws=%5B0.5%5D, j_blues=None, nl...
1c01080116a94e1dcd30afa143454818a9aeaf31
change version to represent actual version
androguard/__init__.py
androguard/__init__.py
# The current version of Androguard # Please use only this variable in any scripts, # to keep the version number the same everywhere. __version__ = "3.1.0"
Python
0.000001
@@ -147,10 +147,14 @@ = %223.1.0 +-rc1 %22%0A
965f3ed4f4723547b69f9430fc5efc097c864579
Remove extraneous spaces.
src/test/testparser.py
src/test/testparser.py
from cStringIO import StringIO from nose.tools import * from tokenutils import Iterable2TokenStream, make_token from libeeyore.functionvalues import * from libeeyore.languagevalues import * from libeeyore.values import * from parse import EeyoreLexer from parse import EeyoreParser from parse import EeyoreTreeWalker...
Python
0.001752
@@ -962,26 +962,24 @@ c.__class__, - EeySymbol ) @@ -1120,18 +1120,16 @@ class__, - EeyStri
5a85c1588d90524289af1d6f0cce99bf842dae5a
Fix a hack in the echo client.
src/test_echoclient.py
src/test_echoclient.py
#!/usr/bin/env python # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from __future__ import print_function import os from twisted.internet import task, stdio, reactor from twisted.internet.defer import Deferred from twisted.internet.protocol import ClientFactory from twisted.protocols.basic ...
Python
0
@@ -1,138 +1,4 @@ -#!/usr/bin/env python%0A# Copyright (c) Twisted Matrix Laboratories.%0A# See LICENSE for details.%0A%0Afrom __future__ import print_function%0A%0A impo @@ -293,32 +293,49 @@ ef __init__(self +, onClientConnect ):%0A # App @@ -446,811 +446,121 @@ -# FIXME FIXME FIXME: This is a terribl...
ed583b1fdcee79bd7999b3b86c329bdd8f43260a
Use absolute paths for oscaar.__file__ to appropriately compile .c code
post_setup.py
post_setup.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import sys import urllib2 import time """ Function to download the ds9 version for current platform. URLs are tested working on 5-19-2013 """ def download_ds9(): print import oscaar oscaardir = oscaar.__file__ osc...
Python
0.000039
@@ -282,32 +282,48 @@ oscaardir = +os.path.abspath( oscaar.__file__%0A @@ -313,32 +313,33 @@ (oscaar.__file__ +) %0A oscaardirds @@ -3345,16 +3345,32 @@ ardir = +os.path.abspath( oscaar._ @@ -3376,16 +3376,17 @@ __file__ +) %0A osc
cff6b143a864f79586882be875913c7dbfa41319
Handle OSError if 'dakota' is not in path
csdms/dakota/utils.py
csdms/dakota/utils.py
#! /usr/bin/env python """Helper functions for processing Dakota parameter and results files.""" import os import subprocess import re import yaml def is_dakota_installed(): """Check whether Dakota is installed and in the execution path. Returns ------- bool True if Dakota is callable. ""...
Python
0.000012
@@ -382,32 +382,33 @@ n'%5D)%0A except +( subprocess.Calle @@ -412,32 +412,42 @@ lledProcessError +, OSError) :%0A return
b4355969af5a238f59cec10f348fb3aed3846eb5
Implement GC3Pie sessions in workflow
src/tmlib/tmaps/api.py
src/tmlib/tmaps/api.py
import os import logging from .workflow import Workflow from ..api import BasicClusterRoutines logger = logging.getLogger(__name__) class WorkflowClusterRoutines(BasicClusterRoutines): def __init__(self, experiment, prog_name, verbosity): ''' Initialize an instance of class WorkflowClusterRoutin...
Python
0
@@ -18,16 +18,66 @@ logging%0A +import shutil%0Afrom gc3libs.session import Session%0A from .wo @@ -1294,16 +1294,348 @@ ct_dir%0A%0A + @property%0A def session_dir(self):%0A '''%0A Returns%0A -------%0A str%0A absolute path the%0A %60GC3Pie session %3Chttp://g...
5ad1684cbbc33845529a3a7a20e35d3732db5e6d
add a redirect url to course detail view in remove_student_from_course function
courses/views.py
courses/views.py
from django.shortcuts import render, redirect, get_object_or_404 from django.http import Http404 from django.contrib import messages from .forms import NewCourseForm, GradeForm, Grade from students.models import Student from courses.models import Course, CourseAnnouncement from .models import GradeColumn # Create yo...
Python
0
@@ -125,16 +125,61 @@ messages +%0Afrom django.core.urlresolvers import reverse %0A%0Afrom . @@ -4512,16 +4512,110 @@ oved.')%0A + return redirect(reverse('instructor_view_course_stundets_announcments', args=%5Bcourse_id%5D)) %0A%0Adef st
382e489895e8b40b4b1ade4d5b62263035121a11
Remove unused version check
crimson/utils.py
crimson/utils.py
# -*- coding: utf-8 -*- """ crimson.utils ~~~~~~~~~~~~~ General utilities. """ # (c) 2015-2020 Wibowo Arindrarto <bow@bow.web.id> import json import re import sys from contextlib import contextmanager from os import linesep import click import yaml if sys.version_info[0] > 2: basestring = str RE_...
Python
0
@@ -164,19 +164,8 @@ re%0A -import sys%0A from @@ -252,58 +252,8 @@ ml%0A%0A -if sys.version_info%5B0%5D %3E 2:%0A basestring = str%0A%0A %0ARE_ @@ -2904,34 +2904,27 @@ ance(input, -basestring +str ):%0A a @@ -2951,35 +2951,15 @@ ut, -basestring), (%0A +str), f %22Une @@ -2982,12 +2982,...
e2f2ad15f8801d82e26044d440741afabb9e49e0
remove debugging print statements.
cruzdb/mirror.py
cruzdb/mirror.py
# from http://www.tylerlesmann.com/2009/apr/27/copying-databases-across-platforms-sqlalchemy/ from sqlalchemy import create_engine, Table, select, Enum, Column, MetaData from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.dialects.mysql import LONGBLOB, ENUM ...
Python
0.000002
@@ -1746,24 +1746,25 @@ har%0A +# print col.na @@ -2052,24 +2052,25 @@ +# print dir(co
95ab395eef8288f1612b479838c065a2d43c4cf2
remove first arg instead of `self` to make the function more robust and worked for classmethod
tensorflow/python/util/function_utils.py
tensorflow/python/util/function_utils.py
# Copyright 2018 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
@@ -1783,22 +1783,40 @@ rgs. +pop(0) # remove -(' + %60 self -') +%60 or %60cls%60 %0A r
e93bc8c5e660581b3a3d42d5b7f7538e131ca487
Remove force-visible of exportable host identity.
termius/porting/providers/ssh/adapter.py
termius/porting/providers/ssh/adapter.py
# -*- coding: utf-8 -*- """Module with adapter for ssh config hosts.""" from os import environ from pathlib2 import Path from termius.core.commands.mixins import SshConfigMergerMixin from termius.core.models.terminal import Host, SshConfig, Identity, SshKey class SSHConfigHostAdapter(SshConfigMergerMixin): """C...
Python
0
@@ -1510,68 +1510,8 @@ %22%22%22%0A - host_instance.ssh_config.identity.is_visible = True%0A
d449e9a81687de41d43a59a10eecf335dce9e30a
Use transaction.atomic() to manage transactions.
teryt/management/commands/teryt_parse.py
teryt/management/commands/teryt_parse.py
from django.core.management.base import BaseCommand, CommandError from django.db import transaction, DatabaseError, IntegrityError from optparse import make_option from teryt.models import ( RodzajMiejscowosci, JednostkaAdministracyjna, Miejscowosc, Ulica ) from teryt.utils import parse import os.path class Co...
Python
0.000001
@@ -755,50 +755,8 @@ te'%5D -%0A transaction.set_autocommit(False) %0A%0A @@ -1236,32 +1236,79 @@ try:%0A + with transaction.atomic():%0A @@ -1357,24 +1357,28 @@ + for vals in @@ -1411,16 +1411,20 @@ + + t = c()%0A @@ -1419...
223ffba460867f566dec8ae71619e0ca96249f72
Add doc string to git_manager.py
src/utils/code_etl/git_manager.py
src/utils/code_etl/git_manager.py
#!/usr/bin/env python """ """ import tempfile import shutil import subprocess class Repository(object): """Manage the download and cleanup of a github.com git repository. Given the name of a github repository, this class will download it to a local, temporary directory. The directory will be cleaned up...
Python
0.000015
@@ -19,16 +19,370 @@ hon%0A%0A%22%22%22 +Provides a Repository class to handle the downloading and removal of a%0Agithub repository.%0A%0AThis class should be used as follows:%0A%0A with Repository(%22lab41/hermes%22) as hermes_repo:%0A # do_stuff()%0A%0AThe repository is downloaded to a temporary directory ...
c8117584e3ebd331ed7aea8ec91751242d607a4e
clean up test_create_large_static_cells_and_rows
test/cql-pytest/test_large_cells_rows.py
test/cql-pytest/test_large_cells_rows.py
# Copyright 2020 ScyllaDB # # This file is part of Scylla. # # Scylla is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Scylla...
Python
0.00012
@@ -733,16 +733,32 @@ requests +%0Aimport nodetool %0A%0Adef te @@ -1284,25 +1284,8 @@ , ?) - USING TIMEOUT 5m %22)%0A @@ -1600,484 +1600,33 @@ -# REST API endpoint address for test scylla node%0A node_address = f'http://%7Bcql.cluster.contact_points%5B0%5D%7D:10000'%0A # Execute force flush of...
d8c31128ee581a167c3b7fede6bdb600a154b1f3
Add missing LICENSE headers
st2common/st2common/util/jinja.py
st2common/st2common/util/jinja.py
import json import jinja2 import six def render_values(mapping=None, context=None): """ Render an incoming mapping using context provided in context using Jinja2. Returns a dict containing rendered mapping. :param mapping: Input as a dictionary of key value pairs. :type mapping: ``dict`` :p...
Python
0.000001
@@ -1,16 +1,796 @@ +# Licensed to the StackStorm, Inc ('StackStorm') under one or more%0A# contributor license agreements. See the NOTICE file distributed with%0A# this work for additional information regarding copyright ownership.%0A# The ASF licenses this file to You under the Apache License, Version 2.0%0A# (the %2...
a46f8319ec96fe6f1b80b9017435e6a2d9a59086
debug ssh key to the EC2WorkerTest.test_worker
studio/tests/cloud_worker_test.py
studio/tests/cloud_worker_test.py
import unittest import os import uuid from studio.gcloud_worker import GCloudWorkerManager from studio.ec2cloud_worker import EC2WorkerManager from local_worker_test import stubtest_worker from timeout_decorator import timeout from studio.util import has_aws_credentials @unittest.skipIf( 'GOOGLE_APPLICATION_CRE...
Python
0.000001
@@ -2309,32 +2309,57 @@ oud-timeout=120' +, 'ssh-keypair=peterz-k1' %5D,%0A c
183675522d68972c59cc3c3db3eaf7f8131422c8
allow keyboard/toggle to be null
subiquity/controllers/keyboard.py
subiquity/controllers/keyboard.py
# Copyright 2015 Canonical, Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
Python
0
@@ -1310,32 +1310,33 @@ ': %7B'type': +%5B 'string' %7D,%0A @@ -1315,32 +1315,41 @@ type': %5B'string' +, 'null'%5D %7D,%0A %7D
9b8bfbbe7f55a72f78de8865e5d7b0c727528e35
set allows_subquery to True (#7863)
superset/db_engine_specs/druid.py
superset/db_engine_specs/druid.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
0
@@ -1003,20 +1003,19 @@ query = -Fals +Tru e%0A%0A t
286d3ba56a6df927215a5668e1689283f1b922ce
Add item_was_clicked signal
svir/ui/multi_select_combo_box.py
svir/ui/multi_select_combo_box.py
from PyQt5.QtWidgets import ( QLineEdit, QCheckBox, QComboBox, QListWidget, QListWidgetItem, QApplication, QMainWindow) from PyQt5.QtCore import QEvent, pyqtSignal from PyQt5.QtGui import QCursor class MultiSelectComboBox(QComboBox): SEARCH_BAR_IDX = 0 selection_changed = pyqtSignal() def __init...
Python
0.000002
@@ -297,16 +297,55 @@ Signal() +%0A item_was_clicked = pyqtSignal(str) %0A%0A de @@ -5060,16 +5060,72 @@ ecked()) +%0A self.item_was_clicked.emit(checkbox.text()) %0A%0A de
2155e1441f2722619640c0fb93ca70a216feec4d
update settings.py language to zh-cn
ArtWorkManager/settings.py
ArtWorkManager/settings.py
""" Django settings for ArtWorkManager project. Generated by 'django-admin startproject' using Django 1.8.5. 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/ """ # Bui...
Python
0.000001
@@ -3188,13 +3188,13 @@ = ' -en-us +zh-cn '%0A%0AD
4e628f9b2c3b30df81fb878d00343005badf952a
fix missing import
lib/exaproxy/network/server.py
lib/exaproxy/network/server.py
#!/usr/bin/env python # encoding: utf-8 """ server.py Created by Thomas Mangin on 2011-11-30. Copyright (c) 2011 Exa Networks. All rights reserved. """ # http://code.google.com/speed/articles/web-metrics.html # http://itamarst.org/writings/pycon05/fast.html from exaproxy.network.functions import listen from exaproxy...
Python
0.008361
@@ -340,16 +340,30 @@ logger%0A +import socket%0A %0A%0Aclass