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 |
|---|---|---|---|---|---|---|---|
1641243682f080257b7f79b35503985d3d72aa44 | Fix requirement for diff tool | setup.py | setup.py | from setuptools import setup
setup(name='osm_hall_monitor',
version='0.2',
description='Passive changeset monitoring for OpenStreetMap.',
url='http://github.com/ethan-nelson/osm_hall_monitor',
author='Ethan Nelson',
author_email='ethan-nelson@users.noreply.github.com',
install_requi... | Python | 0 | @@ -339,10 +339,18 @@
'osm
-dt
+_diff_tool
'%5D,%0A
|
c0155f59f52696e178def437f712f22c610c333a | Add classifiers for Python 3.3 and PyPy | setup.py | setup.py | import io
from setuptools import setup, find_packages
long_description = '\n'.join((
io.open('README.rst', encoding='utf-8').read(),
io.open('CHANGES.txt', encoding='utf-8').read()
))
setup(
name='morepath',
version='0.15.dev0',
description="A micro web-framework with superpowers",
long_descri... | Python | 0.999386 | @@ -935,17 +935,134 @@
on :: 3.
-4
+3',%0A 'Programming Language :: Python :: 3.4',%0A 'Programming Language :: Python :: Implementation :: PyPy
',%0A
|
97f03ffd2a309340bf41d381b35703272be600cc | Bump version. | setup.py | setup.py | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'name': 'django-email-analytics',
'version': '0.3',
'author': 'Jess Johnson',
'author_email': 'jess@grokcode.com',
'packages': ['emailanalytics'],
'scripts': [],
'url': 'https://github.... | Python | 0 | @@ -160,9 +160,9 @@
'0.
-3
+4
',%0A
|
024878fc913097364123d28a99ab7cb5501b0af5 | Set permission mask to allow read/exec for all users | setup.py | setup.py | #!/usr/bin/env python
import subprocess
from distutils.core import setup
requirements = [pkg.split('=')[0] for pkg in open('requirements.txt').readlines()]
description = 'Download videos from Udemy for personal offline use'
try:
subprocess.call(["pandoc", "README.md", "-f", "markdown", "-t", "rst", "-o", "README... | Python | 0 | @@ -16,16 +16,26 @@
python%0A%0A
+import os%0A
import s
@@ -738,16 +738,156 @@
trip()%0A%0A
+# if installed as root or with sudo, set permission mask to allow read/exec for all users%0Aif os.getuid() == 0:%0A os.umask(int('022', 8))%0A%0A
setup(na
|
a1a0de9e1f290161d83165f2983335844a5c17f9 | fix tests_require | setup.py | setup.py | #!/usr/bin/env python
#-*-coding:utf-8-*-
from setuptools import setup, find_packages
#+BEGIN_DELETE
import os.path
# anditional to make a tar.gz file
import tarfile
with tarfile.open("skeleton.tar.gz", "w:gz") as tar:
for name in ["setup.py", "LICENSE", "README.md", "requirements.txt",
"pyskele... | Python | 0.000001 | @@ -1965,16 +1965,17 @@
test
+s
_require
|
a6d27ef03438133e7dd38f4a26208dc7d3904f6e | Fix url in setup.py file. | setup.py | setup.py | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
try:
from sphinx.setup_command import BuildDoc
cmdclass = {'build_sphinx': BuildDoc}
except ImportError:
print "Sphinx not installed - needed to build documentation"
cmdclass = {}
# Figure out the version; this could be done b... | Python | 0 | @@ -1409,16 +1409,23 @@
url = '
+http://
github.c
|
949b190f0ebc04798e6c20fca458500a96f78433 | Add workaround to setup.py for a distutils bug causing attempted hard links in a Vagrant image directory shared with the host to fail | setup.py | setup.py | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
import sys
from setuptools.command.test import test as TestCommand
here = path.abspath(pat... | Python | 0 | @@ -290,16 +290,334 @@
ommand%0A%0A
+# Work around a bug in distutils where attempted hard links within a directory%0A# shared between the Vagrant machine and the host fails. Deleting the 'os.link'%0A# method causes distutils to copy instead of using hard links.%0A# https://bugs.python.org/issue8876%0Aif os.environ.ge... |
c18bbf109a19eb0a5ee65be61030a1c3dd54a6d4 | Bump version | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(name='python-bittrex',
version='0.2.1',
url="https://github.com/ericsomdahl/python-bittrex",
packages=['bittrex'],
modules=['bittrex'],
install_requires=['requests'],
description='Python bindings for bittrex API.',
aut... | Python | 0 | @@ -99,9 +99,9 @@
0.2.
-1
+2
',%0A
|
182eb14fd444940e598b26b5ce075ec1366ff321 | add catalog.xml to deployment/packaging (#149) | setup.py | setup.py | # -*- coding: iso-8859-15 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files... | Python | 0 | @@ -2982,16 +2982,177 @@
files)%0A
+ catalog_xml = filter(lambda x: x.find('catalog.xml') != -1,%0A files)%0A xsds.extend(catalog_xml)%0A
|
b3f4c5211d33d8242b863f812421b37b22cd91cc | update deps, setup.py | setup.py | setup.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
from subprocess import call
from setuptools import setup, find_packages
from setuptools.command.install import install as _install
version = '0.2.21'
def _post_install(dir):
call([sys.executable, 'setup_post.py'],
cwd=os.path.join(dir, 'metado... | Python | 0 | @@ -207,19 +207,18 @@
on = '0.
-2.2
+3.
1'%0A%0Adef
@@ -1500,34 +1500,8 @@
2',%0A
- 'newspaper3k==0.1.7',%0A
|
8b64aec8d6fe9b27e1b95bc61488eb03216f0077 | fix scikit-image dependency | setup.py | setup.py | #!/usr/bin/env python
#===============================================================================
# Copyright 2017 Geoscience Australia
#
# 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... | Python | 0.000003 | @@ -2526,92 +2526,20 @@
-# 'scikit-image',TODO add scikit-image - currently removed as dash is casuing errors
+ 'skimage',
%0A
|
8978c1b49f43465bc3cd51b3ee51350d44ed9ae7 | Bump tqdm from 4.38.0 to 4.39.0 | setup.py | setup.py | #!/usr/bin/env python3
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='ogn-python',
versio... | Python | 0.000001 | @@ -1657,17 +1657,17 @@
qdm==4.3
-8
+9
.0',%0A%09'r
|
05295bfa9edf99dfe66d21025088e00ae6152bfa | bump version to 0.3.5 | setup.py | setup.py | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
from pypandoc import convert
read_md = lambda f: convert(f, 'rst')
except ImportError:
print("warning: pypandoc module not found,"
"could not convert markdown README to RST")
read_md = lambda f... | Python | 0.000001 | @@ -402,9 +402,9 @@
0.3.
-4
+5
',%0A
|
0cd17d762ef1b7728b3ce3670e08cc30e2eac904 | remove README | setup.py | setup.py | import os
import sys
from distutils.core import setup, Extension
## Command-line argument parsing
# --with-zlib: use zlib for compressing and decompressing
# --without-zlib: ^ negated
# --with-zlib=<dir>: path to zlib if needed
# --with-libmemcached=<dir>: path to libmemcached package if needed
cmd = None
use_zlib =... | Python | 0 | @@ -2957,16 +2957,18 @@
xit(0)%0A%0A
+#
readme_t
@@ -3386,16 +3386,18 @@
%22,%0A
+ #
long_de
|
57b17e6edcbe1e5400e3ede82292c1cd1c38f4e4 | Bump version | setup.py | setup.py | from setuptools import setup, find_packages
from pip.req import parse_requirements
def reqs_from_requirements_file():
reqs = parse_requirements('requirements.txt', session='hack')
return [str(r.req) for r in reqs]
setup(
name="demosys-py",
version="0.1.1",
description="Modern OpenGL 4.1+ Prototy... | Python | 0 | @@ -266,17 +266,17 @@
on=%220.1.
-1
+2
%22,%0A d
|
2cc2bf3665246f1876e9c25911baf6e418a356db | Add include_package_data=True to setup | setup.py | setup.py | import os
import sys
from pathlib import Path
from shutil import rmtree
from setuptools import setup, find_packages, Command
from simple_model.__version__ import __version__
here = Path(__file__).absolute().parent
with open(here / 'README.rst') as f:
readme = '\n' + f.read()
class UploadCommand(Command):
""... | Python | 0.000006 | @@ -1898,10 +1898,41 @@
%0A %7D,%0A
+ include_package_data=True,%0A
)%0A
|
f2256ffb1786ba88922c437a54f214547448121b | version bump | setup.py | setup.py | from setuptools import setup, find_packages
from setuptools.command.test import test
class TestRunner(test):
def run(self, *args, **kwargs):
if self.distribution.install_requires:
self.distribution.fetch_build_eggs(self.distribution.install_requires)
if self.distribution.tests_require:
... | Python | 0.000001 | @@ -506,17 +506,17 @@
on='0.0.
-4
+5
',%0A d
|
e846fff0060a431187e607fa0852b00265aff709 | fix bug #141 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""QTPyLib: Quantitative Trading Python Library
(https://github.com/ranaroussi/qtpylib)
Simple, event-driven algorithmic trading system written in
Python 3, that supports backtesting and live trading using
Interactive Brokers for market data and order execution.
"""
from ... | Python | 0 | @@ -2173,16 +2173,17 @@
tatic':
+%5B
'qtpylib
@@ -2193,16 +2193,17 @@
ebapp/*'
+%5D
,%0A
@@ -2210,16 +2210,17 @@
'db':
+%5B
'qtpylib
@@ -2232,16 +2232,17 @@
ma.sql*'
+%5D
%0A %7D,%0A
|
990d1a364dcfd62e700daba9945c35f96fbdfa5b | Order the main extensions list by name. | sweettooth/extensions/urls.py | sweettooth/extensions/urls.py |
from django.conf.urls.defaults import patterns, include, url
from django.views.generic.simple import direct_to_template
from django.views.generic.list_detail import object_list
from extensions import views, models
upload_patterns = patterns('',
url(r'^$', views.upload_file, dict(pk=None), name='extensions-upload... | Python | 0 | @@ -1264,16 +1264,33 @@
isible()
+.order_by('name')
,%0A
|
73d89e5a6f23fd3292b4057e56649d6c20fc0483 | replace couch_db reference | corehq/apps/change_feed/pillow.py | corehq/apps/change_feed/pillow.py | import json
from kafka import KeyedProducer
from kafka.common import KafkaUnavailableError
from casexml.apps.case.models import CommCareCase
from corehq.apps.change_feed import data_sources
from corehq.apps.change_feed.connection import get_kafka_client
from corehq.apps.change_feed.models import ChangeMeta
from corehq.... | Python | 0.000001 | @@ -915,24 +915,28 @@
rn self.
+get_
couch_db
.dbname%0A
@@ -927,16 +927,18 @@
couch_db
+()
.dbname%0A
|
a9c2a45786b0bf3ec46adf09943bd2aaa79b9f19 | Fix issue with spurious XP when opening a window and remove some logging | CodeStats.py | CodeStats.py | import sublime
import sublime_plugin
import os
import shutil
import datetime
import json
import requests
# Pulses will be sent after intervals of this many seconds
PULSE_TIMEOUT = 10
# Default URL for the API
DEFAULT_URL = 'https://codestats.net/api/my/pulses'
def log(*msg):
print('code-stats-sublime: ', *msg)... | Python | 0 | @@ -304,17 +304,16 @@
sublime:
-
', *msg)
@@ -313,16 +313,16 @@
, *msg)%0A
+
%0A%0Adef sh
@@ -2196,17 +2196,22 @@
ption',
-e
+str(e)
)%0A
@@ -3983,38 +3983,8 @@
ut()
-%0A log('Timer started.')
%0A%0A
@@ -4022,38 +4022,8 @@
un()
-%0A log('Timer removed.')
%0A%0A
@@ -5685,24 +5685,213 ... |
4cfe702b7c06f431f8b250bbd72e121bfeef5b5e | Fix warning message in api AlertsHandler. | dashboard/dashboard/api/alerts.py | dashboard/dashboard/api/alerts.py | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import datetime
import urllib
from google.appengine.datastore import datastore_query
from google.appengine.ext import ndb
from dashboard import alerts
from... | Python | 0.999824 | @@ -5740,21 +5740,16 @@
st_suite
-_name
=' + fil
|
5130b6c2b89484cfebd4b5416fd3e260ebab8b85 | Univariate regression: Increase the number of decimals from 0 to 3 | Orange/widgets/regression/owlinearregression.py | Orange/widgets/regression/owlinearregression.py | from PyQt4.QtGui import QLayout
from Orange.data import Table
from Orange.regression.linear import (RidgeRegressionLearner, LinearModel,
LinearRegressionLearner)
from Orange.preprocess.preprocess import Preprocess
from Orange.widgets import widget, settings, gui
class OWLinearRe... | Python | 0.998977 | @@ -1639,36 +1639,82 @@
ridgealpha%22,
- 0.0, 1000.0
+%0A 0.0, 1000.0, step=0.01, decimals=2
, label=%22alp
@@ -1888,16 +1888,39 @@
oalpha%22,
+%0A
0.0, 10
@@ -1924,16 +1924,27 @@
1000.0,
+ step=0.01,
label=%22
@@ -1949,16 +1949,28 @@
=%22alpha%22
+, decimals=2
)%0... |
9f5c1bdbe31945706725de688e61c0d77a91ae9b | fix filtering | lg_earth/scripts/add_kml.py | lg_earth/scripts/add_kml.py | #!/usr/bin/env python
from std_msgs.msg import String, Empty
from lg_common.srv import USCSMessage
from lg_common.msg import StringArray
from interactivespaces_msgs.msg import GenericMessage
import SimpleHTTPServer
import SocketServer
import threading
import tempfile
import rospy
import json
import copy
import os
imp... | Python | 0.000002 | @@ -3255,179 +3255,402 @@
-matcher = None%0A if ids:%0A files = %5Bname for name in names for names in self.id_to_file%5D%0A for id in ids:%0A self.id_to_file.pop(id)
+if ids:%0A files = %5B%5D%0A for id in ids:%0A if id in self.id_t... |
b5a4708009e78c5727f2a54c54056df21983e958 | Fix SlackOAuth | slack.py | slack.py | import os
import sys
import logging
from werkzeug.contrib.fixers import ProxyFix
import flask
from flask import Flask, redirect, url_for
from flask_dance.consumer import OAuth2ConsumerBlueprint
from raven.contrib.flask import Sentry
from requests.auth import AuthBase
log = logging.getLogger(__name__)
log.setLevel(logg... | Python | 0.999411 | @@ -74,16 +74,65 @@
roxyFix%0A
+from werkzeug.urls import url_encode, url_decode%0A
import f
@@ -309,16 +309,48 @@
AuthBase
+%0Afrom urlobject import URLObject
%0A%0Alog =
@@ -1246,16 +1246,20 @@
if
+not
access_t
@@ -1281,13 +1281,304 @@
r
-.data
+eturn r%0A%0A if r.method == %22GET%22:%0A ... |
6020741950aa1e4f60fbb66946fd962d6b0ccc21 | fix bug | geni/methods/get_credential.py | geni/methods/get_credential.py | from geni.util.faults import *
from geni.util.excep import *
from geni.util.method import Method
from geni.util.parameter import Parameter, Mixed
from geni.util.auth import Auth
from geni.util.record import GeniRecord
from geni.util.credential import *
from geni.util.rights import *
from geni.util.debug import log
cla... | Python | 0.000001 | @@ -1538,17 +1538,17 @@
dNotFoun
-t
+d
(hrn)%0A
|
db676bcde0b301c1cd1a4346687b3cef02390e8c | Mark trustee_domain_admin_password secret | magnum/common/keystone.py | magnum/common/keystone.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 th... | Python | 0.999889 | @@ -1259,16 +1259,29 @@
ssword',
+ secret=True,
%0A
|
c80fd613af104fc05e0413936d9c740b048365d9 | add pdb shell | tensorpack/callbacks/stats.py | tensorpack/callbacks/stats.py | # -*- coding: utf-8 -*-
# File: stats.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
import os
import numpy as np
from .base import Callback
from ..utils import logger
from ..tfutils import get_op_tensor_name
__all__ = ['SendStat', 'DumpParamAsImage', 'InjectShell']
class SendStat(Callback):
""" An equivalent of ... | Python | 0.000001 | @@ -818,37 +818,8 @@
)%0A%0A%0A
-# TODO other types of shell?%0A
clas
@@ -887,16 +887,20 @@
IPython
+/pdb
shell i
@@ -1080,16 +1080,33 @@
ELL.tmp'
+, shell='ipython'
):%0A
@@ -1201,37 +1201,156 @@
-%22%22%22%0A self._file = file
+ shell (str): one of 'ipython', 'pdb'%0A %22%22%22%0A ... |
e145d8012efbfb373dfe566845f3957777a3da5a | Clean up an unnecessary variable. | sqltd.py | sqltd.py | #!/usr/bin/env python
import sqlite3
import sys
import re
def runPage(db, html):
def parseStrings(s, query=[False]):
output = ''
if s == '<sql>':
query[0] = True
elif s == '</sql>':
query[0] = False
... | Python | 0.000031 | @@ -618,29 +618,8 @@
l)%0A%0A
- output = ''%0A%0A
|
9a68c2f1af56169215cf473b1f588df77fb1f9fe | Remove wait timeouts | MTGO-scry-bug-test.sikuli/MTGO-scry-bug-test.py | MTGO-scry-bug-test.sikuli/MTGO-scry-bug-test.py | import os
import shutil
import tempfile
import time
REGION_PLAY = Region(7,965,334,57)
REGION_MULLIGAN_KEEP = Region(0,13,175,154)
REGION_TEMPORARY_ZONE = Region(1150,195,130,37)
REGION_PUT_ON_THE_BOTTOM_OF_YOUR_LIBRARY = Region(921,181,459,166)
REGIO... | Python | 0.000023 | @@ -1026,27 +1026,24 @@
t(%22play.png%22
-, 5
)%0A REGION
@@ -1120,27 +1120,24 @@
an_keep.png%22
-, 5
)%0A for i
@@ -1213,27 +1213,24 @@
ed_keep.png%22
-, 5
)%0A ti
@@ -1345,27 +1345,24 @@
ry_zone.png%22
-, 5
)%0A time.s
@@ -1724,27 +1724,24 @@
library.png%22
-, 5
)%0A time.s
@@ -2377,11 +... |
d1d3a8d5729dda7ca32d140dfcf078e9afbb57a4 | Move configurable constants back to the top level | MTGO-scry-bug-test.sikuli/MTGO-scry-bug-test.py | MTGO-scry-bug-test.sikuli/MTGO-scry-bug-test.py | import hashlib
import os
import shutil
import tempfile
import time
def hash_file(file_path):
hasher = hashlib.md5()
with open(file_path, 'rb') as opened_file:
buf = opened_file.read()
hasher.update(buf)
return hasher.hexdigest()
def main():
REGION_PLAY ... | Python | 0 | @@ -65,216 +65,8 @@
me%0A%0A
-def hash_file(file_path):%0A hasher = hashlib.md5()%0A with open(file_path, 'rb') as opened_file:%0A buf = opened_file.read()%0A hasher.update(buf)%0A%0A return hasher.hexdigest()%0A%0Adef main():%0A
REGI
@@ -136,20 +136,16 @@
334,57)%0A
-
REGION_M
@@ -21... |
49e9fbbd00a7732faa716e5e930ec63dbaa18983 | fix gumbel unit test | test/lib/test_distribution.py | test/lib/test_distribution.py | from flaky import flaky
from slm_lab.lib import distribution
import pytest
import torch
@pytest.mark.parametrize('pdparam_type', [
'probs', 'logits'
])
def test_argmax(pdparam_type):
pdparam = torch.tensor([1.1, 10.0, 2.1])
# test both probs or logits
pd = distribution.Argmax(**{pdparam_type: pdparam}... | Python | 0 | @@ -656,32 +656,66 @@
am_type: pdparam
+, 'temperature': torch.tensor(1.0)
%7D)%0A for _ in
|
cec8e3078784abf0224b23592d56745a09d7060f | add jszip to mechanical rob | test/requests/link_checker.py | test/requests/link_checker.py | import re
import requests
from lxml.html import parse
from requests.exceptions import ConnectionError
DO_FAIL=False # fail on error
def is_root_link(link):
pattern = re.compile("^/$")
return pattern.match(link)
def is_mailto_link(link):
pattern = re.compile("^mailto:.*")
return pattern.match(link)
... | Python | 0 | @@ -3763,24 +3763,58 @@
d5.min.js%22,%0A
+ %22/js/jszip/jszip.min.js%22,%0A
%5D%0A%0A p
|
79759d982c7524a117a4d3cb72a28b501ef5b354 | add jsalt/timeago.min.js to mechanical rob | test/requests/link_checker.py | test/requests/link_checker.py | import re
import requests
from lxml.html import parse
from requests.exceptions import ConnectionError
DO_FAIL=False # fail on error
def is_root_link(link):
pattern = re.compile("^/$")
return pattern.match(link)
def is_mailto_link(link):
pattern = re.compile("^mailto:.*")
return pattern.match(link)
... | Python | 0.000004 | @@ -3835,24 +3835,61 @@
ey.min.js%22,%0A
+ %22/js/js_alt/timeago.min.js%22,%0A
%5D%0A%0A p
|
f27e08b0dcace5b9f49c5b2a211347a2f50f8254 | Use tags or direct url | stats.py | stats.py | from bs4 import BeautifulSoup
import requests
def statsRoyale(tag):
link = 'http://statsroyale.com/profile/' + tag
response = (requests.get(link)).text
soup = BeautifulSoup(response, 'html.parser')
stats = {}
content = soup.find_all('div', {'class':'content'})
stats['clan'] = content[0].get_text()
if stats['cl... | Python | 0 | @@ -62,16 +62,122 @@
e(tag):%0A
+%09if not tag.find('/') == -1:%0A%09%09tag = tag%5B::-1%5D%0A%09%09pos = tag.find('/')%0A%09%09tag = tag%5B:pos%5D%0A%09%09tag = tag%5B::-1%5D%0A%0A
%09link =
@@ -305,29 +305,21 @@
r')%0A
-%09stats = %7B%7D%0A%0A%09content
+%0A%09description
= s
@@ -352,460 +352,216 @@
s':'
-cont... |
c917ef2c5e241e2cd2f6bf77c80ca8be7c7fd3cf | Update docs list | great_expectations/cli/docs.py | great_expectations/cli/docs.py | import os
import sys
import click
from great_expectations.cli import toolkit
from great_expectations.cli.cli_logging import logger
from great_expectations.cli.util import cli_message, cli_message_list
from great_expectations.core.usage_statistics.usage_statistics import (
send_usage_message,
)
@click.group()
de... | Python | 0 | @@ -1510,16 +1510,29 @@
.format(
+%0A
docs_sit
@@ -1551,16 +1551,28 @@
_name%22%5D,
+%0A
docs_si
@@ -1574,25 +1574,29 @@
cs_site_dict
-%5B
+.get(
%22site_url%22%5D)
@@ -1597,11 +1597,202 @@
url%22
-%5D)%5C
+) or%0A f'site configured but does not exist. Run the following command... |
9c014da319023eee205d725b49c7aa486af5e59e | remove extraneous comment. | greatbigcrane/project/views.py | greatbigcrane/project/views.py | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
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 agre... | Python | 0 | @@ -5487,58 +5487,8 @@
t):%0A
- # return HttpResponse(request.POST%5B'update'%5D)%0A
|
62420187118d4709bb419065d9d32e8aaddf640b | add psutil to synth.py (#55) | 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.000005 | @@ -6221,16 +6221,26 @@
t_utils%22
+, %22psutil%22
%5D%0A)%0As.mo
|
7fae0ec95a5d5cacc36ecd650cb886d2d83ad1ea | 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 | @@ -2212,16 +2212,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
|
3610c9d782ab9bbacb2b990a5712a44f3b93d374 | update synth to fix relative cloud.google.com links (#2745) | 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 | @@ -3460,28 +3460,175 @@
ckwards compatibility fixes%0A
+%0A# fix relative cloud.google.com links%0As.replace(%0A %22src/**/V*/**/*.php%22,%0A r%22(.%7B0,%7D)%5C%5D%5C((/.%7B0,%7D)%5C)%22,%0A r%22%5C1%5D(https://cloud.google.com%5C2)%22%0A)%0A
|
f8ae46f22a9b5b1fc8215ac26aed6dfddf25c224 | set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#320) | synth.py | synth.py | import synthtool as s
import synthtool.gcp as gcp
import logging
import subprocess
logging.basicConfig(level=logging.DEBUG)
# Run the gapic generator
gapic = gcp.GAPICMicrogenerator()
version = 'v1'
library = gapic.typescript_library(
'container',
generator_args={
"grpc-service-config": f"google/c... | Python | 0 | @@ -119,16 +119,52 @@
DEBUG)%0A%0A
+AUTOSYNTH_MULTIPLE_COMMITS = True%0A%0A%0A
# Run th
|
d54d202970610a59cb7fd60e51483c6e0db93d60 | update synth scripts to document/utilize apiEndpoint instead of serviceAddress option (#2165) | 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 | @@ -1326,16 +1326,635 @@
ests')%0A%0A
+# document and utilize apiEndpoint instead of serviceAddress%0As.replace(%0A %22**/Gapic/*GapicClient.php%22,%0A r%22'serviceAddress' =%3E%22,%0A r%22'apiEndpoint' =%3E%22)%0As.replace(%0A %22**/Gapic/*GapicClient.php%22,%0A r%22@type string %5C$serviceAddress%22,%... |
30d108b3a206d938ef67c112bc6c953a12c606af | Allow specifying custom host and port when starting app | tasks.py | tasks.py | """Task functions for use with Invoke."""
from invoke import task
@task
def clean(context):
cmd = '$(npm bin)/gulp clean'
context.run(cmd)
@task
def requirements(context):
steps = [
'pip install -r requirements.txt',
'npm install',
'$(npm bin)/bower install',
]
cmd = ' &... | Python | 0 | @@ -352,16 +352,17 @@
n(cmd)%0A%0A
+%0A
@task%0Ade
@@ -366,32 +366,63 @@
%0Adef run(context
+, host='127.0.0.1', port='5000'
):%0A steps = %5B
@@ -447,22 +447,21 @@
p://
-127.0.0.1:5000
+%7Bhost%7D:%7Bport%7D
/',%0A
@@ -527,23 +527,117 @@
lask run
-',%0A
+ --host=%7Bhost%7D --port=%7Bport%7D',%0A %5D%0... |
c05b06577785bdf34f1fcd051ecf6d4398d2f77e | Add new release task w/ API doc prebuilding | tasks.py | tasks.py | from os.path import join
from invoke import Collection, ctask as task
from invocations import docs as _docs
d = 'sites'
# Usage doc/API site (published as docs.paramiko.org)
path = join(d, 'docs')
docs = Collection.from_module(_docs, name='docs', config={
'sphinx.source': path,
'sphinx.target': join(path, '... | Python | 0.000002 | @@ -17,16 +17,48 @@
ort join
+%0Afrom shutil import rmtree, move
%0A%0Afrom i
@@ -134,16 +134,58 @@
s _docs%0A
+from invocations.packaging import publish%0A
%0A%0Ad = 's
@@ -237,32 +237,37 @@
s.paramiko.org)%0A
+docs_
path = join(d, '
@@ -273,16 +273,55 @@
'docs')%0A
+docs_build = join(docs_path, '_build')%0A
d... |
b7e42d4a231cc1c34e193e2bd719c134f7f29b0a | Use a minimum of 1% completness to not ship empty translations. | tasks.py | tasks.py | import os
import os.path
import sys
from invoke import run, task
@task
def clean():
run('git clean -Xfd')
@task
def test(country='all'):
print('Python version: ' + sys.version)
test_cmd = 'coverage run `which django-admin.py` test --settings=tests.settings'
flake_cmd = 'flake8 --ignore=W801,E128,E50... | Python | 0 | @@ -1115,16 +1115,24 @@
ask%0Adef
+compile_
translat
@@ -1140,51 +1140,150 @@
ons(
-pull=False, locale=None):%0A if pull:%0A
+):%0A run('cd localflavor; django-admin.py compilemessages; cd ..')%0A%0A%0A@task(post=%5Bcompile_translations%5D)%0Adef pull_translations(locale=None):%0A
@@ -1293,36 +1293,... |
f62626799eddfea04ffad5005de09305a18f287d | Add linux dependencies task. | tasks.py | tasks.py | from invoke import Collection, task, run
from okcupyd import tasks
ns = Collection()
ns.add_collection(tasks, name='okcupyd')
@ns.add_task
@task(default=True)
def install():
run("python setup.py install")
@ns.add_task
@task
def pypi():
run("python setup.py sdist upload -r pypi")
@ns.add_task
@task(alia... | Python | 0.000002 | @@ -1091,8 +1091,308 @@
trip())%0A
+%0A%0Alinux_dependencies = ('zlib1g-dev', 'libxml2-dev', 'libxslt1-dev', 'python-dev',%0A 'libncurses5-dev')%0A@ns.add_task%0A@task(aliases='linux_dep')%0Adef install_linux_dependencies():%0A for package in linux_pacakges:%0A run('%7B0%7D %7B1%7D'.form... |
61deb461f2a36413cbb6108e7e0e86fc81f44891 | Update to work with invoke >= 0.13 | tasks.py | tasks.py | import sys
from invoke import run, task
@task
def docs(watch=False, warn=False):
if watch:
return watcher(docs)
run('make -C docs/ html', warn=warn)
@task
def test(path=None, coverage=False, watch=False, warn=False):
if watch:
return watcher(test, path=path, coverage=coverage)
path ... | Python | 0 | @@ -51,16 +51,21 @@
ef docs(
+ctx,
watch=Fa
@@ -183,16 +183,21 @@
ef test(
+ctx,
path=Non
@@ -510,16 +510,21 @@
ef lint(
+ctx,
watch=Fa
@@ -640,16 +640,19 @@
authors(
+ctx
):%0A #
|
45f098b3664a11ef51cd66a11773bab923b02c91 | Make all exceptions inherit from ValueError | stdnum/exceptions.py | stdnum/exceptions.py | # exceptions.py - collection of stdnum exceptions
# coding: utf-8
#
# Copyright (C) 2013 Arthur de Jong
#
# 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 Software Foundation; either
# version 2.1 of the Licen... | Python | 0 | @@ -81,16 +81,21 @@
(C) 2013
+-2022
Arthur
@@ -1124,17 +1124,18 @@
ror(
-Exception
+ValueError
):%0A
|
ad9f0c488bf761fe83714377fce06ed93d2ec5f3 | Update navigation controller | controller/navigation.py | controller/navigation.py | import asyncio
class ControlProtocol:
def connection_made(transport):
pass
def connection_lost(exc):
pass
class DriveMotorControl:
def __init__(self, left=0, right=1):
self.loop = asyncio.get_event_loop()
left = open("/var/run/motor{}".format(left),"w")
right = ope... | Python | 0.000001 | @@ -13,125 +13,8 @@
io%0A%0A
-class ControlProtocol:%0A def connection_made(transport):%0A pass%0A%0A def connection_lost(exc):%0A pass%0A%0A
clas
@@ -128,16 +128,22 @@
+self._
left = o
@@ -191,16 +191,22 @@
+self._
right =
@@ -289,32 +289,132 @@
elf.__right = 0%0A
+ ... |
14b607e89a465693e88da4f936fc477a718d9a3e | Fix typo | metrology/stats/sample.py | metrology/stats/sample.py | import math
import random
import sys
import heapq
from time import time
from atomic import Atomic
from threading import RLock
from metrology.stats.snapshot import Snapshot
class UniformSample(object):
def __init__(self, reservoir_size):
self.counter = Atomic(0)
self.values = [0] * reservoir_size... | Python | 0.999999 | @@ -2940,17 +2940,16 @@
self.
-_
rescale(
|
055573c622d03d02077f49ee3146db300b92813c | Add guard for empty selection when changing images | microscopium/bokeh_app.py | microscopium/bokeh_app.py | import os
import numpy as np
import click
from bokeh.server.server import Server
from bokeh.application import Application
from bokeh.application.handlers.function import FunctionHandler
from bokeh.plotting import figure, ColumnDataSource
from bokeh.layouts import row
from bokeh.models.tools import TapTool, PanTool
fro... | Python | 0 | @@ -1584,16 +1584,85 @@
ndices)%0A
+ if len(new.indices %3E 0): # could be empty selection%0A
@@ -1683,16 +1683,17 @@
ename =
+(
datafram
@@ -1711,16 +1711,52 @@
'path'%5D%5D
+%0A
.iloc%5Bne
@@ -1768,17 +1768,22 @@
ices%5B0%5D%5D
-%0A
+)%0A
... |
63a2deeb5602eb9834232a592bac16501bb8c8de | Fix program name when using __main__ | cookiecutter/__main__.py | cookiecutter/__main__.py | """Allow cookiecutter to be executable through `python -m cookiecutter`."""
from __future__ import absolute_import
from .cli import main
if __name__ == "__main__":
main()
| Python | 0.000026 | @@ -163,16 +163,60 @@
__%22:
-%0A main(
+ # pragma: no cover%0A main(prog_name=%22cookiecutter%22
)%0A
|
f4ba2cba93222b4dd494caf487cdd6be4309e41a | Update labels for application form | studygroups/forms.py | studygroups/forms.py | from django import forms
from studygroups.models import StudyGroupSignup, Application
from localflavor.us.forms import USPhoneNumberField
class ApplicationForm(forms.ModelForm):
mobile = USPhoneNumberField(required=False)
class Meta:
model = Application
labels = {
'name': 'Please t... | Python | 0 | @@ -428,59 +428,35 @@
: 'P
-lease tell us how would you perfer us to c
+referred Method of C
ontact
- us
+.
',%0A
@@ -502,24 +502,8 @@
ave
-normal everyday
acce
@@ -512,11 +512,9 @@
to
-the
+a
com
@@ -518,16 +518,39 @@
computer
+ outside of the library
?',%0A
@@ -571,75 +571,387 @@
': '
-Please tell... |
c1b637b2c3a097b4b7421a4192de8bf2326d1613 | Fix test_cant_auto_apply_freetext | suggestions/tests.py | suggestions/tests.py | from django.test import TestCase
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from mks.models import Member, Party, GENDER_CHOICES
from committees.models import Committee
from .models import Suggestion, SuggestedAction
class SuggestionsTests(TestCase):
MK_SITE =... | Python | 0.000531 | @@ -6232,100 +6232,16 @@
-subject=self.member1,%0A action=Suggestion.FREE_TEXT,%0A content=%7B'text':
+comment=
%22A f
@@ -6257,17 +6257,16 @@
comment%22
-%7D
%0A
|
95686be0b45e350791c85c757acd450623b14d60 | test OK | tests.py | tests.py | import pdb
import logging
import unittest
from yahoo_oauth import OAuth2, OAuth1
from fantasy_sport import FantasySport
from fantasy_sport.utils import pretty_json, pretty_xml
logging.getLogger('yahoo_oauth').setLevel(logging.WARNING)
class TestFantasySport(unittest.TestCase):
def setUp(self,):
oauth =... | Python | 0.999767 | @@ -1581,14 +1581,243 @@
tent))%0A%0A
+ def test_get_leagues_settings(self):%0A response = self.yfs.get_leagues_settings(%5B'238.l.627060','238.l.627062'%5D)%0A self.assertEqual(response.status_code, 200)%0A logging.debug(pretty_json(response.content))%0A%0A
%0A %0A
|
7d0cf5548fc8efcce8743ab6308425e5f97e8945 | Add support for rollback() operation | sunburnt/sunburnt.py | sunburnt/sunburnt.py | from __future__ import absolute_import
import cgi
from itertools import islice
import urllib
import httplib2
from .schema import SolrSchema, SolrError
from .search import SolrSearch
h = httplib2.Http(".cache")
class SolrConnection(object):
def __init__(self, url, h=h):
self.url = url.rstrip("/") + "/"... | Python | 0.000001 | @@ -1029,32 +1029,103 @@
ait_searcher))%0A%0A
+ def rollback(self):%0A response = self.update(%22%3Crollback/%3E%22)%0A%0A
def update(s
@@ -2507,32 +2507,86 @@
rgs, **kwargs)%0A%0A
+ def rollback(self):%0A self.conn.rollback()%0A%0A
def search(s
|
89128af9fad82166c716ef7a73965d23afa23095 | Fix a misdefined test. All extant tests now pass. | tests.py | tests.py | from unittest import TestCase, main
from preconditions import PreconditionError, preconditions
class PreconditionTestBase (TestCase):
def check_prec_fail(self, target, *args, **kw):
self.assertRaises(PreconditionError, target, *args, **kw)
class InvalidPreconditionTests (PreconditionTestBase):
def ... | Python | 0.000033 | @@ -3028,46 +3028,8 @@
C()%0A
-%0A self.check_prec_fail(i.get)%0A%0A
@@ -3072,16 +3072,74 @@
anana'%7D%0A
+ i.key = 'X'%0A%0A self.check_prec_fail(i.get)%0A%0A
|
90bbb6604fdbb16c5a9d4390a429f2ce1c31035c | Add more tests, pend all dysfunctional tests. | tests/acceptance/test_rate.py | tests/acceptance/test_rate.py | from pytest import fixture
from pytest import mark
from adhocracy_core.testing import annotator_login
from .shared import wait
from .shared import get_column_listing
from .shared import get_list_element
from .shared import get_listing_create_form
from .shared import login_god
from .test_comment import create_comment
... | Python | 0 | @@ -1,24 +1,35 @@
+import re%0A%0A
from pytest import fixtu
@@ -494,16 +494,80 @@
t None%0A%0A
+ @mark.skipif(True, reason=%22pending weil schlechtes wetter%22)%0A
def
@@ -677,36 +677,32 @@
mment')%0A
-pro_
button = rateabl
@@ -728,36 +728,32 @@
e-pro')%0A
-pro_
button.click()%0A
@@ -103... |
dc57d4b95e39f756858dc1d73c8f221f0bb1956c | add stubs | tests/commands/test__vi_cc.py | tests/commands/test__vi_cc.py | import unittest
from Vintageous.vi.constants import _MODE_INTERNAL_NORMAL
from Vintageous.vi.constants import MODE_NORMAL
from Vintageous.vi.constants import MODE_VISUAL
from Vintageous.vi.constants import MODE_VISUAL_LINE
from Vintageous.tests.commands import set_text
from Vintageous.tests.commands import ad... | Python | 0.000001 | @@ -1610,13 +1610,8 @@
ment
- this
%22)%0D%0A
@@ -1679,12 +1679,121 @@
e(False)%0D%0A%0D%0A
+ @unittest.skip(%22Implement%22)%0D%0A def testDeletedLinesAreYanked(self):%0D%0A self.assertTrue(False)%0D%0A%0D%0A
|
13f6394b42026b50cf2eedc17834a9de355344f1 | split tests | tests/entity_linking_tests.py | tests/entity_linking_tests.py | import unittest
from dataset.dbpedia import NgramEntityResolver
from dataset.msnbc import DataSet
from entity_linking.babelfy import _extract_candidates, link, CandidateEntity, SemanticGraph
from entity_linking.evaluation import Metrics
from kilogram import NgramService
import kilogram
NgramService.configure(hbase_ho... | Python | 0.000003 | @@ -1179,183 +1179,8 @@
2)%0A%0A
- def test_twitter(self):%0A for line in open('fixtures/sample.txt'):%0A text = line.strip()%0A print text, %5Bx for x in link(text) if x.true_entity%5D%0A%0A
@@ -1708,16 +1708,64 @@
mes.%22)%0A%0A
+%0Aclass TestEntityLinkingKB(unittest.TestCase):... |
6755255332039ab3c0ea60346f61420b52e2f474 | Fix intermittent failure in l10n language selector test | tests/functional/test_l10n.py | tests/functional/test_l10n.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import random
import pytest
from ..pages.home import HomePage
@pytest.mark.nondestructive
def test_change_language(b... | Python | 0.000003 | @@ -712,19 +712,35 @@
assert
+'/%7B0%7D/'.format(
new
+)
in sele
|
7ac7ef85f10c4f29a858693944c489060b6f8498 | Connection string redundant | tests/functional_test_base.py | tests/functional_test_base.py | import pyproctor
from moto import mock_s3
from pyshelf.app import app
import pyshelf.configure as configure
import boto
from boto.s3.key import Key
import yaml
import tests.metadata_utils as meta_utils
import tests.permission_utils as utils
from tests.route_tester.tester import Tester
from tests.search.test_wrapper imp... | Python | 0.999752 | @@ -2878,59 +2878,8 @@
f):%0A
- con_str = %22http://localhost:9200/metadata%22%0A
@@ -2938,15 +2938,58 @@
er,
-con_str
+FunctionalTestBase.ELASTICSEARCH_CONNECTION_STRING
)%0A
|
da6c8f6daee4baa3798ab2c4b49fbc780e46ee3a | Rename test case for ObjectLoader to match | tests.py | tests.py | #!/usr/bin/env python
import sys
import os
import unittest
from straight.plugin import loaders
class ModuleLoaderTestCase(unittest.TestCase):
def setUp(self):
self.loader = loaders.ModuleLoader()
sys.path.append(os.path.join(os.path.dirname(__file__), 'test-packages', 'more-test-plugins'))
... | Python | 0 | @@ -710,17 +710,14 @@
ass
-Selective
+Object
Load
|
d8737e4b2a0b41b139edbed6535e834a9aa17699 | Remove ShCommandContext | modules/command/cmd_sh.py | modules/command/cmd_sh.py | # -*- coding: utf-8 -*-
from models import CommandInfo
from cmd import Command, CommandContext, validator, cmd_indicator
class ShCommand(Command):
"""
NAME: sh - execute shell command within application container on remote machine
SYNOPSIS: sh [--env|-e <ENV>] <marathin_app_id> <raw bash command>
DE... | Python | 0.000007 | @@ -2516,353 +2516,4 @@
sh)%0A
-%0Aclass ShCommandContext(CommandContext):%0A def __init__(self, env, marathon_app_id):%0A self.env = env%0A self.marathon_app_id = marathon_app_id%0A%0A def enter(self):%0A # TODO: Return a open connection to remote machine%0A return self%0A%0A def ... |
f924770c9e48e4bcb94f724b7e0c9911a87a7415 | Version 2.4.1 | createsend/createsend.py | createsend/createsend.py | import urllib
import urllib2
import httplib
import base64
import gzip
from StringIO import StringIO
from urlparse import urlparse
from utils import json_to_py, get_faker
__version_info__ = ('2', '4', '0')
__version__ = '.'.join(__version_info__)
class CreateSendError(Exception):
"""Represents a CreateSend API error... | Python | 0 | @@ -195,17 +195,17 @@
, '4', '
-0
+1
')%0A__ver
|
a18e195734983849a90786a4631987466952a232 | Set vestion to 0.4.2 in __init__.py | lib/recordclass/__init__.py | lib/recordclass/__init__.py | # The MIT License (MIT)
#
# Copyright (c) <2011-2014> <Shibzukhov Zaur, szport at gmail dot com>
#
# 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 witho... | Python | 0.000106 | @@ -1277,11 +1277,13 @@
_ = '0.4
+.2
'%0D%0A
|
ba1fa9d47ae725774807a0aa97cdde476e572266 | improve readbility and remove unuse function. | timer.py | timer.py | from time import strftime
import time
import os
import datetime
import sys
def to_min(sec):
return int(sec/60)
def to_hour(sec):
return int(sec/60/60)
class Timer(object):
def __init__(self):
self._key = self._initial()
self._target_working_sec = 9 * 60 * 60 # 9 hour
def _initial(... | Python | 0 | @@ -53,24 +53,55 @@
rt datetime%0A
+from datetime import timedelta%0A
import sys%0A%0A
@@ -107,19 +107,20 @@
%0Adef to_
-min
+hour
(sec):%0A
@@ -133,65 +133,161 @@
urn
-int
+get_time
(sec
-/60
)%0A%0Adef
-to_hour
+get_time
(sec
+ond
):%0A
-return int(sec/60/60)%0A
+sec = timedelta(seconds=second)%0A ... |
d537ea32462c7ef46634d1527702c4c4a6d37e1e | Fix UDF test, take two | tests/query_test/test_udfs.py | tests/query_test/test_udfs.py | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestUdfs(ImpalaTestSuite):
@classmethod
def get_workload(cls):
return 'functional-query'
@classmethod
def add_test_dimensions(cls):
... | Python | 0.999732 | @@ -730,16 +730,241 @@
none')%0A%0A
+ # This must run serially because other tests executing 'invalidate metadata' will nuke%0A # all loaded functions.%0A # TODO: This can be run in parallel once functions are persisted correctly.%0A @pytest.mark.execute_serially%0A
def te
|
9c0a83da524831cf557e24ad0a61c160c856dec9 | move definitions to the bottom again | tools.py | tools.py | # coding: utf-8
from pyquery import PyQuery as q
import json
from collections import OrderedDict
this = None
BASE = 'http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/'
def load(filename='resource.json'):
schema = json.load(open(filename), object_pairs_hook=OrderedDict)
return schema
def get_pq... | Python | 0 | @@ -2269,8 +2269,89 @@
%5D = new%0A
+ # put definitions last%0A schema%5B'definitions'%5D = schema.pop('definitions')%0A
|
085755df4c542af7cbbf83af9b6069d7d9c74989 | Implement a test for the default user config file | tests/test_get_user_config.py | tests/test_get_user_config.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_get_user_config
--------------------
Tests formerly known from a unittest residing in test_config.py named
TestGetUserConfig.test_get_user_config_valid
TestGetUserConfig.test_get_user_config_invalid
TestGetUserConfig.test_get_user_config_nonexistent
"""
import o... | Python | 0.000006 | @@ -3775,20 +3775,128 @@
custom_user_config%0A
+%0A%0Adef test_default_config_path(user_config_path):%0A assert config.DEFAULT_CONFIG_FILE == user_config_path%0A
|
586cd6c864fdbdb3ac20aa49bdc6c550fa93aa2f | fix a testdir stragler | tests/test_latex_formatter.py | tests/test_latex_formatter.py | # -*- coding: utf-8 -*-
"""
Pygments LaTeX formatter tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2006-2007 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import os
import unittest
import tempfile
from pygments.formatters import LatexFormatter
from pygments.lexers import Python... | Python | 0.99996 | @@ -320,16 +320,47 @@
nLexer%0A%0A
+from support import test_file%0A%0A
%0Aclass L
@@ -492,51 +492,18 @@
ile(
-%0A os.path.join(testdir,
test
+_
file
+(
)).r
|
592b8a1a97a3c6d4c17eaeb6e748134501240894 | Increase the default number of training epoch | train.py | train.py | #!/usr/bin/env python
__author__ = 'Tony Beltramelli www.tonybeltramelli.com - 19/08/2016'
import os
import argparse
from modules.Model import *
from modules.Batch import *
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--training_file', type=str, required=True)
parser.add_argument('... | Python | 0.000005 | @@ -469,33 +469,34 @@
pe=int, default=
-5
+20
0)%0A parser.ad
|
07cfc39e50251384ddb647ccc7f73c98ed8cf7b9 | Save model with an interval of 1000 steps | train.py | train.py | import tensorflow as tf
from model import CycleGAN
from reader import Reader
from datetime import datetime
import os
X_TRAIN_FILE = 'data/tfrecords/apple.tfrecords'
Y_TRAIN_FILE = 'data/tfrecords/orange.tfrecords'
BATCH_SIZE = 1
def train():
current_time = datetime.now().strftime("%Y%m%d-%H%M")
checkpoints_dir =... | Python | 0 | @@ -1387,24 +1387,54 @@
er.flush()%0A%0A
+ if step %25 100 == 0:%0A
prin
@@ -1478,32 +1478,34 @@
%25 step)%0A
+
print(' G_loss
@@ -1532,32 +1532,34 @@
s_val))%0A
+
+
print(' D_Y_los
@@ -1590,32 +1590,34 @@
s_val))%0A
+
print(' F_loss
@@ -1644,32 +1644,34 @@
s... |
5e4152b6d48740268a4937535815c561144fdbd5 | Fix failing unit test | tests/unit/test_connection.py | tests/unit/test_connection.py | try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
from StringIO import StringIO
from mock import Mock, ANY
from cassandra.connection import (Connection, PROTOCOL_VERSION,
HEADER_DIRECTION_TO_CLIENT,
HEADER_DIRECTIO... | Python | 0.000015 | @@ -525,16 +525,17 @@
2_pack%0A%0A
+%0A
class Co
@@ -4472,17 +4472,16 @@
%22%22%22%0A
-%0A
@@ -4482,17 +4482,16 @@
c
-
= self.m
@@ -4568,286 +4568,8 @@
se)%0A
- self.assertRaises(NotImplementedError, c.defunct, None)%0A self.assertRaises(NotImplementedError, c.send_msg, None, N... |
1970bad9d9933432154de2042c4ed74a8696b7f0 | fix timeout when no options are specified | teuthology/task/thrashosds.py | teuthology/task/thrashosds.py | import contextlib
import logging
import ceph_manager
from teuthology import misc as teuthology
log = logging.getLogger(__name__)
@contextlib.contextmanager
def task(ctx, config):
"""
"Thrash" the OSDs by randomly marking them out/down (and then back
in) until the task is ended. This loops, and every op_d... | Python | 0.000003 | @@ -1865,24 +1865,170 @@
ve:%0A %22%22%22%0A
+ if config is None:%0A config = %7B%7D%0A assert isinstance(config, dict), %5C%0A 'thrashosds task only accepts a dict for configuration'%0A
log.info
|
e7b7709784e105114d490eaab655a16e9842a1ed | optimize post processor shouldn't run 'call' with shell and pipe. | thumbnails/post_processors.py | thumbnails/post_processors.py | import imghdr
import os
from subprocess import call, PIPE
import tempfile
import uuid
from django.core.files import File
def get_or_create_temp_dir():
temp_dir = os.path.join(tempfile.gettempdir(), 'thumbnails')
if not os.path.exists(temp_dir):
os.mkdir(temp_dir)
return temp_dir
def process(thu... | Python | 0 | @@ -48,14 +48,8 @@
call
-, PIPE
%0Aimp
@@ -712,16 +712,29 @@
nd=None,
+%0A
gif_com
@@ -1881,45 +1881,133 @@
-call(command, shell=True, stdout=PIPE
+try:%0A call(command)%0A except OSError:%0A raise OSError('Error while optimizing %25s image' %25 filetype
)%0A%0A
@@ ... |
58b5cd41be50ee72a8cae46504273e0760a5446b | Corrected docker_host docker driver doc | molecule/driver/docker.py | molecule/driver/docker.py | # Copyright (c) 2015-2017 Cisco Systems, Inc.
#
# 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, modify, merge... | Python | 0.999971 | @@ -2577,16 +2577,63 @@
ame: bar
+%0A docker_host: tcp://localhost:12376
%0A%0A ..
@@ -2851,24 +2851,24 @@
safe_files:%0A
+
@@ -2878,427 +2878,8 @@
oo%0A%0A
- To use a URL to connect to the Docker API instead of the default Unix socket%0A path %60unix://var/run/docker.sock%60.%0A%0... |
c761c55ebc5d7f89116cbfe81031953394657b85 | patch utils.which | daemon/tests/conftest.py | daemon/tests/conftest.py | """
Unit test fixture module.
"""
import threading
import time
import mock
import pytest
from mock.mock import MagicMock
from core.api.grpc.client import InterfaceHelper
from core.api.grpc.server import CoreGrpcServer
from core.api.tlv.corehandlers import CoreHandler
from core.emulator.coreemu import CoreEmu
from co... | Python | 0 | @@ -1470,24 +1470,72 @@
utils.cmd%22)%0A
+ patch_manager.patch(%22core.utils.which%22)%0A
patc
|
bdda5ca28721dfeca8cfe42afb81fee09b78e83a | fix tap handler | daiquiri/tap/handlers.py | daiquiri/tap/handlers.py | from django.conf import settings
from django.dispatch import receiver
from django.db.models.signals import post_save, post_delete
from daiquiri.metadata.models import Database, Table, Column
from daiquiri.metadata.settings import ACCESS_LEVEL_PUBLIC, ACCESS_LEVEL_INTERNAL
from .models import (
Schema as TapSchema... | Python | 0.000002 | @@ -4625,38 +4625,38 @@
on:%0A
-schema
+column
.description = i
|
27e30c4172f2da79168640799188f0394b88c9ec | Fix circular import between querysets.workflow and models.domain | swf/models/domain.py | swf/models/domain.py | # -*- coding: utf-8 -*-
from boto.swf.exceptions import SWFResponseError, SWFDomainAlreadyExistsError
from swf.constants import REGISTERED
from swf.core import ConnectedSWFObject
from swf.querysets.workflow import WorkflowTypeQuerySet
from swf.exceptions import AlreadyExistsError, DoesNotExistError
class Domain(Con... | Python | 0.000025 | @@ -178,64 +178,8 @@
ect%0A
-from swf.querysets.workflow import WorkflowTypeQuerySet%0A
from
@@ -1938,24 +1938,88 @@
orkflows%22%22%22%0A
+ from swf.querysets.workflow import WorkflowTypeQuerySet%0A
qs =
|
6e013f4c5f9f71e3b4386c3b401449922ffdfad8 | fix colorization | utils.py | utils.py | import torch
import numpy as np
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.initialized = False
self.val = None
self.avg = None
self.sum = None
self.count = None
def initialize(self, val, weight):
... | Python | 0.000004 | @@ -2385,24 +2385,63 @@
elmap):%0A
+ if label %3C 0:%0A continue%0A
labe
@@ -2506,20 +2506,16 @@
-
np.tile(
@@ -2529,20 +2529,16 @@
label%5D,%0A
-
|
b07d1b73c3b3bdee8af53b544009b0de8ef436ac | use isinstance and types.* | utils.py | utils.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... | Python | 0 | @@ -1586,19 +1586,25 @@
%0A if
-typ
+isinstanc
e(subjec
@@ -1608,22 +1608,27 @@
ject
-) ==
+,
type
-(bool
+s.BooleanType
):%0A
@@ -1660,60 +1660,47 @@
if
-hasattr(subject, 'startswith'): # str or unicode...
+isinstance(subject, types.StringTypes):
%0A
|
c04ac9ef5f112674df0ae43cc1f0be98050cdac5 | Check for NoneType. (#253) | utils.py | utils.py | #!/usr/bin/env python3
import hashlib
import struct
import logging
import socket
from lrucache import *
logger = logging.getLogger('utils')
# The maximum number of clashes to allow when assigning a port.
MAX_CLASHES = 50
class ServicePortAssigner(object):
"""
Helper class to assign service ports.
Ord... | Python | 0 | @@ -4559,16 +4559,59 @@
, task)%0A
+ if task_ports is not None:%0A
@@ -4654,32 +4654,36 @@
app, task_port)%0A
+
|
b26d057bc2cb16e98e3af95f6f2a2e5f4bff07cf | Add final command to run results | utils.py | utils.py | # Copyright (c) 2010, Silas Sewell
# All rights reserved.
#
# This file is subject to the New BSD License (see the LICENSE file).
import copy
import inspect
import os
import pipes
import string
import subprocess
import sys
DIRECTORY_STACK_NAME = '__utils_directory_stack'
class Objectify(dict):
def __getattr__(s... | Python | 0.000004 | @@ -5532,16 +5532,44 @@
e == 0,%0A
+ 'command': command,%0A
|
157a09187bccfbfae9b4698159f3a889cb619dd6 | Call resp.json() | utils.py | utils.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015–2020 Molly White
#
# 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... | Python | 0.000001 | @@ -2120,16 +2120,18 @@
esp.json
+()
%0A
|
e2dd97f16f4f8223c25dbaf661863b3e7323a302 | add more make errors. i now need to add context lines. | mozharness/base/errors.py | mozharness/base/errors.py | #!/usr/bin/env python
"""Generic error regexes.
We could also create classes that generate these, but with the appropriate
level (please don't die on any errors; please die on any warning; etc.)
"""
# ErrorLists {{{1
""" TODO: more of these.
We could have a generic shell command error list (e.g. File not found,
perm... | Python | 0.000017 | @@ -1981,16 +1981,178 @@
rror'%7D,%0A
+ %7B'regex': ':%5Cd+: error:', 'level': 'error'%7D,%0A %7B'regex': 'make%5C%5B%5Cd+%5C%5D: %5C*%5C*%5C* %5C%5B.*%5C%5D Error %5Cd+', 'level': 'error'%7D,%0A %7B'substr': 'Warning: ', 'level': 'warning'%7D,%0A
%5D%0A%0A%0A%0A# _
|
9391d9091ffee2e01e1fb6654ffbb032dfc9b278 | fix utils.py | utils.py | utils.py | from mxnet import gluon
from mxnet import autograd
from mxnet import nd
from mxnet import image
from mxnet.gluon import nn
import mxnet as mx
import numpy as np
class DataLoader(object):
"""similiar to gluon.data.DataLoader, but faster"""
def __init__(self, X, y, batch_size, shuffle):
self.batch_size =... | Python | 0.000006 | @@ -3086,16 +3086,72 @@
pu()%5D):%0A
+ if isinstance(ctx, mx.Context):%0A ctx = %5Bctx%5D%0A
acc
|
9a986e0c1b0cebc494a709d9c12eca7f69b9fd41 | Fix divide by zero issue when timestamp start and end are the same | libmproxy/console/common.py | libmproxy/console/common.py | import urwid
import urwid.util
from .. import utils, flow
VIEW_LIST = 0
VIEW_FLOW = 1
VIEW_FLOW_REQUEST = 0
VIEW_FLOW_RESPONSE = 1
def highlight_key(s, k):
l = []
parts = s.split(k, 1)
if parts[0]:
l.append(("text", parts[0]))
l.append(("key", k))
if parts[1]:
l.append(("text",... | Python | 0.000018 | @@ -5015,22 +5015,47 @@
e(size /
+ (
delta
+ if delta %3E 0 else 1 )
)%0A%0A
|
e6a0e0c6a73c96b55784b3b567a1564127a86db1 | added rand gauss util | utils.py | utils.py | #!/usr/bin/python
import os, json
from parameters import Conf, Knows, Settings, Controller, isKnows, isConf, isSettings, isButton
from smbool import SMBool
class ParamsLoader(object):
@staticmethod
def factory(params):
# can be a json, a python file or a dict with the parameters
if type(params... | Python | 0.999711 | @@ -27,16 +27,24 @@
os, json
+, random
%0Afrom pa
@@ -159,16 +159,283 @@
SMBool%0A%0A
+# gauss random in %5B0, r%5D range%0A# the higher the slope, the less probable extreme values are%0Adef randGaussBounds(r, slope=8):%0A r = float(r)%0A n = int(round(random.gauss(r/2, r/slope), 0))%0A if n %3C 0:%0A ... |
c967f59da33dec46ccbe73d7e7878e01715da236 | Add docstrings and comments to video module | video.py | video.py | import graphics
class VideoController():
def power_on(self):
print("VideoController.power_on()")
self._create_terminal_window()
def _create_terminal_window(self):
win = graphics.GraphWin("RichEmu86", 890, 408)
win.setBackground("black")
s = "RichEmu86 " * 8
i ... | Python | 0 | @@ -40,32 +40,142 @@
():%0A
-%0A def power_on(self):
+ %22%22%22Represents a computer system's video controller.%22%22%22%0A %0A def power_on(self):%0A %22%22%22Powers on this video controller.%22%22%22
%0A
@@ -286,32 +286,106 @@
l_window(self):%0A
+ # Creates the terminal window using J... |
c705ef83607e09b2ed6e2b8d14aa6a6a7f9f57ea | Update __init__.py | newspaperdemo/__init__.py | newspaperdemo/__init__.py | from flask import Flask, request, render_template, redirect, url_for, json
from newspaper import Article
from xml.etree import ElementTree
app = Flask(__name__)
# Debug logging
import logging
import sys
# Defaults to stdout
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
try:
log.info(... | Python | 0.000072 | @@ -65,15 +65,9 @@
_for
-, json
%0A
+
from
@@ -482,14 +482,21 @@
e('/
-scrape
+articles/show
')%0Ad
@@ -603,281 +603,41 @@
-a= %7B%0A%09 'authors': '', %0A%09 'title': '',%0A%09 'text': '',%0A%09 'keywords': '',%0A%09 'summary': ''%0A%09 %7D%0A%09response = app.response_class(%0A r... |
90c4340dcc578b8ea3532b46058772c4ddda56c0 | add missing import | views.py | views.py | # -*- encoding: utf-8 ---------------------------------------------------------
from operator import attrgetter
from serve import *
from models import *
@app.route('/')
@app.route('/index.html')
def index():
datasets = Dataset.query.all()
return render_template('index.html', datasets=datasets)
@app.route... | Python | 0.000042 | @@ -75,16 +75,50 @@
-----%0A%0A%0A
+from flask import render_template%0A
from ope
|
0523b4f72344999c675f63b07d83bd509adcef2a | Check return code | t/py/script_tests.py | t/py/script_tests.py | '''
Created on Jan 30, 2015
@author: gaprice@lbl.gov
'''
from __future__ import print_function
import os
import inspect
from biokbase.Transform import script_utils
from biokbase.Transform.handler_utils import PlugIns
from biokbase.AbstractHandle.Client import AbstractHandle
from bzrlib.config import ConfigObj
import j... | Python | 0.00001 | @@ -2735,22 +2735,24 @@
-return
+so, se =
task.co
@@ -2762,16 +2762,55 @@
nicate()
+%0A return so, se, task.returncode
%0A%0A de
@@ -4535,16 +4535,22 @@
do, stde
+, code
= self.
@@ -4940,16 +4940,110 @@
+ stde)
+%0A if code != 0:%0A raise TestException('Got non zero return... |
844270b6eee2eabfaa1b43c73ed8ffcab833586f | Bump to version 0.19.4 | tabutils/__init__.py | tabutils/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
tabutils
~~~~~~~~
Provides methods for reading and processing data from tabular formatted files
Attributes:
CURRENCIES [tuple(unicode)]: Currency symbols to remove from decimal
strings.
ENCODING (str): Default file encoding.... | Python | 0 | @@ -704,17 +704,17 @@
= '0.19.
-3
+4
'%0A__lice
|
c7665ba1988215fd27f0eb7f547a34104d8b921f | add MA | nsnqtlib/tkpi/momentum.py | nsnqtlib/tkpi/momentum.py |
import numpy as np
#MACD related indicators
#Moving average: there will be unstable period in the beginning
#input: list of close price
def EMA(close=[], timeperiod=10):
ema = []
current = close[0]
for i in close:
current = (current*(timeperiod-1)+ 2*i)/(timeperiod+1)
ema.append(current)
... | Python | 0.999026 | @@ -14,16 +14,241 @@
y as np%0A
+import pandas as pd%0A%0A%0A#Moving average%0Adef MA(data=%5B%5D, timeperiod=10):%0A ma = %5B%5D%0A ma_a = pd.DataFrame(data,columns=%5B'MA'%5D).rolling(window=timeperiod).mean()%0A for i in ma_a%5B'MA'%5D:%0A ma.append(i)%0A return ma%0A
%0A#MACD r
@@ -2110,14 ... |
1045f8a2cedf86a401a2868f4092f5d416e8f3e9 | Bump to 0.26 | octave_kernel/__init__.py | octave_kernel/__init__.py | """An Octave kernel for Jupyter"""
__version__ = '0.25.1'
| Python | 0.000005 | @@ -51,9 +51,9 @@
'0.2
-5.1
+6.0
'%0A
|
389f892fcd3903b936226a2e464d26a0df359e7b | Determine what wheels should be built, don't attempt to build them if they've been built, don't continue if they fail to build. | wheel.py | wheel.py | #!/usr/bin/env python
import os
import sys
import urllib2
import argparse
import subprocess
from os.path import abspath, dirname, join, basename
import yaml
WHEELS_DIST_DIR = abspath(join(dirname(__file__), 'wheels', 'dist'))
WHEELS_BUILD_DIR = abspath(join(dirname(__file__), 'wheels', 'build'))
WHEELS_YML = join(W... | Python | 0.001012 | @@ -138,16 +138,24 @@
basename
+, exists
%0A%0Aimport
@@ -787,24 +787,83 @@
s.package)%0A%0A
+ version = wheels%5B'packages'%5D%5Bargs.package%5D%5B'version'%5D%0A%0A
if args.
@@ -1177,32 +1177,24 @@
%0A if not
-os.path.
exists(src_c
@@ -1347,16 +1347,8 @@
not
-os.path.
exis
@@ -1490,28 +1490,1491 @... |
bcb3ecebfec6c38a57e82b2c149d045546fbcc72 | fix broken test for py26 | locust/test/test_runners.py | locust/test/test_runners.py | import unittest
import gevent
from gevent.queue import Queue
from gevent import sleep
from locust.runners import LocalLocustRunner, MasterLocustRunner, SlaveLocustRunner
from locust.core import Locust, task, TaskSet
from locust.rpc import Message
from locust.stats import RequestStats, global_stats
from locust.main im... | Python | 0.000001 | @@ -6606,18 +6606,20 @@
f.assert
-In
+True
(%22traceb
@@ -6622,17 +6622,19 @@
aceback%22
-,
+ in
excepti
@@ -6660,10 +6660,12 @@
sert
-In
+True
(%22He
@@ -6678,17 +6678,18 @@
eption%22
-,
+in
excepti
|
7567f63b5bf967a8dc2b370c0deecef41ded3dcd | add LoadBalancer API | Client.py | Client.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
#
# Copyright 2012 Netsco Inc.
# Copyright 2012 Minsu Kang
from urllib import quote_plus as quote
from urllib2 import urlopen, HTTPError
from base64 import b64encode
import hmac
import hashlib
import json
import re
UCLOUD_API_KEY = ''
UCLOUD_SECRET = ''
UCLOUD_API_URL ... | Python | 0 | @@ -312,18 +312,36 @@
_API_URL
+S
=
+ %7B%0A 'server' :
'https:
@@ -387,16 +387,96 @@
ent/api'
+,%0A 'lb' : 'https://api.ucloudbiz.olleh.com/loadbalancer/v1/client/api',%0A%7D
%0A%0Aclass
@@ -513,16 +513,37 @@
__(self,
+ api_type = 'server',
api_key
@@ -619,16 +619,27 @@
_API_URL
+S%5Bapi_type%5D
... |
dcc89b0d4757a4d2e0a541172ce3ded1f7e92014 | Create CDAP's HDFS directory | package/scripts/master.py | package/scripts/master.py | import sys
import ambari_helpers as helpers
from resource_management import *
class Master(Script):
def install(self, env):
print 'Install the CDAP Master';
import params
self.configure(env)
# Add repository file
helpers.add_repo(params.files_dir + params.repo_file, params.os_repo_dir)
# Inst... | Python | 0 | @@ -519,32 +519,98 @@
.configure(env)%0A
+ create_hdfs_dir(params.hdfs_namespace, params.hdfs_user, 755)%0A
Execute('ser
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.