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 |
|---|---|---|---|---|---|---|---|
5a3e0859fe7774fc8caee54ff498f324a89be9e3 | install command line scripts to bin/ when installing the package | setup.py | setup.py | #!/usr/bin/env python
import setuptools
long_description="""python-evtx is a pure Python parser for recent 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-evtx t... | Python | 0 | @@ -989,10 +989,514 @@
'six'%5D,%0A
+ scripts = %5B'scripts/evtx_dump',%0A 'scripts/evtx_dump_chunk_slack',%0A 'scripts/evtx_eid_record_numbers',%0A 'scripts/evtx_extract_record',%0A 'scripts/evtx_filter_records',%0A 'scripts/evtx_fin... |
66b722e86547907c6c9fb6e9ae972597aba7cd96 | Version 1.17.8 | setup.py | setup.py | """
The setup package to install SeleniumBase dependencies and plugins
(Uses selenium 3.x and is compatible with Python 2.7+ and Python 3.6+)
"""
from setuptools import setup, find_packages # noqa
from os import path
this_directory = path.abspath(path.dirname(__file__))
long_description = None
try:
with open(pa... | Python | 0 | @@ -562,17 +562,17 @@
n='1.17.
-7
+8
',%0A d
|
369102151ba98a69a976622bee93a8a8770ce368 | support 3.6 and 3.7 | setup.py | setup.py | # coding=utf-8
import os
import re
from setuptools import setup
from setuptools.command.test import test as TestCommand
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGELOG.txt')).read()
except IOError:
R... | Python | 0.000014 | @@ -2616,16 +2616,114 @@
: 3.5',%0A
+ 'Programming Language :: Python :: 3.6',%0A 'Programming Language :: Python :: 3.7',%0A
|
c793fe512903fd381e7af0e3d85e375c6653e8fb | remove unique constraint in old migration which leads the migration to break if data is pressent in the database | src/feedback/migrations/0030_auto_20170108_1300.py | src/feedback/migrations/0030_auto_20170108_1300.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-08 13:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('feedback', '0029_auto_20161227_1258'),
]
operations = [
migrations.AlterFie... | Python | 0 | @@ -694,21 +694,8 @@
True
-, unique=True
),%0A
|
c956c0e42657a13642f2bee989ca538ecd43691d | change license to BSD to resolve Twine issue | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
import watson.di
name = 'watson-di'
description = 'Dependency Injection made simple.'
version = watson.di.__version__
def read(filename, as_list=False):
with open(os.path.join(os.path.dirname(__file__), filename)) as f:
content... | Python | 0 | @@ -706,23 +706,13 @@
nse=
-read('LICENSE')
+'BSD'
,%0A
|
1c4d4806ada333f3939d84be0fcb0a8df4cd059b | Bump to 0.0.3-dev | setup.py | setup.py | import os
from setuptools import setup, find_packages
requires = [
'aiohttp',
'attrs',
]
classifiers = [
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3 :: Only',
'Framework :: AsyncIO',
'Topic :: Internet',
'Topic... | Python | 0 | @@ -607,17 +607,21 @@
on='0.0.
-2
+3-dev
',%0A d
|
09451bf011dc371284b4b33f41a6bf35cfd5966e | Change back taggit requirement | setup.py | setup.py | #!/usr/bin/env python
import os
import sys
import bluebottle
from setuptools import setup, find_packages
def read_file(name):
return open(os.path.join(os.path.dirname(__file__), name)).read()
readme = read_file('README.rst')
changes = ''
dependency_links = [
'https://github.com/onepercentclub/django-taggit... | Python | 0 | @@ -429,27 +429,25 @@
odified-0.1.
-0b4
+1
',%0A 'http
@@ -2612,11 +2612,9 @@
0.1.
-0b4
+1
',%0A
|
ae1aa047d7d25e6ea6e357ce31dfc085b341f4a7 | add bruker_test_data subdirs | setup.py | setup.py | #!/usr/bin/env python
# setup script for nmrglue
from distutils.core import setup
from codecs import open
from os import path, walk
here = path.abspath(path.dirname(__file__))
# get long description from README
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
... | Python | 0.000001 | @@ -1644,24 +1644,173 @@
st_data/*',%0A
+ 'fileio/tests/bruker_test_data/1/*',%0A 'fileio/tests/bruker_test_data/1/pdata/*',%0A 'fileio/tests/bruker_test_data/1/pdata/1/*',%0A
'fil
|
c52b2fc3f4a8cb20b2a692e4ae94575fa849c251 | Update version to v0.5.0. | setup.py | setup.py | import os
from setuptools import setup
def contents(filename):
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, filename)) as fp:
return fp.read()
setup(
name="sqlalchemy-json",
version="0.4.0",
author="Elmer de Looff",
author_email="elmer.delooff@gmail.... | Python | 0 | @@ -240,17 +240,17 @@
sion=%220.
-4
+5
.0%22,%0A
|
c75749922c8be3b70bacd66a6b25b8e50faf7b76 | Bump flask from 0.10.1 to 1.0 | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name="myapp",
version='0.0.1-dev',
description='My Awesome Application',
author='**INSERT_AUTHOR_NAME**',
author_email='**INSERT_AUTHOR_EMAIL**',
packages=[
'myapp',
'myapp.blueprints'
],
url='https://www.gith... | Python | 0.000002 | @@ -433,14 +433,11 @@
sk==
-0.10.1
+1.0
',%0A
|
08cb8185444d00bffd7b58723ddf2d4232f789c3 | Version bump - 0.3-dev | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
__author__ = "Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com>"
__version__ = "0.2"
NAME = 'textX'
DESC = 'Meta-language in Arpeggio inspired by Xtext'
VERSION = __version__
AUTHOR = 'Igor R. Dejanovic'
AUTHOR_EMAIL = 'igor DO... | Python | 0 | @@ -171,9 +171,13 @@
%220.
-2
+3-dev
%22%0A%0AN
@@ -216,19 +216,30 @@
age
-in Arpegg
+for DSL implementat
io
+n
ins
|
787bc6427cc641e3c7a590f1ab57a2b840f471bc | bump to v0.6.0.dev0 (#61) | setup.py | setup.py | # -*- coding: utf-8 -*-
#!/usr/bin/env python
import codecs
import os
from setuptools import setup, find_packages
PACKAGE = 'japandas'
README = 'README.rst'
REQUIREMENTS = 'requirements.txt'
VERSION = '0.5.1'
def read(fname):
# file must be read as utf-8 in py3 to avoid to be bytes
return codecs.open(os.path.jo... | Python | 0 | @@ -204,11 +204,16 @@
'0.
-5.1
+6.0.dev0
'%0A%0Ad
|
d2f7fce3cac7b2d742ab553325b3394092a0c8f8 | Change the name of the package | setup.py | setup.py | from setuptools import setup
setup(
name='libgen',
version='0.1',
license='MIT',
author='Adolfo Silva',
author_email='code@adolfosilva.org',
url='https://github.com/adolfosilva/libgen.py',
description='A script to download books from gen.lib.rus.ec',
tests_requires=['pytest'],
py_mo... | Python | 0 | @@ -46,16 +46,19 @@
='libgen
+.py
',%0A v
@@ -68,16 +68,18 @@
ion='0.1
+.0
',%0A l
@@ -278,16 +278,184 @@
us.ec',%0A
+ classifiers=%5B%0A 'License :: OSI Approved :: MIT License',%0A %5D,%0A keywords='libgen',%0A include_package_data=True, # include files listed in MANIFEST.in%0A
tes... |
46414834ec14f4c70b8c66770aa13570f09b924a | Upgrade content-io to 1.2.2 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
from sys import version_info
install_requires = [
'six',
'content-io >= 1.2.1',
'simplejson >= 3.2.0'
]
tests_require = [
'coverage',
'Markdown <= 2.4.1',
'Pillow',
]
if version_info < (3,):
tests_require += ['unittest2']
... | Python | 0.000001 | @@ -145,17 +145,17 @@
%3E= 1.2.
-1
+2
',%0A '
|
ea08f44e4ef3ed4e94068b8a00914a0c182db881 | Version bump to 0.0.5. | setup.py | setup.py | from distutils.core import setup
import os
longdesc = \
'''A simple library to download, slice and search NFL game footage on a play-by-play basis.
This library comes with preloaded play-by-play meta data, which describes the start time of each play in the game footage. However, the actual footage does not come with ... | Python | 0 | @@ -817,17 +817,17 @@
on='0.0.
-4
+5
',%0A l
|
204cb3a68562e4ac7367571071faeb1762031220 | Fix silly typo in setup.py | setup.py | setup.py | from setuptools import setup, find_packages
import os
import opencanary
setup(
name='opencanary',
version=opencanary.__version__,
url='http://www.thinkst.com/',
author='Thinkst Applied Research',
author_email='info@thinkst.com',
description='OpenCanary daemon',
long_description='A low inte... | Python | 0.0004 | @@ -579,16 +579,17 @@
==2.7.0'
+,
%0A
|
d6c998868ac89acbbfc232245676449f126f6f19 | add subscribed field | src/people/admin.py | src/people/admin.py | from django.shortcuts import reverse
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from api.admin import admin_site
from .models import Person, PersonTag
@admin.register(Person, site=admin_site)
class PersonAdmin(admin.ModelAdmin):
list_display = ('email', 'subscribed',... | Python | 0.000001 | @@ -956,16 +956,29 @@
('tags',
+ 'subscribed'
)%0A%0A d
|
17842783a5ab45be6cfe4e8600ac693b41700937 | remove error handling and improve {up,down}vote | src/player/queue.py | src/player/queue.py | import heapq
import logging
from song import Song
class Dyn_Queue:
queue = []
def __init__(self, *song):
# parsing the parameters
for s in song:
self.queue.append(s)
heapq._heapify_max(self.queue)
logging.info("playlist created with " + str(self.get_list_of_al... | Python | 0.000002 | @@ -1217,29 +1217,8 @@
se:%0A
- try:%0A
@@ -1263,147 +1263,8 @@
g))%0A
- except IOError:%0A logging.error(%22can't create song: no file associated to %22 + new_song)%0A return 1%0A
@@ -1305,29 +1305,8 @@
eue)
-%0A return 0
%0A%0A
@@ -1... |
909754723e8f3f643b7bf3c56978f6c345a74992 | Add default callback function to mock nodes | mock_nodes.py | mock_nodes.py | """Utilities that deal with creating fake rosnodes for testing.
Contains tools to send and recieve data from fake nodes and topics.
"""
import contextlib
import functools
import time
import rospy
class NoMessage(Exception):
"""Exception for a lack of message in a Node.
"""
pass
class MockNode: # pylin... | Python | 0 | @@ -2083,16 +2083,21 @@
callback
+=None
):%0A %22
@@ -2174,24 +2174,152 @@
it.%0A %22%22%22%0A
+ if callback is None:%0A def default_callback(message):%0A return message%0A callback = default_callback%0A%0A
rospy.in
|
8e211245b786fab5ff8f686b4220f2b0fed2f10e | Update easyium/__init__.py | easyium/__init__.py | easyium/__init__.py | from .webdriver import WebDriver, WebDriverType
from .staticelement import StaticElement
from .identifier import Identifier
from .waits.waiter import wait_for
__author__ = 'karl.gong'
try:
import appium
appium_installed = True
except ImportError:
appium_installed = False
| Python | 0.000009 | @@ -1,12 +1,113 @@
+try:%0A import appium%0A appium_installed = True%0Aexcept ImportError:%0A appium_installed = False%0A%0A
from .webdri
@@ -283,105 +283,4 @@
ng'%0A
-%0Atry:%0A import appium%0A appium_installed = True%0Aexcept ImportError:%0A appium_installed = False%0A
|
80be25e8ff106e0a578cc7ddcfd4aa060ce0ab4f | support deep path | easylinker/links.py | easylinker/links.py | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
import os
class LinkException(Exception):
pass
class Link(object):
def __init__(self, src, dst):
self.src = src
self.dst = dst
def create(self):
src = self.src
dst = sel... | Python | 0 | @@ -247,24 +247,154 @@
.dst = dst%0A%0A
+ def pathname_to_valid_pathname(self, pathname):%0A return pathname.replace('/', os.path.sep).replace('%5C%5C', os.path.sep)%0A%0A
def crea
@@ -417,24 +417,56 @@
src =
+self.pathname_to_valid_pathname(
self.src
%0A
@@ -457,16 +457,17 @@
self.src
+)
... |
61f78a13362fb75796c423f60a62c865e50e212a | Rewrite command-line. (#9) | nsfw_dl/__main__.py | nsfw_dl/__main__.py | #!/usr/bin/python3.6
"""
Read the license at:
https://github.com/IzunaDevs/nsfw_dl/blob/master/LICENSE
"""
import argparse
import sys
import nsfw_dl
def download(downloader, args, file, download_file):
with nsfw_dl.NSFWDL() as dl:
img = dl.download(downloader, args=args)
if callable(file):
... | Python | 0 | @@ -127,16 +127,26 @@
port sys
+%0Aimport os
%0A%0Aimport
@@ -164,641 +164,173 @@
def
-download(downloader, args, file, download_file):%0A with nsfw_dl.NSFWDL() as dl:%0A img = dl.download(downloader, args=args)%0A%0A if callable(file):%0A file = file(img)%0A%0A if download_file:%... |
b85042044c120777bebb2f7fdcbd0723a7a7ad0d | Update the author | lastpass/lastpass.py | lastpass/lastpass.py | # JavaRAT detection and analysis for Volatility - v 1.0
# This version is limited to JavaRAT's clients 3.0 and 3.1, and maybe others
# Author: Brian Baskin <brian@thebaskins.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | Python | 0.000006 | @@ -1,881 +1,134 @@
#
-JavaRAT detection and analysis for Volatility - v 1.0%0A# This version is limited to JavaRAT's clients 3.0 and 3.1, and maybe others%0A# Author: Brian Baskin %3Cbrian@thebaskins.com%3E%0A#%0A# This program is free software; you can redistribute it and/or modify%0A# it under the terms of the GNU... |
42dba1bb3d86aa7998a55967ef5e7dc0f47c2050 | Implement unfreeze. | src/s3bot/freeze.py | src/s3bot/freeze.py | """Wrapper for the freeze.sh bash script."""
import getpass
import os
import subprocess
from s3bot import SHARED_BASE
from s3bot.useremails import UserEmailRecord
FREEZE_SH_SCRIPT_PATH = os.path.join(SHARED_BASE, "freezer", "freeze.sh")
def freeze(path):
"""Queue a freeze.sh job for the specified file."""
u... | Python | 0.000002 | @@ -232,16 +232,94 @@
eze.sh%22)
+%0AUNFREEZE_SH_SCRIPT_PATH = os.path.join(SHARED_BASE, %22freezer%22, %22unfreeze.sh%22)
%0A%0Adef fr
@@ -854,8 +854,407 @@
ncode))%0A
+%0Adef unfreeze(itemname):%0A user = getpass.getuser()%0A email = UserEmailRecord().get(user)%0A%0A cmd = %5B%22qsub%22,%0A %22-... |
c62ceaab233b0e2f60d5553e6b6f359cc6e0ae35 | Update string-to-integer-atoi.py | Python/string-to-integer-atoi.py | Python/string-to-integer-atoi.py | # Time: O(n)
# Space: O(1)
#
# Implement atoi to convert a string to an integer.
#
# Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below
# and ask yourself what are the possible input cases.
#
# Notes: It is intended for this problem to be specified vaguely (ie, no given... | Python | 0.000184 | @@ -1759,33 +1759,17 @@
ult%0A
- else:%0A
+%0A
sig
@@ -1760,25 +1760,24 @@
lt%0A%0A
-
sign = 1%0A
@@ -1769,28 +1769,24 @@
sign = 1%0A
-
if s
@@ -1815,23 +1815,15 @@
-
-
i += 1%0A
-
@@ -1854,28 +1854,24 @@
-
-
sign = -1%0A
@@... |
4c21c20f047b1c1fc61fe32f92693431235f217e | Add port to ladder | lcapy/laddermaker.py | lcapy/laddermaker.py | import numpy as np
from .oneport import Ser, Par
from .netlisthelper import NetlistHelper
class LadderMaker(NetlistHelper):
def __init__(self, net):
self.net = net
self.s = ''
self.first_cpt = None
self.first_series = None
self.first_parallel = None
def _add(self, s):... | Python | 0.000001 | @@ -604,32 +604,138 @@
(n1, n2, dir))%0A%0A
+ def _port_add(self, n1, n2, dir='right'):%0A self._add('P %25s %25s; %25s%5Cn' %25 (n1, n2, dir)) %0A%0A
def _split(s
@@ -1312,214 +1312,37 @@
Ser.
- Only one arg can have a depth more than 1.%0A depths = net._depths%0A num = sum(%5Bde... |
7e733c79dfd354b8689af4961547d97b0f948326 | Remove unnecessary setting | egielda/settings.py | egielda/settings.py | # coding=utf-8
"""
Django settings for egielda project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BA... | Python | 0.00001 | @@ -2323,39 +2323,8 @@
ome'
-%0ALOGIN_URL = '/accounts/login/'
%0A%0A#
|
e1e03925fdb108f4e045ba1e626be4a8c3a84b2a | add classify to the commandline | svtools/cli.py | svtools/cli.py | import argparse, sys
import svtools.lsort
import svtools.lmerge
import svtools.vcfpaste
import svtools.copynumber
import svtools.afreq
import svtools.bedpetobed12
import svtools.bedpetovcf
import svtools.vcftobedpe
import svtools.vcfsort
import svtools.bedpesort
import svtools.genotype
import svtools.prune
import svtoo... | Python | 0.999163 | @@ -325,16 +325,45 @@
arlookup
+%0Aimport svtools.sv_classifier
%0A%0Aclass
@@ -3341,16 +3341,172 @@
ookup)%0A%0A
+ classifier = subparsers.add_parser('classify', help=svtools.sv_classifier.description())%0A svtools.sv_classifier.add_arguments_to_parser(classifier)%0A%0A
retu
|
c5f9a02843fd85e9622597c831f238d3daa86ee4 | Update the build number | src/version.py | src/version.py | BUILD = 11
| Python | 0.000002 | @@ -3,10 +3,10 @@
UILD = 1
-1
+2
%0A
|
7285687cf8e36553dc5419779f5bfefd523b80ba | Test that periods of holidays are matched. | education/test/test_util_functions.py | education/test/test_util_functions.py | # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from datetime import date, time, datetime, timedelta
from unittest import TestCase
import dateutils
from django.conf import settings
from education.reports import is_holiday
from education.utils import get_week_count, get_months, _next_thursday
class TestUtilFunctions(TestC... | Python | 0 | @@ -1438,32 +1438,439 @@
L_HOLIDAYS')))%0A%0A
+ def test_should_return_true_if_given_date_is_in_holidays(self):%0A holidays = %5B(datetime(2012, 1, 1), datetime(2012, 1, 3))%5D%0A self.assertTrue(is_holiday(datetime(2012,1,2), holidays))%0A%0A def test_should_return_true_if_given_date_is_not_in_hol... |
9d21f3ba8d081fcdd30f1566e28d1fc0568542cb | metadata sync should be wrappertask | tasks/carto.py | tasks/carto.py | '''
Tasks to sync data locally to CartoDB
'''
from tasks.meta import session_scope, BMDTable, Base
from tasks.util import TableToCarto
from luigi import Task, WrapperTask, BooleanParameter
class SyncMetadata(Task):
force = BooleanParameter(default=True)
def requires(self):
for tablename, _ in Base... | Python | 0.999871 | @@ -151,14 +151,8 @@
port
- Task,
Wra
@@ -199,16 +199,23 @@
etadata(
+Wrapper
Task):%0A%0A
|
7d0b81075b26782155cbcb77576e29b72c2fac86 | Update forms.py | terms/forms.py | terms/forms.py | # coding: utf-8
from __future__ import unicode_literals
from django.conf import settings
from django.db.models import Q
from django.forms import ModelForm, TextInput, ValidationError
from django.utils.translation import ugettext as _
from .models import Term
from .settings import AVAILABLE_WIDGETS, TERMS_DEFINITION_WI... | Python | 0.000001 | @@ -1937,10 +1937,54 @@
', 'url'
+, 'teaser_title', 'teaser_img', 'teaser_txt'
)%0A
|
7b17da483d7aaef5353d3d19ca5a81089c0ad647 | remove primitive bad pixels correction | test-viewer.py | test-viewer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys, re, subprocess
import numpy as np
import cv2
if __name__ == '__main__':
cmd = ['./build/seek-test']
proc = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
)
grid_fn = '1grid.png'
if os.path.exists(grid_fn):
grid = cv2.imread('1grid.png')/255
grid... | Python | 0.000001 | @@ -222,166 +222,8 @@
%09)%0A%0A
-%09grid_fn = '1grid.png'%0A%09if os.path.exists(grid_fn):%0A%09%09grid = cv2.imread('1grid.png')/255%0A%09%09grid, a, b = cv2.split(grid)%0A%09else:%0A%09%09grid = np.zeros((156, 208))%0A%0A
%09cv2
@@ -754,76 +754,8 @@
n)%0A%0A
-%09%09%09b = cv2.blur(img, (9,9))%0A%09%09%09a = img *... |
0f86706e6405e75120cad2a4cf8f387d45bde0a1 | Version bump | oauth_api/__init__.py | oauth_api/__init__.py | __version__ = '0.1.3'
| Python | 0.000001 | @@ -14,9 +14,7 @@
'0.
-1.3
+2
'%0A
|
069512c4d5ee2ffe0ead486138576ac2ae04e0cf | Update version to 1.10.5 | validator/__init__.py | validator/__init__.py | __version__ = '1.10.4'
class ValidationTimeout(Exception):
"""Validation has timed out.
May be replaced by the exception type raised by an external timeout
handler when run in a server environment."""
def __init__(self, timeout):
self.timeout = timeout
def __str__(self):
return ... | Python | 0 | @@ -17,9 +17,9 @@
.10.
-4
+5
'%0A%0A%0A
|
bbb3274333b7527604bcd8e87bb0e61929a83f78 | Set program version to 1.2.0 | objbrowser/version.py | objbrowser/version.py | """ Version info for objbrowser
"""
import os, sys
import objbrowser.qtpy, objbrowser.qtpy._version
DEBUGGING = False
PROGRAM_NAME = 'objbrowser'
PROGRAM_VERSION = '1.2.0-dev'
PROGRAM_URL = 'https://github.com/titusjan/objbrowser'
PROGRAM_DIRECTORY = os.path.abspath(os.path.dirname(__file__))
PYTHON_VERSION = "%d.%d... | Python | 0.001561 | @@ -169,12 +169,8 @@
.2.0
--dev
'%0APR
|
cfe783c46d4543489298d6eccdc687063a9748f5 | Use `make_residual_image` in solve_multiple_shards.py | solve_multiple_shards.py | solve_multiple_shards.py | # solve_multiple_shards.py
# Imports
import argparse
import matplotlib.pyplot as plt
import numpy as np
import os
import visualise_progress as vis
from functools import partial
from operator import itemgetter
from pickle_ import dump
from reconstruct import ShardReconstructor
from time import time
# main
def main():... | Python | 0.000011 | @@ -2745,16 +2745,127 @@
e=True)%0A
+ vis.make_residual_image(I, J1s%5B-1%5D, %0A output_dir, verbose=True)%0A
|
8362da9dbf7f63c37b70c1793b53d867529ef893 | Remove left-over debug message | ohai_kit/singleton.py | ohai_kit/singleton.py | # Written by Senko Rasic <senko.rasic@goodcode.io>
# Released into Public Domain. Use it as you like.
from django.db import models
class SingletonModel(models.Model):
"""Singleton Django Model
Ensures there's always only one entry in the database, and can fix the
table (by deleting extra entries) even i... | Python | 0.000001 | @@ -1295,58 +1295,8 @@
ry:%0A
- print %22Trying to load object from DB%22%0A
@@ -1365,60 +1365,8 @@
st:%0A
- print %22Not found: Returning new object%22%0A
|
dc7260a67d012f6b9a78d361b16f902dbb612e94 | Append out_file.path to args instead of out_file (#201) | stardoc/stardoc.bzl | stardoc/stardoc.bzl | # Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | Python | 0 | @@ -2492,32 +2492,37 @@
put=%22 + out_file
+.path
)%0A ctx.ac
|
fbc4c3f4f5a50e515489ea7199e6307c59a0dd34 | Add prototype actors for RPC (this is an experiment) | cell/workflow/entities.py | cell/workflow/entities.py | """cell.actors"""
from __future__ import absolute_import, with_statement
import sys
import traceback
from itertools import count
from operator import itemgetter
from .monads import callcc, done, ContinuationMonad, do, mreturn, MonadReturn
from .utils.utils import lazy_property
from kombu import Consumer, Exchange,... | Python | 0 | @@ -3628,321 +3628,8 @@
w)%0A%0A
-class Forwarder(Actor):%0A %0A def __init__(self, input_actors = None, output_actors = None):%0A self.input = input_actors%0A self.output = output_actors%0A %0A def main(self):%0A body, message = yield self.receive()%0A self.true_channel.send(b... |
906abea3ee0c3dbd7470ac8390802d4bb4897162 | Update for workign with the RoboRIO broker. | mqttClient.py | mqttClient.py | import paho.mqtt.client as mqtt
import sys
import socket
import time
class MqttClient:
def __init__(self, host, port, topics, messageHandler = None):#, userdata = None):
self.__isConnected = False
self.__host = host
self.__port = port
self.__topics = topics
self._... | Python | 0 | @@ -597,18 +597,16 @@
andler%0D%0A
-%0D%0A
@@ -640,32 +640,8 @@
t()%0D
-%0A self.connect()%0D
%0A%0D%0A
@@ -1303,24 +1303,121 @@
raise%0D%0A%0D%0A
+ def publish(self, topic, payload):%0D%0A self.__pahoClient.publish(topic, payload) %0D%0A%0D%0A
def isCo
@@ -1698,17 +1698,17 @@... |
4c5de3c7a031155488248563ab2d98fd6f40ba15 | improve http server example | examples/http/http_server.py | examples/http/http_server.py | from http.client import parse_headers
from io import BytesIO
from whoops import ioloop, async_server
class HttpServer(async_server.AsyncServer):
def __init__(self, ioloop, address):
super(HttpServer, self).__init__(ioloop, address)
self.rbufsize = -1
self.wbufsize = 0
self.rfile... | Python | 0.000002 | @@ -183,16 +183,17 @@
dress):%0A
+%0A
@@ -242,17 +242,55 @@
ddress)%0A
+ self.host, self.port = address
%0A
-
@@ -520,17 +520,8 @@
%5B%5D%0A%0A
- %0A
@@ -799,16 +799,54 @@
(65537)%0A
+ # print(self.raw_requestline)%0A
@@ -884,16 +884,45 @@
f.rfile)
+%0A ... |
543d32ee3ce44b972a80cf0f69151d13199a9cc1 | use -g:off and -g:none to avoid the group animations prompt | etc/scene-viewer.py | etc/scene-viewer.py | # GamePlay 3D Blender Scene Viewer
#
# Copyright 2013 Ithai Levi
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0.000001 | @@ -3159,24 +3159,58 @@
(%22-g:none%22)%0A
+ args.append(%22-g:off%22)%0A
if b
|
905cfd584c3e2f5d2c63219e13e0063e661e6fe0 | implement changeset expansion here; trying to use the normal install path was a nightmare | conary/build/derivedrecipe.py | conary/build/derivedrecipe.py | # Copyright (c) 2006,2007 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/li... | Python | 0 | @@ -592,16 +592,23 @@
rt files
+, trove
%0Afrom co
@@ -798,16 +798,56 @@
port log
+%0Afrom conary.repository import changeset
%0A%0Aclass
@@ -1311,102 +1311,1183 @@
def
-unpackSources(self, builddir, destdir, resume=None,%0A downloadOnly=False):
+_expandChangeset(self):%0A destdir = s... |
024a957e536681b93d2fd84f6c4616fadc689467 | Fix typo, thanks to Johannes Schumann | examples/nogallery/module_workflow.py | examples/nogallery/module_workflow.py | #!/usr/bin/env python
from __future__ import division, absolute_import, print_function
__author__ = 'tamasgal'
from km3pipe.core import Pipeline, Module, Pump
class DummyPump(Pump):
"""A pump demonstration with a dummy list as data."""
def configure(self):
self.data = [{'nr': 1}, {'nr': 2}]
... | Python | 0.000005 | @@ -1341,16 +1341,21 @@
.attach(
+Dummy
Pump, 't
|
bb3b997f33413df54ca9c9d5e9cfa13264141a82 | clarify utils.stripList() docstring | nupic/data/utils.py | nupic/data/utils.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-15, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This pro... | Python | 0.000019 | @@ -4260,16 +4260,26 @@
rs to a
+string of
space-se
@@ -4286,20 +4286,23 @@
parated
-list
+numbers
.%22%22%22%0A r
|
deb39eeb54ee0d87f5251ac8ac3ab232746c584d | Fix default dtype resolution code in cifar.py | chainer/datasets/cifar.py | chainer/datasets/cifar.py | import os
import sys
import tarfile
import numpy
import six.moves.cPickle as pickle
from chainer.dataset import download
from chainer.datasets import tuple_dataset
def get_cifar10(withlabel=True, ndim=3, scale=1., dtype=None):
"""Gets the CIFAR-10 dataset.
`CIFAR-10 <https://www.cs.toronto.edu/~kriz/cifar.... | Python | 0.000002 | @@ -79,16 +79,31 @@
pickle%0A%0A
+import chainer%0A
from cha
@@ -6352,17 +6352,16 @@
chainer.
-_
get_dtyp
|
866793779d9f631c05fa7f59592de558ee0ca428 | Use salary as summary | examples/list/kitchensink.py | examples/list/kitchensink.py | # encoding: utf-8
import datetime
import random
import time
import gtk
from kiwi.datatypes import currency
from kiwi.ui.objectlist import (Column, ObjectList, SequentialColumn,
ColoredColumn, SummaryLabel)
def random_date():
max = datetime.datetime.today()
min = max.replace(... | Python | 0.000244 | @@ -2287,19 +2287,22 @@
column='
-age
+salary
', label
|
faa37e8a908bfd82effbcc941d0df05b8ff01e90 | Fix unpacking and newline errors | netconsole/netconsole.py | netconsole/netconsole.py |
from argparse import ArgumentParser
import socket
import struct
import sys
import threading
import time
from ._fakeds import FakeDS
__all__ = ['Netconsole', 'main', 'run']
def _output_fn(s):
sys.stdout.write(s.encode(sys.stdout.encoding, errors='replace').decode(sys.stdout.encoding))
class StreamEOF(IOError):... | Python | 0.000004 | @@ -286,16 +286,43 @@
coding))
+%0A sys.stdout.write('%5Cn')
%0A%0Aclass
@@ -5147,17 +5147,17 @@
truct('%3E
-d
+f
HHiB')%0A
@@ -5230,17 +5230,17 @@
truct('%3E
-d
+f
H')%0A
|
bc2cae81722506a95827bc33378693b3fd39f70c | Test cases | test_router.py | test_router.py | from __future__ import with_statement
import sys
import unittest
from flask import Flask
from flask_router import Router
if sys.version_info[0] < 3:
b = lambda s: s
else:
b = lambda s: s.encode('utf-8')
# The main functions have to be defined outside
# the RouterTestCase class, since their context
# wo... | Python | 0.000001 | @@ -355,28 +355,94 @@
how(
-):%0A return 'show'
+id=None):%0A if not id:%0A return 'show'%0A else:%0A return 'show %25s' %25 id
%0A%0Ade
@@ -509,16 +509,72 @@
pdate'%0A%0A
+def regex(action=None):%0A return 'regex %25s' %25 action%0A%0A
%0Aclass R
@@ -756,24 +756,76 @@
:%5B'GET'%5D%7D),%0... |
28555e1c35eee5a718396fdef1c14447d34e6acc | fix after cleanup | example/settings.py | example/settings.py | import os
import sys
WEBAPP_DIR = os.path.dirname(os.path.abspath(__file__))
APP_BASEDIR = os.path.abspath(os.path.join(WEBAPP_DIR, os.path.pardir))
DEBUG = any((cmd in sys.argv for cmd in (
'runserver', 'shell', 'dbshell', 'sql', 'sqlall')))
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('FEINHEIT Developers', 'dev@fein... | Python | 0.000001 | @@ -2067,51 +2067,13 @@
c%22,%0A
-%0A
-# required by django-admin-tools%0A '
+%22
djan
@@ -2110,122 +2110,10 @@
uest
-',%0A%0A 'allauth.account.context_processors.account',%0A 'allauth.socialaccount.context_processors.socialaccount'
+%22,
%0A)%0A%0A
@@ -2193,67 +2193,8 @@
d',%0A
- 'allauth.accoun... |
b90b464b3cf8dc2de0bded8b2554fd53fe9ce4d6 | Add test for dict-like | test_sempai.py | test_sempai.py | import jsonsempai
import os
import shutil
import sys
import tempfile
TEST_FILE = '''{
"three": 3,
"one": {
"two": {
"three": 3
}
}
}'''
class TestSempai(object):
def setup(self):
self.direc = tempfile.mkdtemp(prefix='jsonsempai')
sys.path.append(self.dire... | Python | 0.000001 | @@ -737,32 +737,136 @@
two.three == 3%0A%0A
+ def test_acts_like_dict(self):%0A import sempai%0A assert sempai.one.two == %7B%22three%22: 3%7D%0A%0A
def test_loc
|
5b9023fd4e338a065f813977c956ea7ac1bfff91 | Refactor examples/mnist/train_test.py from testing single epoch to single train step. This is to make the tests across examples consistent. | examples/mnist/train_test.py | examples/mnist/train_test.py | # Copyright 2020 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Python | 0 | @@ -725,29 +725,8 @@
om%0A%0A
-import numpy as onp%0A%0A
# Pa
@@ -858,23 +858,25 @@
est_
-train_one_epoch
+single_train_step
(sel
@@ -893,23 +893,17 @@
ain_ds,
-test_ds
+_
= train
@@ -926,45 +926,23 @@
-input_rng = onp.random.RandomState(0)
+batch_size = 32
%0A
@@ -1044,29 +1044,22 @@
1, 0.9)%0A
+%0A... |
9006898036d9f877e450b3dad605450fb98a1f0d | Fix #265 - Wrong introspection rule for GeoDjango 1.0 | south/introspection_plugins/geodjango.py | south/introspection_plugins/geodjango.py | """
GeoDjango introspection rules
"""
import django
from django.conf import settings
from south.modelsinspector import add_introspection_rules
has_gis = "django.contrib.gis" in settings.INSTALLED_APPS
if has_gis:
# Alright,import the field
from django.contrib.gis.db.models.fields import GeometryField
... | Python | 0 | @@ -1001,24 +1001,16 @@
ex%22: %5B%22_
-spatial_
index%22,
|
289f23df515c168ef7d2ae57e6054fefa07def3c | Test beam parsing | spacy/tests/parser/test_neural_parser.py | spacy/tests/parser/test_neural_parser.py | # coding: utf8
from __future__ import unicode_literals
from thinc.neural import Model
from mock import Mock
import pytest
import numpy
from ..._ml import chain, Tok2Vec, doc2feats
from ...vocab import Vocab
from ...pipeline import TokenVectorEncoder
from ...syntax.arc_eager import ArcEager
from ...syntax.nn_parser imp... | Python | 0 | @@ -1808,8 +1808,245 @@
) == 0.%0A
+%0A%0Adef test_predict_doc_beam(parser, tok2vec, model, doc):%0A doc.tensor = tok2vec(%5Bdoc%5D)%5B0%5D%0A parser.model = model%0A parser(doc, beam_width=32, beam_density=0.001)%0A for word in doc:%0A print(word.text, word.head, word.dep_)%0A
|
4a594d22b371b0ca85c0235e8aa866cb23b780de | fix typo | examples/plot_delta_field.py | examples/plot_delta_field.py | #!/usr/bin/env python
import argparse
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import h5py
import qusp
def main():
# parse command-line arguments
parser = argparse.ArgumentParser(
formatter_class=argparse.Argu... | Python | 0.999991 | @@ -2003,16 +2003,50 @@
tride%5D%0A%0A
+ zmax = 7%0A max_scale = 1.2%0A%0A
if a
@@ -2099,25 +2099,24 @@
(14,8))%0A
-%0A
z_cosra
@@ -2111,137 +2111,163 @@
-z_cosra = redshift * np.cos(ra)%0A z_sinra = redshift * np.sin(ra)%0A%0A plt.scatter(z_cosra, z_sinra, marker='.', s=.1)... |
91f260f2c4c260f51e9a2529da6c028b968e5ce7 | Add another test for #1971 | spacy/tests/regression/test_issue1971.py | spacy/tests/regression/test_issue1971.py | # coding: utf8
from __future__ import unicode_literals
import pytest
from spacy.matcher import Matcher
from spacy.tokens import Token, Doc
@pytest.mark.xfail
def test_issue1971(en_vocab):
# Possibly related to #2675 and #2671?
matcher = Matcher(en_vocab)
pattern = [
{"ORTH": "Doe"},
{"ORT... | Python | 0.000001 | @@ -1801,8 +1801,644 @@
1, 2)%5D)%0A
+%0A%0A# @pytest.mark.xfail%0Adef test_issue_1971_4(en_vocab):%0A %22%22%22Test that pattern matches correctly with multiple extension attribute%0A values on a single token.%0A %22%22%22%0A Token.set_extension(%22ext_a%22, default=%22str_a%22)%0A Token.set_extension(... |
b31fd6d7c8f51f0b749107cb3848d8541b4814c9 | remove assertion | examples/pspnet/caffe2npz.py | examples/pspnet/caffe2npz.py | import argparse
from google.protobuf import text_format
import numpy as np
import re
from chainer import serializers
from chainercv.experimental.links import PSPNetResNet101
import caffe_pb2
def copy_conv(layer, config, conv, has_bias=False, inverse_ch=False):
data = np.array(layer.blobs[0].data)
conv.W.dat... | Python | 0.999944 | @@ -478,66 +478,8 @@
ata)
-%0A%0A assert layer.convolution_param.bias_term == has_bias
%0A
|
cfd608f4cbe81bc621f2cff90934a181b1fb0aae | about_true_and_false | python3/koans/about_true_and_false.py | python3/koans/about_true_and_false.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutTrueAndFalse(Koan):
def truth_value(self, condition):
if condition:
return 'true stuff'
else:
return 'false stuff'
def test_true_is_treated_as_true(self):
self.assertEqual(__, s... | Python | 0.999942 | @@ -300,34 +300,44 @@
elf.assertEqual(
-__
+'true stuff'
, self.truth_val
@@ -410,34 +410,45 @@
elf.assertEqual(
-__
+'false stuff'
, self.truth_val
@@ -521,34 +521,45 @@
elf.assertEqual(
-__
+'false stuff'
, self.truth_val
@@ -631,34 +631,45 @@
elf.assertEqual(
-__
+'false stuff'
, self.truth_val
@@ -752,34 +7... |
1bd1b3ccebe2dfe5338ef0957e2555fe8818715f | update random_integers to randint | pyamg/gallery/random_sparse.py | pyamg/gallery/random_sparse.py | """Random sparse matrices"""
import numpy as np
import scipy as sp
__all__ = ['sprand']
__docformat__ = "restructuredtext en"
# TODO add sprandn
def _rand_sparse(m, n, density, format='csr'):
"""Helper function for sprand, sprandn"""
nnz = max(min(int(m*n*density), m*n), 0)
row = np.random.random_int... | Python | 0.000385 | @@ -303,35 +303,27 @@
.random.rand
-om_integers
+int
(low=0, high
@@ -366,19 +366,11 @@
rand
-om_integers
+int
(low
|
83f6775d0fb427ef9a15cb9dadd3cdf044620623 | Add ondelete. | pybossa/model/project_stats.py | pybossa/model/project_stats.py | # -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2015 Scifabric LTD.
#
# PYBOSSA 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 op... | Python | 0 | @@ -1146,15 +1146,8 @@
#:
- Webook
ID%0A
@@ -1200,39 +1200,18 @@
#:
-Webhook created (aka triggered)
+Project ID
%0A
|
8802bde96a76b265c0468fadb75a1b5859f58250 | Fix export for sponsor information on badges | pyconde/attendees/exporters.py | pyconde/attendees/exporters.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.conf import settings
from django.core.urlresolvers import reverse
LOG = logging.getLogger('pyconde.attendees')
class PurchaseExporter(object):
"""
This exporter takes an pyconde.attendees.Purchase object and exports... | Python | 0 | @@ -6740,20 +6740,18 @@
add(
-_('S
+'s
ponsor')
)%0A%0A
@@ -6746,17 +6746,16 @@
ponsor')
-)
%0A%0A
|
2eea2d5a366af0e4b76d2fcd73e1cef5d6250c8c | remove unused import | pyfarm/agent/http/api/tasks.py | pyfarm/agent/http/api/tasks.py | # No shebang line, this module is meant to be imported
#
# Copyright 2014 Oliver Palmer
# Copyright 2014 Ambient Entertainment GmbH & Co. KG
#
# 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
#
... | Python | 0.000001 | @@ -964,53 +964,8 @@
D)%0A%0A
-from twisted.web.server import NOT_DONE_YET%0A%0A
from
|
326b19babc833aa7771bfb1bc26c88a064603e32 | Support Lambert Azimuthal Equal Area proj | pysteps/visualization/utils.py | pysteps/visualization/utils.py | """Miscellaneous utility functions."""
try:
import cartopy.crs as ccrs
cartopy_imported = True
except ImportError:
cartopy_imported = False
try:
import pyproj
pyproj_imported = True
except ImportError:
pyproj_imported = False
def parse_proj4_string(proj4str):
"""Construct a dictionary from... | Python | 0 | @@ -3443,32 +3443,114 @@
nsverseMercator%0A
+ elif v == %22laea%22:%0A cl = ccrs.LambertAzimuthalEqualArea%0A
elif
|
d4e2aebec83880b0a8df4cc53901e6545bf7a530 | Move the alphabet to the trie constructor | python/data_structures/trie.py | python/data_structures/trie.py | # -*- coding: utf-8 -*-
"""
Trie
----
Based on the proposed C/C++ implementation by
Yannis Chatzimichos @ https://git.softlab.ntua.gr/public/pdp-camp/blob/master/2013/advanced_data_structures.pdf
Supports
- multiple insertions of the same word
- count the words that have a specific prefix... | Python | 0.999999 | @@ -1033,24 +1033,64 @@
_init__(self
+, alphabet = %22abcefghijklmnopqrstuvwxyz%22
):%0A #
@@ -1127,55 +1127,8 @@
es.%0A
- alphabet = %22abcefghijklmnopqrstuvwxyz%22%0A
|
797bd9842faa4b1cd29d713aa4721379fd56e2b6 | Add test-credentials command | python/leosacpy/scripts/cli.py | python/leosacpy/scripts/cli.py | import logging
from types import SimpleNamespace
import click
import colorama
from click_repl import register_repl
import leosacpy.cli.dev.dev
from leosacpy.utils import guess_root_dir
# The debug flag is set globally.
# This is because when running "leosaccli --debug shell"
# we want all command running in the REPL t... | Python | 0 | @@ -41,16 +41,32 @@
amespace
+%0A%0Aimport asyncio
%0Aimport
@@ -360,16 +360,57 @@
ned on.%0A
+from leosacpy.wsclient import LeosacAPI%0A%0A
sticky_d
@@ -1045,16 +1045,16 @@
ot_dir:%0A
-
@@ -1114,16 +1114,483 @@
ory.')%0A%0A
+@cli_entry_point.command(name='test-credentials')%0A@click.argument('username... |
f9d606fd7b5833ed43c5f2ae720f7dcc4764543e | Update serializer.py | python_rucaptcha/serializer.py | python_rucaptcha/serializer.py | from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel
from pydantic import BaseModel, ValidationError, validator
from uuid import uuid4
class CaptchaOptionsSer(BaseModel):
phrase: bool = False
caseSensitive: bool = False
numeric: int = 0
calc: bool = False
... | Python | 0.000001 | @@ -2,180 +2,75 @@
rom
-datetime import datetime%0Afrom typing import List, Optional%0Afrom pydantic import BaseModel%0Afrom pydantic import BaseModel, ValidationError, validator%0A%0Afrom uuid import uuid4
+uuid import uuid4%0A%0Afrom pydantic import Field, BaseModel, validator
%0A%0A%0Ac
@@ -1092,30 +1092,51 @@
s... |
3712295e7f3a1e54e468a2d3a1095ebb4d7154db | implement naive bayes fitting | pytrain/nbayes/basic_nbayes.py | pytrain/nbayes/basic_nbayes.py |
class basic_nbayes:
def __init__(self, mat_data, label_data):
self.mat_data = mat_data
self.label_data = label_data
pass
def fit(self):
print "fitting----------------------"
num_row = len(self.mat_data)
num_col = len(self.mat_data[0])
pass
def... | Python | 0.000038 | @@ -1,8 +1,27 @@
+from numpy import *
%0A%0Aclass
@@ -90,27 +90,28 @@
self.
-mat
+word
_data = mat_
@@ -132,204 +132,644 @@
elf.
-label_data = label_data%0A pass%0A%0A def fit(self):%0A print %22fitting----------------------%22%0A num_row = len(
+num_word = 0%0A %0A sel... |
c1b72fc43d8834638447f5216c8d11edb60a7cc7 | Clean up code to reduce duplication | qiskit/aqua/utils/subsystem.py | qiskit/aqua/utils/subsystem.py | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | Python | 0.00366 | @@ -2094,24 +2094,71 @@
ystem_counts
+, post_select_index=None, post_select_flag=None
):%0A %22%22%22%0A
@@ -2827,1008 +2827,272 @@
'.%0A%0A
-%0A
-Args:%0A complete_system_counts (dict): The measurement count dictionary of a complete system%0A that contains multiple classical registers fo... |
51805b0660661d08840b18452245313ca8ebc3d7 | Version bump 0.5.10 | opengrid/__about__.py | opengrid/__about__.py | # -*- coding: utf-8 -*-
__all__ = ['__title__', '__summary__', '__url__', '__version__', '__author__', '__email__', '__license__']
__title__ = 'opengrid'
__summary__ = 'Open-source algorithms for data-driven building analysis and control'
__version__ = '0.5.9'
__author__ = 'Roel De Coninck and many others'
__email__ =... | Python | 0.000001 | @@ -256,9 +256,10 @@
0.5.
-9
+10
'%0A__
|
021bb5d97a13a73e4ffdab81689118b7c3153d10 | Revert file | rasa/core/policies/fallback.py | rasa/core/policies/fallback.py | import json
import logging
import os
from typing import Any, List, Text
from rasa.core.actions.action import ACTION_LISTEN_NAME
import rasa.utils.io
from rasa.core import utils
from rasa.core.domain import Domain
from rasa.core.policies.policy import Policy
from rasa.core.trackers import DialogueStateTracker
logger... | Python | 0.000002 | @@ -1891,30 +1891,27 @@
def
-nlu_has_low_confidence
+should_nlu_fallback
(%0A
@@ -2316,92 +2316,8 @@
)%0A%0A
- def nlu_is_confused(%0A%0A ) -%3E bool:%0A %22%22%22Check if NLU %22%22%22%0A%0A pass%0A%0A
@@ -2744,16 +2744,17 @@
%22Predict
+s
a fallb
@@ -2963,16 +2963,17 @@
se_data%0A... |
794302dd6e5108f6d8a52cff2a44cf61d60c7f6d | Set OPPS_PAGINATE_NOT_APP is list ([]) | opps/core/__init__.py | opps/core/__init__.py | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from appconf import AppConf
trans_app_label = _('Core')
class OppsCoreConf(AppConf):
DEFAULT_URLS = ('127.0.0.1', 'localhost',)
SHORT = 'googl'
SHORT_URL = 'googl.short.GooglUrlShort'
CH... | Python | 0.000005 | @@ -395,24 +395,50 @@
UFFIX = u''%0A
+ PAGINATE_NOT_APP = %5B%5D%0A
CHECK_MO
|
3590b8bfebd14f439270b2fb89e9e6c3c6e5ed6f | fix name of test | weboob/backends/cragr/test.py | weboob/backends/cragr/test.py | # -*- coding: utf-8 -*-
# Copyright(C) 2010 Romain Bignon
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will b... | Python | 0.998764 | @@ -823,14 +823,13 @@
est_
-bnporc
+cragr
(sel
|
83fb8a8468e7d7bd31012ec688797dd57ca96d0f | Version bump. | orchestra/__init__.py | orchestra/__init__.py | # The current Orchestra version.
__version__ = '0.1.28'
default_app_config = 'orchestra.apps.OrchestraAppConfig'
| Python | 0 | @@ -50,9 +50,9 @@
.1.2
-8
+9
'%0A%0Ad
|
049e171f7e12ad4b1886bcf1e1ba603f337d410c | DoesNoExist typo | rdrf/registry/groups/models.py | rdrf/registry/groups/models.py | from django.contrib.auth.models import User as AuthUser
from django.contrib.auth.models import Group
from django.contrib.auth.models import AbstractUser, BaseUserManager
from django.db.models.signals import post_save
from django.db import models, transaction
from django.dispatch import receiver
from django.dispatch i... | Python | 0.999812 | @@ -2224,24 +2224,25 @@
istry.DoesNo
+t
Exist:%0A
@@ -2406,16 +2406,17 @@
p.DoesNo
+t
Exist:%0A
|
cd1b264ea8ee45ecca403dbcd76ef2a21311e8c6 | add regex routine | ott/utils/re_utils.py | ott/utils/re_utils.py | import re
import logging
log = logging.getLogger(__file__)
| Python | 0.000026 | @@ -53,8 +53,273 @@
ile__)%0A%0A
+def contains(regexp, str):%0A ''' does string have one or more instances of regexp%0A '''%0A ret_val = False%0A try:%0A a = re.findall(regexp, str.strip())%0A if a and len(a) %3E 0:%0A ret_val = True%0A except:%0A pass%0A return ret_va... |
f00c0c7d2d275ae8daf4442ab922022b28f67cd8 | Add marketing dependencies. | website_slides/__openerp__.py | website_slides/__openerp__.py | # -*- coding: utf-8 -*-
# #############################################################################
#
# Odoo, Open Source Management Solution
# Copyright (C) 2014-TODAY Odoo SA (<https://www.odoo.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | Python | 0 | @@ -1329,22 +1329,67 @@
te',
- 'website_mail
+%0A 'website_mail',%0A 'marketing
'%5D,%0A
|
fe0c7836f054011017c7a5018d433bbf6e26b078 | Update agent for environment. | reinforcement-learning/play.py | reinforcement-learning/play.py | """This is the agent which currently takes the action with highest immediate reward."""
import env
env.make("text")
for episode in range(10):
env.reset()
episode_reward = 0
for t in range(100):
episode_reward += env.actual_reward
if env.done:
print(
"Episode %d ... | Python | 0 | @@ -93,16 +93,28 @@
ort env%0A
+import time%0A
env.make
@@ -119,12 +119,14 @@
ke(%22
-text
+pygame
%22)%0A%0A
|
d621303a5fcf466e2d8cefad25996993c916b979 | Add test for second function call. | PySrc/tests/code_tracer_test.py | PySrc/tests/code_tracer_test.py | import unittest
from code_tracer import CodeTracer
class CodeTracerTest(unittest.TestCase):
# Other things to test:
# multiline variable value.
# calling a second function
# imports
# making print work?
def test_empty(self):
# EXEC
report = CodeTracer().trace_code("")
expected_report = ""... | Python | 0 | @@ -2801,32 +2801,73 @@
# VERIFY%0A
+ self.assertEqual(%5B%5D, tracer.log)%0A
self.ass
@@ -3261,32 +3261,479 @@
ace_code(code)%0A%0A
+ # VERIFY%0A self.assertEqual(expected_report.splitlines(), report.splitlines())%0A %0A def ignore_function_called_twice(self):%0A ... |
c811a4a4848cb4041478041e1707ac19cf55e420 | Convert unicode paramets to utf-8. | nexmomessage/nexmo.py | nexmomessage/nexmo.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Marco Londero <marco.londero@linux.it>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code m... | Python | 0.999995 | @@ -2647,27 +2647,8 @@
cept
- UnicodeDecodeError
:%0A
@@ -6187,24 +6187,123 @@
'reqtype'%5D)%0A
+ for k, v in params.iteritems():%0A params%5Bk%5D = unicode(v).encode('utf-8')%0A
|
0b92361118e696e04f3fe49e879b63b1c760df18 | fix - args + make executable. | versus/src/web/run.py | versus/src/web/run.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This module defines the entry point for flask_ web server implementation
of the test.com. This module is consumable
by the Apache web server via WSGI interface via mod_wsgi. An Apache
server can be pointed to api.wsgi such that Apache may be used as a
... | Python | 0 | @@ -4,16 +4,20 @@
usr/bin/
+env
python%0A#
@@ -1685,26 +1685,21 @@
int for
-git deploy
+flask
.%22,%0A
@@ -1768,42 +1768,20 @@
ge=%22
-git-deploy method %5Bremote%5D %5Bbranch
+run.py %5BOPTS
%5D%22%0A
@@ -1833,83 +1833,26 @@
nt%5D
-%22%0A %22
%5Cn%5Ct%5B-
-d --debug%5D %5Cn%5Ct%5B-c --coun... |
7691287e5f2563db8a0a6dcf2de042306b359d46 | Fix buildbots that are failing due to this test by adding all expected fails that TestMultipleDebuggers.py has. | packages/Python/lldbsuite/test/api/multiple-targets/TestMultipleTargets.py | packages/Python/lldbsuite/test/api/multiple-targets/TestMultipleTargets.py | """Test the lldb public C++ api when creating multiple targets simultaneously."""
from __future__ import print_function
import os
import re
import subprocess
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestMultipleTargets(Test... | Python | 0.000005 | @@ -462,16 +462,283 @@
hRemote%0A
+ @expectedFailureAll(%0A archs=%22i%5B3-6%5D86%22,%0A bugnumber=%22multi-process-driver.cpp creates an x64 target%22)%0A @expectedFailureAll(%0A oslist=%5B%0A %22windows%22,%0A %22linux%22,%0A %22freebsd%22%5D,%0A bug... |
f619a75e1c2e14d5f18b54d0e0f8c6488efed38b | Add pagination to case id fetching | corehq/messaging/tasks.py | corehq/messaging/tasks.py | from __future__ import absolute_import
from __future__ import unicode_literals
from corehq.apps.data_interfaces.models import AutomaticUpdateRule
from corehq.apps.sms import tasks as sms_tasks
from corehq.form_processor.exceptions import CaseNotFound
from corehq.form_processor.interfaces.dbaccessors import CaseAccessor... | Python | 0.000001 | @@ -715,24 +715,69 @@
ed_databases
+, paginate_query_across_partitioned_databases
%0Afrom corehq
@@ -3618,24 +3618,283 @@
rule_id))%0A%0A%0A
+def paginated_case_ids(domain, case_type):%0A for case in paginate_query_across_partitioned_databases(CommCareCaseSQL,%0A ... |
5c851ee3d333518829ce26bfc06fd1038e70651c | Add util to temporarily alter log levels | corehq/util/decorators.py | corehq/util/decorators.py | from functools import wraps
import logging
from corehq.util.global_request import get_request
from dimagi.utils.logging import notify_exception
def handle_uncaught_exceptions(mail_admins=True):
"""Decorator to log uncaught exceptions and prevent them from
bubbling up the call chain.
"""
def _outer(fn)... | Python | 0 | @@ -139,16 +139,402 @@
ption%0A%0A%0A
+class ContextDecorator(object):%0A %22%22%22%0A A base class that enables a context manager to also be used as a decorator.%0A https://docs.python.org/3/library/contextlib.html#contextlib.ContextDecorator%0A %22%22%22%0A def __call__(self, fn):%0A @wraps(fn)... |
a2c965ea7e8c30378bb8d8f5c7977c45eb830423 | Comment on AsyncNotifier upstream's availability | lib/asyncnotifier.py | lib/asyncnotifier.py | #
#
# Copyright (C) 2009 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 version.
#
# This program is distributed ... | Python | 0 | @@ -915,16 +915,224 @@
otify%0A%0A%0A
+# We contributed the AsyncNotifier class back to python-pyinotify, and it's%0A# part of their codebase since version 0.8.7. This code can be removed once%0A# we'll be ready to depend on python-pyinotify %3E= 0.8.7%0A
class As
|
a35d6f59d214741f554dde1363d2eac7addb04cb | Add limitations to package documentation | crypto_enigma/__init__.py | crypto_enigma/__init__.py | #!/usr/bin/env python
# encoding: utf8
"""An Enigma machine simulator with rich textual display functionality."""
from ._version import __version__, __author__
#__all__ = ['machine', 'components']
from .components import *
from .machine import *
| Python | 0 | @@ -104,16 +104,829 @@
onality.
+%0A%0ALimitations%0A~~~~~~~~~~~%0A%0ANote that the correct display of some characters used to represent%0Acomponents (thin Naval rotors) assumes support for Unicode, while some%0Aaspects of the display of machine state depend on support for combining%0AUnicode. This is a %60known%0Alim... |
d4ce72ec1ea629a5a5678d12aafe6ca4f3b07dce | Remove lol lambda | lib/chrome-binary.py | lib/chrome-binary.py | #!/usr/bin/env python
import optparse
import sys
import os
import tempfile
CHROMIUM_BASE_URL = ('http://commondatastorage.googleapis.com'
'/chromium-browser-snapshots')
WEBKIT_BASE_URL = ('http://commondatastorage.googleapis.com'
'/chromium-webkit-snapshots')
class Dummy(object... | Python | 0.003344 | @@ -1535,38 +1535,18 @@
-_GetDownloadPath = lambda rev:
+zip_file =
os.
@@ -1587,11 +1587,20 @@
str(
-rev
+opts.version
), c
@@ -1625,54 +1625,8 @@
e))%0A
- zip_file = _GetDownloadPath(opts.version)%0A
|
097ed5ef81ed34ff8372f1ab44951ade8446b4c0 | fix push to append | src/builder.py | src/builder.py | # realpath() with make your script run, even if you symlink it :)
#
# cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile( inspect.currentframe() ))[0]))
# if cmd_folder not in sys.path:
# sys.path.insert(0, cmd_folder)
#
# use this if you want to include modules from a subforder
import inspect
... | Python | 0.000001 | @@ -1921,12 +1921,14 @@
rgs.
-push
+append
(arg
|
0fe35173418a52c6ff5ee7d9f61e7b793bd9d2e2 | change pmma parameters for bonding monomer | src/builder.py | src/builder.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import molecules, os, polymer
def pmma_monomer():
"""Return pmmma monomer building block as defined by SMILES
format obtained in avogadro"""
builddir = 'build'
molfile = 'pmma_monomer.pdb'
FILE = os.path.join( os.path.dirname( os.pat... | Python | 0 | @@ -366,32 +366,33 @@
dir, molfile ))%0A
+%0A
m = polymer.
@@ -441,24 +441,111 @@
AA = True )%0A
+ m._mono_name = %22pmma%22%0A m._r = 1.46%0A m._angle = 104.5%0A m._dihedral = 180.0%0A
return m
|
6882cdbbbb66db8289bfb69b8334e7406099d456 | remove connector and settings | lib/search/search.py | lib/search/search.py | import argparse
import os
import cv2
import connector
import settings
import cluster
from shutil import copyfile
from fba.preprocess import Preprocess
from fba.searcher import Searcher
def create_database():
if not os.path.isfile(settings.DATABASE):
connector.initial(table="image", feature="text",
... | Python | 0 | @@ -34,41 +34,8 @@
cv2%0A
-import connector%0Aimport settings%0A
impo
@@ -151,211 +151,8 @@
r%0A%0A%0A
-def create_database():%0A if not os.path.isfile(settings.DATABASE):%0A connector.initial(table=%22image%22, feature=%22text%22,%0A cluster=%22int%22, weka_id=%22int%22, image_pat... |
29dd6496534d32a996891475473e8584a0621871 | Fix import problem | yunbi/__init__.py | yunbi/__init__.py | from yunbi import yunbi
| Python | 0.000028 | @@ -1,13 +1,14 @@
from
+.
yunbi im
@@ -12,14 +12,14 @@
import
-y
+Y
unbi%0A
|
e44c3c2197e2f6653fa938dadb1f503fe2629649 | Fix VoresourceRendererMixin | daiquiri/oai/renderers.py | daiquiri/oai/renderers.py | from daiquiri.core.renderers import XMLRenderer
from daiquiri.core.renderers.dublincore import DublincoreRendererMixin
from daiquiri.core.renderers.datacite import DataciteRendererMixin
from daiquiri.core.renderers.voresource import VoresourceRendererMixin
class OaiRenderer(DublincoreRendererMixin, DataciteRendererMi... | Python | 0.000001 | @@ -2955,16 +2955,78 @@
ption')%0A
+ if repository_metadata%5B'identifier'%5D is not None:%0A
@@ -3079,32 +3079,92 @@
%5B'identifier'%5D)%0A
+ if repository_metadata%5B'registry'%5D is not None:%0A
self.ren
|
8a058acded2984ec6be3ac32b2d284239bb5d3b7 | Add Docstring to some scheduler/driver.py methods | nova/scheduler/driver.py | nova/scheduler/driver.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... | Python | 0.000007 | @@ -1883,24 +1883,115 @@
uest_spec):%0A
+ %22%22%22On run_instance failure, update instance state and%0A send notifications.%0A %22%22%22%0A%0A
if not i
@@ -2241,65 +2241,8 @@
d)%0A%0A
- # update instance state and notify on the transition%0A
@@ -3164,19 +3164,19 @@
e):%0A
-'''
+%22%22%22
... |
5d2f3f7378f4a2c3e10793caaf7fd5128864e805 | add subtitle support for vimeo plugin | src/streamlink/plugins/vimeo.py | src/streamlink/plugins/vimeo.py | import re
from streamlink.compat import html_unescape
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import DASHStream, HLSStream, HTTPStream
from streamlink.utils import parse_json
class Vimeo(Plugin):
_url_re = re.compile(r"https?://(player\.vimeo\.com/vi... | Python | 0 | @@ -84,17 +84,50 @@
t Plugin
+, PluginArguments, PluginArgument
%0A
-
from str
@@ -225,16 +225,68 @@
PStream%0A
+from streamlink.stream.ffmpegmux import MuxedStream%0A
from str
@@ -1453,32 +1453,184 @@
%7D
+,%0A validate.optional(%22text_tracks%22): validate.all(%0A ... |
93338a20f2a81990e1015bf167b43e6f9348137f | Convert binary Popen output into str | setup_extra.py | setup_extra.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup helpers for PyGraphviz.
"""
# Copyright (C) 2006-2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Manos Renieris, http://www.cs.brown.edu/~er/
# Distributed with BSD license.
# All rights reserved, see LICENSE ... | Python | 1 | @@ -984,32 +984,72 @@
).communicate()%0A
+ output = output.decode(%22utf-8%22)%0A
if outpu
|
ebb65e72b6df662a85819faa0c31b963ed1a9715 | allow string OBJID | SAGA/spectra/extract_exsiting.py | SAGA/spectra/extract_exsiting.py | import numpy as np
from easyquery import Query
from ..utils import fill_values_by_query
from .common import SPEED_OF_LIGHT, ensure_specs_dtype
from .manual_fixes import fixes_sdss_spec_by_objid
__all__ = ["extract_sdss_spectra", "extract_nsa_spectra"]
def extract_sdss_spectra(sdss):
if sdss is None:
ret... | Python | 0.999998 | @@ -39,16 +39,28 @@
rt Query
+, QueryMaker
%0A%0Afrom .
@@ -304,32 +304,49 @@
if sdss is None
+ or not len(sdss)
:%0A return
@@ -701,29 +701,34 @@
cs,
-%22OBJID == %7B%7D%22.format(
+QueryMaker.equal(%22OBJID%22,
obji
|
686666b224d9c8f104cc49a0ac58e170cf5b9477 | use get_device_from_array | chainercv/links/model/ssd/gradient_scaling.py | chainercv/links/model/ssd/gradient_scaling.py | from chainer import cuda
class GradientScaling(object):
"""Optimizer/UpdateRule hook function for scaling gradient.
This hook function scales gradient by a constant value.
Args:
rate (float): Coefficient for scaling.
Attributes:
rate (float): Coefficient for scaling.
"""
nam... | Python | 0.000039 | @@ -511,16 +511,27 @@
t_device
+_from_array
(g):%0A
|
ef0fd440118dc2ffc806fb55f20b16b61ad4f317 | correct build arguments | scripts/python/util/replace_relative_links.py | scripts/python/util/replace_relative_links.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import argparse
import sys
import os
import logging
import glob
import re
import fnmatch
from io import open
# This script is intended to be run against a single folder. All readme.md files (regardless of casing) will have t... | Python | 0.000005 | @@ -3894,17 +3894,13 @@
rs.R
-ootFolder
+epoId
%7D%7D%22
@@ -4201,16 +4201,18 @@
ers.
-BuildSHA
+RootFolder
%7D%7D%22
@@ -4441,38 +4441,40 @@
%22$%7B%7B parameters.
-RepoId
+BuildSHA
%7D%7D%22,%0A )%0A%0A
@@ -5155,16 +5155,34 @@
ion, %22w%22
+, encoding=%22utf-8%22
) as rea
@@ -5242,16 +5242,33 @@
ont... |
67e94d7fc729960bd29ecc17e08230211c5eb576 | Fix a typo in STATICFILES_DIRS. | vsub/settings/base.py | vsub/settings/base.py | """Base settings available to all environments."""
# Based on https://github.com/rdegges/django-skel and
# https://github.com/cyberdelia/django-heroku-template.
import os
import sys
## Path configuration
# Absolute path to our project directory.
# NOTE: Use dirname() twice as the settings file is two levels deep.
PR... | Python | 0.003171 | @@ -2450,24 +2450,25 @@
h('assets/')
+,
%0A)%0A%0A# See: h
|
05abb27a09a7d6cc3a61a30207fd49bdfb610fe9 | Print nonbond section | mbuild/formats/par_writer.py | mbuild/formats/par_writer.py | import mbuild as mb
import parmed as pmd
from foyer import Forcefield
__all__ = ['write_par']
def write_par(structure, filename):
""" Write CHARMM Par file given a parametrized structureture """
# ATOMS
with open(filename, 'w') as f:
f.write("ATOMS\n")
for atom in structure.atoms:
... | Python | 0 | @@ -3915,12 +3915,318 @@
%5D.psi_eq))%0A%0A
+ f.write(%22NONBONDED%5Cn%22)%0A unique_atypes = set()%0A for atom in struture.atoms:%0A unique_atypes.append(atom.atom_type)%0A for atype in unique_atypes:%0A f.write('%7B:8s%7D %7B8.3f%7D %7B:8f%7D %7B:8f%7D%5Cn'.format(at... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.