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
eadc0eb76fc027e5eaee5b9c3c734eaa42a73bf1
set up...
miniverse/settings/heroku_dev.py
miniverse/settings/heroku_dev.py
from __future__ import absolute_import import os from os.path import join#, normpath, isdir, isfile import dj_database_url from .base import * # Set the secret key SECRET_KEY = os.environ['SECRET_KEY'] # Cookie name SESSION_COOKIE_NAME = 'dv_metrics_dev' #INTERNAL_IPS = () # Heroku IP ALLOWED_HOSTS = ['54.235.7...
Python
0
@@ -579,375 +579,376 @@ %5D%0A%0A%0A -HEROKU_DB_CONFIG = dj_database_url.config(conn_max_age=500)%0A%0A# Set the Miniverse admin url%0ADATABASES%5B'miniverse_admin_db'%5D.update(HEROKU_DB_CONFIG)%0ADATABASES%5B'miniverse_admin_db'%5D%5B'TEST'%5D = %7B'MIRROR': 'default'%7D%0A%0A# Set the Dataverse url%0ADV_DEMO_DATABA...
251ac6779c57439482837d925601f87d7ad31543
Remove unused functions
src/core/models.py
src/core/models.py
from django.apps import apps from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _ from .validators import EAWMaxLengthValidator class BigForeignKey(models.ForeignKey): def db_type(self, connection): """ Adds support for foreign keys to big ...
Python
0.000004
@@ -5324,557 +5324,4 @@ el%5D%0A -%0A def get_language_url(self):%0A return %7B%0A 'ENEN': 'en-talk-en-slides.svg',%0A 'ZHZH': 'zh-talk-zh-slides.svg',%0A 'ZHEN': 'zh-talk-en-slides.svg',%0A # no TAI svg provide, so use zhzh.%0A 'TAI': 'zh-talk-zh-slides...
74bb23355d168f4f415fa2d3dd3d147b7807fed0
Update leap_factory.py
leapcast/services/leap_factory.py
leapcast/services/leap_factory.py
from __future__ import unicode_literals import shlex import subprocess import copy import logging import tempfile import shutil import tornado.websocket import tornado.ioloop import tornado.web from leapcast.services.websocket import App from leapcast.utils import render from leapcast.environment import Environment ...
Python
0.000001
@@ -477,16 +477,43 @@ ne = ''' +--no-default-browser-check --ignore
1a8c7e23fccec4ba94337963c2dbc9fd3c834446
Include Chrome's Skia config, not the default one
brightray.gyp
brightray.gyp
{ 'includes': [ 'brightray.gypi', ], 'variables': { 'brightray_source_root': '<!(python tools/brightray_source_root.py)', }, 'targets': [ { 'target_name': 'brightray', 'type': 'static_library', 'include_dirs': [ '.', '<(libchromiumcontent_include_dir)', '<...
Python
0
@@ -350,32 +350,12 @@ ir)/ -third_party/skia/include +skia /con @@ -619,69 +619,21 @@ ir)/ -third_party/skia/include/config',%0A # For SkMatrix.h. +skia/config', %0A
e5f662d9cebe4133705eca74a300c325d432ad04
Remove destruction of pips/test requires entries that don't exist.
anvil/components/cinder_client.py
anvil/components/cinder_client.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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.or...
Python
0
@@ -1052,304 +1052,8 @@ s)%0A%0A - def _filter_pip_requires_line(self, line):%0A if line.lower().find('keystoneclient') != -1:%0A return None%0A if line.lower().find('novaclient') != -1:%0A return None%0A if line.lower().find('glanceclient') != -1:%0A return Non...
64fc6944c1b1a37b90a171f6faffcbc6cd2e5cdd
Change index name of weather DataFrame in basic_example
example/basic_example.py
example/basic_example.py
""" The ``basic_example`` module shows a simple usage of the windpowerlib. """ __copyright__ = "Copyright oemof developer group" __license__ = "GPLv3" import logging import os import pandas as pd try: from matplotlib import pyplot as plt except ImportError: plt = None from windpowerlib import modelchain fr...
Python
0.000001
@@ -1634,16 +1634,40 @@ er.csv') +%0Aweather.index.name = '' %0A%0A# Spec
e95925a075b77d7cb33e477154eab1c8f4e250ee
Add a 0-score for unknown score keys
reviewday/mergeprop.py
reviewday/mergeprop.py
class MergeProp(object): def _calc_score(self, lp, project, topic): cause = 'No link' try: if topic.find('bug/') == 0: bug = lp.bug(topic[4:]) #FIXME: bug.importance doesn't seem to work but it should? cause = '%s bugfix' % bug.bug_tasks[0...
Python
0.9998
@@ -1291,16 +1291,183 @@ %7D%0A%0A + if cause not in cause_score:%0A print 'WARNING: unable to find score for (%25s, %25s)' %25 (topic, cause)%0A return (%22Unknown cause: %22 + cause, 0)%0A
e7e8a9663abdeba5ed9d57b9e1140fb619242b32
remove useless print
completions.py
completions.py
import sublime, sublime_plugin import re import time from . import context from .salesforce.metadata import apex_completions from .salesforce import vf def get_sobject_completions(): # Load sobjects compoletions setting = sublime.load_settings("sobjects_completion.sublime-settings") # Load sobjects field...
Python
0.000178
@@ -3557,36 +3557,8 @@ s%5D%22%0A - print (pattern)%0A @@ -3629,78 +3629,8 @@ ASE) -%0A print (variable_name)%0A print (matched_regions) %0A%0A
bbe6d9cea66351a2d9b0629889250b3eb6bbd3f0
Use triple double quotes
bears/natural_language/LanguageToolBear.py
bears/natural_language/LanguageToolBear.py
import shutil import logging from guess_language import guess_language from coalib.bearlib import deprecate_settings from coalib.bears.LocalBear import LocalBear from dependency_management.requirements.PipRequirement import PipRequirement from coalib.results.Diff import Diff from coalib.results.Result import Result f...
Python
0.000004
@@ -1441,35 +1441,35 @@ r)=()):%0A -''' +%22%22%22 %0A Checks @@ -2040,11 +2040,11 @@ -''' +%22%22%22 %0A
e1e7589b805072ff741eeb7b31ba326f45ea0504
Implement an authorization system
buffpy/api.py
buffpy/api.py
import json from rauth import OAuth2Session from buffpy.response import ResponseObject BASE_URL = 'https://api.bufferapp.com/1/%s' PATHS = { 'INFO': 'info/configuration.json' } class API(object): ''' Small and clean class that embrace all basic operations with the buffer app ''' def __init__(self, ...
Python
0.005519
@@ -4,16 +4,30 @@ ort json +%0Aimport urllib %0A%0Afrom r @@ -51,16 +51,31 @@ 2Session +, OAuth2Service %0A%0Afrom b @@ -112,16 +112,17 @@ Object%0A%0A +%0A BASE_URL @@ -167,16 +167,18 @@ THS = %7B%0A + 'INFO' @@ -208,16 +208,138 @@ son'%0A%7D%0A%0A +AUTHORIZE_URL = 'https://bufferapp.com/oauth2/authorize'...
7bb5f463dfeb39b8ba84a63147756d27901a2f56
fix cymysql's _extact_error_code() for py3
lib/sqlalchemy/dialects/mysql/cymysql.py
lib/sqlalchemy/dialects/mysql/cymysql.py
# mysql/cymysql.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mysql+cymysql :name: CyMySQL :dbapi: cymysql :connectst...
Python
0.000887
@@ -716,22 +716,19 @@ -return +v = excepti @@ -737,16 +737,94 @@ .args%5B0%5D +%0A if not isinstance(v, int):%0A v = v.args%5B0%5D%0A return v %0A%0Adialec
24be0e81f34e077f4a976851a3da67e08faf9905
Use logging
src/gopro_renamer/renamer.py
src/gopro_renamer/renamer.py
#!/usr/bin/env python # # Copyright (c) 2014,2018 Kevin Ha # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modif...
Python
0.000001
@@ -1172,16 +1172,76 @@ datetime +%0Aimport logging%0A%0Alogger = logging.getLogger('gopro-renamer') %0A%0A__vers @@ -2951,21 +2951,27 @@ w))%0A -print +logger.info (log)%0A%0Ad @@ -3192,24 +3192,179 @@ toptions()%0A%0A + logging.basicConfig(level=logging.INFO,%0A format='%25(asctime)s - %25(levelnam...
d4ecc0c5de4690c529d24afcdd6d285b2a2144f0
fix parsing date, duration and title
weboob/backends/ina/pages/video.py
weboob/backends/ina/pages/video.py
# -*- coding: utf-8 -*- # Copyright(C) 2010 Christophe Benz # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will...
Python
0.00013
@@ -1686,28 +1686,36 @@ ct(' +div .bloc- -video-edito h3 +produit-haut p.date ')%5B0 @@ -2200,28 +2200,32 @@ ct(' +div .bloc- -video-edito h2 +produit-haut h1 ')%5B0
8e86727c52b4a6e2277be6ab270aa1ec67441526
use all_to_dicts
examples/40_join.py
examples/40_join.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import psycopg2 from pprint import pprint from mosql.query import select, left_join from mosql.db import Database db = Database(psycopg2, host='127.0.0.1') with db as cur: cur.execute(select( 'person', {'person_id': 'mosky'}, # It is same as...
Python
0.00007
@@ -153,16 +153,30 @@ Database +, all_to_dicts %0A%0Adb = D @@ -599,20 +599,23 @@ int( -cur.fetchall( +all_to_dicts(cur ))%0A
f6d1f69cb187b78448ab23832287aa443a1b8cb2
Add instance and Elastic IP usage
testcases/cloud_admin/create_resources.py
testcases/cloud_admin/create_resources.py
#!/usr/bin/python # Software License Agreement (BSD License) # # Copyright (c) 2009-2011, Eucalyptus Systems, Inc. # All rights reserved. # # Redistribution and use of this software in source and binary forms, with or # without modification, are permitted provided that the following conditions # are met: # # Redistri...
Python
0
@@ -2588,24 +2588,792 @@ et_zones())%0A + keypair = self.tester.add_keypair(self.tester.id_generator())%0A group = self.tester.add_group(self.tester.id_generator())%0A self.tester.authorize_group_by_name(group_name=group.name )%0A self.tester.authorize_group_by_name(group_na...
6e08cf59befaf986089f3584dad26f1ae21dbcc9
Refactor impl_blivet
os_disk_config/impl_blivet.py
os_disk_config/impl_blivet.py
# Copyright 2015 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 applicable law or agreed to in writin...
Python
0.000002
@@ -1319,16 +1319,490 @@ , obj):%0A + partition = self._get_partition(obj)%0A self._create_partition(partition)%0A%0A if obj.filesystem is not None:%0A self._format_partition(obj, partition)%0A if obj.mountpoint is not None:%0A self._mounts.append((partition, o...
e0c814815a89a20ce92c7382e305c077c8368637
Add tests for user.is_active
osf_models_tests/test_user.py
osf_models_tests/test_user.py
# -*- coding: utf-8 -*- import datetime as dt from modularodm.exceptions import ValidationError import mock import pytest from osf_models.models.user import OSFUser as User from osf_models.utils.names import impute_names_model from .factories import fake, UserFactory @pytest.mark.django_db def test_factory(): u...
Python
0.000016
@@ -1858,16 +1858,1628 @@ fix'%5D%0A%0A%0A +@pytest.mark.django_db%0Aclass TestIsActive:%0A%0A @pytest.fixture()%0A def make_user(self):%0A def func(**attrs):%0A # By default, return an active user%0A user = UserFactory.build(%0A is_registered=True,%0A m...
73a73fa0a0e398b0139f9e41c6328c982a18f35b
Update complex.py
examples/complex.py
examples/complex.py
#!/usr/bin/env python from __future__ import division, print_function from pyxl320 import ServoSerial from pyxl320 import Packet from pyxl320 import xl320 from pyxl320 import DummySerial from time import sleep # import sys """ This example rotates the servo back and forth while cycling through the different colors of...
Python
0.000001
@@ -722,13 +722,15 @@ max +s , min +s , de @@ -935,21 +935,23 @@ ange(min +s , max +s , delta)
f9837d8c661a4f8354574a82b1aea0ac4658a8be
add v6.1.6 (#22713)
var/spack/repos/builtin/packages/qwt/package.py
var/spack/repos/builtin/packages/qwt/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Qwt(QMakePackage): """The Qwt library contains GUI Components and utility classes which ar...
Python
0
@@ -706,16 +706,112 @@ r.bz2%22%0A%0A + version('6.1.6', sha256='99460d31c115ee4117b0175d885f47c2c590d784206f09815dc058fbe5ede1f6')%0A vers
2171a5ecf77625a2234f6ef0dac17bab24ddaf39
Insert job header into log files.
psyrun/backend/base.py
psyrun/backend/base.py
"""Base backend interface.""" import os import sys class Backend(object): """Abstract base class for processing backends. Processing backends determine how work is split across jobs. Deriving classes are supposed to implement `create_job` and `get_missing`. Parameters ---------- task : `Ta...
Python
0
@@ -1409,16 +1409,278 @@ pass%0A%0A +import time%0Aprint(%22%22)%0Aprint(%22----------------------------------------------------------------------%22)%0Aprint(%22Job started (%7B%7B%7D%7D)%22.format(time.strftime('%25a, %25d %25b %25Y %25H:%25M:%25S, %25Z')))%0Aprint(%22----------------------------------------------...
8afb4863472679b28408675b7c3c15cc5f7c4721
test nics and info
vent/core/network_tap/ncontrol/test_ncontrol.py
vent/core/network_tap/ncontrol/test_ncontrol.py
#!/usr/bin/python import docker import falcon import pytest from falcon import testing from .ncontrol import api from .prestart import pull_ncapture @pytest.fixture def client(): return testing.TestClient(api) def test_pull_ncapture(): pull_ncapture() def test_create_r(client): """ tests the restful ...
Python
0
@@ -2048,119 +2048,433 @@ est_ -list_r(client):%0A %22%22%22 tests the restful endpoint: list %22%22%22%0A # test list%0A r = client.simulate_get('/list +info_r(client):%0A %22%22%22 tests the restful endpoint: info %22%22%22%0A # test info%0A r = client.simulate_get('/info')%0A assert r.status ==...
5a6a3c0ef162ec5b338c7f9a2d45b3562da2b5aa
fix browsable api version checking to support DRF +3.7
api_tests/base/test_versioning.py
api_tests/base/test_versioning.py
import pytest from api.base.settings import REST_FRAMEWORK, LATEST_VERSIONS valid_url_path_version = '2.0' valid_header_version = '2.1' valid_query_parameter_version = '2.2' invalid_url_path_version = '1.0' invalid_header_version = '1.0.1' invalid_query_parameter_version = '1.1' invalid_url_path_version_url = '/v1/...
Python
0
@@ -4617,42 +4617,23 @@ rt ' -&quot; +%22 version -&quot;: &quot;%7B%7D&quot +%22: %22%7B%7D%22 '.fo @@ -4874,43 +4874,24 @@ rt ' -&quot; +%22 version -&quot;: &quot;2.5&quot +%22: %222.5%22 ' in
f81e6ea2410a209a5d598a5d384e51fc447d9668
update __init__.py
django_bitcoin/__init__.py
django_bitcoin/__init__.py
from django_bitcoin.models import BitcoinPayment, getNewBitcoinPayment from django_bitcoin.models import BitcoinWallet from django_bitcoin.utils import generateuniquehash, int2base64, base642int, bitcoinprice
Python
0.000078
@@ -27,23 +27,16 @@ import -Bitcoin Payment,
dc8e97774a41c082da7b61224b7c826e100ebdf5
Use timezone marker in timestamp, fix extra bug.
logstash_formatter/__init__.py
logstash_formatter/__init__.py
''' This library is provided to allow standard python logging to output log data as JSON formatted strings ready to be shipped out to logstash. ''' import logging import socket import datetime import traceback as tb import json import sys def _default_json_default(obj): """ Coerce everything to strings. A...
Python
0
@@ -306,18 +306,17 @@ strings. - %0A + All @@ -1304,16 +1304,91 @@ son_cls%0A + if extra is None:%0A self.defaults = %7B%7D%0A else:%0A @@ -1409,16 +1409,16 @@ = extra%0A - @@ -1862,17 +1862,9 @@ y()%0A - %0A + @@ -2554,26 +2554,48 @@ tcnow()....
ea1aecf53c0f623b532225b1bcf7a9f14c22a110
Test that we actually set that payout status to needs_approval when a project finishes
bluebottle/projects/tests/test_deadline.py
bluebottle/projects/tests/test_deadline.py
from django.test.utils import override_settings from bluebottle.bb_projects.models import ProjectPhase from bluebottle.tasks.models import Task from bluebottle.test.factory_models.tasks import TaskFactory from bluebottle.test.factory_models.projects import ProjectFactory from bluebottle.test.utils import BluebottleTes...
Python
0
@@ -1562,32 +1562,104 @@ , self.complete) +%0A self.assertEquals(self.project.payout_status, 'needs_approval') %0A%0A def test_f @@ -1941,32 +1941,104 @@ self.incomplete) +%0A self.assertEquals(self.project.payout_status, 'needs_approval') %0A%0A def test_s @@ -2740,32 +2740,92 @@ self.incomple...
9a30ddacebfe989b4f1121593166e85a6edb058b
send email endpoint is configurable
src/pyramid_torque_engine/notification_table_executer.py
src/pyramid_torque_engine/notification_table_executer.py
# -*- coding: utf-8 -*- from pyramid_torque_engine import orm from pyramid_torque_engine import repo from sqlalchemy import create_engine from pyramid_basemodel import bind_engine, save, Session import os import datetime import json import requests import transaction AVAILABLE_CHANNELS = ['sms', 'email'] def disp...
Python
0.00001
@@ -304,16 +304,100 @@ mail'%5D%0A%0A +SINGLE_EMAIL_ENDPOINT = os.environ.get('NOTIFICATION_SINGLE_EMAIL_ENDPOINT', None)%0A%0A %0Adef dis @@ -632,16 +632,54 @@ %0A %22%22%22 +%0A%0A endpoint = SINGLE_EMAIL_ENDPOINT %0A for @@ -855,45 +855,11 @@ -if len(to_dispatch) == 1:%0A +for dis @@ ...
a897c664cef9693308040cebf043952911594e7b
update lovinghut
locations/spiders/lovinghut.py
locations/spiders/lovinghut.py
# -*- coding: utf-8 -*- import scrapy import json import re from locations.items import GeojsonPointItem class LovinghutSpider(scrapy.Spider): name = "lovinghut" allowed_domains = ["lovinghut.us"] start_urls = ( 'http://lovinghut.us/locations', ) def normalize_time(self, time_str): ...
Python
0
@@ -2699,16 +2699,86 @@ urs%5B1%5D%0A%0A + if day == 'Last Order':%0A continue%0A%0A @@ -2879,16 +2879,17 @@ 2013 %22)%0A +%0A @@ -3070,32 +3070,49 @@ %5B1%5D%5B:2%5D + ' ' + +self._clean_text( self.normalize_t @@ -3113,32 +3113,33 @@ lize_time(hours) +) %0A ...
85ac27150218087217756969275249178cc695e2
Prepare v2.10.73.dev
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
Python
0.000002
@@ -439,11 +439,15 @@ '2.10.7 -2 +3.dev '%0A
74077fe71ed4837fe0128e7a699f53fd518d7265
Improve is bot output
bot/action/standard/info/formatter/user.py
bot/action/standard/info/formatter/user.py
from bot.action.standard.info.formatter import ApiObjectInfoFormatter from bot.action.util.format import UserFormatter from bot.api.api import Api from bot.api.domain import ApiObject MEMBER_STATUS_CREATOR = "creator" MEMBER_STATUS_ADMINISTRATOR = "administrator" MEMBER_STATUS_KICKED = "kicked" MEMBER_STATUS_RESTRICT...
Python
0.999888
@@ -3701,9 +3701,11 @@ ji=%22 -%F0%9F%A4%96 +(%F0%9F%A4%96) %22, n @@ -3717,9 +3717,11 @@ ji=%22 -%F0%9F%91%A4 +(%F0%9F%91%A4) %22)%0A
167a5a648bd74586d1b973b88d323259581348e1
Change threshold to % and not per-thousand
pipelines/alert_pipeline/word_alert.py
pipelines/alert_pipeline/word_alert.py
#!/usr/local/bin/python import sys from os import path from lib.database.backend_db import Db import csv import json import requests import datetime from warnings import warn import operator from collections import defaultdict from lib.general.counters import ItemCounterDelta from lib.language.word_types import toke...
Python
0.00001
@@ -404,17 +404,16 @@ _ABS = 5 -0 %0A%0Adef ma
316a53249a8da17097e54ffcc4fe983e1106eb85
enable all plugins and increase duration
mpf/tests/MpfMachineTestCase.py
mpf/tests/MpfMachineTestCase.py
from mpf.tests.MpfTestCase import MpfTestCase class MpfMachineTestCase(MpfTestCase): def getConfigFile(self): return "config.yaml" def getMachinePath(self): return "" def getAbsoluteMachinePath(self): # do not use path relative to MPF folder return self.getMachinePath()
Python
0
@@ -81,16 +81,329 @@ Case):%0A%0A + def __init__(self, methodName='runTest'):%0A super().__init__(methodName)%0A%0A # only disable bcp. everything else should run%0A self.machine_config_patches = dict()%0A self.machine_config_patches%5B'bcp'%5D = %5B%5D%0A%0A # increase test expec...
344bc36d95d84abf767e97bf4db38cd4a044f8c8
Update cluster_function.py
magnum/sur/cluster_function.py
magnum/sur/cluster_function.py
# SUR 2015/08/20 # Senlin replacing Heat in Magnum # cluster_function for bay_conductor import argparse import logging import time import yaml from magnum.common.clients import OpenStackClients as OSC from magnum import objects from magnum.sur.client import SURClient from magnum.sur.action.senlin.clusters import Clu...
Python
0.000003
@@ -3634,30 +3634,8 @@ , fw -, allow_unicode=False )%0A
ba3bdcb41110487110a7f1061193217262f5c76f
replace imports
xgds_core/importer/modelCreator.py
xgds_core/importer/modelCreator.py
#! /usr/bin/env python # __BEGIN_LICENSE__ # Copyright (c) 2015, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # All rights reserved. # # The xGDS platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this fi...
Python
0.003993
@@ -3368,24 +3368,204 @@ table%5Cn')%0A%0A + # replace the imports%0A new_source = replace(new_source, 'from __future__ import unicode_literals%5Cn')%0A new_source = replace(new_source, 'from django.db import models%5Cn')%0A%0A # replac
206bc6360709559a18be2bfa69925a804a7b2350
add progress bar to build_cids.py
build_cids.py
build_cids.py
import json from crpapi import CRP try: from config import secrets except ImportError: secrets = { "OPENSECRETS_API_KEY" : os.environ['OPENSECRETS_API_KEY'] } crp = CRP(secrets['OPENSECRETS_API_KEY']) states = [ "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID"...
Python
0
@@ -1,12 +1,225 @@ +%22%22%22%0ARetrieves the OpenSecrets.org CIDs (Candidate IDs) for every US legislator and%0Awrite them to data/cids.txt.%0A%0AThe cids.txt file is used by TweetText to select a random legislator for each%0Atweet.%0A%22%22%22%0A%0Aimport os%0A import json%0A @@ -770,16 +770,608 @@ %22WY%22%0A%5D%0...
5b665c25c5a3a6d1ed4f4fa0458950f96e48b05d
Fix for whitespace.
logstash_formatter/__init__.py
logstash_formatter/__init__.py
''' This library is provided to allow standard python logging to output log data as JSON formatted strings ready to be shipped out to logstash. ''' import logging import socket import datetime import traceback as tb import json def _default_json_default(obj): """ Coerce everything to strings. All objects r...
Python
0.000018
@@ -4550,17 +4550,16 @@ text')%0A%0A -%09 %09now = d
ce4f2216fa804f066187023d9950eb9da78461ae
fix PEP8 issue in example
examples/example_json.py
examples/example_json.py
from xkcdpass import xkcd_password as xp from django.http import JsonResponse def json_password_generator(request): # Example Django view to generate passphrase suggestions via xkcd library # Called with optional params e.g. # /json_password_generator/?tc=true&separator=|&acrostic=face if request.met...
Python
0
@@ -537,17 +537,16 @@ ordfile, - %0A @@ -563,17 +563,16 @@ ength=3, - %0A
9b6add620f303a299983fc9a1393bd3c76c53d20
Generate keystone admin token
fuelmenu/fuelmenu/modules/servicepws.py
fuelmenu/fuelmenu/modules/servicepws.py
#!/usr/bin/env python # Copyright 2013 Mirantis, 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 a...
Python
0.999995
@@ -1990,32 +1990,231 @@ en.password()%7D,%0A + %22keystone/admin_token%22: %7B%22label%22: %22Keystone Admin Token%22,%0A %22tooltip%22: %22%22,%0A %22value%22: pwgen.password()%7D,%0A
0d78ac36f49b8492702a8bc0c49a1508af7f86c2
Remove explicit app_name
djangocms_oscar/cms_app.py
djangocms_oscar/cms_app.py
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from django.conf.urls import patterns from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from oscar.app import application from .menu import CategoriesMenu class OscarApp(CMSApp): """ Allows "mounting" the...
Python
0
@@ -513,31 +513,8 @@ enu%5D -%0A app_name = %22oscar%22 %0A%0Aap
a8b2fddcd910606b6bb18ffe91fccdd2c505f390
fix satella's import
satella/coding/concurrent/__init__.py
satella/coding/concurrent/__init__.py
from .atomic import AtomicNumber from .callablegroup import CallableGroup, CallNoOftenThan, CancellableCallback from .functions import parallel_execute, run_as_future from .futures import Future, WrappingFuture, InvalidStateError from .id_allocator import IDAllocator, SequentialIssuer from .locked_dataset import Locked...
Python
0.000001
@@ -616,21 +616,8 @@ read -, Terminating %0Afro @@ -1226,32 +1226,6 @@ uer' -,%0A 'Terminating' %5D%0A
30374bcd42bd2432b50ee58a91889cc7a59108bc
Update expected ALPN output for recent versions of curl (#9072)
tests/gold_tests/tls/tls_bad_alpn.test.py
tests/gold_tests/tls/tls_bad_alpn.test.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");...
Python
0
@@ -3344,17 +3344,17 @@ on(%22ALPN -, +. server @@ -3365,16 +3365,10 @@ pted - to use +.* h2%22,
74d60fbe23c4c44d029b54c8ec075f82db48fc93
Update python-modules/cis_publisher/cis_publisher/mozilliansorg_groups.py
python-modules/cis_publisher/cis_publisher/mozilliansorg_groups.py
python-modules/cis_publisher/cis_publisher/mozilliansorg_groups.py
import cis_profile import cis_publisher from cis_publisher.publisher import PublisherError import logging import json from queue import Queue from urllib.parse import quote_plus logger = logging.getLogger(__name__) MO_PREFIX = "mozilliansorg_" def get_nested(d, *keys, default=None): if d is None: return ...
Python
0
@@ -1682,17 +1682,16 @@ ror(%22mis -s matching
426038ea25f1e747a0f72178f3c11b47fad982e4
Add a second level of initialization.
monitoring/nagios/plugin/base.py
monitoring/nagios/plugin/base.py
# -*- coding: UTF-8 -*- # #=============================================================================== # Name : base # Author : Vincent BESANCON <besancon.vincent@gmail.com> # Description : Base class for developing new Nagios Plugins. #-------------------------------------------------------------...
Python
0
@@ -1048,16 +1048,37 @@ ======%0A%0A +import sys%0Aimport os%0A import a @@ -1085,16 +1085,16 @@ rgparse%0A - import l @@ -1525,31 +1525,190 @@ -def __init__(self, name +%22%22%22%0A Create a new Nagios plugin.%0A%0A You may inherit from this class if you want to configure default behavior.%0A %22%22...
b3257f82b9637388384e798543fcc280ed752b79
Handle existing symlinks gracefully (but don't delete existing non-links to be safe).
lv2includegen/lv2includegen.py
lv2includegen/lv2includegen.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # lv2includegen, a tool to generate directory trees for including # extension headers from source code. __authors__ = 'David Robillard' __license = 'GNU GPL v3 or later <http://www.gnu.org/licenses/gpl.html>' __contact__ = 'devel@lists.lv2plug.in' __date__ = '2010-10-05...
Python
0.000015
@@ -351,16 +351,28 @@ port os%0A +import stat%0A import s @@ -1232,25 +1232,8 @@ ipt) -%0A sys.exit(-1) %0A%0Ade @@ -1245,24 +1245,58 @@ ir_p(path):%0A + %22Equivalent of UNIX mkdir -p%22%0A try:%0A @@ -1457,16 +1457,139 @@ ndles):%0A + %22%22%22Build a directory tree of symlinks to LV2 extension...
7a994fbb091854d4558de3336b4db6a3a6cb4eaf
Update json_field to use stdlib json module
json_field.py
json_field.py
from django.core.serializers.json import DjangoJSONEncoder from django.db import models from django.utils import simplejson as json # https://bitbucket.org/offline/django-annoying class JSONField(models.TextField): """ JSONField is a generic textfield that neatly serializes/unserializes JSON objects seaml...
Python
0
@@ -81,16 +81,98 @@ models%0A +%0Atry:%0A import json # json module added in Python 2.6.%0Aexcept ImportError:%0A from dja
8078371a2fdb71f2f1ea57be2513ef7d78d8117c
fix for unix paths
tests/seleniumPythonTest/run_all_tests.py
tests/seleniumPythonTest/run_all_tests.py
__author__ = 'QSG' import unittest import HTMLTestRunner import os,sys, time # Directory for locating test cases test_dir=os.path.split(os.path.realpath(sys.argv[0]))[0] test_case_dir=test_dir+'\\test_case\\' test_reports_dir=test_dir+'\\selenium_test_reports\\' print test_reports_dir def creatsuite(): testunit=un...
Python
0.000001
@@ -174,32 +174,46 @@ st_case_dir= + os.path.join( test_dir +'%5C%5Ctest_cas @@ -200,20 +200,19 @@ test_dir -+'%5C%5C + ,' test_cas @@ -212,19 +212,18 @@ est_case -%5C%5C ' +) %0Atest_re @@ -232,24 +232,38 @@ rts_dir= + os.path.join( test_dir +'%5C%5Csele @@ -258,12 +258,11 @@ _dir -+'%5C%5C +, ' sele @@ -...
4eda64c78401cc9fc66e176ff475860e457c3008
Simplify a method slightly.
mtg_ssm/serialization/mtgdict.py
mtg_ssm/serialization/mtgdict.py
"""Methods for managing data in the form of dicts.""" from mtg_ssm.mtg import models def get_printing(coll, card_dict): """Given a card dict and various indexes, get the matching CardPrinting.""" mtgjsid = card_dict.get('id') set_code = card_dict.get('set') name = card_dict.get('name') mvid = car...
Python
0.000006
@@ -490,144 +490,8 @@ d%5D%0A%0A - if set_code is None or name is None:%0A print('Card has no set or card has no name and cannot be found.')%0A return None%0A%0A @@ -557,16 +557,16 @@ vid).')%0A + set_ @@ -800,81 +800,8 @@ s%5B0%5D -%0A else:%0A print('%7B%7D entries fou...
86b22c351d70ee8a84df5735020949dd02bdfb49
Include object type only if a number (of objects) is present.
src/eudat/accounting/client/utils.py
src/eudat/accounting/client/utils.py
# utilties module from eudat.accounting.client # collects methods that could be useful for client code as well USERKEY = "ACCOUNTING_USER" PWKEY = "ACCOUNTING_PW" URL_PATTERN = "%s/%s/%s/addRecord?" import os import sys import requests from eudat.accounting.client import LOG def getCredentials(args): """Extrac...
Python
0
@@ -1461,16 +1461,38 @@ s, k)))%0A + hasNumber = False%0A for @@ -1609,14 +1609,153 @@ if -value: +k=='number' and value:%0A hasNumber = True%0A if value:%0A if k=='object_type' and not hasNumber:%0A continue %0A
d59f78c1472aaed31b81ba7d2820ee83f3f2b72d
Add Apache v2 license header
justfishin.py
justfishin.py
#!/usr/bin/env python """Script to simplify file retrieval from S3. Make sure your credentials are set up in ~/.boto as documented here: http://boto.readthedocs.org/en/latest/boto_config_tut.html """ from __future__ import print_function import argparse import boto import sys import tarfile import unittest # Chan...
Python
0
@@ -16,16 +16,588 @@ python%0A%0A +# Copyright 2015 Neverware%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 ...
452452a8cb6f60250b2896fead64a10e41228c15
change some pring to log
src/knesset/mks/listeners.py
src/knesset/mks/listeners.py
#encoding: utf-8 from django.db.models.signals import post_save from planet.models import Feed, Post from actstream import action from knesset.utils import cannonize, disable_for_loaddata from knesset.laws.models import VoteAction from knesset.links.models import Link, LinkType from knesset.mks.models import Member im...
Python
0
@@ -842,14 +842,20 @@ -print +logger.info( u'co @@ -877,16 +877,17 @@ %25s' %25 m +) %0A
9f41f4feae76b56235598e4f45c76b4670e7eec8
Add long description
varints/setup.py
varints/setup.py
#!/usr/bin/python # Copyright 2017 John Bailey # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
Python
0.999999
@@ -851,16 +851,18 @@ ion='0.1 +.3 ',%0A @@ -1058,24 +1058,76 @@ e='Apache',%0A + long_description=open('README', 'rt').read(),%0A packag @@ -1183,24 +1183,87 @@ est_suite',%0A + keywords = %5B'varint', 'integer', 'variable', 'length' %5D,%0A zip_sa
51d06cc32f5077cca462739204fa89ceebf76a81
update tests
tests/test_pecanstreet_dataset_adapter.py
tests/test_pecanstreet_dataset_adapter.py
import sys sys.path.append('../') from disaggregator import PecanStreetDatasetAdapter import unittest class PecanStreetDatasetAdapterTestCase(unittest.TestCase): def setUp(self): db_url = "postgresql://USERNAME:PASSWORD@db.wiki-energy.org:5432/postgres" self.psda = PecanStreetDatasetAdapter(db_u...
Python
0.000001
@@ -1418,28 +1418,8 @@ ss%0A%0A -fast = TestSuite()%0A%0A if _
15ea4eab0feaa4c40d551934a0dc6f507ad77e54
make dispatcher available to services as __exscriptd__.
src/Exscriptd/PythonService.py
src/Exscriptd/PythonService.py
# Copyright (C) 2007-2010 Samuel Abels. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANT...
Python
0
@@ -1607,16 +1607,17 @@ + = compil @@ -1674,16 +1674,17 @@ + = %7B%7D%0A @@ -1703,24 +1703,25 @@ _builtin__'%5D + = __builti @@ -1753,16 +1753,17 @@ _'%5D + = filena @@ -1798,15 +1798,55 @@ '%5D + = self%0A + vars%5B'__exscriptd__'%5D = parent%0A @@ -1869,16 +18...
e53491b8135d2edd338b57a6c39285fd4f1ef9ab
Raise an exception when input not real.
scikits/talkbox/tools/correlations.py
scikits/talkbox/tools/correlations.py
import numpy as np from scipy.fftpack import fft, ifft __all__ = ['nextpow2', 'acorr'] def nextpow2(n): """Return the next power of 2 such as 2^p >= n. Note ---- Infinite and nan are left untouched, negative values are not allowed.""" if np.any(n < 0): raise ValueError("n should be > 0")...
Python
0.000006
@@ -1487,24 +1487,113 @@ n.%0A %22%22%22%0A + if not np.isrealobj(x):%0A raise ValueError(%22Complex input not supported yet%22)%0A%0A maxlag =
756013fdc63eae95c9a0f510ea27357777114807
remove dead code
src/bat/piecharts.py
src/bat/piecharts.py
#!/usr/bin/python ## Binary Analysis Tool ## Copyright 2012-2013 Armijn Hemel for Tjaldur Software Governance Solutions ## Licensed under Apache 2.0, see LICENSE file for details ''' This is a plugin for the Binary Analysis Tool. It generates images of results of the ranking scan, like piecharts and version charts. ...
Python
0.999454
@@ -893,1036 +893,4 @@ e))%0A -%0A'''%0A### This is just some dead code that was an attempt at generating better piecharts. It might be used in the future, so keep it here for reference.%0A%09%09%09%09%09j_sorted = sorted(j%5B4%5D, key=lambda x: j%5B4%5D%5Bx%5D)%0A%09%09%09%09%09max_y = j%5B4%5D%5Bj_sorted%5B-1%5D%5D%...
025265c9c2b9cbcd335b371a90c04bfadab61e37
add missing import of shutil, used for "shutil.rmtree"
rmake/server/daemon.py
rmake/server/daemon.py
#!/usr/bin/python2.4 # # Copyright (c) 2006 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www...
Python
0
@@ -625,16 +625,30 @@ port os%0A +import shutil%0A import s
5912da19de956aec79ecd54c2139911c20032748
fix color parsing
glc/value_parser.py
glc/value_parser.py
""" glc.value_parser ================ Parsing possible values for shape properties. (c) 2016 LeoV https://github.com/leovoel/ """ from numbers import Number from math import floor from .utils import lerp, clamp, quadratic, bezier from .color import Color, str2color, clerp, multi_clerp import c...
Python
0.000006
@@ -3625,19 +3625,20 @@ = Color( -out +prop )%0A%0A r
269d91767ea26618efb1c387d0ec3a9d50c45c48
make `TemplateView` more consistant with `JsonView`
verktyg/views.py
verktyg/views.py
# -*- coding: utf-8 -*- """ verktyg.views ~~~~~~~~~~~~~ :copyright: (c) 2014 by Ben Mather. :license: BSD, see LICENSE for more details. """ import json from werkzeug import Response from verktyg.dispatch import BindingFactory, Binding class View(BindingFactory): """ Wraps a function or callable...
Python
0
@@ -2267,29 +2267,47 @@ res = + super(JsonView, self +) ._ -action +_call__ (env, re @@ -2326,16 +2326,17 @@ kwargs)%0A +%0A @@ -2388,16 +2388,17 @@ urn res%0A +%0A
ac9eb8c3293605d073039f5037b22e44c6a959a9
Fix linter.
src/waldur_mastermind/support_invoices/tests/fixtures.py
src/waldur_mastermind/support_invoices/tests/fixtures.py
from django.utils.functional import cached_property from django.db.models import Sum from waldur_core.structure.tests import fixtures as structure_fixtures from waldur_mastermind.marketplace import models as marketplace_models from waldur_mastermind.marketplace.tests import factories as marketplace_factories from wald...
Python
0
@@ -48,41 +48,8 @@ erty -%0Afrom django.db.models import Sum %0A%0Afr
ad43ca074213ea804561ce1361fb0718f5838646
Fix default case when not passing any subcommand
vic2/__main__.py
vic2/__main__.py
import sys import argparse from . import encrypt, decrypt def argparser(): parser = argparse.ArgumentParser(prog='vic') subparsers = parser.add_subparsers(dest='subparser', help='action sub-commands') parser_encrypt = subparsers.add_parser('encrypt', description='V...
Python
0
@@ -5369,20 +5369,22 @@ ():%0A +p ar -g s +er = argpa @@ -5389,16 +5389,34 @@ parser() +%0A args = parser .parse_a
33e2b4b18b8ef927ec5ea6c81585f6e1b76cf247
Fix order for authorized user.
robokassa/receivers.py
robokassa/receivers.py
# set encoding=utf-8 from logging import getLogger log = getLogger('robokassa.receivers') from django.http import HttpRequest from django.contrib.sessions.backends.db import SessionStore from django.contrib.auth.models import AnonymousUser from oscar.apps.checkout.mixins import OrderPlacementMixin from oscar.apps.ch...
Python
0
@@ -2349,16 +2349,75 @@ _email() +%0A else:%0A guest_email = user.email %0A%0A or
b6fd5d5799590c5069e1b34c0e0381c684bd94ce
enable unittest (chmod +x)
scripts/cli/test_interfaces_tunnel.py
scripts/cli/test_interfaces_tunnel.py
#!/usr/bin/env python3 # # Copyright (C) 2020 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as # published by the Free Software Foundation. # # This program is distributed in the hope t...
Python
0
44963d516c69196db418dee2cb810786d521f7c0
Improve doc.
symmetry/groups.py
symmetry/groups.py
#!/usr/bin/env python """ TODO: Modify module doc. """ from __future__ import division __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2013, The Materials Virtual Lab" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "ongsp@ucsd.edu" __date__ = "4/4/14" import os from itertools import prod...
Python
0
@@ -1574,24 +1574,115 @@ onal symbol. +%0A%0A Args:%0A int_symbol (str): Full International or Hermann-Mauguin Symbol. %0A %22%22%22 @@ -2428,16 +2428,208 @@ umber):%0A + %22%22%22%0A Obtains a SpaceGroup from its international number.%0A%0A Args:%0A int_numbe...
2b3e1498b6a346be779e0857b24540b958e41073
Use new API version and fix an error if no price is supplied.
nzfilm.py
nzfilm.py
import json import util import urllib # SHIFT API Documentation # http://indiereign.github.io/shift72-docs/ DATA_URL = 'https://ondemand.nzfilm.co.nz/services/meta/v3/featured/show/home_page' FILM_DETAILS_TEMPLATE = "https://ondemand.nzfilm.co.nz/services/meta/v2{0}/show_multiple" PRICE_TEMPLATE = "https://ondemand.n...
Python
0
@@ -164,9 +164,9 @@ ta/v -3 +4 /fea @@ -175,22 +175,9 @@ red/ -show/home_page +8 '%0AFI @@ -879,32 +879,71 @@ t price%0A%09price = + %22%22%0A%09if price_data%5B%22prices%22%5D:%0A%09%09price = price_data%5B%22pri @@ -1588,32 +1588,71 @@ t price%0A%09price = + %22%22%0A%09if price_data%5B%22prices%22%5D:%0A%09%...
39afa87eb5a1ff795aca82414ffc766dccb829a1
add simple hybrid model for cold start
polara/recommender/coldstart/models.py
polara/recommender/coldstart/models.py
import numpy as np from polara.recommender.models import RecommenderModel class ContentBasedColdStart(RecommenderModel): def __init__(self, *args, **kwargs): super(ContentBasedColdStart, self).__init__(*args, **kwargs) self.method = 'CB' self._prediction_key = '{}_cold'.format(self.data.fi...
Python
0
@@ -71,55 +71,134 @@ del%0A -%0A%0Aclass ContentBasedColdStart(RecommenderModel) +from polara.lib.similarity import stack_features%0Afrom polara.lib.sparse import sparse_dot%0A%0A%0Aclass ItemColdStartEvaluationMixin :%0A @@ -254,35 +254,8 @@ per( -ContentBasedColdStart, self ).__ @@ -295,21 +295,70 @@ elf. -met...
3515c1367b8f815fb2d5e6a8615da5fa5cc097a7
Fix some whitespace issues
src/ibei/models.py
src/ibei/models.py
# coding=utf-8 import astropy.constants import astropy.units import attrs import functools import mpmath import numpy as np def _temperature_converter(value): try: temperature = astropy.units.Quantity(value, astropy.units.K) except astropy.units.UnitConversionError: temperature = value.to(ast...
Python
0.999991
@@ -5065,33 +5065,32 @@ rial(self.order) - %0A%0A elif s @@ -5213,33 +5213,32 @@ rial(self.order) - %0A%0A else:%0A @@ -5591,17 +5591,16 @@ f.order) - %0A%0A
ab0c805573cefc57b0df4bc12e4279bdd83721c2
Change program to a command-line one
cdnetworks.py
cdnetworks.py
import time import sys import csv import os from configparser import ConfigParser import wdstart from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import selenium.common.exc...
Python
0.000001
@@ -37,16 +37,32 @@ port os%0A +import argparse%0A from con @@ -563,16 +563,20 @@ print(' +%5B*%5D Config f @@ -617,33 +617,32 @@ figured! Exiting -. ')%0A s @@ -3001,50 +3001,229 @@ -input_file = input('Enter the f +parser = argparse.ArgumentParser()%0A parser.add_argument('action', help='I...
eb3b82cb356382bb4f48c917e0bf141818f78b90
Fix test when creating duplicate campaign
wikilabels/tests/utilities/test_new_campaign.py
wikilabels/tests/utilities/test_new_campaign.py
from wikilabels.utilities.new_campaign import main import pytest item = {'wiki': "cawiki", 'name': "newiki", 'form': "chan", 'view': "bivicyt", 'labels_per_task': "1", 'task_per_task': "50", 'active': True, 'info_url': "--info-url=https://www.mediawiki.org/wiki/ORES#Edit_quality"} ...
Python
0.000001
@@ -47,22 +47,8 @@ main -%0Aimport pytest %0A%0Ait @@ -1208,16 +1208,22 @@ gn_fail( +capsys ):%0A i @@ -1247,63 +1247,188 @@ -with pytest.raises(Exception):%0A insert_repeated( +insert_repeated()%0A out, err = capsys.readouterr()%0A assert (err == %22Duplicate campaign: repeated already exists...
64f1cf31ef93970e9fe747151e6093fc4756ac53
add 'zimbabwe' to the known countries
bin/switch-country.py
bin/switch-country.py
#!/usr/bin/env python # coding=UTF-8 # If you have a standard Mzalendo setup (see below) and need to switch # between developing for different countries, this script can be # useful for making that switch simply. It assumes that you have the # following directory hierarchy, config files and symlinks set up: # # . # ├...
Python
0.000866
@@ -442,16 +442,42 @@ -africa%0A +# %E2%94%9C%E2%94%80%E2%94%80 media_root.zimbabwe%0A # %E2%94%9C%E2%94%80%E2%94%80 mz @@ -628,24 +628,59 @@ -africa.yml%0A +# %E2%94%82%C2%A0%C2%A0 %E2%94%82%C2%A0%C2%A0 %E2%94%9C%E2%94%80%E2%94%80 general-zimbabwe.yml%0A # %E2%94%82%C2%A0%C2%A0 %E2%94%82%C2%A0%C2%A0 %E2%94%94%E2%9...
2a2c9dc43a7d096dd5601f51c0407c36433e73e1
Make coordinate 'frames' be imported
astropy/coordinates/__init__.py
astropy/coordinates/__init__.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This subpackage contains classes and functions for celestial coordinates of astronomical objects. It also contains a framework for conversions between coordinate systems. """ from __future__ import (absolute_import, division, print_function, ...
Python
0.998719
@@ -401,20 +401,17 @@ om . -coordsystems +baseframe imp @@ -507,22 +507,21 @@ builtin_ -system +frame s import
3cf81c31cad0ad55b0288aa70b67d03484a626b9
Remove unused ngram references, add new thresholds for small matches
src/licensedcode/__init__.py
src/licensedcode/__init__.py
# # Copyright (c) 2015 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. # # You may not use...
Python
0
@@ -2073,45 +2073,8 @@ r)%0A%0A -# length of ngrams%0ANGRAM_LENGTH = 5%0A%0A # mi @@ -2332,8 +2332,151 @@ ST = 10%0A +%0A# length below which a match is considered as %22small%22%0ASMALL_MATCH = 50%0A%0A# minimal score for matches to small rules%0ASMALL_MATCH_MIN_SCORE = 80%0A
539f1432cdc301e2f7b9c8109bcc25f5c38cad78
Remove caching of cc_is_msvc
scripts/mbedtls_dev/c_build_helper.py
scripts/mbedtls_dev/c_build_helper.py
"""Generate and run C code. """ # Copyright The Mbed TLS Contributors # SPDX-License-Identifier: Apache-2.0 # # 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...
Python
0
@@ -2923,57 +2923,8 @@ ')%0A%0A -_cc_is_msvc = None #pylint: disable=invalid-name%0A def @@ -3932,154 +3932,8 @@ %60.%0A%0A - NOTE: This function only checks the identity of the compiler referred to by%0A %60%60CC%60%60 on its first invocation, and caches the result.%0A%0A @@ -4542,118 +4542,8 @@ ...
31e452568bdbcaca243d3f1239db6d14a69dbdcc
Update `saved` snippet to match description
praw/models/listing/mixins/redditor.py
praw/models/listing/mixins/redditor.py
"""Provide the RedditorListingMixin class.""" from typing import TYPE_CHECKING, Any, Dict, Iterator, Union from urllib.parse import urljoin from ....util.cache import cachedproperty from ..generator import ListingGenerator from .base import BaseListingMixin from .gilded import GildedListingMixin if TYPE_CHECKING: # ...
Python
0
@@ -5502,16 +5502,26 @@ ).saved( +limit=None ):%0A
11a5c32396d7b97793bd7e1f0bf2baf11f737ef6
fix localhost bug
celery_cgi.py
celery_cgi.py
from celery import Celery celery_tasks = [ 'hms_flask.modules.hms_controller', 'pram_flask.tasks' ] celery = Celery('flask_qed', broker='redis://localhost:6379/0', backend='redis://localhost:6379/0', include=celery_tasks) # celery = Celery('flask_qed', broker='redis://redis:6379/0', backend='redis://redis:63...
Python
0.000003
@@ -104,16 +104,18 @@ sks'%0A%5D%0A%0A +# celery = @@ -228,18 +228,16 @@ _tasks)%0A -# celery =
1e16e58f37a9e3b98638f66a66830e242aa76b77
Fix to upload script
bin/upload_version.py
bin/upload_version.py
#!python import os import sys import json import requests if __name__ == '__main__': version = sys.argv[1] filename = sys.argv[2].split('/')[-1] github_token = os.environ['GITHUB_TOKEN'] auth = (github_token, 'x-oauth-basic') commit_sha = os.environ['CIRCLE_SHA1'] params = json.dumps({ 'tag_name': 'v{...
Python
0
@@ -109,20 +109,20 @@ %5D%0A file -name +path = sys.a @@ -127,16 +127,38 @@ .argv%5B2%5D +%0A filename = filepath .split(' @@ -721,20 +721,20 @@ pen(file -name +path ) as fil
b64a63ad19d2ed4922207b71c31870dac3784870
Fix possum test.
nipype/interfaces/fsl/possum.py
nipype/interfaces/fsl/possum.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ The possum module provides classes for interfacing with `POSSUM <http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/POSSUM>`_ command line tools. Please, check out the l...
Python
0
@@ -3738,16 +3738,19 @@ ield.nii +.gz --b0=3.
9938b524bb5779d5c5ce132563b3100969c8c5d6
Drop carreralib.fw --force flag.
src/carreralib/fw.py
src/carreralib/fw.py
import argparse import contextlib import logging import time from . import ControlUnit if __name__ == "__main__": parser = argparse.ArgumentParser(prog="python -m carreralib.fw") parser.add_argument( "device", metavar="DEVICE", help="the Control Unit device, e.g. a serial port or MAC ...
Python
0
@@ -522,114 +522,8 @@ nt(%0A - %22-f%22, %22--force%22, action=%22store_true%22, help=%22force firmware update%22%0A )%0A parser.add_argument(%0A @@ -598,32 +598,32 @@ e log messages%22%0A + )%0A parser @@ -1182,103 +1182,8 @@ cu:%0A - if not args.file or not args.force:%0A ...
50e93c3a7d713a5c82824eab5220266dcca82b78
fix pylint issues
sdcm/remote/libssh2_client/session.py
sdcm/remote/libssh2_client/session.py
# 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 distributed in the hope that it will be usefu...
Python
0.000001
@@ -3245,16 +3245,47 @@ except: + # pylint: disable=bare-except %0A
44d7028e925fa8771e127b8b11f17d955eff33b4
Fix the ProtocolErrors to raise Exception (as the other bits do)
nodemanager/openDHTadvertise.py
nodemanager/openDHTadvertise.py
""" Author: Justin Cappos Start Date: July 8, 2008 Description: Advertises availability to openDHT... This code is partially adapted from the example openDHT code. """ import socket import threading import random import urllib import sha try: import xmlrpclib except ImportError: # Python 3.0 portability fix....
Python
0
@@ -2660,24 +2660,39 @@ his code...%0A + try:%0A vals @@ -2737,24 +2737,96 @@ , %22get.py%22)%0A + except xmlrpclib.ProtocolError, e:%0A raise Exception, e%0A # if
a00dcd9c8ced0aa7280ed01ff061c32b552eae3c
Update common.py
build-tools/code_generator/utils/common.py
build-tools/code_generator/utils/common.py
# Copyright (c) 2017 Sony Corporation. 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 applicabl...
Python
0.000001
@@ -1757,9 +1757,15 @@ 1.0. -9 +10.dev1 '%0A
a4d5db323910852ad701f9cd9953c3bedb63ae1d
Bump base version (#5842)
vsphere/setup.py
vsphere/setup.py
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from codecs import open from os import path from setuptools import setup HERE = path.abspath(path.dirname(__file__)) # Get version info ABOUT = {} with open(path.join(HERE, "datadog_checks", "vsphere", ...
Python
0
@@ -696,11 +696,12 @@ se%3E= -6.4 +11.0 .0'%0A
e18d1e36d12ca2acebde53b94276bb0b24f7dc90
bump to version 1.5.1
bump/__init__.py
bump/__init__.py
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ bump ~~~~ An automated way to follow the Semantic Versioning Specification Examples: basic usage:: >>> from os import path as p >>> project = Project(p.abspath(p.dirname(p.dirname(__file__)))) >>> project.current_version == __versio...
Python
0
@@ -827,17 +827,17 @@ = '1.5. -0 +1 '%0A%0A__tit
626606992854967c569296a35e641198839e5170
use a model for test that is not influenced by the mail module
auditlog/tests/test_auditlog.py
auditlog/tests/test_auditlog.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2015 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
Python
0
@@ -1154,20 +1154,22 @@ -user +groups _model_i @@ -1201,20 +1201,21 @@ del_res_ -user +group s').id%0A @@ -1290,20 +1290,21 @@ ule for -user +group s',%0A @@ -1323,20 +1323,22 @@ el_id': -user +groups _model_i @@ -1489,20 +1489,21 @@ -user +group = self. @@ -1511,20 +1511,21 @@ nv%5...
6da2772ae86bf105b8e1801bd3165ac15d2659e6
make links relative for better offline viewing
buster/buster.py
buster/buster.py
"""Ghost Buster. Static site generator for Ghost. Usage: buster.py setup [--gh-repo=<repo-url>] [--dir=<path>] buster.py generate [--domain=<local-address>] [--dir=<path>] buster.py preview [--dir=<path>] buster.py deploy [--dir=<path>] buster.py add-domain <domain-name> [--dir=<path>] buster.py (-h | --he...
Python
0
@@ -1202,16 +1202,86 @@ re site%0A + %22--convert-links %5C%5C%22 # make links relative%0A
186e78667f87351a50943691a281c06f9e00b533
Update background.py
autostart/scripts/background.py
autostart/scripts/background.py
#!/usr/bin/env python3 """ Bing's wallpaper of the day background setter Hits Bing's wallpaper API and compares the wallpaper of the day with the OS's current one. If they are the same, the script does nothing. If they are different, it downloads the new wallpaper and sets it, then remove the old one. Usage: =====...
Python
0.000001
@@ -399,20 +399,8 @@ ests -%0Aimport json %0A%0A# @@ -558,19 +558,8 @@ a = -json.loads( resp @@ -567,12 +567,13 @@ nse. -text +json( )%0Aim @@ -1022,16 +1022,24 @@ image +_content = reque @@ -1124,23 +1124,26 @@ wb') as -hand +image_fi le -r :%0A @@ -1148,15 +1148,18 @@ -hand +image_fi le...
9746f290506fc10227a31fb18890d763f9b69879
Add automatic scheduling in Simulation.run
hoomd/simulation.py
hoomd/simulation.py
import hoomd._hoomd as _hoomd from hoomd.state import State from hoomd.snapshot import Snapshot from hoomd.operations import Operations class Simulation: R""" Simulation. Parameters: device (:py:mod:`hoomd.device`): Device to execute the simulation. Attributes: device state ...
Python
0
@@ -6084,74 +6084,86 @@ -raise RuntimeError('Cannot run before operations are scheduled.')%0A +self.operations.schedule()%0A%0A # TODO either remove or refactor this code %0A
49a7bfe61e288d4d5e3341504cc2b51643e7ab55
Reword docs
hoomd/simulation.py
hoomd/simulation.py
import hoomd._hoomd as _hoomd from hoomd.state import State from hoomd.snapshot import Snapshot from hoomd.operations import Operations class Simulation: R""" Simulation. Parameters: device (:py:mod:`hoomd.device`): Device to execute the simulation. Attributes: device state ...
Python
0
@@ -4501,26 +4501,9 @@ %22%22%22 -Set this flag to a +A lway @@ -4645,24 +4645,10 @@ eded -. Specifically, +( when @@ -4740,16 +4740,17 @@ tegrator +) . Set%0A @@ -5036,16 +5036,54 @@ penalty +%0A when using MD pair potentials .%0A
2fa9bad60d1ea5e4af2e07b6291083be95834fc5
fix cyclic depndencies
neuralmonkey/runners/__init__.py
neuralmonkey/runners/__init__.py
from .beamsearch_runner import BeamSearchRunner from .beamsearch_runner import beam_search_runner_range from .label_runner import LabelRunner from .logits_runner import LogitsRunner from .perplexity_runner import PerplexityRunner from .plain_runner import PlainRunner from .regression_runner import RegressionRunner from...
Python
0.000006
@@ -346,70 +346,8 @@ ner%0A -from .tensor_runner import TensorRunner, RepresentationRunner%0A from
4115bd2791569f937502eb9083cd280cdfd59f6b
update for py39
neuroml/nml/generateds_config.py
neuroml/nml/generateds_config.py
#Maps from NeuroML element space (Key) to python object space (value) #The class names are essentially correct, the instance names need converting #also attributes need fixing import lxml from lxml import objectify import re from config import variables import csv import sys sys.setrecursionlimit(10000) def remove_c...
Python
0
@@ -301,16 +301,17 @@ 10000)%0A%0A +%0A def remo @@ -363,24 +363,25 @@ %22%22,string)%0A%0A +%0A def to_lower @@ -527,16 +527,17 @@ ower()%0A%0A +%0A def to_c @@ -886,16 +886,17 @@ tring)%0A%0A +%0A def trav @@ -2269,24 +2269,18 @@ %0Aimport -StringIO +io %0Aimport @@ -2307,24 +2307,18 @@ tfile = -StringI...
95ee3bfeaf5615538eaa3bf384956b803e71ca35
Add 'address_group' extension to OVN
neutron/common/ovn/extensions.py
neutron/common/ovn/extensions.py
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
Python
0.000003
@@ -568,16 +568,70 @@ cense.%0A%0A +from neutron_lib.api.definitions import address_group%0A from neu @@ -3648,24 +3648,49 @@ ENSIONS = %5B%0A + address_group.ALIAS,%0A address_
9572617bf98292e1d3f22aadbf924173c18981e9
fix smbfs installl for mint13 and move config_network into deploy_root_teat_down for mint13
newage/deploy/linux/mint/core.py
newage/deploy/linux/mint/core.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from fabric.api import run, settings, abort from fabric.colors import red from fabric.contrib.files import append from ..core import (Linux, SicrawebMixin, PyGmountMixin, RdesktopMixin, BrowsersMixin, MateM...
Python
0
@@ -1073,42 +1073,8 @@ - # self.config_network()%0A # sel @@ -1106,18 +1106,16 @@ %0A - # with se @@ -1145,18 +1145,16 @@ %0A - # sel @@ -1176,34 +1176,32 @@ ckages()%0A - # self.prepare_py @@ -1210,34 +1210,32 @@ on_env()%0A - # self.prepare_rd @@ -1242,34 +12...
1a636c2233c704669c2f4d5b7996ed5438922f68
fix variable name to follow snake_case style
awslimitchecker/services/eks.py
awslimitchecker/services/eks.py
""" awslimitchecker/services/eks.py The latest version of this package is available at: <https://github.com/jantman/awslimitchecker> ################################################################################ Copyright 2015-2018 Jason Antman <jason@jasonantman.com> This file is part of awslimitchecker, also...
Python
0.00035
@@ -3497,31 +3497,33 @@ public -A +_a ccess -C +_c idrs_list = @@ -3765,31 +3765,33 @@ len(public -A +_a ccess -C +_c idrs_list),%0A
2a34d8cd07542228b15ed3f9b46fbe491a2c2a2c
fix MinMax
backgammon/bots/utils/minmax.py
backgammon/bots/utils/minmax.py
# Copyright (c) 2015, Bartlomiej Puget <larhard@gmail.com> # All rights reserved. # # 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...
Python
0.000011
@@ -1687,20 +1687,8 @@ es%0A%0A -import sys%0A%0A %0Acla @@ -1962,27 +1962,16 @@ return - modifier * self.ev @@ -2166,15 +2166,26 @@ ue = + modifier * -2**3 -0 +1 %0A%0A @@ -2320,117 +2320,180 @@ -max_value = max(max_value,%0A modifier * self.maximize(possible_board, level+1,%0...
c398a0cae84a63cc3b2cb2d2d3f4b04752957690
Put all graphs on one set of axes, and add a legend.
FailGraph.py
FailGraph.py
import simplejson import datetime import matplotlib from matplotlib.dates import MONDAY, WeekdayLocator, DayLocator, DateFormatter from matplotlib.ticker import NullFormatter, FuncFormatter import matplotlib.pyplot as plt def to_percent(y, position): if matplotlib.rcParams['text.usetex'] == True: return s...
Python
0
@@ -1325,16 +1325,317 @@ %7D +%0Afig, ax = plt.subplots()%0Aax.yaxis.set_major_formatter(FuncFormatter(to_percent))%0Aax.xaxis.set_major_locator(WeekdayLocator(MONDAY))%0Aax.xaxis.set_major_formatter(NullFormatter())%0Aax.xaxis.set_minor_locator(DayLocator())%0Aax.xaxis.set_minor_formatter(DateFormatter(%22%25a...
346677be332af8f9cc84617cec77df09d5555064
Disable cache for now (slower, but fixes #64831)
logwalker.py
logwalker.py
# Copyright (C) 2006 Jelmer Vernooij <jelmer@samba.org> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program...
Python
0
@@ -917,45 +917,8 @@ t os -%0Afrom bsddb import dbshelve as shelve %0A%0Afr @@ -1592,171 +1592,8 @@ me%0A%0A - # Try to load cache from file%0A if cache_dir is not None:%0A self.revisions = shelve.open(os.path.join(cache_dir, 'log'))%0A else:%0A
09c9840db402fdeead721d29ec93cebab1b13e93
Use cat instead of sleep for rootwrap test.
nova/tests/test_nova_rootwrap.py
nova/tests/test_nova_rootwrap.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
Python
0.000005
@@ -2742,20 +2742,144 @@ n(%5B%22 -sleep%22, %225%22%5D +cat%22%5D, stdin=subprocess.PIPE,%0A stdout=subprocess.PIPE,%0A stderr=subprocess.STDOUT )%0A @@ -2917,29 +2917,27 @@ oot%22, %22/bin/ -sleep +cat %22, %22-9%22, %22-H @@ -2991,21 +2991,19 @@ usr/bin/...
ac6b38351264b6b7b301542793b7a9d164f3d5ec
fix get_global
lib/kodi65/addon.py
lib/kodi65/addon.py
# -*- coding: utf8 -*- # Copyright (C) 2016 - Philipp Temminghoff <phil65@kodi.tv> # This program is Free Software see LICENSE file for details import xbmcaddon import xbmc import os import xbmcgui ADDON = xbmcaddon.Addon() ID = ADDON.getAddonInfo('id') ICON = ADDON.getAddonInfo('icon') NAME = ADDON.getAddonInfo('na...
Python
0.000001
@@ -1203,24 +1203,31 @@ _name):%0A +return HOME.getProp
6a0bd8c5ad7d01b611220f25e2a1228e4d420945
Remove unintended exposure of private attribute
manila/share/drivers/ganesha/__init__.py
manila/share/drivers/ganesha/__init__.py
# Copyright (c) 2014 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 # # Unless require...
Python
0.000116
@@ -1771,24 +1771,25 @@ = tag%0A%0A +_ confrx = re. @@ -2229,24 +2229,25 @@ filter(self. +_ confrx.searc
e72be22141d1d58f281cc19cc9179b84c7a1f8cc
use correct title FieldIndex
bika/lims/content/artemplate.py
bika/lims/content/artemplate.py
""" AnalysisRequests often use the same configurations. ARTemplate includes all AR fields, including preset AnalysisProfile """ from AccessControl import ClassSecurityInfo from Products.Archetypes.public import * from Products.Archetypes.references import HoldingReference from Products.CMFCore.permissions impo...
Python
0.000028
@@ -5715,17 +5715,17 @@ eType', -T +t itle = v @@ -5895,32 +5895,24 @@ self. -context. plone_utils. @@ -6056,32 +6056,24 @@ self. -context. absolute_url @@ -6714,17 +6714,17 @@ Point', -T +t itle = v @@ -6901,24 +6901,16 @@ self. -context. plone_ut @@ -7010,32 +7010,32 @@ ader(%22referer%2...
662de028b7b521a122b8ce2c6d7d1a4e4b399811
replace getitem calls with []
blaze/serve/server.py
blaze/serve/server.py
from __future__ import absolute_import, division, print_function from collections import Iterator from flask import Flask, request, jsonify, json from functools import partial, wraps from .index import parse_index class Server(object): __slots__ = 'app', 'datasets' def __init__(self, name='Blaze-Server', da...
Python
0
@@ -2107,35 +2107,23 @@ dset.py -.__getitem__( +%5B index -) +%5D %0A if @@ -2310,27 +2310,15 @@ hape -.__getitem__( +%5B index -) +%5D ),%0A
d31dac0cf53677d62db2f4bbfae4e2ddfaa29ba7
Fix for making Fortran extensions on AIX.
numpy/distutils/fcompiler/ibm.py
numpy/distutils/fcompiler/ibm.py
import os import re import sys from numpy.distutils.fcompiler import FCompiler from numpy.distutils.exec_command import exec_command, find_executable from distutils import log class IbmFCompiler(FCompiler): compiler_type = 'ibm' version_pattern = r'(xlf\(1\)\s*|)IBM XL Fortran ((Advanced Edition |)Version |...
Python
0
@@ -169,16 +169,63 @@ port log +%0Afrom distutils.sysconfig import get_python_lib %0A%0Aclass @@ -1938,16 +1938,428 @@ ersion%0A%0A + def get_linker_so(self):%0A if sys.platform.startswith('aix'):%0A python_lib = get_python_lib(standard_lib=1)%0A ld_so_aix = os.path.join(python_lib, ...