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 |
|---|---|---|---|---|---|---|---|
327b4a656347951b1b6bed1f04465dffc5011ec1 | Update setup.py | setup.py | setup.py | """Rachiopy setup script."""
from setuptools import find_packages, setup
from datetime import datetime
VERSION = "1.0.0"
GITHUB_USERNAME = "rfverbruggen"
GITHUB_REPOSITORY = "rachiopy"
GITHUB_PATH = f"{GITHUB_USERNAME}/{GITHUB_REPOSITORY}"
GITHUB_URL = f"https://github.com/{GITHUB_PATH}"
DOWNLOAD_URL = f"{GITHUB_UR... | Python | 0.000001 | @@ -69,38 +69,8 @@
etup
-%0Afrom datetime import datetime
%0A%0AVE
|
f91007560497d370b7451d212ad91dd23b47c892 | Create version 0.3.22 | setup.py | setup.py | from setuptools import setup
setup(name='DukeDSClient',
version='0.3.21',
description='Command line tool(ddsclient) to upload/manage projects on the duke-data-service.',
url='https://github.com/Duke-GCB/DukeDSClient',
keywords='duke dds dukedataservice',
author='John Bradley',
... | Python | 0.000001 | @@ -77,9 +77,9 @@
.3.2
-1
+2
',%0A
|
4c15430e02c12f190b95791681f20f1a36a016d9 | Add Python 3.4 classifier | setup.py | setup.py | __version__ = '0.21-dev'
import os
import sys
py_version = sys.version_info[:2]
PY3 = py_version[0] == 3
if PY3:
if py_version < (3, 2):
raise RuntimeError('On Python 3, Py65 requires Python 3.2 or later')
else:
if py_version < (2, 6):
raise RuntimeError('On Python 2, Py65 requires Python 2.6... | Python | 0.999999 | @@ -682,25 +682,25 @@
POSIX',%0A
-%22
+'
Programming
@@ -717,24 +717,24 @@
: Python
-%22
+'
,%0A
-%22
+'
Programm
@@ -762,24 +762,24 @@
n :: 2.6
-%22
+'
,%0A
-%22
+'
Programm
@@ -807,24 +807,67 @@
n :: 2.7
-%22
+'
,%0A
-%22
+'Programming Language :: Python :: 3',%0A '
Programm
@@ -899,16 ... |
f31d7a224d0c5a3c2b1d2b16fb4bc74edefacf24 | Bump version string | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='autobuilder',
version='0.6.6',
packages=find_packages(),
license='MIT',
author='Matt Madison',
author_email='matt@madison.systems',
install_requires=['buildbot>=0.8.12m1']
)
| Python | 0.000001 | @@ -86,17 +86,17 @@
on='0.6.
-6
+7
',%0A p
|
014acee66b9cff26cb8f02f65c071f78a0a77e19 | Bump version to 0.9.4pbs22 | setup.py | setup.py | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
dependency_links = [
'http://github.com/pbs/django-cms/tarball/support/2.3.x#egg=django-cms-2.3.5pbs.X.dev',
'http://github.com/pbs/django-filer/tarball/master_pbs#egg=... | Python | 0 | @@ -405,17 +405,17 @@
.9.4pbs2
-1
+2
%22,%0A u
|
c53b8a0a06596d9803a8df92e909d4ad28169dda | Update the cookiedomain requirement to 0.6, which has httponly. | setup.py | setup.py | AUTHOR = 'Osmosoft'
AUTHOR_EMAIL = 'tiddlyspace@osmosoft.com'
NAME = 'tiddlywebplugins.tiddlyspace'
DESCRIPTION = 'A discoursive social model for TiddlyWiki'
VERSION = '0.2.2' # N.B.: duplicate of tiddlywebplugins.tiddlyspace.__init__
import os
from setuptools import setup, find_packages
setup(
namespace_packa... | Python | 0 | @@ -1124,25 +1124,25 @@
iedomain%3E=0.
-3
+6
',%0A '
|
07656b928c506c0f9d602a5c4195793b5e449693 | test fix | setup.py | setup.py | from setuptools import setup, find_packages
import re
with open('requirements.txt') as f:
requirements = f.readlines()
with open('async_connect/__init__.py') as f:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
with open('README.rst') as f:
readme = f.read... | Python | 0.000001 | @@ -37,16 +37,27 @@
ackages%0A
+import sys%0A
import r
@@ -328,16 +328,111 @@
read()%0A%0A
+if sys.version_info%5B1%5D == 6:%0A test_require = %5B'uvloop%3E=0.8.0'%5D%0Aelse:%0A test_require = %5B%5D%0A%0A
setup(na
@@ -936,33 +936,28 @@
require=
-%5B'uvloop%3E=0.8.0'%5D
+test_require
,%0A
|
5c1338a623f438c1fdc6ddfcd79baf256819d57e | move tests scripts to parent directory to keep the same path in the source code | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2009 Adriano Monteiro Marques.
#
# Author: Bartosz SKOWRON <getxsick at gmail dot com>
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free S... | Python | 0.000007 | @@ -1806,39 +1806,32 @@
('share','umpa',
-'tests'
),%0A
|
ca62972886bcaef6375e78e32514883183f50929 | bump version UP! Align to pypi | setup.py | setup.py | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
setup(
name='instapy-cli',
version='0.0.1',
description='Python library and cli used to upload photo on Instagram. W/o a phone!',
long_description=open('README.md.rst').read(),
classifiers=[
... | Python | 0.000008 | @@ -2,16 +2,30 @@
mport os
+%0Aimport codecs
%0A%0Afrom s
@@ -114,16 +114,264 @@
le__))%0A%0A
+def read(*parts):%0A %22%22%22%0A Build an absolute path from *parts* and and return the contents of the%0A resulting file. Assume UTF-8 encoding.%0A %22%22%22%0A with codecs.open(os.path.join(here, *parts)... |
cee0402b1d8e3c261be789de43aaa8d56b78e743 | Support for in and function calls | plyxproto/logicparser.py | plyxproto/logicparser.py | __author__ = "Sapan Bhatia"
__copyright__ = "Copyright (C) 2017 Open Networking Lab"
__version__ = "1.0"
import ply.lex as lex
import ply.yacc as yacc
from helpers import LexHelper, LU
class FOLLexer(object):
keywords = ('forall', 'exists', 'True', 'False', 'not')
tokens = ['STRING_LITERAL', 'NUM', 'ESCAPE... | Python | 0 | @@ -264,16 +264,22 @@
', 'not'
+, 'in'
)%0A%0A t
@@ -1224,16 +1224,23 @@
Za-z
-0
+2
-9_+$%5D*
+(%5C(%5C))?
'%0A
@@ -2432,32 +2432,127 @@
p%5B0%5D = p%5B2%5D%0A%0A
+ def p_fole_in(self, p):%0A %22fole : term IN term%22%0A p%5B0%5D = %7B'in': (p%5B1%5D, p%5B3%5D)%7D%0A%0A
def p_fole_e
|
47dd0d3f9d5d150adad7097bb2a24964f3c732b2 | add pytest dep | setup.py | setup.py | #!/usr/bin/env python
import setuptools
long_description = """python-evtx is a pure Python parser for \
Windows Event Log files (those with the file extension ".evtx"). \
The module provides programmatic access to the File and Chunk headers, \
record templates, and event entries. For example, you can use \
python-evt... | Python | 0.000001 | @@ -1010,24 +1010,85 @@
es=%5B
-'hexdump', 'six'
+%0A 'six',%0A 'pytest',%0A 'hexdump',%0A
%5D,%0A
|
f3cc4d84fbfcb430b004d730e44653079b3b3490 | Update version to 1.6 | setup.py | setup.py | import os
from setuptools import setup
def read(file):
return open(os.path.join(os.path.dirname(__file__), file)).read()
setup(
name="vsut",
version="1.5.5",
author="Alex Egger",
author_email="alex.egger96@gmail.com",
description="A simple unit testing framework for Python 3.4",
license="M... | Python | 0 | @@ -163,11 +163,9 @@
=%221.
-5.5
+6
%22,%0A
|
5ea089d150a7e6132670ab92521bf763b1e719bf | bump version to 0.2 | setup.py | setup.py | #!/usr/bin/python
from setuptools import setup
setup(
name="htmlgen",
version="0.1",
description="HTML 5 Generator",
author="Sebastian Rittau",
author_email="srittau@rittau.biz",
url="https://github.com/srittau/python-htmlgen",
packages=["htmlgen", "test_htmlgen"],
depends=["asserts"]... | Python | 0.000001 | @@ -89,9 +89,9 @@
=%220.
-1
+2
%22,%0A
|
7cfe670f621ac8ee7723e80c279a9794dc0a1bb9 | update docker version | setup.py | setup.py | from setuptools import setup
setup(
name='vent',
version='v0.6.9.dev',
packages=['vent', 'vent.core', 'vent.core.file_drop',
'vent.core.rq_worker', 'vent.core.rq_dashboard', 'vent.menus',
'vent.core.network_tap', 'vent.core.network_tap.ncontrol',
'vent.core.rmq_es_... | Python | 0 | @@ -389,17 +389,17 @@
er%3E=3.5.
-0
+1
', 'npys
|
284779dd4c0d13f53b0450c8c564ac23f6611170 | Use higher degree poly kernel in SVC | prepare_outputs.py | prepare_outputs.py | # Prepare text to become data labels. Decompose phonemes into phonological features.
import nltk, pandas, prepare_data, prepare_EMG
from sklearn.svm import SVC
import numpy as np
class output_preparer():
""" Prepares the target data labels. Takes text, transforms it into phonemes, and then decomposes each phoneme... | Python | 0 | @@ -989,10 +989,10 @@
C=0.
-90
+25
, ke
@@ -1003,16 +1003,26 @@
='poly',
+ degree=5,
random_
@@ -1469,32 +1469,34 @@
x_2)%0A
+ #
print(%22processe
|
046f9e35568c4f647780e504e2000fabf0f9937b | use __version__ from dynash.py | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
SETUP_OPTIONS = dict(
name='dynash',
version='0.5.1',
description='Command line client for DynamoDB',
long_description = open("README.md").read(),
author='Raffaele Sena',
author_email='raff367@gmail.com',
url='https... | Python | 0.000043 | @@ -68,16 +68,47 @@
rt setup
+%0Afrom dynash import __version__
%0A%0ASETUP_
@@ -158,15 +158,19 @@
ion=
-'0.5.1'
+__version__
,%0A
|
1f9b2c7836d6738d5a86d93644a04da7729b3688 | Prepare openprocurement.api 2.4.5. | setup.py | setup.py | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
README = f.read()
requires = [
'barbecue',
'chaussette',
'cornice',
'couchdb-schematics',
'gevent',
'iso8601',
'jsonpatch',
'li... | Python | 0 | @@ -1065,17 +1065,17 @@
on='2.4.
-4
+5
',%0A
|
cabfe1a7586e5ce313105cab08810f51dae6b479 | Update setup.py | setup.py | setup.py | #from distutils.core import setup
from setuptools import setup
from odplib import meta
setup(name="rst2odp",
version=meta.__version__,
author=meta.__author__,
author_email=meta.__email__,
description="Converter for rst to OpenOffice Impress",
long_description='''Packacking of rst2odp and... | Python | 0 | @@ -491,14 +491,11 @@
se='
-Apache
+MIT
',%0A
|
ec87897adfe021f2f61b96e07eb23e7f31edd2a4 | Remove set_templates code (it wasnt used) | nexus/nexus_modules.py | nexus/nexus_modules.py | import nexus
from django.conf import settings
from django.contrib import admin
def make_nexus_model_admin(model_admin):
class NexusModelAdmin(model_admin.__class__):
def render_change_form(self, request, context, add=False, change=False, form_url='', obj=None):
opts = self.model._meta
... | Python | 0 | @@ -4778,81 +4778,8 @@
s)%0A%0A
- def set_templates(self, model, admin):%0A # TODO:%0A pass%0A%0A
|
1a7eb2627fbf3bc0ddb5d8fd5b051f3139275590 | Fix moderation rule | Rules/Moderation.py | Rules/Moderation.py | from ._shared import *
class Moderation(Rule):
"""Handles message to moderate listing"""
def __init__(self, bot):
self.bot = bot
def __call__(self, serv, author, args):
"""Handles message to moderate listing"""
if not self.bot.has_admin_rights(serv, author):
return
... | Python | 0.000048 | @@ -1181,32 +1181,36 @@
self.
+bot.
ans(serv,%0A
@@ -1228,16 +1228,20 @@
+
author,%0A
@@ -1236,16 +1236,20 @@
author,%0A
+
@@ -1336,16 +1336,20 @@
self.
+bot.
ans(serv
@@ -1443,16 +1443,20 @@
self.
+bot.
say(serv
|
90c82f0936addeb4469db2c42c1cd48713e7f3cf | Switch from bold to red highlighting. | progress_logger.py | progress_logger.py | # Copyright Google
# BSD License
import copy
import wash
# from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033... | Python | 0 | @@ -418,35 +418,34 @@
lf, lots, text,
-bol
+re
d_lots):%0A lot
@@ -561,19 +561,18 @@
te)%0A
-bol
+re
d_ids =
@@ -591,19 +591,18 @@
lot in
-bol
+re
d_lots%5D%0A
@@ -678,19 +678,18 @@
lot) in
-bol
+re
d_ids:%0A
@@ -710,19 +710,18 @@
= color.
-BOL
+RE
D%0A
@@ -874,19 +874,18 @@
, text,
-bol
... |
e409c6608abd19f863e8e21452d438bdf9176b4a | rename for first run | test/test_var_nn_embedded_vec_classifier.py | test/test_var_nn_embedded_vec_classifier.py | import os
import unittest
import urllib
import sys
import shorttext
# The "test_w2v_model.bin" in this directory is adapted from: https://raw.githubusercontent.com/chinmayapancholi13/shorttext_test_data/master/test_w2v_model
class TestVarNNEmbeddedVecClassifier(unittest.TestCase):
def setUp(self):
print... | Python | 0.000001 | @@ -4102,16 +4102,18 @@
def test
+AA
SumEmbed
|
a25558ef0f1a902e948424bc0a3e137cc4d0f569 | implement programming via remote gdb session | scons/site_tools/openocd_remote.py | scons/site_tools/openocd_remote.py | #!/usr/bin/env python
#
# Copyright (c) 2014, Roboterclub Aachen e.V.
# All Rights Reserved.
#
# The file is part of the xpcc library and is released under the 3-clause BSD
# license. See the file `LICENSE` for the full license governing this code.
import platform
from SCons.Script import *
# -----------------------... | Python | 0 | @@ -1098,16 +1098,586 @@
action))
+%0A# -----------------------------------------------------------------------------%0A# Program elf file via a remote gdb session%0Adef gdb_remote_program(env, source, alias='gdb_remote_program'):%0A%09if platform.system() == %22Windows%22:%0A%09%09print %22Not supported under windows... |
9df7691be1e46310736db2a0a3303e39923273a5 | allow properties to be instantiated via file stream | jproperties.py | jproperties.py | """
python-jproperties
Java .properties file parsing and handling
"""
from collections import OrderedDict
from collections.abc import MutableMapping
__version__ = "0.3"
__author__ = "Jerome Leclanche"
__email__ = "jerome@leclan.ch"
class Node:
def __repr__(self):
return "<EmptyNode>"
class Comment(Nod... | Python | 0 | @@ -1157,42 +1157,178 @@
None
-):%0A if defaults is not None
+, stream=None):%0A if stream and defaults:%0A raise ValueError(%0A %22defaults and stream are mutually exclusive parameters%22)%0A if defaults
:%0A
@@ -1492,16 +1492,66 @@
ems()%5D%0A%0A
+ if stream:... |
0263e6782086a97a5f403d9de79b85b2d405aa6b | Disable SSH agent forwarding | nighttrain/__main__.py | nighttrain/__main__.py | # Copyright 2017 Codethink Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | Python | 0 | @@ -4040,16 +4040,41 @@
t(hosts,
+ forward_ssh_agent=False,
host_co
|
c3f844cfe03a23a5d6207ba99b5dc6abac9b94a1 | Add unit test. | awx/main/tests/unit/models/test_job_unit.py | awx/main/tests/unit/models/test_job_unit.py | import pytest
import json
from awx.main.tasks import RunJob
from awx.main.models import Job
@pytest.fixture
def job(mocker):
return mocker.MagicMock(**{
'display_extra_vars.return_value': '{\"secret_key\": \"$encrypted$\"}',
'extra_vars_dict': {"secret_key": "my_password"},
'pk': 1, 'job_... | Python | 0 | @@ -1129,16 +1129,548 @@
ted$'%7D%0A%0A
+@pytest.mark.survey%0Adef test_survey_passwords_not_in_extra_vars():%0A %22%22%22Tests that survey passwords not included in extra_vars are%0A not included when displaying job information%22%22%22%0A job = Job(%0A name=%22test-survey-not-in%22,%0A extra_v... |
3b0760ce604ab5e627f8459fc83f4f7b638c224e | Fix flake8 warning | cmsplugin_forms_builder/cms_plugins.py | cmsplugin_forms_builder/cms_plugins.py | from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cmsplugin_forms_builder.models import PluginForm
from django.utils.translation import ugettext_lazy as _
class FormBuilderPlugin(CMSPluginBase):
"""
Plugin class for form-builder forms.
"""
model = PluginForm
... | Python | 0 | @@ -517,16 +517,17 @@
ontext%0A%0A
+%0A
plugin_p
|
75aa936c489dedc8592f5f27fd013c1bda2decc1 | Use POST form data instead of GET parameters | flask_mwoauth/__init__.py | flask_mwoauth/__init__.py | #!/usr/bin/env python
# MediaWiki OAuth connector for Flask
#
# Requires flask-oauthlib
#
# (C) 2013 Merlijn van Deen <valhallasw@arctus.nl>
# Licensed under the MIT License // http://opensource.org/licenses/MIT
#
__version__ = '0.2.46'
import sys
from future.utils import iteritems
from future.moves.urllib.parse impo... | Python | 0 | @@ -5329,23 +5329,53 @@
.php
-?%22 + urlencode(
+%22,%0A data=
api_
@@ -5379,18 +5379,16 @@
pi_query
-),
%0A
@@ -5421,33 +5421,8 @@
-content_type=%22text/plain%22
).da
|
a051899ac8365ebb855267a706e3a5c094f9ab24 | support longer instance ids | awsh/__init__.py | awsh/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import boto3
from os import path, system
from pprint import pprint
import argparse
import itertools
from collections import deque
VERSION = "1.0.11"
def connect(instance, args):
details = get_details(instance)
print('\nConnecting to: {name}\n'.format(**details))... | Python | 0.000001 | @@ -3789,10 +3789,10 @@
id:%3C
-16
+24
%7D%7Bpu
|
749b05712474ea8695fb6f2d1662399da42b1d32 | Update error with user input | SimpleCalculator.py | SimpleCalculator.py | '''
Author : DORIAN JAVA BROWN
Version : N/A
Copyright : All Rights Reserve; You may use, distribute and modify this code.
Description : This is a simple calculator that can add, subtract, multiply and divide using functions
'''
'''function definitions'''
def calculate():
# operation selection f... | Python | 0.000001 | @@ -245,35 +245,8 @@
'%0A%0A%0A
-%0A'''function definitions'''
%0A%0Ade
@@ -676,175 +676,10 @@
lid%0A
- operator(operation)%0A %0A # recieving two numbers from user%0A num1 = int(raw_input('%5CnEnter first number : '))%0A num2 = int(raw_input('%5CnEnter second number : '))%0A
+%0A%0A
%0A #
@@ -711,16 +711,... |
9302f918390063c1bfedf2724e0b1fb9a3d1effb | Add the required whitespace before css classes This was preventing some email clients from correctly displaying the styling. | portal/models/message.py | portal/models/message.py | """Model classes for message data"""
from datetime import datetime
from textwrap import fill
from flask import current_app
from flask_mail import Message
from flask_mail import email_dispatched
from ..audit import auditable_event
from ..database import db
from ..extensions import mail
from .user import User
def log_... | Python | 0.00007 | @@ -619,16 +619,44 @@
%3E%3Chead%3E%3C
+title%3ETrueNTH email%3C/title%3E%3C
style%3E%22%0A
@@ -701,24 +701,25 @@
%22%7D%22%0A %22
+
.btn %7B%22%0A
@@ -1164,16 +1164,17 @@
%7D%22%0A %22
+
.btn:hov
|
1072487ce3ffe96557d5a14efed3715c2592cebc | Fix OSX | prompty/userdir.py | prompty/userdir.py | #!/usr/bin/env python
# vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import shutil
import errno
import distutils.dir_util
PROMPTY_USER_D... | Python | 0.000659 | @@ -1627,32 +1627,222 @@
#
+ Mac OSX%0A self.skelDir = os.path.join(self.promtyBaseDir, %22share%22, %22prompty%22, SKEL_DIR)%0A%0A if not os.path.exists(self.skelDir):%0A #
Install dir as
@@ -1853,32 +1853,36 @@
ned in setup.py%0A
+
... |
101b48fed741c0c95f69e4ce678fbb390d7f709e | Fix flake8 | ykman/native/pyusb.py | ykman/native/pyusb.py | # Copyright (c) 2015 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | Python | 0 | @@ -1817,32 +1817,45 @@
= os.path.join(
+%0A
os.path.dirname(
|
85912ea3988ffc4e0516ff14fa51c4bab9ac1630 | fix string formatting | slask.py | slask.py | #!/usr/bin/env python
from __future__ import print_function
from glob import glob
import importlib
import logging
import os
import re
import sys
import time
import traceback
from slackclient import SlackClient
def init_log(config):
loglevel = config.get("loglevel", logging.INFO)
logformat = config.get("logfor... | Python | 0.000182 | @@ -3599,16 +3599,17 @@
token %3C%7B
+0
%7D%3E?%22.for
|
fa7fc8181f09340c9778ef6c056674ddc7d3d54e | Add run convergence | tests/convergence_tests/convergence_lspr.py | tests/convergence_tests/convergence_lspr.py | import re
import os
import sys
import time
import numpy
import pickle
import datetime
try:
import pycuda
except ImportError:
ans = input('PyCUDA not found. Regression tests will take forever. Do you want to continue? [y/n] ')
if ans in ['Y', 'y']:
pass
else:
sys.exit()
from pygbe.mai... | Python | 0.000001 | @@ -2723,20 +2723,1812 @@
otal_time), file=f)%0A
+%0A%0Adef run_convergence(mesh, test_name, problem_folder, param):%0A %22%22%22%0A Runs convergence tests over a series of mesh sizes%0A%0A Inputs:%0A ------%0A mesh : array of mesh suffixes%0A problem_folder: str, name of folder cont... |
9ff9add738807ffcca63fdf02aca5e13a029259a | Fix debug message again | fluxghost/http_handler.py | fluxghost/http_handler.py |
import os
from http.server import BaseHTTPRequestHandler
from urllib.parse import urlparse
from urllib.request import Request
from urllib.request import urlopen
import logging
from fluxghost.http_websocket_route import get_match_ws_service
from fluxghost import __version__
from io import StringIO
import urllib.error
... | Python | 0.000001 | @@ -3164,16 +3164,20 @@
%22 + str(
+len(
resp_con
@@ -3182,16 +3182,17 @@
ontent))
+)
%0A
|
8f815c41b505c01cbc1c57088ddc3a465f1ac07c | Add a configuration key for the URL of the Fedora OpenID server | fmn/web/default_config.py | fmn/web/default_config.py | SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
| Python | 0 | @@ -123,8 +123,60 @@
n-web'%5D%0A
+%0AFMN_FEDORA_OPENID = 'https://id.fedoraproject.org'%0A
|
87b6166bb2f88b54c78569d6b566c4d557733c57 | Modify proxy to use inlineCallbacks | proxy.py | proxy.py | from twisted.internet import endpoints, protocol, reactor
from twisted.protocols import basic
from twisted.web.client import getPage
import time
class ProxyProtocol(basic.LineReceiver):
def gotPage(self, data, line, start):
print 'Fetched {} in {} sec'.format(line, time.time() - start)
self.transp... | Python | 0 | @@ -21,16 +21,23 @@
t import
+ defer,
endpoin
@@ -200,192 +200,209 @@
def
-gotPage(self, data, line, start):%0A print 'Fetched %7B%7D in %7B%7D sec'.format(line, time.time() - start)%0A self.transport.write(data)%0A%0A def errGettingPage(self, reason, line):
+lineReceived(self, line):%0A if... |
714ecf45aaa233d067768de526955a319ff154f4 | Add annotation | nomenklatura/loader.py | nomenklatura/loader.py | import json
import logging
from nomenklatura.resolver import Resolver
from typing import (
Dict,
Generator,
Generic,
Iterable,
Iterator,
List,
Optional,
Tuple,
TypeVar,
)
from followthemoney.proxy import EntityProxy
from followthemoney.types import registry
from followthemoney.proper... | Python | 0.000002 | @@ -4027,16 +4027,23 @@
__(self)
+ -%3E str
:%0A
|
860b6a5a645de9aa69cbd61632a20075edac1553 | Change remove_accents function to normalize back to NFKC | normalizr/normalizr.py | normalizr/normalizr.py | import codecs
import os
import re
import string
import unicodedata
import normalizr.regex as regex
path = os.path.dirname(__file__)
DEFAULT_NORMALIZATIONS = [
'remove_extra_whitespaces', 'replace_punctuation', 'replace_symbols', 'remove_stop_words'
]
class Normalizr:
"""
This class offers methods for t... | Python | 0.000001 | @@ -2663,17 +2663,16 @@
n text%0A%0A
-%0A
def
@@ -2698,39 +2698,24 @@
(self, text,
- format='NFKD',
excluded=se
@@ -2851,53 +2851,8 @@
ed.%0A
- format (string): Unicode format.%0A
@@ -2978,32 +2978,33 @@
ks.%0A %22%22%22%0A
+%0A
return '
@@ -2993,32 +2993,62 @@
%0A%0A ... |
33b0113b0a3b5ea11e15265479cfde168ebd8a48 | Fix properties of Evaluation when its dates are None | indico/modules/events/evaluation/models/evaluations.py | indico/modules/events/evaluation/models/evaluations.py | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | Python | 0.999999 | @@ -3204,24 +3204,40 @@
self.end_dt
+and self.end_dt
%3C now_utc()%0A
@@ -3289,24 +3289,40 @@
return
+self.end_dt and
self.start_d
|
d75e1309bf41f05489ffcf8502309b765bc8c359 | handle non dev/rc last release (#5133) | scripts/update_bokehjs_versions.py | scripts/update_bokehjs_versions.py | import os
import re
import sys
def check_input(version):
pat = r'^(\d+.\d+.\d+)((dev|rc)\d+)?$'
if not re.match(pat, version):
print("The new version must be in the format X.X.X([dev|rc]X) (ex. '0.12.0')")
return False
return True
def version_update(version, filename):
pat = r"""(relea... | Python | 0 | @@ -631,10 +631,66 @@
p(3)
+%0A if match.group(4) is not None:%0A old_version
+
+=
mat
|
001924264830761cfa5938ca542201f2e8bdaf66 | Fix haystack index | freieit/search_indexes.py | freieit/search_indexes.py | from haystack import indexes, site
from .models import ExpertProfile
class ExpertProfileIndex(indexes.SearchIndex):
#text = indexes.CharField(document=True, use_template=True)
text = indexes.EdgeNgramField(document=True, use_template=True)
#name = indexes.CharField(model_attr='name')
#location = inde... | Python | 0.000607 | @@ -25,14 +25,8 @@
exes
-, site
%0A%0Afr
@@ -103,16 +103,35 @@
rchIndex
+, indexes.Indexable
):%0A #
@@ -499,24 +499,36 @@
ueryset(self
+, using=None
):%0A %22
@@ -648,55 +648,4 @@
ue)%0A
-%0A%0Asite.register(ExpertProfile, ExpertProfileIndex)%0A
|
270df828dfc76f993a999daeeb8fa8f6c82b1e62 | Fix typo in documentation | lib/cmdlib/query.py | lib/cmdlib/query.py | #
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc.
#
# 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... | Python | 0.999937 | @@ -1776,10 +1776,11 @@
plem
+en
t
-n
atio
|
afc47fd469d7836dcda0eb8bb027cce2a0ed2121 | Update MergeSort.py | fundamentals/MergeSort.py | fundamentals/MergeSort.py | """
@author: Maneesh D
@email: maneeshd77@gmail.com
@date: 24/6/17
Merge Sort -> O(nlog n)
"""
from random import randint
from timeit import Timer, default_timer
def merge_sort(data):
if len(data) == 1:
return data
n = len(data)
mid = n // 2
# Divide and sort the sub lists
left = merge_s... | Python | 0 | @@ -61,16 +61,37 @@
4/6/17%0A%0A
+Worst Case Analysis:
Merge So
@@ -1081,25 +1081,8 @@
= %5B
-randint(1, 10) +
i fo
@@ -1103,11 +1103,57 @@
0000
-1)%5D
+0, 0, -1)%5D # Worst Case Input (Reverse Sorted)
%0A
|
38c96a366b68cd74cbec6e69ca168225ccf3fe18 | Patch for an Issue #260 | lib/core/convert.py | lib/core/convert.py | #!/usr/bin/env python
"""
Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
try:
import hashlib
except:
import md5
import sha
import pickle
import re
import sys
import struct
import urllib
from lib.core.enums import PLACE
from lib.core.s... | Python | 0 | @@ -558,19 +558,295 @@
%0A ret
-urn
+Val = None%0A try:%0A retVal = base64encode(pickle.dumps(value, pickle.HIGHEST_PROTOCOL))%0A except:%0A warnMsg = %22problem occurred while serializing %22%0A warnMsg += %22instance of a type '%25s'%22 %25 type(value)%0A singleTimeWarnMessage(wa... |
bebbbed6dba82329fcaab32fdb0109ec78cd7ad9 | Use correct subprotocol | ztag/transforms/s7.py | ztag/transforms/s7.py | from ztag.transform import *
from ztag import protocols, errors
class S7Transform(ZGrabTransform):
name = "s7/status"
port = 102
protocol = protocols.S7
subprotocol = protocols.S7.STATUS
def _transform_object(self, obj):
zout = ZMapTransformOutput()
wrapped = Transformable(obj)
... | Python | 0.024217 | @@ -197,13 +197,10 @@
S7.S
-TATUS
+ZL
%0A%0A%0A
|
d16d61c1d3a9eaaef3e4673205a42a9dd010900a | Replace Unwrapped with Value on proto method names (#2283) | synth.py | synth.py | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 | @@ -2112,16 +2112,179 @@
lass%22)%0A%0A
+# Replace %22Unwrapped%22 with %22Value%22 for method names.%0As.replace(%0A %22src/V*/**/*.php%22,%0A r%22public function (%5Cw%7B0,%7D)Unwrapped%22,%0A r%22public function %5C1Value%22%0A)%0A%0A
# fix ye
|
0cd617ddc7e6303139583b6a92e90cfac1e91b31 | set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#938) | synth.py | synth.py | import synthtool as s
import synthtool.gcp as gcp
import logging
import subprocess
import os
logging.basicConfig(level=logging.DEBUG)
gapic = gcp.GAPICGenerator()
common_templates = gcp.CommonTemplates()
# tasks has two product names, and a poorly named artman yaml
version = 'v1'
library = gapic.node_library(
'p... | Python | 0 | @@ -129,16 +129,52 @@
DEBUG)%0A%0A
+AUTOSYNTH_MULTIPLE_COMMITS = True%0A%0A%0A
gapic =
|
b3b93f642f88e5f00d22d07fccc9bab1f16ca564 | exclude Bundle Proto from Synthtool run (#377) | synth.py | synth.py | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 | @@ -4485,16 +4485,178 @@
True%0A)%0A%0A
+# TODO(wu-hui): Add %60bundle.proto%60 to googleapis/googleapis.%0A# The target below points to a local file, but synthtool only works against the%0A# googleapis repo.%0A#
bundle_v
@@ -4668,32 +4668,34 @@
enerate_client(%0A
+#
service='fir
@@ -4706,24 +4706,26 @@
re-b... |
92771ac9fbe49b5bbf0ed2c178d930a374d42b6f | enable context aware commits (#93) | synth.py | synth.py | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 | @@ -733,16 +733,51 @@
s java%0A%0A
+AUTOSYNTH_MULTIPLE_COMMITS = True%0A%0A
gapic =
|
59860336a32b4cb438d275ced06a3100a2dd78b6 | Update synth.py | synth.py | synth.py | # Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 | @@ -8,17 +8,17 @@
ight 202
-0
+1
Google
@@ -706,8 +706,9 @@
plates()
+%0A
|
171950f63b6a1bc1bdb60b10c25f529e51dbfe8b | Split up dev and static servers | tasks.py | tasks.py | from glob import glob
from invoke import task
@task(aliases=['dev-server'])
def dev_server(ctx, pty=True):
"""Run django dev server and servers for static files."""
ctx.run('python manage.py runserver | npm run watch-static', pty=pty)
@task
def build(ctx):
"""Build docs, static-files, etc."""
ctx.r... | Python | 0 | @@ -135,12 +135,143 @@
rver
- and
+.%22%22%22%0A ctx.run('python manage.py runserver', pty=pty)%0A%0A%0A@task(aliases=%5B'static-server'%5D)%0Adef static_server(ctx, pty=True):%0A %22%22%22Run
ser
@@ -313,37 +313,8 @@
un('
-python manage.py runserver %7C
npm
|
0e8994d1dbeb6266156fa9615fc003aa0d0a4822 | remove unused import, flake8 | tasks.py | tasks.py | # -*- coding: utf-8 -*-
import os
import sys
from invoke import task, run
from waterbutler import settings
@task
def install(upgrade=False, pip_cache=None, wheel_repo=None):
cmd = 'pip install -r dev-requirements.txt'
if upgrade:
cmd += ' --upgrade'
if pip_cache:
cmd += ' --download-ca... | Python | 0 | @@ -22,18 +22,8 @@
*-%0A%0A
-import os%0A
impo
|
ca78234cc9bebd3901750e913d87e7f63ebcd7f0 | test 42 | tasks.py | tasks.py | """
QED celery instance
"""
from __future__ import absolute_import
import os
import logging
import redis
import json
import uuid
from celery import Celery
from flask import request, Response
from flask_restful import Resource
logging.getLogger('celery.task.default').setLevel(logging.DEBUG)
logging.getLogger().setLev... | Python | 0.000002 | @@ -5026,16 +5026,17 @@
ing%0A
+#
rest_mod
@@ -5094,18 +5094,16 @@
sam)%0A
- #
logging
|
fd9ef4b30ef09d52c120e9e8ab2461cbce939dfd | Add --show-diff-on-failure | tasks.py | tasks.py | # -*- coding: utf-8 -*-
import os
import sys
import webbrowser
from invoke import task
docs_dir = 'docs'
build_dir = os.path.join(docs_dir, '_build')
@task
def test(ctx, watch=False, last_failing=False):
"""Run the tests.
Note: --watch requires pytest-xdist to be installed.
"""
import pytest
syn... | Python | 0.000107 | @@ -601,16 +601,39 @@
ll-files
+ --show-diff-on-failure
', echo=
|
59c9e30df3397a9114a59cc8a318cf011ba04085 | fix terminal size formatting | .util/cliformatting.py | .util/cliformatting.py | import os
import sys
import click
from math import ceil
import shutil
rows, columns = shutil.get_terminal_size()
RESULTS = {"success": 0, "failure": 0}
def header(msg):
click.secho(f"\n# {msg}", bold=True)
def s(n):
if n == 1:
return ""
return "s"
def error(s, details=None):
lineart = "**... | Python | 0.000007 | @@ -68,21 +68,18 @@
il%0A%0A
-rows,
columns
+, _
= s
|
7b8b4c7f76c4623ee58fc7a05aee8a8d62d99b89 | Improve init | polyaxon_cli/cli/init.py | polyaxon_cli/cli/init.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import os
import sys
import click
import clint
from polyaxon_cli.cli.getters.project import get_project_or_local
from polyaxon_cli.client import PolyaxonClient
from polyaxon_cli.client.exceptions import PolyaxonHTTPError, Polya... | Python | 0.000015 | @@ -1729,16 +1729,61 @@
IT_FILE)
+,%0A add_sign=True
)%0A%0A%0A@cli
@@ -3930,36 +3930,16 @@
n=True)%0A
- sys.exit(1)%0A
else
|
88ccfdb981b181087b442fc25877489c019a0679 | Clean up some inconsistent in error handling | gunicorn/workers/sync.py | gunicorn/workers/sync.py | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
#
from datetime import datetime
import errno
import os
import select
import socket
import ssl
import gunicorn.http as http
import gunicorn.http.wsgi as wsgi
import gunicorn.util as util
impor... | Python | 0 | @@ -3527,19 +3527,24 @@
args%5B0%5D
-!=
+not in (
errno.EP
@@ -3546,16 +3546,35 @@
no.EPIPE
+, errno.ECONNRESET)
:%0A
@@ -3599,25 +3599,32 @@
.exception(%22
-E
+Socket e
rror process
@@ -3648,32 +3648,172 @@
else:%0A
+ if e.args%5B0%5D == errno.ECONNRESET:%0A s... |
6a651684fa2e3d5d0837ff8ab040493cb0ddb9f3 | Booleans are sentence case | pelican/pelicanconf.py | pelican/pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Rich Cornish'
SITENAME = u'Rich learns Python the hard way'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'America/Chicago'
DEFAULT_LANG = u'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = Non... | Python | 0.999999 | @@ -926,8 +926,8 @@
= T
-RUE
+rue
%0A
|
3ad217795a0e8d570b9759a93d24678bdd67a5b4 | Replacing pythonic print with Logger.logException | UM/Mesh/ReadMeshJob.py | UM/Mesh/ReadMeshJob.py | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Job import Job
from UM.Application import Application
from UM.Message import Message
from UM.Math.Vector import Vector
from UM.Preferences import Preferences
from UM.Logger import Logger
from UM.Mesh.MeshReader i... | Python | 0.998468 | @@ -4674,13 +4674,8 @@
tion
- as e
:%0A
@@ -4700,15 +4700,82 @@
-print(e
+Logger.logException(%22e%22, %22While auto-scaling an exception has been raised%22
)%0A
|
87f31f79ac42d454402d8863cb6ba6bd6a75f860 | Fix missing researcher parameter | backend/tasks.py | backend/tasks.py | # -*- encoding: utf-8 -*-
# Dissemin: open access policy enforcement tool
# Copyright (C) 2014 Antonin Delpeuch
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the Licen... | Python | 0.000121 | @@ -2806,16 +2806,17 @@
_papers(
+r
)%0A
|
3b5473048d40feee7807c5ad50f4521113d8216f | copy packages instead of symlinking | buildtools/publish_deb.py | buildtools/publish_deb.py | #!/usr/bin/python2
import os
import sys
import subprocess
import shutil
import gzip
archive_dir = "%s/packages" % (os.environ["WORKSPACE"])
if not os.path.isdir(archive_dir):
print "no artifacts archived. Either this is a failed build or a job that does not archive artifacts"
sys.exit(0)
deb_packages = filter(l... | Python | 0.000001 | @@ -1442,26 +1442,31 @@
-os.symlink
+shutil.copyfile
(target,
|
7519bd63bfbd175d49289727d7fed234a8ceb7f5 | fix tenant properties test | bluebottle/clients/tests/test_properties.py | bluebottle/clients/tests/test_properties.py | import mock
from django.test import TestCase
from bluebottle.clients.middleware import TenantProperties, TenantPropertiesMiddleware
from bluebottle.clients.middleware import properties
Mock = mock.Mock
class TestProperties(TestCase):
def test_property_match(self):
""" A match found in the client proper... | Python | 0 | @@ -3003,149 +3003,15 @@
lid/
-properties.py%22)%0A self.assertEquals(execfile.call_args_list%5B1%5D%5B0%5D%5B0%5D,%0A %22/some/client/path/valid/secret
+setting
s.py
|
5e007acb5cf5fafa8d95e012948305157efa1dd7 | Refactor and simplify code | bumblebee/modules/cmus.py | bumblebee/modules/cmus.py | # pylint: disable=C0111,R0903
# -*- coding: utf-8 -*-
"""Displays information about the current song in cmus.
Requires the following executable:
* cmus-remote
Parameters:
* cmus.format: Format string for the song information. Tag values can be put in curly brackets (i.e. {artist})
"""
from collections impor... | Python | 0 | @@ -2060,60 +2060,47 @@
-if widget.name == %22cmus.shuffle%22:%0A return
+returns = %7B%0A %22cmus.shuffle%22:
%22sh
@@ -2140,24 +2140,25 @@
shuffle-off%22
+,
%0A if
@@ -2158,59 +2158,26 @@
-if widget.name == %22cmus.repeat%22:%0A return
+ %22cmus.repeat%22:
... |
6ac618821c3fb83f439849208742417c50decbd2 | Fix forced error message display for non-503 errors | src/adhocracy/controllers/error.py | src/adhocracy/controllers/error.py | import cgi
import re
from pylons import request, response, tmpl_context as c
from pylons.i18n import _
from pylons.controllers.util import abort
from paste.urlparser import PkgResourcesParser
from pylons.controllers.util import forward
from adhocracy import config
from adhocracy.lib.base import BaseController
from a... | Python | 0.000004 | @@ -2536,16 +2536,20 @@
(status)
+, ''
),%0A
|
09dbfc7ee6eb6db2ac18a8696406cd8c92dbfef4 | fix pylint issues | sdcm/wait.py | sdcm/wait.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 | @@ -1477,16 +1477,29 @@
R.debug(
+%0A
'wait_fo
@@ -1510,18 +1510,18 @@
etrying
-%7B%7D
+%25s
: attemp
@@ -1522,18 +1522,18 @@
attempt
-%7B%7D
+%25s
ended w
@@ -1541,19 +1541,25 @@
th:
-%7B%7D'.format(
+%25s',%0A
text
@@ -1613,170 +1613,36 @@
- ... |
2f0dc639a4448e0762843fe3c9a4239eb7fac8c6 | Fix bug- socks_http does not resolve DNS remotely via Tor | nowallet/socks_http.py | nowallet/socks_http.py | import asyncio
import aiohttp
import aiosocks
from aiosocks.connector import ProxyConnector, ProxyClientRequest
class SocksHTTPError(Exception):
pass
async def urlopen(url: str) -> str:
auth5 = aiosocks.Socks5Auth(
'proxyuser1', password='pwd') # type: aiosocks.Socks5Auth
conn = ProxyConnector(re... | Python | 0 | @@ -330,12 +330,11 @@
lve=
-Fals
+Tru
e)
|
34016dca73f56c6929bf265f597fee0a0b325434 | Add better introspection | barin/manager.py | barin/manager.py | from . import schema as S
from . import cursor
from . import query
class Manager(object):
def __init__(self, cname, field_collection, indexes, **options):
# schema=S.Missing, db=None):
self._cname = cname
self.f = field_collection
self.indexes = indexes
self.query = query.... | Python | 0 | @@ -757,16 +757,99 @@
value%0A%0A
+ def __dir__(self):%0A return dir(self.collection) + self.__dict__.keys()%0A%0A
def
@@ -1431,16 +1431,97 @@
lete')%0A%0A
+ def __dir__(self):%0A return dir(self._manager) + self.__dict__.keys()%0A%0A
def
|
5a5a7fe10b74b321eade98c35d404a0c83243642 | fix reverse range bug | numba/targets/heapq.py | numba/targets/heapq.py |
# A port of https://github.com/python/cpython/blob/3.7/Lib/heapq.py
from __future__ import print_function, absolute_import, division
import heapq as hq
import numpy as np
from numba import types
from numba.errors import TypingError
from numba.extending import overload, register_jitable
@register_jitable
def _sift... | Python | 0.000001 | @@ -1204,44 +1204,8 @@
')%0A%0A
- # what to do if list is empty?%0A%0A
@@ -2373,44 +2373,8 @@
(x)%0A
- #for i in reversed(range(n//2)):
%0A
@@ -2396,17 +2396,17 @@
(n // 2
-+
+-
1, -1,
|
1f74194580b571e678879e4d0f267f180e933cce | Use the abbreviate_url function for the Host attachment | icinga_slack/webhook.py | icinga_slack/webhook.py | #!/usr/bin/env python3
import argparse
import json
import urllib.parse
import urllib.request
import sys
from icinga_slack import __version__
alert_colors = {'UNKNOWN': '#6600CC',
'CRITICAL': '#FF0000',
'WARNING': '#FF9900',
'OK': '#36A64F'}
def abbreviate_url(url):
... | Python | 0 | @@ -1953,32 +1953,45 @@
fields.append(
+%0A
AttachmentField(
@@ -2007,28 +2007,62 @@
+
%22Host%22,
- %22%3C%7B1
+%0A abbreviate_url(%22%7B0
%7D?host=%7B
0%7D%7C%7B
@@ -2061,15 +2061,10 @@
st=%7B
-0%7D%7C%7B0%7D%3E
+1%7D
%22.fo
@@ -2068,22 +2068,16 @@
.format(
-host,
stat... |
a68193102354af807285d0238354314c9aa67a25 | Move victim selection to enforce | senlin/policies/deletion_policy.py | senlin/policies/deletion_policy.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
# distributed unde... | Python | 0 | @@ -542,16 +542,31 @@
cense.%0A%0A
+import random%0A%0A
from sen
@@ -664,12 +664,8 @@
licy
-Base
):%0A
@@ -907,14 +907,12 @@
('
-BEFORE
+WHEN
', '
@@ -918,33 +918,67 @@
'CLUSTER
-', 'DELETE_MEMBER
+_SCALE_DOWN'),%0A ('AFTER', 'CLUSTER_DEL_NODES
'),%0A
@@ -1003,25 +1003,19 @@
STER
-', 'DELETE_MEMB... |
190abc81176855208847ccb171e88b6c12d57de7 | replace a hack with ProtocolDesc | ryu/tests/unit/lib/test_ofp_pktinfilter.py | ryu/tests/unit/lib/test_ofp_pktinfilter.py | # Copyright (C) 2013 Stratosphere 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 ... | Python | 0 | @@ -1010,148 +1010,107 @@
ser%0A
-%0A%0ALOG = logging.getLogger('test_pktinfilter')%0A%0A%0Aclass _Datapath(object):%0A ofproto = ofproto_v1_3%0A ofproto_parser = ofproto_v1_3_parser
+from ryu.ofproto.ofproto_protocol import ProtocolDesc%0A%0A%0ALOG = logging.getLogger('test_pktinfilter')
%0A%0A%0Ac
@@ -1589,34... |
324d0a201150b72bbf965e81c40dab22ce81374f | Update DataCleaning.py | iembdfa/DataCleaning.py | iembdfa/DataCleaning.py | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 15 11:39:04 2016
@author: rahulmehra
"""
# Import the modules
import pandas as pd
from sklearn.preprocessing import LabelEncoder
import numpy as np
raw_data = {'patient': [500,1, 1,-2, 2,3,4,5,6,7,None,9,6,3,4,5,6,7,8,9],
'obs': [1, 2, 3, 1, 2,3,4,5,6,7,8,9,6,3,... | Python | 0 | @@ -2369,16 +2369,20 @@
dtype)%0A%0A
+
return x
|
4003a3adcef9eb32efc4d41e45b9e6a1cdfe47b8 | Complete basic assignment string1.py | basic/string1.py | basic/string1.py | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... | Python | 0.999999 | @@ -1024,30 +1024,112 @@
e here+++%0A
-return
+if count%3C10:%0A return 'Number of donuts: %25d'%25(count)%0A return 'Number of donuts: many'
%0A%0A%0A# B. both
@@ -1388,30 +1388,74 @@
e here+++%0A
-return
+if len(s)%3E=2:%0A return s%5B0:2%5D+s%5B-2:%5D%0A return ''
%0A%0A%0A# C. fix_
@@ -1854,24 +1854... |
b3213feae032032018354548f244a3204f04707f | Change compressor. | pyncd.py | pyncd.py | import gzip
x = open('1.png', 'rb').read() # file 1 of any type
y = open('2.png', 'rb').read() # file 2 of the same type as file 1
x_y = x + y # the concatenation of files
x_comp = gzip.compress(x) # compress file 1
y_comp = gzip.compress(y) # compress file 2
x_y_comp = gzip.compress(x_y) # compress file concatenated... | Python | 0 | @@ -1,19 +1,19 @@
import
-gzip
+lzma
%0A%0Ax = op
@@ -16,17 +16,36 @@
= open('
-1
+examples/imgs/square
.png', '
@@ -87,17 +87,36 @@
= open('
-2
+examples/imgs/circle
.png', '
@@ -206,36 +206,36 @@
files%0A%0Ax_comp =
-gzip
+lzma
.compress(x) # c
@@ -250,36 +250,36 @@
file 1%0Ay_comp =
-gzip
+lzma
.compres... |
4bca4d85018bcd8f7e86c2b6d576c645674b4693 | Support indented function (nested function maybe?) | resumable.py | resumable.py | import ast
import inspect
import warnings
import linecache
from uuid import uuid4
from collections import OrderedDict
from astmonkey.transformers import ParentNodeTransformer
from astmonkey.visitors import SourceGeneratorNodeVisitor
def split(func, name=None):
return func, name
def get_sub(lst, pred):
for s... | Python | 0 | @@ -75,16 +75,44 @@
t uuid4%0A
+from textwrap import dedent%0A
from col
@@ -5105,16 +5105,42 @@
(lines)%0A
+ lines = dedent(lines)%0A
line
|
033a236767329263d55bd9d0cefd681d030a10bf | Separated the SEA goal from the joint goal | pysea.py | pysea.py | from PyDynamixel import *
class Spring(Joint):
''' This class derives from Joint to
implement a Spring feedback board. It
works exactly like joint, except that
we can't set torques or goal angles.
We can only read its current angle.'''
def __init__(self, spring_id, centerValue = 0):
''... | Python | 0.999959 | @@ -1993,24 +1993,77 @@
or_sum = 0.0
+%0A %0A # Goal angle of the SEA%0A goalAngle = 0.0
%0A%0A def __
@@ -3032,38 +3032,32 @@
error = self.
-joint.
goalAngle - angl
@@ -3747,73 +3747,34 @@
goal
-Value = %5C%0A self.joint.goalValue + int(2048.0*c/pi)
+Angle = self.goalValue + c
%0A%0... |
111e1d1b92860a4342c3499ca9eb0e5623b4974c | Increase RQ default_timeout to one hour (in case we have very very long running jobs) | call_server/extensions.py | call_server/extensions.py | # define flask extensions in separate file, to resolve import dependencies
from flask_sqlalchemy import SQLAlchemy as _BaseSQLAlchemy
# workaround to enable pool_pre_ping
# per https://github.com/pallets/flask-sqlalchemy/issues/589#issuecomment-361075700
class SQLAlchemy(_BaseSQLAlchemy):
def apply_pool_defaults(s... | Python | 0 | @@ -964,16 +964,37 @@
rq = RQ(
+default_timeout=60*60
)%0A%0Afrom
|
e8fdbc786b7a8391014199366a71b290b49efb4c | Fix views decorators (ref #141) | caminae/trekking/views.py | caminae/trekking/views.py | from caminae.authent.decorators import trekking_manager_required
from caminae.mapentity.views import (MapEntityLayer, MapEntityList, MapEntityJsonList,
MapEntityDetail, MapEntityCreate, MapEntityUpdate, MapEntityDelete)
from .models import Trek, POI
from .filters import TrekFilter, POIF... | Python | 0 | @@ -1,20 +1,74 @@
+from django.utils.decorators import method_decorator%0A%0A
from caminae.authent
@@ -867,32 +867,49 @@
TrekForm%0A%0A @
+method_decorator(
trekking_manager
@@ -935,24 +935,25 @@
:trek_list')
+)
%0A def dis
@@ -1125,32 +1125,49 @@
TrekForm%0A%0A @
+method_decorator(
trekking_manager
@... |
c0c3d63c6124549008a2dc17c1e691e799129444 | Fix getting unwatched episodes from Plex | plex2myshows/modules/plex/plex.py | plex2myshows/modules/plex/plex.py | class Plex(object):
def __init__(self, plex):
self.plex = plex
def get_watched_episodes(self, section_name):
watched_episodes = set(self.plex.library.section(section_name).searchEpisodes(unwatched=False))
return watched_episodes
| Python | 0.000001 | @@ -150,12 +150,27 @@
s =
-set(
+%5B%5D%0A shows =
self
@@ -215,32 +215,92 @@
arch
-Episodes(un
+Shows()%0A for show in shows:%0A watched_episodes.extend(show.
watched
-=False
+(
))%0A
|
d8da358042e6b02426804783b20e256398c6c467 | Remove decimals from y-axis percentage label | capstone/rl/utils/plot.py | capstone/rl/utils/plot.py | from __future__ import division
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
from .callbacks import Callback
from ...game.players import GreedyQ, RandPlayer
from ...game.utils import play_series
class EpisodicWLDPlotter(Callback):
'''
Plot... | Python | 0.998577 | @@ -1847,15 +1847,15 @@
y,
-pos
+_
: '%7B
+:d
%7D%25'.
@@ -1861,16 +1861,20 @@
.format(
+int(
y * 100)
@@ -1874,16 +1874,17 @@
* 100))
+)
%0A
|
b77685c442fcc769727c443a59ac2bb620d90bdc | update copyright year | casingSimulations/info.py | casingSimulations/info.py | __version__ = '0.1.0b0'
__author__ = 'Lindsey Heagy'
__license__ = 'MIT'
__copyright__ = 'Copyright 2018 Lindsey Heagy'
| Python | 0.000001 | @@ -104,16 +104,21 @@
ght 2018
+-2019
Lindsey
|
bed15fe0680277cefb0c02fddfe566a73e0dc2ba | refresh_token is bac | keystoneauth_oidc_refreshtoken/tests/unit/test_oidc.py | keystoneauth_oidc_refreshtoken/tests/unit/test_oidc.py | # coding=utf-8
# Copyright 2017 JOSÉ JOAQUÍN ESCOBAR GÓMEZ
# File: test_oidc.py
# Description:
#
# 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/license... | Python | 0.999995 | @@ -1169,16 +1169,48 @@
OINT = '
+https://localhost:8020/oidc/auth
'%0D%0A%0D%0A
@@ -1496,24 +1496,73 @@
_ENDPOINT,%0D%0A
+ refresh_token = self.REFRESH_TOKEN,%0D%0A
|
ff93b501d489f182617e7f8f497747f26e91f39e | add older experiments | kid_readout/analysis/resources/starcryo_experiments.py | kid_readout/analysis/resources/starcryo_experiments.py | import bisect
from kid_readout.utils.time_tools import date_to_unix_time
by_unix_time_table = [('2014-04-28', 'STAR Cryo 4x5 0813f12 Al horn package, AR chip, LPF, copper shield', 'light'),
('2014-04-16', 'STAR Cryo 4x5 0813f12 Al horn package, AR chip, fully taped', 'dark'),
('2014-04-... | Python | 0.000654 | @@ -89,16 +89,158 @@
able = %5B
+%0A ('2014-07-03', 'STAR Cryo 4x5 0813f12 Al horn package, AR chip, LPF, copper shield, IR LED fiber', 'light'),%0A
('2014-0
@@ -985,32 +985,122 @@
LPF', 'light'),%0A
+ ('2014-01-28', 'STAR Cryo 4x5 0813f10 Cu horn package, no LPF', 'ligh... |
8f13dedde762edc6b1b02e7dc2b4675a7fc13514 | Fix problem with watcher failing. Resolve issue #36 | hamlpy/hamlpy_watcher.py | hamlpy/hamlpy_watcher.py | # haml-watcher.py
# Author: Christian Stefanescu (st.chris@gmail.com)
#
# Watch a folder for files with the given extensions and call the HamlPy
# compiler if the modified time has changed since the last check.
import sys
import codecs
import os
import os.path
import time
from hamlpy import Compiler
EXTENSIONS = ['.h... | Python | 0 | @@ -317,16 +317,27 @@
%5B'.haml'
+, '.hamlpy'
%5D # w
@@ -1875,18 +1875,21 @@
ilename)
-
%0A
+
@@ -1931,32 +1931,36 @@
ime%0A
+
+
compiled_path =
@@ -2009,16 +2009,20 @@
+
if (not
@@ -2053,32 +2053,36 @@
+
+
compiled%5Bfullpat
@@ -2091,24 +... |
691880274cc2082de54c0c7d0c561d720ce28ae1 | Fix crash when bed is not preheated before printing starts | OctoPrintOutputController.py | OctoPrintOutputController.py | # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
from PyQt5.QtCore import QTimer
MYPY = False
if MYPY:
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
from cura.... | Python | 0.000001 | @@ -1995,86 +1995,8 @@
f):%0A
- self._active_printer_state = self._output_device.activePrinter.state%0A%0A
@@ -2022,17 +2022,17 @@
_printer
-_
+.
state !=
@@ -3549,80 +3549,80 @@
eat_
-printer.targetBedTemperature == 0 and self._preheat_bed_timer.isActive()
+bed_timer.isActive() and self._preheat_print... |
a21b87c92295fe650222ee27910efba1e912fa6c | Add TODO comment for a unit test failure due to timezone changes | Test/test_Format.py | Test/test_Format.py |
import unittest
from NanoPcap import Format
class FormatTest(unittest.TestCase):
def setUp(self):
self._initialHeader = (1234, 5678, 9102, -1, 3456, 7890, 4321)
self._initialRecordHeader = (1463179445, 10 * 1000 * 1000, 9102, 3456)
def test_header(self):
self.assertEqual(Format.PCAP... | Python | 0 | @@ -2943,32 +2943,68 @@
ay, 13)%0A
+#TODO: make this time-zone agnostic
self.assertEqual
|
225413d811f5449d1973b475c474225e343a1a09 | Remove unused code for course platforms platforms | studygroups/models/course.py | studygroups/models/course.py | from django.db import models
from django.db.models import Count, Max, Q, Sum, Case, When, IntegerField, Value
from django.urls import reverse # TODO ideally this shouldn't be in the model
from django.utils import timezone
from django.contrib.auth.models import User
from django.db.models import F
from django.utils.tran... | Python | 0.000001 | @@ -447,17 +447,16 @@
e_info%0A%0A
-%0A
from .ba
@@ -505,701 +505,8 @@
on%0A%0A
-KNOWN_COURSE_PLATFORMS = %7B%0A %22www.edx.org/%22: %22edX%22,%0A %22www.futurelearn.com/%22: %22FutureLearn%22,%0A %22ocw.mit.edu/%22: %22MIT OpenCourseWare%22,%0A %22www.coursera.org/%22: %22Coursera%22,%0A %22www.khana... |
89dae839a950bc0e45a7e94d142eafcb45cf2a43 | Resolve pylint warning about executable without the executable bit. | tests/external/py2/testfixture_test.py | tests/external/py2/testfixture_test.py | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | Python | 0 | |
957d31218e44c12dc56dd64a98e62b851c683bf9 | update static root | cfbets/cfbets/settings.py | cfbets/cfbets/settings.py | """
Django settings for cfbets project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... | Python | 0.000001 | @@ -3193,16 +3193,23 @@
E_DIR, %22
+cfbets_
static%22)
@@ -3213,16 +3213,64 @@
c%22),%0A%5D%0A%0A
+STATIC_ROOT = os.path.join(BASE_DIR, 'static')%0A%0A
LOGIN_RE
|
c91a593507cea9c6ba2777eff741b9e7ec7fdf0f | Fix test to give more data on failure | tests/integration/cli/custom_module.py | tests/integration/cli/custom_module.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Daniel Mizyrycki (mzdaniel@glidelink.net)`
tests.integration.cli.custom_module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test salt-ssh sls with a custom module work.
$ cat srv/custom_module.sls
custom-module:
module.run:
- name: test.r... | Python | 0.000001 | @@ -1763,16 +1763,217 @@
if not
+isinstance(cmd, dict) or not isinstance(cmd%5Bkey%5D, dict):%0A raise AssertionError('%7B0%7D is not a proper state return'%0A .format(cmd))%0A elif not
cmd%5Bkey%5D
|
32b33885a42a005fa4e37134e156e149bef1673d | make binaries use the new retry for requests | chacractl/api/binaries.py | chacractl/api/binaries.py | import logging
import sys
import os
from textwrap import dedent
from hashlib import sha512
import requests
from tambo import Transport
import chacractl
logger = logging.getLogger(__name__)
class Binary(object):
_help = dedent("""
Operate binaries on a remote chacra instance.
Creating a new binary::
... | Python | 0 | @@ -101,16 +101,17 @@
equests%0A
+%0A
from tam
@@ -147,16 +147,49 @@
hacractl
+%0Afrom chacractl.util import retry
%0A%0Alogger
@@ -1816,16 +1816,29 @@
gest()%0A%0A
+ @retry()%0A
def
@@ -2424,16 +2424,29 @@
rified%0A%0A
+ @retry()%0A
def
@@ -3931,33 +3931,45 @@
%25 filepath)%0A
+ @retry(... |
ccc8c0d885c9eaafeba2e91e248bf3febc484ab5 | change default port to IANA and allow to change peer port | pifpaf/drivers/etcd.py | pifpaf/drivers/etcd.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
# distributed under the... | Python | 0 | @@ -626,12 +626,41 @@
T =
-4001
+2379%0A DEFAULT_PEER_PORT = 2380
%0A%0A
@@ -691,32 +691,78 @@
t=DEFAULT_PORT,%0A
+ peer_port=DEFAULT_PEER_PORT,%0A
@@ -848,16 +848,51 @@
t = port
+%0A self.peer_port = peer_port
%0A%0A @c
@@ -1122,16 +1122,219 @@
etcd%22)%0A
+ ... |
9044657473e949138343132bbfb4c96b137c6abb | Use NotImplementedError | chainerrl/agents/sarsa.py | chainerrl/agents/sarsa.py | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
from chainerrl.agents import dqn
class SARSA(dqn.DQN):
... | Python | 0.000002 | @@ -1041,39 +1041,46 @@
:%0A raise
-Runtime
+NotImplemented
Error('SARSA doe
@@ -1250,15 +1250,22 @@
ise
-Runtime
+NotImplemented
Erro
|
b7108e818316a91d9b2b761af450faa1b99887d1 | Fix Python functions state which is completely broken (#4027) | pulsar-functions/instance/src/main/python/state_context.py | pulsar-functions/instance/src/main/python/state_context.py | #!/usr/bin/env python
#
# 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
# "... | Python | 0 | @@ -4196,16 +4196,93 @@
.Client(
+storage_client_settings=client_settings,%0A
namespac
|
85891287a312ea2ff40a67f0ceea45ae7143bec6 | Update target offices | openelex/us/fl/load.py | openelex/us/fl/load.py | import unicodecsv
from openelex.base.load import BaseLoader
from openelex.lib.text import slugify
from openelex.models import RawResult
from .datasource import Datasource
class LoadResults(BaseLoader):
"""
Loads Florida election results.
Florida results are provided in tab-delimited text files.
... | Python | 0 | @@ -1,12 +1,27 @@
+import logging%0A
import unico
@@ -1879,23 +1879,62 @@
ficer%22,%0A
+ %22Commissioner of Agriculture%22,%0A
%5D)%0A
-
%0A dis
@@ -2023,24 +2023,73 @@
sentative%22,%0A
+ %22State Senate%22,%0A %22State Senator%22,%0A
%5D)%0A%0A
@@ -2464,20 +2464,16 @@
if... |
787d2482e424f0a6bb5fd30bb19a35e852131ac8 | Remove leading 0s from Jersey stop codes, fix service casing | busstops/management/commands/import_guernsey.py | busstops/management/commands/import_guernsey.py | import os
import json
import requests
from time import sleep
from datetime import date
from bs4 import BeautifulSoup
from django.conf import settings
from django.contrib.gis.geos import Point, LineString, MultiLineString
from django.core.management.base import BaseCommand
from ...models import Region, StopPoint, Servic... | Python | 0 | @@ -858,16 +858,55 @@
ontinue%0A
+ stop_code = int(stop_code)%0A
@@ -990,20 +990,16 @@
_code':
-int(
stop_cod
@@ -999,17 +999,16 @@
top_code
-)
,%0A
@@ -1357,20 +1357,16 @@
ower(),
-int(
stop_cod
@@ -1368,17 +1368,16 @@
p_code))
-)
%0A%0A%0Adef i
@@ -1632,32 +1632,40 @@
y').text.s... |
8adc911641e301682068393e2a88b0061031c1d9 | switch to nose.run_exit to see if it will propagate exit code to hudson | run_tests.py | run_tests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Testing with Nose
=================
This test runner uses Nose for test discovery and running. It uses the argument
spec of Nose, but with some options pre-set. To begin with, make sure you have
Nose installed, e.g.:
$ sudo easy_install nose
For daily test runs, ... | Python | 0.000003 | @@ -2501,16 +2501,21 @@
nose.run
+_exit
(argv=fi
|
fe77a38380aa9bb1b3e1c72b445c0a23f4deae3f | Fix tests | tests.py | tests.py | import re
import unittest
from django.template import Template, Context
from django.template import TemplateSyntaxError as DjangoTemplateSyntaxError
from django.conf import settings
from jinja2 import TemplateSyntaxError as Jinja2TemplateSyntaxError
from jinja2 import Environment
from jinja2 import FileSystemLoader
... | Python | 0.000003 | @@ -331,16 +331,17 @@
rtkick%0A%0A
+%0A
# python
@@ -570,16 +570,47 @@
= ''%0A%0A%0A
+import django%0Adjango.setup()%0A%0A%0A
class Te
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.