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 |
|---|---|---|---|---|---|---|---|
2651b475e998d6033d1cf31047398f985c89f23c | Correct usage message | client/cvra_bootloader/read_config.py | client/cvra_bootloader/read_config.py | #!/usr/bin/env python3
from cvra_bootloader import commands, utils
import msgpack
import json
def parse_commandline_args():
"""
Parses the program commandline arguments.
"""
DESCRIPTION = 'Read board configs and dumps to JSON'
parser = utils.ConnectionArgumentParser(description=DESCRIPTION)
pa... | Python | 0.000011 | @@ -427,13 +427,13 @@
to
-flash
+query
%22)%0A%0A
@@ -493,19 +493,21 @@
can
-all network
+the whole bus
.%22,%0A
|
7f782297afe568b44396c869877affbe5e5e862e | Define class properties for GenerateSolutions. | src/puzzle/steps/generate_solutions.py | src/puzzle/steps/generate_solutions.py | import itertools
from typing import Any, Callable, Iterable, NamedTuple, Tuple, Union
from data import meta
from puzzle.constraints import solution_constraints
from puzzle.steps import step
Solution = Tuple[str, float]
Solutions = Iterable[Union[Solution, StopIteration]]
class SolutionsChangeEvent(NamedTuple):
pa... | Python | 0 | @@ -419,16 +419,112 @@
straints
+%0A _source: Callable%5B%5B%5D, Solutions%5D%0A _all_solutions: meta.Meta%0A _filtered_solutions: meta.Meta
%0A%0A def
|
f4acbc92f3c15f00a683ada70ab1da913c265902 | Modify statement that creates end-point url | ideascaly/binder.py | ideascaly/binder.py | # IdeaScaly
# Copyright 2015 Jorge Saldivar
# See LICENSE for details.
import requests
from ideascaly.error import IdeaScalyError
from ideascaly.utils import convert_to_utf8_str
def bind_api(**config):
class APIMethod(object):
api = config['api']
path = config['path']
payload_type = co... | Python | 0.000009 | @@ -2760,30 +2760,166 @@
-full_url = 'http://' +
+if self.api.community_url.find(%22http%22) == -1:%0A full_url = 'http://' + self.api.community_url + url%0A else:%0A full_url =
sel
|
7f35204b6c33d82fd5f6b45d67b6a043283b3938 | FastImage examples/test.py: convert to numpy | examples/test.py | examples/test.py | import pkg_resources
import motmot.FastImage.FastImage as fi
width = 10
height = 10
im = fi.FastImage32f(fi.Size(width,height))
im.set_val(0,im.size)
roi = im.roi(1,1,fi.Size(8,8))
roi.set_val(1,roi.size)
print im.stringview()
import Numeric as nx
nview = nx.asarray( im )
print nview
nview[0,1]=240
print nview
... | Python | 0.999971 | @@ -237,21 +237,19 @@
ort
-Numeric
+numpy
as n
-x
+p
%0A%0Anv
@@ -247,33 +247,33 @@
as np%0A%0Anview = n
-x
+p
.asarray( im )%0Ap
@@ -325,33 +325,33 @@
w view%0Anview = n
-x
+p
.asarray( im )%0Ap
@@ -413,17 +413,17 @@
#print n
-x
+p
.__versi
@@ -439,17 +439,17 @@
view = n
-x
+p
.asarray
@@ -531,17 +531,17 ... |
37b12e53aff8eb4df8d2f106489da4bd4201c125 | Bump version to 0.4.2. | django_inbound_email/__init__.py | django_inbound_email/__init__.py | """An inbound email handler for Django."""
__title__ = 'django-inbound-email'
__version__ = '0.4.1'
__author__ = 'YunoJuno Ltd'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014 YunoJuno'
__description__ = 'A Django app for receiving inbound emails.'
| Python | 0 | @@ -91,17 +91,17 @@
= '0.4.
-1
+2
'%0A__auth
|
7d75f1dd14374d6bfbb8011fc1853d7d53f4c98c | Fix dtype | src/python/genPriorV.py | src/python/genPriorV.py | # The preprocessing step of DEIM: given ppr_1, ppr_2, ... ppr_k, generate the orthogonal basis.
# This is based on SVD so the basis are sorted according to the singular values (from large to small)
import sys
import os
from sys import argv
import numpy as np
import time
from scipy import linalg
import deimCommon
... | Python | 0.000001 | @@ -603,17 +603,13 @@
ype=
-%22float32%22
+dtype
)%0Aid
|
7851328ceec4a5fbe944f81783912706c7495d11 | Complete iter sol | lc0404_sum_of_left_leaves.py | lc0404_sum_of_left_leaves.py | """Leetcode 404. Sum of Left Leaves
Easy
URL: https://leetcode.com/problems/sum-of-left-leaves/
Find the sum of all left leaves in a given binary tree.
Example:
3
/ \
9 20
/ \
15 7
There are two left leaves in the binary tree, with values 9 and 15 respectively.
Return 24.
"""
# Definition for ... | Python | 0.999986 | @@ -1014,16 +1014,1059 @@
ight)%0A%0A%0A
+class SolutionIter(object):%0A def sumOfLeftLeaves(self, root):%0A %22%22%22%0A :type root: TreeNode%0A :rtype: int%0A%0A Time complexity: O(n).%0A Space complexity: O(logn) for balanced tree; O(n) for singly linked list.%0A %22%22%... |
a04e783c99f54ad7cc2525287ad95ae1308769b1 | clean up the users in the example | examples/user.py | examples/user.py | # -*- coding: utf-8 -*-
#
# © 2012 Scott Reynolds
# Author: Scott Reynolds <scott@scottreynolds.us>
#
"""Example of a User Model"""
from record import Record, MirroredRecord
from redboy.key import Key
from redboy.view import Queue, Stack, Score
from time import time
import redboy.exceptions as exc
user_prefix = "user... | Python | 0.000007 | @@ -130,16 +130,23 @@
%22%22%0Afrom
+redboy.
record i
@@ -2464,16 +2464,82 @@
t user%0A%0A
+ # Clean up%0A scott.remove()%0A thomas_jeffereson.remove()%0A%0A
if __nam
|
9908cb563cf97253a33eb2af8fd50fe769bd0b54 | Revise comments | lc0443_string_compression.py | lc0443_string_compression.py | """Leetcode 443. String Compression
Easy
URL: https://leetcode.com/problems/string-compression/
Given an array of characters, compress it in-place.
The length after compression must always be smaller than or equal to the
original array.
Every element of the array should be a character (not int) of length 1.
After ... | Python | 0 | @@ -1269,32 +1269,38 @@
%0A%0Aclass Solution
+OldNew
TwoPointersRepea
@@ -1306,24 +1306,24 @@
at(object):%0A
-
def comp
@@ -1571,17 +1571,17 @@
pointer
-e
+s
method:
@@ -1586,33 +1586,36 @@
d: i
-: old index, j: new index
+ & j for old & new positions
.%0A
@@ -1732,16 +1732,24 @@
Iterate
+through
RH... |
d10860567eca20b95e652d13b8741338ec85f35e | Refresh cache when modifying tasks from API | pybossa/api/task.py | pybossa/api/task.py | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2014 SF Isle of Man Limited
#
# 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... | Python | 0 | @@ -943,16 +943,62 @@
APIBase%0A
+from pybossa.cache import apps as cached_apps%0A
%0A%0Aclass
@@ -1074,12 +1074,96 @@
ss__ = Task%0A
+%0A def _refresh_cache(self, task):%0A cached_apps.clean_project(task.app_id)%0A
|
5665dd3bf2c2e3b83299ba766a7634606df9bc05 | Fix a command line verification bug | systrace/profile_chrome/main.py | systrace/profile_chrome/main.py | #!/usr/bin/env python
#
# Copyright 2014 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 logging
import optparse
import os
import sys
import webbrowser
from profile_chrome import chrome_tracing_agent
from profile_c... | Python | 0.00005 | @@ -5107,24 +5107,25 @@
urn 1%0A%0A if
+(
options.chro
@@ -5142,16 +5142,52 @@
ies and
+options.atrace_categories and%0A
'webview
@@ -5216,16 +5216,17 @@
tegories
+)
:%0A lo
|
defd892ea1fafea0bf79e8aa95b5d21ba09f93f1 | Update PF.py | geoportal/geoportailv3_geoportal/PF.py | geoportal/geoportailv3_geoportal/PF.py | # -*- coding: utf-8 -*-
from suds.client import Client
from geoportailv3_geoportal.models import LuxMeasurementLoginCommune
from geoportailv3_geoportal.models import LuxMeasurementDirectory
from c2cgeoportal_commons.models import DBSession
from sqlalchemy import func
import logging
import os
import sys
lo... | Python | 0.000001 | @@ -645,54 +645,15 @@
Ver1
-' +%0D%0A 'Service/META-INF/wsdl
+Service
/Par
|
e2cbd73218e6f5cf5b86718f6adebd92e9fee2a3 | Make sure land filters are set up when testing | geotrek/trekking/tests/test_filters.py | geotrek/trekking/tests/test_filters.py | from geotrek.land.tests.test_filters import LandFiltersTest
from geotrek.trekking.filters import TrekFilterSet
from geotrek.trekking.factories import TrekFactory
class TrekFilterLandTest(LandFiltersTest):
filterclass = TrekFilterSet
def test_land_filters_are_well_setup(self):
filterset = TrekFilter... | Python | 0 | @@ -1,20 +1,112 @@
+# Make sure land filters are set up when testing%0Afrom geotrek.land.filters import * # NOQA%0A
from geotrek.land.te
|
98453bf0c637ff37ea29cceec8fcfdd3ed24c494 | bump version number | pymzn/__init__.py | pymzn/__init__.py | # -*- coding: utf-8 -*-
"""PyMzn is a Python library that wraps and enhances the MiniZinc tools for CSP
modelling and solving. It is built on top of the libminizinc library (version
2.0) and provides a number of off-the-shelf functions to readily solve problems
encoded in MiniZinc and evaluate the solutions into Python... | Python | 0.000171 | @@ -514,17 +514,17 @@
= '0.11.
-2
+3
'%0A__all_
|
d5780089b268f353e49d9a0a6460d3a2dde3888f | Update to 0.1.1 | djangocms_styledlink/__init__.py | djangocms_styledlink/__init__.py | __version__ = '0.1.0' | Python | 0.000058 | @@ -12,10 +12,10 @@
= '0.1.
-0
+1
'
|
5734762d89f10f3133bd0ec5153ba039d53220ee | Add support for updating records | lexicon/providers/transip.py | lexicon/providers/transip.py | from __future__ import absolute_import
from .base import Provider as BaseProvider
from transip.client import DomainClient
def ProviderParser(subparser):
subparser.add_argument("--auth-username", help="specify username used to authenticate")
subparser.add_argument("--auth-api-key", help="specify API private ke... | Python | 0 | @@ -3067,16 +3067,21 @@
entifier
+=None
, type=N
@@ -3123,69 +3123,754 @@
-raise NotImplementedError(%22Providers should implement this!%22)
+all_records = self.list_records(show_output=False)%0A filtered_records = self._filter_records(all_records, type, name)%0A%0A for record in filtered_records:... |
beafa2d2e34a55486fecae6944c8b9e365f35fc9 | Use create instead of created | taiga/events/signal_handlers.py | taiga/events/signal_handlers.py | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | Python | 0 | @@ -1413,17 +1413,16 @@
%22create
-d
%22%0A%0A e
|
2bfd80f26e2ff4cc46e3cf5f2272d0f1fb4143df | Add missing quote | pycroft/lib/host.py | pycroft/lib/host.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
from pycroft.helpers.i18n import deferred_gettext
from pycroft.lib.logging import log_us... | Python | 0.000283 | @@ -5349,16 +5349,17 @@
ame: '%7B%7D
+'
.%22.forma
|
301ba33c0b9fcc1924a90aba646cc375a9ef76e5 | Simplify logic | src/sentry/api/endpoints/group_tags.py | src/sentry/api/endpoints/group_tags.py | from __future__ import absolute_import
from rest_framework.response import Response
from collections import defaultdict
from itertools import chain
from sentry.api.bases.group import GroupEndpoint
from sentry.api.serializers import serialize
from sentry.models import GroupTagValue, GroupTagKey, TagKey, TagKeyStatus
... | Python | 0.033914 | @@ -119,36 +119,8 @@
ict%0A
-from itertools import chain%0A
from
@@ -639,32 +639,36 @@
ta = %5B%5D%0A
+all_
top_values_by_ke
@@ -665,20 +665,13 @@
lues
-_by_key
=
-%7B%7D
+%5B%5D
%0A
@@ -1032,32 +1032,36 @@
ey%0A%0A
+all_
top_values_by_ke
@@ -1058,23 +1058,16 @@
lues
-_by_key%5Bkey%5D... |
35c75ecc44542ddec18eee2b0acfd79530a570d4 | Update how graph results are fetched when they are optional. | taskflow/patterns/graph_flow.py | taskflow/patterns/graph_flow.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | Python | 0 | @@ -1799,24 +1799,25 @@
task):%0A
+%0A
would_li
@@ -1812,161 +1812,76 @@
-would_like = set(getattr(task, 'requires', %5B%5D))%0A would_like.update(getattr(task, 'optional', %5B%5D))%0A%0A inputs = collections.defaultdict(list)%0A
+def extract_inputs(place_where, would_like, is_optional=... |
7ac1819b21f18083b1bc8acaa54d0e5f9f55eeb6 | Move environment initialization | extras/client.py | extras/client.py | # Some code stolen from httpie (https://github.com/jakubroztocil/httpie/) :)
import os
import sys
import json
import time
import pkg_resources
from textwrap import dedent
from argparse import (RawDescriptionHelpFormatter, FileType,
OPTIONAL, ZERO_OR_MORE, SUPPRESS, ArgumentParser)
# Set default... | Python | 0.000001 | @@ -1947,36 +1947,8 @@
g):%0A
- ctx.obj = Environment()%0A
@@ -3517,10 +3517,27 @@
cli(
+obj=Environment()
)%0A
|
718b7fe643fc49d1b4261338f68c2216a3391df4 | correct dev version | pydantic/version.py | pydantic/version.py | __all__ = ['VERSION', 'version_info']
VERSION = '1.3a1'
def version_info() -> str:
import platform
import sys
from importlib import import_module
from pathlib import Path
from .main import compiled
optional_deps = []
for p in ('typing-extensions', 'email-validator', 'devtools'):
... | Python | 0.000002 | @@ -45,17 +45,17 @@
ON = '1.
-3
+4
a1'%0A%0A%0Ade
|
2134270e0fa18ccd0297fd42f2cdb3444cc3a189 | Simplify construction of socket array. Add logging. | udprecv.py | udprecv.py | # -*- coding: utf-8 -*-
""" Provides a thread class to process UDP packets. """
from __future__ import print_function
__author__ = 'João Taveira Araújo'
__version__ = '0.0.6'
__license__ = 'MIT'
from collections import defaultdict
from binascii import hexlify
import IN
try:
from itertools import filterfalse
excep... | Python | 0 | @@ -397,16 +397,31 @@
erfalse%0A
+import logging%0A
import s
@@ -472,16 +472,82 @@
eading%0A%0A
+log = logging.getLogger(__name__) # pylint: disable=invalid-name%0A%0A
class Ud
@@ -2061,16 +2061,43 @@
tance.%22%0A
+ log.error(err)%0A
@@ -2835,49 +2835,28 @@
s =
-%5Bs for s in self.sockets if... |
9643b0dea3c1dc3d01fbdc66cf195c6c953751af | Check whether attribute is localizable (do not access locales directly) | cubes/mapper.py | cubes/mapper.py | # -*- coding: utf-8 -*-
"""Logical to Physical Mappers"""
import collections
from .common import get_logger
from .errors import *
__all__ = (
"Mapper",
)
class Mapper(object):
"""Mapper is core clas for translating logical model to physical
database schema.
"""
# WARNING: do not put any SQL/engi... | Python | 0 | @@ -5534,23 +5534,32 @@
if attr.
+is_
local
-es
+izable()
:%0A
|
bcc2e31a849fdf775e181f20f7578e3ca73b8842 | use list(dict) instead of list.keys() for py3 | uhdl/hw.py | uhdl/hw.py | import os
import shutil
from myhdl import toVerilog, toVHDL, traceSignals
from uhdl.backends import CoSimulator
from uhdl.utils import cd
from uhdl.structures import CaselessDict
def merge_config(current, new):
if not new:
return current
merged = CaselessDict(current)
merged.update(new)
re... | Python | 0.000003 | @@ -4985,16 +4985,21 @@
hdl'%5D =
+list(
backend.
@@ -5011,14 +5011,8 @@
lers
-.keys(
)%5B0%5D
|
37c929e1b5c771c88a7e49abf9ee1e0dda4437bf | add localhost to allowed hosts | teknologr/teknologr/settings.py | teknologr/teknologr/settings.py | """
Django settings for teknologr project.
Generated by 'django-admin startproject' using Django 1.9.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
... | Python | 0.000001 | @@ -1235,16 +1235,27 @@
OSTS = %5B
+'localhost'
%5D%0A%0A%0A# Ap
|
a05dece21b1c3d0349e7deb0c24d565e7e3dd604 | Fix unterminated loop for empty texts; in rst.render_docstring_html | pydocweb/doc/rst.py | pydocweb/doc/rst.py | # Portions copied from MoinMoin's RST parser
import cgi
from django.core.urlresolvers import reverse
from django.conf import settings
from django.template import Context
from django.template.loader import get_template
import pydocweb.doc.models as models
#-------------------------------------------------------------... | Python | 0.000203 | @@ -3806,16 +3806,33 @@
decoded
+ and trial_phrase
:%0A
|
751339df0a9c8b45c32b3e55e3a36e1e456d7f99 | Remove VerboseHook. | pydov/util/hooks.py | pydov/util/hooks.py | import sys
class AbstractHook(object):
def __init__(self, name):
self.name = name
def wfs_search(self, typename):
pass
def wfs_result(self, number_of_results):
pass
def xml_requested(self, url):
pass
def xml_cache_hit(self, url):
pass
def xml_cache_... | Python | 0 | @@ -398,666 +398,8 @@
s%0A%0A%0A
-class VerboseHook(AbstractHook):%0A def __init__(self):%0A super(VerboseHook, self).__init__('VerboseHook')%0A%0A def wfs_search(self, typename):%0A print('Searching WFS service for %25s.' %25 typename)%0A%0A def wfs_result(self, number_of_results):%0A pr... |
e5dd9b6348a00815b3de59c4f41bc4e17cd4231e | remove loading messages from validator | fdp/validator.py | fdp/validator.py | import pkg_resources
from pyshacl import validate
from rdflib.graph import Graph
def _validate(data, shapes_file, fdp=False):
try:
data_format = 'turtle'
shapes_file_format = 'turtle'
# validate number of subjects or focus nodes
g = Graph()
g.parse(data=data, format=data_fo... | Python | 0 | @@ -1232,44 +1232,8 @@
f):%0A
- print('Loading fdp shapes')%0A
@@ -1318,48 +1318,8 @@
l')%0A
- print('Loading catalog shapes')%0A
@@ -1412,48 +1412,8 @@
l')%0A
- print('Loading dataset shapes')%0A
@@ -1506,53 +1506,8 @@
l')%0A
- print('Loading distribution shapes')%0A
... |
dd2a0849b10feaf44d09f8a37e12e6da91c97c8f | annotate bad PDF function | figures_tools.py | figures_tools.py | import os
from astropy.wcs import WCS
from astropy.wcs.utils import skycoord_to_pixel, proj_plane_pixel_scales
import astropy.coordinates as coords
import warnings
try:
from astropy.wcs.utils import linear_offset_coordinates
except ImportError:
pass
else:
warnings.warn('linear_offset_coordinates now avai... | Python | 0.000001 | @@ -4,16 +4,90 @@
ort os%0A%0A
+import numpy as np%0Aimport matplotlib.pyplot as plt%0Afrom copy import copy%0A%0A
from ast
@@ -413,16 +413,101 @@
ead!')%0A%0A
+cm = copy(plt.cm.viridis)%0Acm.set_under(color='gray', alpha=0.5)%0Acm.set_bad(alpha=1.)%0A
%0Adef lin
@@ -1232,16 +1232,28 @@
e, fdir,
+ close=True,
**... |
e3d3e149f0b87fb385c78fc3506b7fc84e8e916e | Fix too long line | qubes/vm/appvm.py | qubes/vm/appvm.py | #
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de>
#
# This library is free software; you ca... | Python | 0.999592 | @@ -5068,24 +5068,43 @@
ge template
+'%0A '
while there
|
df12df3fd16baebcf9656b396d20d1a2bf4ddea0 | bump version | radar/__init__.py | radar/__init__.py | __version__ = '2.48.11'
| Python | 0 | @@ -14,11 +14,16 @@
'2.48.1
-1
+2_beta
'%0A
|
44460760f4f5f202477947fd1946209801846e82 | Fix name | first_problem.py | first_problem.py | def getFizz(num):
if num % 5 == 0 and num % 3 == 0:
return 'fizzbuzz'
elif num % 3 == 0:
return 'fizz'
elif num % 5 == 0:
return 'buzz'
else:
return str(num)
num = eval(input())
print(getFizz(num)) | Python | 0.999361 | @@ -1,23 +1,27 @@
def getFizz
+Buzz
(num):%0A i
@@ -242,10 +242,15 @@
Fizz
+Buzz
(num))
+%0A
|
ff9411cba4aedcaada6ffa759335cd8fa3ec8e11 | change base url to https | pygbif/gbifutils.py | pygbif/gbifutils.py | import requests
import re
import pygbif
# import requests_cache
# from requests_cache.core import remove_expired_responses
# import os.path
# import tempfile
# CACHE_FILE = os.path.join(tempfile.gettempdir(), 'pygbif_requests_cache')
# expire = 300
# backend = "sqlite"
# requests_cache.install_cache(cache_name=CACHE_... | Python | 0.000007 | @@ -2276,16 +2276,17 @@
= %22http
+s
://api.g
|
c1b0cfe9fdfbacf71ffbba45b4a8f7efe3fe36a7 | Update wront port script to Python3 | docker/dev_wrong_port_warning.py | docker/dev_wrong_port_warning.py | #!/usr/bin/env python
"""
Per kobotoolbox/kobo-docker#301, we have changed the uWSGI port to 8001. This
provides a helpful message to anyone still trying to use port 8000
"""
import BaseHTTPServer
import sys
class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(503)
... | Python | 0 | @@ -181,53 +181,60 @@
ort
-BaseHTTPS
+sys%0Afrom http.s
erver
-%0A
+
import
-sys%0A%0Aclass
+BaseHTTPRequest
Handler
-(Base
+,
HTTP
@@ -239,17 +239,33 @@
TPServer
-.
+%0A%0A%0Aclass Handler(
BaseHTTP
@@ -400,16 +400,17 @@
+b
'Your de
@@ -481,16 +481,17 @@
+b
'contain
@@ -561,16 +561,17... |
732883ec44c64da9190c9fd807da1fd14a58f2ea | Rename wip | src/testers/unittests/test_symbolic.py | src/testers/unittests/test_symbolic.py | #!/usr/bin/env python2
# coding: utf-8
"""Test Symbolic."""
import unittest
from triton import ARCH, Instruction, CPUSIZE, MemoryAccess, Immediate, TritonContext
class TestSymbolic(unittest.TestCase):
"""Testing the symbolic engine."""
def setUp(self):
"""Define the arch."""
self.Triton = ... | Python | 0.000001 | @@ -4035,21 +4035,11 @@
ton.
-buildSymbolic
+get
Imme
@@ -4043,16 +4043,19 @@
mmediate
+Ast
(Immedia
|
effb70b276b644d55a0e05727ae5cc5059904222 | Handle 500 error when experiment is queued | floyd/cli/run.py | floyd/cli/run.py | from __future__ import print_function
import click
from tabulate import tabulate
from time import sleep
from floyd.constants import DOCKER_IMAGES
from floyd.cli.utils import (get_task_url, get_docker_image, get_module_task_instance_id,
get_mode_parameter, wait_for_url)
from floyd.client.ex... | Python | 0 | @@ -3733,16 +3733,37 @@
ailable%0A
+ try:%0A
@@ -3829,16 +3829,20 @@
+
if exper
@@ -3883,14 +3883,142 @@
+
break%0A
+ except Exception:%0A floyd_logger.debug(%22Experiment not available yet: %7B%7D%22.format(experiment_id))%0A%0A
|
3fff382fa256d802b5d727d777d6fcac18603632 | Improve tracing output | pykit/ir/tracing.py | pykit/ir/tracing.py | # -*- coding: utf-8 -*-
"""
Interpreter tracing of pykit programs.
"""
from __future__ import print_function, division, absolute_import
from collections import namedtuple
from .value import Value
from pykit.utils import nestedmap
#===------------------------------------------------------------------===
# Trace Ite... | Python | 0.000193 | @@ -1457,16 +1457,128 @@
level%0A%0A
+ @property%0A def func(self):%0A %22%22%22Currently executing function%22%22%22%0A return self.callstack%5B-1%5D%0A%0A
def
@@ -1931,53 +1931,112 @@
elf.
-emit(%22 --------%3E Calling function %25s(%25s)%22 %25 (
+call(item.func)%0A self.emit(... |
902183ac0e718eee6f506e9cf863104f3947f15c | Enforce alphanumeric ordering for plugins grabbed via glob. | lib/ansible/utils/plugins.py | lib/ansible/utils/plugins.py | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | Python | 0 | @@ -5698,27 +5698,25 @@
-for path in
+matches =
glob.gl
@@ -5742,16 +5742,75 @@
%22*.py%22))
+%0A matches.sort()%0A for path in matches
:%0A
|
a0ea737e40863067db90ca8c1d6d811ed0505d26 | Update run_dc.py | apps/deeplearning/darknet-rpi/run_dc.py | apps/deeplearning/darknet-rpi/run_dc.py |
## Crate by TJ, https://github.com/taijoon
import serial,os,time
import sys
import RPi.GPIO as GPIO
import picamera
import subprocess
import datetime
import os
# check pin location
gled = 19
rled = 26
# HW setup, GPIO
GPIO.cleanup()
GPIO.setmode(GPIO.BCM)
GPIO.setup(rled, GPIO.OUT)
GPIO.setup(gled, GPIO.OUT)
time.s... | Python | 0.000002 | @@ -1,9 +1,8 @@
-%0A
## Crate
|
e61da7a1cd41d6f07b84c43d0a15107c3319294a | fix str to bytes in python3 in svn.py | python/qisrc/svn.py | python/qisrc/svn.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Fake Git """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import prin... | Python | 0.002099 | @@ -1838,16 +1838,32 @@
line%5B8:%5D
+.encode(%22UTF-8%22)
%0A
|
83742a7fa364edc2872908ef19ae786e6ee0e7b8 | validate aggregation field in report config | corehq/apps/userreports/reports/specs.py | corehq/apps/userreports/reports/specs.py | from jsonobject import JsonObject, StringProperty, BooleanProperty, ListProperty
from jsonobject.base import DefaultProperty
from sqlagg import CountUniqueColumn, SumColumn
from sqlagg.columns import SimpleColumn
from corehq.apps.reports.sqlreport import DatabaseColumn
from corehq.apps.userreports.reports.filters impor... | Python | 0 | @@ -255,32 +255,92 @@
DatabaseColumn%0A
+from corehq.apps.userreports.exceptions import BadSpecError%0A
from corehq.apps
@@ -471,16 +471,131 @@
perty%0A%0A%0A
+SQLAGG_COLUMN_MAP = %7B%0A 'count_unique': CountUniqueColumn,%0A 'sum': SumColumn,%0A 'simple': SimpleColumn,%0A%7D%0A%0A%0A
class Re
@@ -1280,149... |
e7ac7e44fb63c81909e287040fb76bd15dc65df0 | Set version as 1.1.1 | version.py | version.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2017:
# Frederic Mohier, frederic.mohier@alignak.net
#
"""
Alignak - Checks pack for NRPE monitored Linux hosts/services
"""
# Package name
__pkg_name__ = u"alignak_checks_nrpe"
# Checks types for PyPI keywords
# Used for:
# - PyPI keywords
# -... | Python | 0.002245 | @@ -476,17 +476,17 @@
= u%221.1.
-0
+1
%22%0A__auth
|
04bc0dc59276dff6d8b19f691695a1d4300b8705 | fix feed | generate_feed.py | generate_feed.py | from feedgen.feed import FeedGenerator
import datetime as dt
import pytz
from premailer import transform
import markdown
from functools import lru_cache
from bs4 import BeautifulSoup
URL = "https://pandoc--westminster-daily.netlify.com/westminster-daily"
FILENAME = "feed.rss"
NUMBER_OF_DAYS = 30
@lru_cache()
def mar... | Python | 0.000001 | @@ -1079,25 +1079,17 @@
return
-str(soup)
+c
%0A%0A%0Adef m
|
b256ed37b581b71c986772a3691d425d148400d9 | support iter_documents on cases | corehq/form_processor/document_stores.py | corehq/form_processor/document_stores.py | from corehq.blobs import Error as BlobError
from corehq.form_processor.exceptions import CaseNotFound, XFormNotFound
from corehq.form_processor.interfaces.dbaccessors import FormAccessors, CaseAccessors
from pillowtop.dao.exceptions import DocumentNotFoundError
from pillowtop.dao.interface import ReadOnlyDocumentStore
... | Python | 0 | @@ -1368,8 +1368,150 @@
main())%0A
+%0A def iter_documents(self, ids):%0A for wrapped_case in self.case_accessors.iter_cases(ids):%0A yield wrapped_case.to_json()%0A
|
a758175da8d2ebad0769fc45679fabe8ef7eacd8 | Bump version to 3.2-alpha | version.py | version.py | short_name = "godot"
name = "Godot Engine"
major = 3
minor = 2
status = "dev"
module_config = ""
year = 2019
website = "https://godotengine.org"
| Python | 0 | @@ -70,11 +70,13 @@
= %22
-dev
+alpha
%22%0Amo
|
67a985a97e985548cd577404f7c36f9704ca9510 | upgrade reader | rawdisk/reader.py | rawdisk/reader.py | # -*- coding: utf-8 -*-
import rawdisk.scheme
from rawdisk.filesystems.detector import FilesystemDetector
from rawdisk.plugins.manager import Manager
from rawdisk.filesystems.unknown_volume import UnknownVolume
from rawdisk.scheme.mbr import SECTOR_SIZE
class Reader(object):
"""Main class used to start filesyste... | Python | 0 | @@ -1026,21 +1026,22 @@
print
-
+(
part
+)
%0A%0A de
@@ -3267,33 +3267,33 @@
print
-
+(
'Partitioning sc
@@ -3315,16 +3315,17 @@
ported.'
+)
%0A
@@ -3348,17 +3348,17 @@
print
-
+(
'Partiti
@@ -3395,9 +3395,10 @@
rmined.'
+)
%0A
|
9014bcff07ad98035bfde6b46fb7c71c11762bd6 | remove prints | genomepy/base.py | genomepy/base.py | import os
import sys
import re
import norns
config = norns.config("genomepy", default="cfg/default.yaml")
class Plugin(object):
active = False
def name(self):
n = type(self).__name__.replace("Plugin", "")
return convert(n)
def activate(self):
self.active = True
def deactiva... | Python | 0.000012 | @@ -1269,80 +1269,8 @@
%7B%7D%0A
- print(%22I%22, config.config_file)%0A print(config.get(%22plugin%22 , %5B%5D))%0A
@@ -1822,35 +1822,8 @@
():%0A
- print(p, v.active)%0A
|
b1b652462898b1c389f189fe1222c5fdf64f13e0 | remove assertIn | stream/httpsig/tests/test_signature.py | stream/httpsig/tests/test_signature.py | #!/usr/bin/env python
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import json
import unittest
import stream.httpsig.sign as sign
from stream.httpsig.utils import parse_authorization_header
class TestSign(unittest.TestCase):
DEFAULT_SIGN_ALGORITHM = sign.DEFAULT_SIGN_AL... | Python | 0.001407 | @@ -870,34 +870,38 @@
self.assert
-In
+True
('Date'
-,
+ in
signed)%0A
@@ -967,34 +967,36 @@
self.assert
-In
+True
('Authorization'
@@ -987,33 +987,35 @@
('Authorization'
-,
+ in
signed)%0A
@@ -1114,34 +1114,36 @@
self.assert
-In
+True
('keyId'
, params)%0A
@@ -1122,33 +1122,35 @@
sertTr... |
823fd5f18a300ba919ab478bf94c3253dcbffd3a | Fix merge issue | version.py | version.py | <<<<<<< HEAD
version = '0.6.0'
=======
version = '0.5.2'
>>>>>>> origin/master
| Python | 0.000001 | @@ -1,17 +1,4 @@
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A
vers
@@ -15,52 +15,5 @@
.0'%0A
-=======%0Aversion = '0.5.2'%0A%3E%3E%3E%3E%3E%3E%3E origin/master
%0A
|
81e3519e3f9927120c7a0ee32546607c1c40407f | patch rev bump | gippy/version.py | gippy/version.py | #!/usr/bin/env python
################################################################################
# GIPPY: Geospatial Image Processing library for Python
#
# AUTHOR: Matthew Hanson
# EMAIL: matt.a.hanson@gmail.com
#
# Copyright (C) 2015 Applied Geosolutions
#
# Licensed under the Apache License, Ve... | Python | 0.000001 | @@ -946,8 +946,9 @@
0.3.11'%0A
+%0A
|
0b765439a4fb2649e8c69bd7f648df45656e84fb | Fix that was truncating the last fragment in removeNs | src/scripts/removeNs.py | src/scripts/removeNs.py |
"""Replaces all runs of Ns greater than M in length with M Ns.
"""
import sys, re
from sonLib.bioio import fastaRead, fastaWrite, logger, setLogLevel
if len(sys.argv) == 0:
print "fasta-file-in fasta-file-out minimum-length-of-ns-to-mask"
sys.exit()
class Header:
def __init__(self, header, lenSeq):
... | Python | 0.999278 | @@ -2107,32 +2107,46 @@
i = fn2(header,
+ searchedSeq +
sequence)%0A i
|
9df392be85f75463b8abd26b1b2dcbf300173bdb | add seeding to the random state | astropy/modeling/tests/test_mappings.py | astropy/modeling/tests/test_mappings.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import pytest
import numpy as np
from numpy.testing.utils import assert_allclose, assert_array_equal
from ..fitting import LevMarLSQFitter
from .... | Python | 0.000001 | @@ -376,16 +376,53 @@
Mapping
+%0Afrom ...utils import NumpyRNGContext
%0A%0Atry:%0A
@@ -2422,26 +2422,50 @@
-y_noisy = y_real +
+with NumpyRNGContext(1234567):%0A n =
np.
@@ -2495,16 +2495,41 @@
.shape)%0A
+ y_noisy = y_real + n%0A
pfit
@@ -2645,17 +2645,17 @@
y_real,
-r
+a
tol=dy)%0A
|
d16ed87c69f281a204ff8c46cca41112c82d1337 | Fix Global | EmeraldAI/Logic/Modules/Global.py | EmeraldAI/Logic/Modules/Global.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import platform
RootPath = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))).rstrip(os.sep) + os.sep
EmeraldPath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))).rstrip(os.sep) + os.sep
OS = platform.system().lowe... | Python | 0.000002 | @@ -537,17 +537,17 @@
+ os.se
-t
+p
+ folde
|
d68db1bf08e1df17acd37f4aeca8958eaa48b2ab | switch back to development version | version.py | version.py | # Copyright (C) 2015 UCSC Computational Genomics Lab
#
# 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 o... | Python | 0 | @@ -608,17 +608,19 @@
= '1.6.
-0
+1a1
'%0A%0Arequi
|
c25943811b3e821d6824d8c67ff1a4efb3580988 | Update __init__.py | pyxl320/__init__.py | pyxl320/__init__.py | #!/usr/bin/env python
__version__ = '0.7.6'
__copyright__ = 'Copyright (c) 2016 Kevin Walchko'
__license__ = 'MIT'
__author__ = 'Kevin J. Walchko'
import Packet
from ServoSerial import ServoSerial, DummySerial
import utils
import xl320
# __doc__ = """
# pyxl320
# ========
#
# A python library to talk with Dynamixel ... | Python | 0.000072 | @@ -37,11 +37,11 @@
'0.
-7.6
+8.0
'%0A__
@@ -236,112 +236,4 @@
20%0A%0A
-# __doc__ = %22%22%22%0A# pyxl320%0A# ========%0A#%0A# A python library to talk with Dynamixel XL-320 smart servos.%0A# %22%22%22%0A
|
ebcf97f786f7d3535bc7cb532a14fafa10161c86 | update model field | github/models.py | github/models.py | from django.db import models
# Create your models here.
class Hiren(models.Model):
access_token = models.CharField(max_length=200)
authorized = models.BooleanField(default=False)
class Counter(models.Model):
number = models.BigIntegerField()
date = models.DateTimeField()
| Python | 0.000001 | @@ -238,11 +238,8 @@
els.
-Big
Inte
@@ -246,18 +246,16 @@
gerField
-()
%0A dat
@@ -273,16 +273,29 @@
Date
-Time
Field(
+auto_now_add=True
)%0A
|
117795cda9ad84598e5648de76937eaa5371dfa3 | Send zookeeper info as well to the kafka clients | reactive/kafka.py | reactive/kafka.py | from charms.reactive import when, when_not
from charms.reactive import set_state, remove_state
from charmhelpers.core import hookenv
from charms.layer.kafka import Kafka
from jujubigdata.utils import DistConfig
@when_not('kafka.installed')
def install_kafka(*args):
kafka = Kafka(DistConfig())
if kafka.ver... | Python | 0 | @@ -2728,67 +2728,49 @@
ted'
-)%0A@when_not('kafka.available')%0Adef waiting_availuable_flume
+, 'zookeeper.available')%0Adef serve_client
(kaf
@@ -2778,23 +2778,40 @@
a_client
+, zookeeper
):%0A
+kafka_
port = D
@@ -2826,21 +2826,12 @@
g().
-exposed_
port
-s
('ka
@@ -2839,11 +2839,8 @@
ka')
-%5B0%5D
%0A ... |
7def00511ca52735f5a6b2c01cba460900ee6fd2 | test for rats - morereal data | athenet/tests/test_sparsify_smallest.py | athenet/tests/test_sparsify_smallest.py | import unittest
from athenet.algorithm.sparsify_smallest import sparsify_smallest_on_layers
from athenet.algorithm.sparsify_smallest import sparsify_smallest_on_network
import numpy as np
from mocks.mock_network import NetworkMock, LayerMock
from nose.tools import assert_equal, assert_true
class SparsifySmallestTest(... | Python | 0.000001 | @@ -494,34 +494,32 @@
iform(low=-1
-5
, high=
-30
+1
, size=size_
@@ -576,18 +576,16 @@
w=-1
-5
, high=
-30
+1
, si
|
f6c8a005b497c896734623c2560d7692fae03fa9 | Increment provision version for upgradation of python dependencies. | version.py | version.py | ZULIP_VERSION = "1.4.1+git"
PROVISION_VERSION = '3.2'
| Python | 0 | @@ -48,7 +48,7 @@
'3.
-2
+3
'%0A
|
b9c1ec9cee3994284918b6834b8088e6248dc10d | Fix hostname publishing for centos7.x | azurelinuxagent/distro/redhat/osutil.py | azurelinuxagent/distro/redhat/osutil.py | #
# Copyright 2014 Microsoft Corporation
#
# 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 ... | Python | 0.000062 | @@ -4980,17 +4980,16 @@
name))%0A%0A
-%0A
class Re
@@ -5295,24 +5295,272 @@
hostname)%0A%0A
+ def publish_hostname(self, hostname):%0A %22%22%22%0A Restart NetworkManager first before publishing hostname%0A %22%22%22%0A shellutil.run(%22service NetworkManager restart%22)%0A sup... |
b3e9404defe9355b3a622338b4bef3108a362367 | Remove print | src/sentry/constants.py | src/sentry/constants.py | """
sentry.constants
~~~~~~~~~~~~~~~~
These settings act as the default (base) settings for the Sentry-provided
web-server
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging... | Python | 0.000016 | @@ -771,27 +771,8 @@
th)%0A
- print(results)%0A
|
1b2801f52071ed98cabd2241b9ca61041a78211f | Make data connection available to uploaded components | vm/base.py | vm/base.py | import json
import os
from uuid import uuid4
import multiprocessing
import requests
import time
from data_connection import DataConnection
class Configurator(object):
"""
Manages a config for the Local Computer
"""
def __init__(self, **kwargs):
if "filename" in kwargs:
with open(k... | Python | 0 | @@ -2212,27 +2212,44 @@
_init__(self
+, data_connection
):%0A
-
self
@@ -2317,16 +2317,63 @@
e('i',0)
+%0A self.data_connection = data_connection
%0A%0A de
@@ -2598,16 +2598,57 @@
ld_stop,
+%0A
multipr
@@ -2696,63 +2696,353 @@
gs=(
-refresh_time_sec, pr... |
77a7155848c36be8f6542fffb7f6cd79ee5e1899 | allow for lower case password prompts in the ios driver | Exscript/protocols/drivers/ios.py | Exscript/protocols/drivers/ios.py | #
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# 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, cop... | Python | 0.000113 | @@ -1387,17 +1387,20 @@
?:%5B%5Cr%5Cn%5D
-P
+%5BPp%5D
assword:
|
2033a5f31d7711496b12f3c4556d5c64e25f5fd0 | Support both older and newer pika. | beaver/transports/rabbitmq_transport.py | beaver/transports/rabbitmq_transport.py | # -*- coding: utf-8 -*-
from Queue import Queue
import pika
import ssl
from threading import Thread
import time
from beaver.transports.base_transport import BaseTransport
from beaver.transports.exception import TransportException
class RabbitmqTransport(BaseTransport):
def __init__(self, beaver_config, logger=N... | Python | 0 | @@ -3972,28 +3972,320 @@
if
-self._connection.is_
+hasattr(self._connection, '_closing'):%0A closing = self._connection._closing%0A elif hasattr(self._connection, 'is_closing'):%0A closing = self._connection.is_closing%0A else:%0A raise NotImplementedError('Unsure how t... |
c19d0bfcc175c4afd382f86b9c37c54126c855b0 | Refactor code for vpcs creation | symaps_proxies/lib/common/aws_utils.py | symaps_proxies/lib/common/aws_utils.py | # -*- coding: utf-8 -*-
import boto3
import logging
import sys
class AWSEC2Interface(object):
def __init__(self, profile):
"""Constructor
Args:
profile (string): AWS profile
"""
# Setup logger
self.logger = self.__setup_logger()
# Get AWS Session
... | Python | 0 | @@ -2088,398 +2088,8 @@
ce%0A%0A
- def create_vpc(self, cidr_block, tags):%0A %22%22%22Create a single AWS VPC%0A%0A Args:%0A cidr_block (string): Cidr block%0A tags (dict): Tags%0A%0A Returns:%0A string: VPC id%0A %22%22%22%0A vpc = self.ec2.creat... |
9ea5a1af728fadc6bda620ad33c5ea92416228f4 | Produce table in different format | bench/pact-suite/scripts/oplevel_fmt.py | bench/pact-suite/scripts/oplevel_fmt.py | #!/usr/bin/env python2.7
import sys
files = sys.argv[1:]
C = "Create"
L = "Scalar Load"
S = "Scalar Store"
Task = "Task Get/Put"
Ins = "Array Insert"
LU = "Array Lookup"
RC = "Refcount"
Sub = "Subscribe"
order = [Task, C, Sub, L, S, LU, Ins, RC]
cats = {
"CONTAINER_REFERENCE": LU,
"CREATE_HEADER": C,
"ENUMERAT... | Python | 0.999999 | @@ -978,16 +978,26 @@
el + 1,%0A
+ tot = 0%0A
for ca
@@ -1016,63 +1016,133 @@
-print %22&%22, '%25.1f' %25 (float(catVals%5Bcat%5D%5Blevel%5D)/
+val = catVals%5Bcat%5D%5Blevel%5D%0A tot +=val%0A print %22&%22, '%25.1f' %25 (float(val)/1000) ,%0A print %22&%22, '%25.1f' %25 (float(tot) /
1000)
- ,
%... |
6e002721023de4d5994a54c0d49f01d5c5ec1f86 | Add some keywords to default and c_mode | vx/mode.py | vx/mode.py | import vx
import os.path
def mode_from_filename(file):
root, ext = os.path.splitext(file)
ext = ext if ext else root
mode = None
if ext == '.c':
return c_mode
class mode:
def __init__(self, window):
self.breaks = ('_', ' ', '\n', '\t')
class python_mode(mode):
def __init__(s... | Python | 0 | @@ -268,16 +268,43 @@
', '%5Ct')
+%0A self.keywords = ()
%0A%0Aclass
@@ -762,32 +762,69 @@
elf.keywords = (
+'#include', '#define', 'if', 'else',
'return', 'goto'
|
302ee4e6c5fce43213556405851c48afc3c340db | implement effigies comments on PR 580 | bids/layout/tests/test_path_building.py | bids/layout/tests/test_path_building.py | import pytest
from bids.layout import BIDSLayout
from os.path import join, abspath, sep
from bids.tests import get_test_data_path
@pytest.fixture(scope='module')
def layout():
data_dir = join(get_test_data_path(), '7t_trt')
return BIDSLayout(data_dir)
def test_bold_construction(layout):
ents = dict(subj... | Python | 0 | @@ -81,16 +81,41 @@
th, sep%0A
+from pathlib import Path%0A
from bid
@@ -148,16 +148,16 @@
ta_path%0A
-
%0A%0A@pytes
@@ -391,87 +391,46 @@
-assert layout.build_path(ents, absolute_paths=False) %5C%0A == %22sub-01/func/
+relative = Path(%22sub-01%22) / %22func%22 / %22
sub-
@@ -460,34 +460,51 @@
.nii.... |
2c8afad5ab79f9ea7345220029c5ada05596c29f | Add missing tuple key for username validation response | app/controllers/accounts_manager.py | app/controllers/accounts_manager.py | import logging
from flask import jsonify, make_response
from flask_restful import Resource, reqparse
from app.models import User
from app.utils.db import save_record
from app.utils.auth.token import JWT
logger = logging.getLogger(__name__)
class LoginResource(Resource):
"""this class handles login and authentic... | Python | 0.000001 | @@ -1123,32 +1123,43 @@
response = (
+%22message%22,
%22username and pa
|
ffa1bbdf4b5d2ae45553ec83aa6a6c8c0bd7a87c | exclude into(nd.array, *) test with datetimes | blaze/api/tests/test_into_exhaustive.py | blaze/api/tests/test_into_exhaustive.py | from __future__ import absolute_import, division, print_function
from dynd import nd
import numpy as np
from pandas import DataFrame
from blaze.api.into import into, discover
from blaze.api.into import degrade_numpy_dtype_to_python
from datashape import dshape
from blaze.bcolz import *
import blaze
from blaze import ... | Python | 0.000032 | @@ -3137,16 +3137,34 @@
ion, CSV
+,%0A nd.array
%5D%5D%0A f
|
da11faa1540bed04d96336422d259de3847fcefe | add mail asserts | watcher.py | watcher.py | import pyinotify
import re
import notify
import mailbox
class MailEventHandler(pyinotify.ProcessEvent):
def my_init(self, maildir):
self.maildir = mailbox.Maildir(maildir)
def process_IN_MOVED_TO(self, event):
self.new_mail_notify(event.name)
def process_IN_CREATE(self, event):
s... | Python | 0 | @@ -178,16 +178,56 @@
maildir)
+%0A assert self.maildir is not None
%0A%0A de
@@ -512,16 +512,49 @@
ail_id)%0A
+ assert mail is not None%0A%0A
|
a085f8f3124b926e48e979e67194f2b2318a568c | Add blank line (#95) | quickstart/setup.py | quickstart/setup.py | #!/usr/bin/env python
# Copyright 2019 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 a... | Python | 0.003245 | @@ -1041,8 +1041,9 @@
Start'%0A)
+%0A
|
fee10efeae410a0bc51842877ef8ffb5fe8b97af | Add gtk implementation of open_file | src/file_dialogs.py | src/file_dialogs.py | #!/usr/bin/env python
# Copyright 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python | 0 | @@ -695,49 +695,613 @@
-raise Exception(%22not implemented%22)%0A else
+import gtk%0A dlg = gtk.FileChooserDialog(title=None,action=gtk.FILE_CHOOSER_ACTION_SAVE,%0A buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK))%0A flt = gtk.FileFilter()%0A ... |
494749fae544aac11c36c6d5277d1673de3140d7 | use pythonic way to test if a list is empty in mini solver (it's faster). | rando/MiniSolver.py | rando/MiniSolver.py |
import log, random
from datetime import datetime
from smboolmanager import SMBoolManager
class MiniSolver(object):
def __init__(self, startAP, areaGraph, restrictions):
self.startAP = startAP
self.areaGraph = areaGraph
self.restrictions = restrictions
self.settings = restrictions.s... | Python | 0 | @@ -17,37 +17,8 @@
dom%0A
-from datetime import datetime
%0Afro
@@ -1048,28 +1048,28 @@
if
-len(
+not
locations) =
@@ -1065,22 +1065,16 @@
ocations
-) == 0
:%0A
@@ -1323,20 +1323,20 @@
if
-len(
+not
toCollec
@@ -1340,14 +1340,8 @@
lect
-) == 0
:%0A
|
c3f176c2d4f4c177679c2c7b5c308e245a91311a | Implement remark presentation | remarkable/cli.py | remarkable/cli.py | """
remarkable.
Usage:
remarkable [options] command <param> <another_params>
remarkable [options] another-command <param>
remarkable -h | --help
Options:
--kw-arg=<kw> Keyword option description.
-b --boolean Boolean option description.
--debug Debug.
-h --help ... | Python | 0.000003 | @@ -40,16 +40,24 @@
ptions%5D
+another-
command
@@ -67,25 +67,8 @@
ram%3E
- %3Canother_params%3E
%0A r
@@ -87,38 +87,45 @@
ptions%5D
-another-command %3Cparam
+remark %3Cpath-to-markdown-file
%3E%0A%0A rem
@@ -335,16 +335,31 @@
een.%0A%22%22%22
+%0Aimport logging
%0A%0Afrom d
@@ -378,30 +378,62 @@
docopt... |
790427faccee15c4a398e340ffe11d0e1ee1488f | Update version.py | rasa_nlu/version.py | rasa_nlu/version.py | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
__version__ = '0.9.0a5'
| Python | 0.000001 | @@ -168,7 +168,7 @@
9.0a
-5
+6
'%0A
|
98a4b9cd7ef0b228a35cef941d2647ae3aed6351 | Handle newly introduced LoopError. | tcfnetworks/annotators/cooccurrence.py | tcfnetworks/annotators/cooccurrence.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Frederik Elwert <frederik.elwert@web.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# ... | Python | 0 | @@ -4424,24 +4424,49 @@
n_gram, 2):%0A
+ try:%0A
@@ -4491,32 +4491,99 @@
_tokens(*combo)%0A
+ except tcf.LoopError:%0A continue%0A
return g
@@ -6376,24 +6376,49 @@
tokens, 2):%0A
+ try:%0A
@@ -6443,32 +6443,9... |
361f28d341e30392cc69a1b0d4e538feee77f7c7 | Fix rainy weather condition code | weather.py | weather.py | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import os
import sys
import urllib.request
import json
location = 'London'
celcius = True
precision = 1
emoji = True
def fetch(location, celcius=True):
unit = 'metric' if celcius else 'imperial'
weather_url = \
'http://api.openweathermap.org/data/2.... | Python | 0.999999 | @@ -733,9 +733,9 @@
-4
+5
: '%E2%98%94
|
2c744e5e18fcf43c4ca55244b3595ea9159eab5e | fix typo in get.perfetto.dev am: d03fd291f3 am: 86c5037948 am: c6e9282977 | infra/perfetto-get.appspot.com/main.py | infra/perfetto-get.appspot.com/main.py | # Copyright (C) 2019 The Android Open Source Project
#
# 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 ... | Python | 0.000427 | @@ -1277,17 +1277,17 @@
rite('Re
-r
+s
ource %22%25
|
5efef95365ce0b54a58f08f0a039362bad4fd706 | Enable API search test | infrastructure/tests/test_api_views.py | infrastructure/tests/test_api_views.py | from django.test import Client, TestCase
from infrastructure import utils
from infrastructure import models
import json
from infrastructure.models import FinancialYear, QuarterlySpendFile, Expenditure, Project
from scorecard.models import Geography
from scorecard.profiles import MunicipalityProfile
# from scorecard.a... | Python | 0.000001 | @@ -801,22 +801,20 @@
project_
-search
+list
(self):%0A
@@ -1194,25 +1194,75 @@
(), 1)%0A%0A
+%0A
+ def test_infrastructure_project_search(self):%0A
-#
+
respons
@@ -1286,25 +1286,24 @@
et(%0A
-#
%22/api/v
@@ -1464,33 +1464,32 @@
udget%22)%0A
-#
self.assertEqua
@@ -1525,17 ... |
900336adbbd41b87c71512f4109d6918988f2e4b | bump version | readme/__about__.py | readme/__about__.py | # Copyright 2014 Donald Stufft
#
# 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, so... | Python | 0 | @@ -958,17 +958,17 @@
= %220.4.
-0
+1
%22%0A%0A__aut
|
d642d545d3755fc8686c9da14d578b4af0bc8f3f | Remove deprecated get_model from tasks | recommends/tasks.py | recommends/tasks.py | from celery.task import task, periodic_task
from celery.schedules import crontab
from .utils import filelock
from .settings import RECOMMENDS_TASK_RUN, RECOMMENDS_TASK_CRONTAB, RECOMMENDS_TASK_EXPIRES
def recommends_precompute():
results = []
from .providers import recommendation_registry
# I know this ... | Python | 0.000001 | @@ -1351,33 +1351,28 @@
dels import
-get_model
+apps
%0A from re
@@ -1432,32 +1432,37 @@
ObjectClass =
+apps.
get_model(*rated
@@ -1800,25 +1800,20 @@
import
-get_model
+apps
%0A fro
@@ -1885,16 +1885,21 @@
Class =
+apps.
get_mode
|
971a2d5d03194be5735b69ecd62de75c975b1395 | Add Raises in the docstring of tf.histogram_fixed_width | tensorflow/python/ops/histogram_ops.py | tensorflow/python/ops/histogram_ops.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -4733,16 +4733,189 @@
alues.%0A%0A
+ Raises:%0A TypeError: If any unsupported dtype is provided.%0A tf.errors.InvalidArgumentError: If value_range does not%0A satisfy value_range%5B0%5D %3C value_range%5B1%5D.%0A%0A
Exampl
|
5eba12dc62163f474ce0c5bfb3466ab99eb220b8 | Add error parsing to nb routines | salt/ssh/shell.py | salt/ssh/shell.py | '''
Manage transport commands via ssh
'''
# Import python libs
import os
import json
import time
import subprocess
# Import salt libs
import salt.utils
import salt.utils.nb_popen
def gen_key(path):
'''
Generate a key for use with salt-ssh
'''
cmd = 'ssh-keygen -P "" -f {0} -t rsa -q'.format(path)
... | Python | 0.000001 | @@ -4708,16 +4708,86 @@
break%0A
+ if err:%0A err = self.get_error(err)%0A
|
6adcffb3c0ee7ce86e32622c500de95f9df2e8bb | add comment to models | inventory/models.py | inventory/models.py | from django.db import models
from djorm_pgarray.fields import ArrayField
from jsonfield import JSONField
class Dataset(models.Model): # dcat:Dataset
# Identification and common fields
division_id = models.CharField(max_length=150, db_index=True)
name = models.CharField(max_length=500) # @see https://git... | Python | 0 | @@ -3116,32 +3116,49 @@
dex=True) # dct
+, plus dct:rights
%0A accessURL =
@@ -3202,32 +3202,55 @@
th=2000) # dcat
+, plus dcat:downloadURL
(length 1692 ob
|
974e98e568173b749d8cd6be34f40c60837c76a1 | fix migrating image format | wikidot.py | wikidot.py | #!/usr/bin/env python
# -*- encoding: UTF8 -*-
# Copyright 2012 Philipp Klaus
# Part of https://github.com/vLj2/wikidot-to-markdown
import re ## The most important module here!
import string ## for string.join()
#import markdown
import uuid ## to generate random UUIDs using uuid.uuid4()
class WikidotToMarkdown(objec... | Python | 0.00006 | @@ -2913,24 +2913,353 @@
r_reg,text)%0A
+ # search for image of the form %5B%5Bimage https://linyehui.com/test.png%5D%5D%0A for link in re.finditer(r%22%5C%5B%5C%5Bimage (%22+self.url_regex+r%22)%5C%5D%5C%5D%22, text):%0A #print link.group(0), %22!%5Balt text%5D(%25s)%22 %25 (link.groups()%5B-... |
b4fedd9475ff10e7800ceb4826c2b1fce3d49072 | Version 0.18.1 | repokid/__init__.py | repokid/__init__.py | # Copyright 2020 Netflix, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Python | 0 | @@ -944,17 +944,17 @@
= %220.18.
-0
+1
%22%0A%0A%0Adef
|
d42868aa998bbee91527c27b38e397b657455436 | set default for pi | app/modules/ectyper/call_ectyper.py | app/modules/ectyper/call_ectyper.py | import shutil
import os
import subprocess
import cPickle as pickle
from ast import literal_eval
from os.path import basename
def call_ectyper(args_dict):
# i don't intend to import anything from ECTyper (there are a lot of
# imports in it - not sure if we'll use them all)
ectyper_dict = {}
# concurren... | Python | 0.000002 | @@ -3037,16 +3037,36 @@
type=int
+,%0A default=90
%0A )%0A
|
982b415693954587fed4e253154829f19d07affc | Validate simple content on construction | tests/bugs/test-200907231705.py | tests/bugs/test-200907231705.py | import pyxb.binding.generate
import pyxb.binding.datatypes as xs
import pyxb.binding.basis
import pyxb.utils.domutils
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="tEmpty">
<xs:attribute name="units" type="xs:string" use... | Python | 0.000029 | @@ -2922,36 +2922,8 @@
f):%0A
- instance = Simple()%0A
@@ -2974,32 +2974,14 @@
or,
-instance.validateBinding
+Simple
)%0A
@@ -3094,45 +3094,8 @@
ng)%0A
- instance = Simple(units='m')%0A
@@ -3146,32 +3146,25 @@
or,
-instance.validateBinding
+Simple, units='m'
)%0A
@@ -3636,25 +3636,... |
325aa95e39a7a581f58578ba64ea2b447f52e34a | update comment | tests/chainer_tests/conftest.py | tests/chainer_tests/conftest.py | import pytest
import chainerx
if not chainerx.is_available():
# Skip all ChainerX tests if it is unavailable.
# TODO(kmaehashi) add `not chainerx` condition to chainer-test.
pytest.mark.chainerx = pytest.mark.skip
# testing.run_module(__name__, __file__)
| Python | 0 | @@ -91,18 +91,24 @@
ests if
-it
+ChainerX
is unav
@@ -142,52 +142,103 @@
hi)
-add %60not chainerx%60 condition to chainer-test
+This is an tentative fix. This file should be removed%0A # once chainer-test supports ChainerX
.%0A
|
e12d1286fa83b37b59239ddec1cb047824aa65ca | user name | tests/clusteringTest20140710.py | tests/clusteringTest20140710.py | # clusteringTest20140710.py
#1. ~ 40 as thresholad
#2. k-means clustering
from armor.initialise import *
from scipy.ndimage import morphology as mor
from armor.geometry import morphology as morph
def getTimeString():
return str(time.time())
outputFolder = 'testing/'
m = march('0312.2130')[0].load()
######... | Python | 0.999999 | @@ -191,17 +191,16 @@
morph%0A%0A
-%0A
def getT
@@ -241,17 +241,16 @@
ime())%0A%0A
-%0A
outputFo
@@ -268,17 +268,16 @@
ting/'%0A%0A
-%0A
m = ma
|
951be987e7739314ae21fa623a7b55cf6b9a78ad | Change docstring. | chainer/functions/activation/sigmoid.py | chainer/functions/activation/sigmoid.py | import numpy
from chainer import cuda
from chainer import function
from chainer import utils
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn = cudnn.cudnn
_cudnn_version = libcudnn.getVersion()
_mode = libcudnn.CUDNN_ACTIVATION_SIGMOID
class Sigmoid(function.F... | Python | 0 | @@ -2123,25 +2123,23 @@
%3E%3E%3E
-assert y.shape ==
+y.shape%0A
(3,
|
d8a21e046af9678d6858a5e4f392284ff35d5ddb | fix #676 | app/py/cuda_make_plugin/__init__.py | app/py/cuda_make_plugin/__init__.py | import os
from cudatext import *
from .dlg import *
from .events import *
fn_sample = os.path.join(os.path.dirname(__file__), 'sample.py')
dir_py = app_path(APP_DIR_PY)
class Command:
def run(self):
res = dlg_make_plugin()
if res is None: return
(s_caption, s_module, cmd_list, event_list)... | Python | 0.000001 | @@ -320,25 +320,17 @@
) = res%0A
-
%0A
+
@@ -453,17 +453,16 @@
md_list%5D
-
%0A%0A
@@ -711,29 +711,17 @@
return%0A
-
%0A
+
@@ -870,24 +870,16 @@
return%0A
-
%0A
@@ -2112,32 +2112,33 @@
f.write('%5Cn')%0A
+%0A
%0A
@@ -2125,32 +212... |
6104b111b4ceaec894018b77cbea4a0de31400d4 | Add name to the snapshot extension | chainer/trainer/extensions/_snapshot.py | chainer/trainer/extensions/_snapshot.py | from chainer.serializers import npz
from chainer.trainer import extension
def snapshot(savefun=npz.save_npz,
filename='snapshot_iter_{.updater.iteration}'):
"""Return a trainer extension to take snapshots of the trainer.
This extension serializes the trainer object and saves it to the output
... | Python | 0.000001 | @@ -1108,16 +1108,33 @@
tension(
+name='snapshot',
trigger=
|
515dbfef85407d559a8160d460c662525f397e06 | Add additional details to the doc string in an attempt to clarify the behavior. | lib/jnpr/junos/decorators.py | lib/jnpr/junos/decorators.py | # stdlib
from functools import wraps
import re
from jnpr.junos.exception import RpcError
from jnpr.junos import jxml as JXML
def timeoutDecorator(function):
@wraps(function)
def wrapper(*args, **kwargs):
if 'dev_timeout' in kwargs:
try:
dev = args[0].dev
except... | Python | 0 | @@ -2377,83 +2377,127 @@
ning
+s
if
-ignore_warning provided and the rpc-reply severity level%0A is warning
+all %3Crpc-error%3E elements are at severity 'warning' and%0A match one of the values of the ignore_warning argument.
%0A%0A
@@ -2829,115 +2829,163 @@
ng:
-It can take take boolean value or string... |
ab6b61d8d0b91ebc2d0b1b8cbd526cfbb6a45a42 | Check for a user from previously in the pipeline before checking for duplicate user. | chipy_org/libs/social_auth_pipelines.py | chipy_org/libs/social_auth_pipelines.py | from django.contrib.auth import get_user_model
from django.utils.translation import ugettext
from social_auth.exceptions import AuthAlreadyAssociated
from social_auth.backends.pipeline.associate import associate_by_email as super_associate_by_email
def associate_by_email(*args, **kwargs):
"""Check if a user with ... | Python | 0 | @@ -462,16 +462,38 @@
github'%5D
+ or kwargs.get('user')
:%0A
|
5ff5faa7b7d7edb0bd591e794fdb2dae113e5771 | Use cached_property | corehq/apps/hqwebapp/async_handler.py | corehq/apps/hqwebapp/async_handler.py | import json
from django.http import HttpResponse, HttpRequest
from dimagi.utils.decorators.memoized import memoized
class AsyncHandlerMixin(object):
"""
To be mixed in with a TemplateView.
todo write better documentation on this (biyeun)
"""
async_handlers = []
@property
def handler_slug(... | Python | 0.000001 | @@ -65,55 +65,53 @@
om d
-imagi
+jango
.utils.
-decorators.memoized import memoized
+functional import cached_property
%0A%0A%0Ac
@@ -537,24 +537,31 @@
uest)%0A%0A @
+cached_
property%0A
@@ -561,22 +561,8 @@
rty%0A
- @memoized%0A
|
cb19fccce26071378a445844e230b78456961af8 | bump up version | ironman/__init__.py | ironman/__init__.py | __version__ = '0.2.16'
__all__ = ['communicator',
'hardware',
'history',
'interfaces',
'packet',
'server',
'utilities']
def engage(proto='udp'):
''' Fire thrusters.
'''
from ironman.server import ServerFactory
from twisted.internet impor... | Python | 0 | @@ -17,9 +17,9 @@
.2.1
-6
+7
'%0A__
|
8fca07c0324c30d454562fc925333e327a04695a | add modular commits to lawyer disambiguation | lib/lawyer_disambiguation.py | lib/lawyer_disambiguation.py | #!/usr/bin/env Python
"""
Performs a basic lawyer disambiguation
"""
from collections import defaultdict, deque
import uuid
import cPickle as pickle
from collections import Counter
from Levenshtein import jaro_winkler
from alchemy import session, get_config, match
from alchemy.schema import *
from handlers.xml_util imp... | Python | 0 | @@ -3020,24 +3020,34 @@
lawyers...'%0A
+ i = 0%0A
for lawy
@@ -3067,24 +3067,24 @@
iterkeys():%0A
-
rl_i
@@ -3155,16 +3155,33 @@
rl_ids:%0A
+ i += 1%0A
@@ -3235,16 +3235,49 @@
block%5D%0A
+ if i %25 10000 == 0:%0A
@@ -3303,16 +3303,121 @@
session
+, comm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.