project
stringlengths 1
98
| commit_sha
stringlengths 40
40
| parent_sha
stringlengths 40
40
| file_path
stringlengths 4
209
| project_url
stringlengths 23
132
| likely_bug
bool 1
class | comodified
bool 1
class | in_function
bool 2
classes | diff
stringlengths 27
9.71k
| before
stringlengths 1
8.91k
| after
stringlengths 1
6k
| sstub_pattern
stringclasses 23
values | edit_script
stringlengths 33
158k
| key
stringlengths 45
154
| commit_message
stringlengths 3
65.5k
⌀ | files
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
helpo | e8d20ad43f1d6ca8af3e172d71e294bd10d31909 | e440fd3d21e8bbe391363a5b0c5e0e7e3b89b218 | helpo-api/actividades/services.py | https://github.com/Jumpi96/helpo | true | false | true | @@ -15,7 +15,7 @@ def send_mail_mensaje_evento(mensaje, evento_id):
)
for participante in participantes:
LogMensaje.objects.create(
- colaborador_id=participante.id, mensaje_id=mensaje.id)
+ usuario_id=participante.id, mensaje_id=mensaje.id)
def get_participantes_evento(evento_id):
| LogMensaje . objects . create ( colaborador_id = participante . id , mensaje_id = mensaje . id ) | LogMensaje . objects . create ( usuario_id = participante . id , mensaje_id = mensaje . id ) | CHANGE_KEYWORD_ARGUMENT_USED | [["Update", ["identifier:colaborador_id", 3, 13, 3, 27], "usuario_id"]] | Jumpi96/helpo@e8d20ad43f1d6ca8af3e172d71e294bd10d31909 | Fixing bug mensajes | [
{
"sha": "370a852065e6cbf223eb7c3699c271d11a795b15",
"filename": "helpo-api/actividades/services.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Jumpi96/helpo/blob/e8d20ad43f1d6ca8af3e172d71e294bd10d31909/helpo-api%2Factividades%2Fservices.py",
"raw_url": "https://github.com/Jumpi96/helpo/raw/e8d20ad43f1d6ca8af3e172d71e294bd10d31909/helpo-api%2Factividades%2Fservices.py",
"contents_url": "https://api.github.com/repos/Jumpi96/helpo/contents/helpo-api%2Factividades%2Fservices.py?ref=e8d20ad43f1d6ca8af3e172d71e294bd10d31909",
"patch": "@@ -15,7 +15,7 @@ def send_mail_mensaje_evento(mensaje, evento_id):\n )\n for participante in participantes:\n LogMensaje.objects.create(\n- colaborador_id=participante.id, mensaje_id=mensaje.id)\n+ usuario_id=participante.id, mensaje_id=mensaje.id)\n \n \n def get_participantes_evento(evento_id):"
}
] |
helpo | 9d15ddf60a6e7ad5046862623aa9cbde8b95f0d3 | de20d5b48cd92aff39020211a3d2bd804f1c7414 | helpo-api/actividades/signals/handlers.py | https://github.com/Jumpi96/helpo | true | false | true | @@ -29,7 +29,7 @@ def handle_evento_change_notification(sender, instance, created, **kwags):
# Busco la ong dueña del evento
- organizacion = User.objects.get(instance.organizacion)
+ organizacion = User.objects.get(pk=instance.organizacion.id)
# Busco todos los usuarios que tengo que notificar
users = User.objects.filter(suscripcion__organizacion=organizacion)
| organizacion = User . objects . get ( instance . organizacion ) | organizacion = User . objects . get ( pk = instance . organizacion . id ) | SINGLE_STMT | [["Insert", ["argument_list", 1, 36, 1, 59], ["keyword_argument", "N0"], 1], ["Insert", "N0", ["identifier:pk", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["attribute", "N1"], 2], ["Move", "N1", ["attribute", 1, 37, 1, 58], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:id", "T"], 2]] | Jumpi96/helpo@9d15ddf60a6e7ad5046862623aa9cbde8b95f0d3 | Fixee un error al buscar la organizacion en la signalHandler | [
{
"sha": "6beaf6125e903722c1a6c1355a05f0b5c4d77809",
"filename": "helpo-api/actividades/signals/handlers.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Jumpi96/helpo/blob/9d15ddf60a6e7ad5046862623aa9cbde8b95f0d3/helpo-api%2Factividades%2Fsignals%2Fhandlers.py",
"raw_url": "https://github.com/Jumpi96/helpo/raw/9d15ddf60a6e7ad5046862623aa9cbde8b95f0d3/helpo-api%2Factividades%2Fsignals%2Fhandlers.py",
"contents_url": "https://api.github.com/repos/Jumpi96/helpo/contents/helpo-api%2Factividades%2Fsignals%2Fhandlers.py?ref=9d15ddf60a6e7ad5046862623aa9cbde8b95f0d3",
"patch": "@@ -29,7 +29,7 @@ def handle_evento_change_notification(sender, instance, created, **kwags):\n esta crea o modifica un evento\n \"\"\"\n # Busco la ong dueña del evento\n- organizacion = User.objects.get(instance.organizacion)\n+ organizacion = User.objects.get(pk=instance.organizacion.id)\n # Busco todos los usuarios que tengo que notificar\n users = User.objects.filter(suscripcion__organizacion=organizacion)\n "
}
] |
scikit-image | fad2813dd8e6fb50e6552a5fbadf1b5e9635f267 | bca962cc8ad765d0e3b8bd97ddd1b025dc827735 | skimage/filter/lpi_filter.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -75,7 +75,7 @@ class LPIFilter2D(object):
- if impulse_response is None:
+ if not callable(impulse_response):
raise ValueError("Impulse response must be a callable.")
self.impulse_response = impulse_response
| if impulse_response is None : raise ValueError ( "Impulse response must be a callable." ) | if not callable ( impulse_response ) : raise ValueError ( "Impulse response must be a callable." ) | SINGLE_STMT | [["Insert", ["if_statement", 0, 9, 1, 69], ["not_operator", "N0"], 1], ["Insert", "N0", ["not:not", "T"], 0], ["Insert", "N0", ["call", "N1"], 1], ["Insert", "N1", ["identifier:callable", "T"], 0], ["Insert", "N1", ["argument_list", "N2"], 1], ["Insert", "N2", ["(:(", "T"], 0], ["Move", "N2", ["identifier:impulse_response", 0, 12, 0, 28], 1], ["Insert", "N2", ["):)", "T"], 2], ["Delete", ["is:is", 0, 29, 0, 31]], ["Delete", ["none:None", 0, 32, 0, 36]], ["Delete", ["comparison_operator", 0, 12, 0, 36]]] | matsuken92/scikit-image@fad2813dd8e6fb50e6552a5fbadf1b5e9635f267 | Fix callable test in LPI filter | [
{
"sha": "2af74d7a2484583ff89d99f70750e6acebe8a87d",
"filename": "skimage/filter/lpi_filter.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/fad2813dd8e6fb50e6552a5fbadf1b5e9635f267/skimage%2Ffilter%2Flpi_filter.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/fad2813dd8e6fb50e6552a5fbadf1b5e9635f267/skimage%2Ffilter%2Flpi_filter.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffilter%2Flpi_filter.py?ref=fad2813dd8e6fb50e6552a5fbadf1b5e9635f267",
"patch": "@@ -75,7 +75,7 @@ def __init__(self, impulse_response, **filter_params):\n >>> filter = LPIFilter2D(filt_func)\n \n \"\"\"\n- if impulse_response is None:\n+ if not callable(impulse_response):\n raise ValueError(\"Impulse response must be a callable.\")\n \n self.impulse_response = impulse_response"
}
] |
scikit-image | d1629aec0f1a861106d54cb015b238e7fe542936 | 00dbb5e4e3017514f41ecbd40b00cfc53ec11916 | skimage/measure/_polygon.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -28,7 +28,7 @@ def approximate_polygon(coords, tolerance):
- if tolerance == 0:
+ if tolerance <= 0:
return coords
chain = np.zeros(coords.shape[0], 'bool')
| if tolerance == 0 : return coords | if tolerance <= 0 : return coords | CHANGE_BINARY_OPERATOR | [["Insert", ["comparison_operator", 0, 8, 0, 22], ["<=:<=", "T"], 1], ["Delete", ["==:==", 0, 18, 0, 20]]] | matsuken92/scikit-image@d1629aec0f1a861106d54cb015b238e7fe542936 | Fix polygon approximation for 0 or less tolerance | [
{
"sha": "7b9b920b1bed1a3d979d61bb086f1badaee75105",
"filename": "skimage/measure/_polygon.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/d1629aec0f1a861106d54cb015b238e7fe542936/skimage%2Fmeasure%2F_polygon.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/d1629aec0f1a861106d54cb015b238e7fe542936/skimage%2Fmeasure%2F_polygon.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmeasure%2F_polygon.py?ref=d1629aec0f1a861106d54cb015b238e7fe542936",
"patch": "@@ -28,7 +28,7 @@ def approximate_polygon(coords, tolerance):\n ----------\n .. [1] http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm\n \"\"\"\n- if tolerance == 0:\n+ if tolerance <= 0:\n return coords\n \n chain = np.zeros(coords.shape[0], 'bool')"
}
] |
scikit-image | bc745e833aa6f983a2d28f67b0b0f22ead798be1 | 88d1b85bcf3614f49c70d997abebebd7a5f20b35 | skimage/__init__.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -65,7 +65,7 @@ except ImportError:
def _setup_test(verbose=False):
import functools
- args = ['', '--exe', '-w', pkg_dir]
+ args = ['', pkg_dir, '--exe']
if verbose:
args.extend(['-v', '-s'])
| args = [ '' , '--exe' , '-w' , pkg_dir ] | args = [ '' , pkg_dir , '--exe' ] | SINGLE_STMT | [["Move", ["string:'--exe'", 3, 17, 3, 24], ["list", 3, 12, 3, 40], 6], ["Move", [",:,", 3, 24, 3, 25], ["list", 3, 12, 3, 40], 7], ["Delete", ["string:'-w'", 3, 26, 3, 30]], ["Delete", [",:,", 3, 30, 3, 31]]] | matsuken92/scikit-image@bc745e833aa6f983a2d28f67b0b0f22ead798be1 | BUG: Pass package directory as positional argument to nose.run
When the package directory is passed to nosetest via the "where" argument (-w), that directory becomes the working directory. This causes problems because `skimage.io` will take precedence over the builtin `io` package. | [
{
"sha": "cf62ee874157685af856fac3ff14f14639d5bec0",
"filename": "skimage/__init__.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/bc745e833aa6f983a2d28f67b0b0f22ead798be1/skimage%2F__init__.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/bc745e833aa6f983a2d28f67b0b0f22ead798be1/skimage%2F__init__.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2F__init__.py?ref=bc745e833aa6f983a2d28f67b0b0f22ead798be1",
"patch": "@@ -65,7 +65,7 @@\n def _setup_test(verbose=False):\n import functools\n \n- args = ['', '--exe', '-w', pkg_dir]\n+ args = ['', pkg_dir, '--exe']\n if verbose:\n args.extend(['-v', '-s'])\n "
}
] |
scikit-image | 7741d906ed1bb5f827f1166e63993ed379c00ea9 | c17ffe6c32707594d07a15c1e89b270afe34a4b3 | skimage/measure/tests/test_regionprops.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -248,7 +248,7 @@ def test_perimeter():
per = regionprops(SAMPLE, ['Perimeter'])[0]['Perimeter']
assert_almost_equal(per, 59.2132034355964)
- per = perimeter(SAMPLE, neighbourhood=8)
+ per = perimeter(SAMPLE.astype('double'), neighbourhood=8)
assert_almost_equal(per, 43.1213203436)
| per = perimeter ( SAMPLE , neighbourhood = 8 ) | per = perimeter ( SAMPLE . astype ( 'double' ) , neighbourhood = 8 ) | ADD_METHOD_CALL | [["Insert", ["argument_list", 3, 20, 3, 45], ["call", "N0"], 1], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["identifier:SAMPLE", 3, 21, 3, 27], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:astype", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["string:'double'", "T"], 1], ["Insert", "N2", ["):)", "T"], 2]] | matsuken92/scikit-image@7741d906ed1bb5f827f1166e63993ed379c00ea9 | Fix failing perimeter test caused by bug in scipy | [
{
"sha": "bd23d8b30b0a047ede010ce2b49ea240b6b6a287",
"filename": "skimage/measure/tests/test_regionprops.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/7741d906ed1bb5f827f1166e63993ed379c00ea9/skimage%2Fmeasure%2Ftests%2Ftest_regionprops.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/7741d906ed1bb5f827f1166e63993ed379c00ea9/skimage%2Fmeasure%2Ftests%2Ftest_regionprops.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmeasure%2Ftests%2Ftest_regionprops.py?ref=7741d906ed1bb5f827f1166e63993ed379c00ea9",
"patch": "@@ -248,7 +248,7 @@ def test_perimeter():\n per = regionprops(SAMPLE, ['Perimeter'])[0]['Perimeter']\n assert_almost_equal(per, 59.2132034355964)\n \n- per = perimeter(SAMPLE, neighbourhood=8)\n+ per = perimeter(SAMPLE.astype('double'), neighbourhood=8)\n assert_almost_equal(per, 43.1213203436)\n \n "
}
] |
scikit-image | 1221a98a4252bdc09146d6b301803610519c6194 | ee098224ebcb7b83e6384d2b73b6f6b2180e4b37 | skimage/transform/hough_transform.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -258,4 +258,4 @@ def hough_peaks(hspace, angles, dists, min_distance=10, min_angle=10,
dist_peaks = dist_peaks[idx_maxsort]
angle_peaks = angle_peaks[idx_maxsort]
- return hspace_peaks, dist_peaks, angle_peaks
+ return hspace_peaks, angle_peaks, dist_peaks
| return hspace_peaks , dist_peaks , angle_peaks | return hspace_peaks , angle_peaks , dist_peaks | SINGLE_STMT | [["Move", ["identifier:dist_peaks", 3, 26, 3, 36], ["expression_list", 3, 12, 3, 49], 4], ["Move", [",:,", 3, 36, 3, 37], ["expression_list", 3, 12, 3, 49], 5]] | matsuken92/scikit-image@1221a98a4252bdc09146d6b301803610519c6194 | Fix ordering of return values | [
{
"sha": "a5987d5d570c2c458192a6d4e75495bb18e81c05",
"filename": "skimage/transform/hough_transform.py",
"status": "modified",
"additions": 3,
"deletions": 3,
"changes": 6,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/1221a98a4252bdc09146d6b301803610519c6194/skimage%2Ftransform%2Fhough_transform.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/1221a98a4252bdc09146d6b301803610519c6194/skimage%2Ftransform%2Fhough_transform.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ftransform%2Fhough_transform.py?ref=1221a98a4252bdc09146d6b301803610519c6194",
"patch": "@@ -216,8 +216,8 @@ def hough_peaks(hspace, angles, dists, min_distance=10, min_angle=10,\n angle_peaks = []\n \n # relative coordinate grid for local neighbourhood suppression\n- dist_ext, angle_ext = np.mgrid[- min_distance:min_distance + 1,\n- - min_angle:min_angle + 1]\n+ dist_ext, angle_ext = np.mgrid[-min_distance:min_distance + 1,\n+ -min_angle:min_angle + 1]\n \n for dist_idx, angle_idx in coords:\n accum = hspace[dist_idx, angle_idx]\n@@ -258,4 +258,4 @@ def hough_peaks(hspace, angles, dists, min_distance=10, min_angle=10,\n dist_peaks = dist_peaks[idx_maxsort]\n angle_peaks = angle_peaks[idx_maxsort]\n \n- return hspace_peaks, dist_peaks, angle_peaks\n+ return hspace_peaks, angle_peaks, dist_peaks"
}
] |
scikit-image | 22a73fc0cb8ab7c11d0aaf37c19caf7ad2257d57 | 80a9a5aba5f6e629219acb0bd44a35567e00b5c7 | check_bento_build.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -5,7 +5,7 @@ import os
import re
-RE_CYTHON = re.compile("config.add_extension\(['\"]([\S]+)['\"]")
+RE_CYTHON = re.compile("config.add_extension\(\s*['\"]([\S]+)['\"]")
| RE_CYTHON = re . compile ( "config.add_extension\(['\"]([\S]+)['\"]" ) | RE_CYTHON = re . compile ( "config.add_extension\(\s*['\"]([\S]+)['\"]" ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"config.add_extension\\(['\\\"]([\\S]+)['\\\"]\"", 3, 24, 3, 65], "\"config.add_extension\\(\\s*['\\\"]([\\S]+)['\\\"]\""]] | matsuken92/scikit-image@22a73fc0cb8ab7c11d0aaf37c19caf7ad2257d57 | BUG: Adapt to whitespace in text search | [
{
"sha": "00e4d6599bb100a0e93b429218e2b1cf668da98c",
"filename": "check_bento_build.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/22a73fc0cb8ab7c11d0aaf37c19caf7ad2257d57/check_bento_build.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/22a73fc0cb8ab7c11d0aaf37c19caf7ad2257d57/check_bento_build.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/check_bento_build.py?ref=22a73fc0cb8ab7c11d0aaf37c19caf7ad2257d57",
"patch": "@@ -5,7 +5,7 @@\n import re\n \n \n-RE_CYTHON = re.compile(\"config.add_extension\\(['\\\"]([\\S]+)['\\\"]\")\n+RE_CYTHON = re.compile(\"config.add_extension\\(\\s*['\\\"]([\\S]+)['\\\"]\")\n \n BENTO_TEMPLATE = \"\"\"\n Extension: {module_path}"
}
] |
scikit-image | e7288f9140b1a1a8a545f19434ec5805006b4a1a | da5a2a82213e01fc9b9d98f31cf740c6d3aa7767 | skimage/feature/peak.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -129,7 +129,7 @@ def peak_local_max(image, min_distance=10, threshold_abs=0, threshold_rel=0.1,
if indices is True:
return []
else:
- return np.zeros_like(image)
+ return np.zeros_like(image, dtype=bool)
image = image.copy()
# Non maximum filter
| return np . zeros_like ( image ) | return np . zeros_like ( image , dtype = bool ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 33, 3, 40], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 33, 3, 40], ["keyword_argument", "N0"], 3], ["Insert", "N0", ["identifier:dtype", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["identifier:bool", "T"], 2]] | matsuken92/scikit-image@e7288f9140b1a1a8a545f19434ec5805006b4a1a | BUG - Dtype conversion to Boolean in a new code path not included in current tests. | [
{
"sha": "2d40ded6e04156e46d75ce37fab2dafa08597d6b",
"filename": "skimage/feature/peak.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/e7288f9140b1a1a8a545f19434ec5805006b4a1a/skimage%2Ffeature%2Fpeak.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/e7288f9140b1a1a8a545f19434ec5805006b4a1a/skimage%2Ffeature%2Fpeak.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2Fpeak.py?ref=e7288f9140b1a1a8a545f19434ec5805006b4a1a",
"patch": "@@ -129,7 +129,7 @@ def peak_local_max(image, min_distance=10, threshold_abs=0, threshold_rel=0.1,\n if indices is True:\n return []\n else:\n- return np.zeros_like(image)\n+ return np.zeros_like(image, dtype=bool)\n \n image = image.copy()\n # Non maximum filter"
}
] |
scikit-image | 22f94d8707d3d9d2a36493403cbaeb61213dd68b | a77923fe4cb95a7223b86bbdcaa6b7489559f2c2 | skimage/transform/_warps.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -163,7 +163,7 @@ def rotate(image, angle, resize=False, order=1, mode='constant', cval=0.):
tform = tform1 + tform2 + tform3
output_shape = None
- if not resize:
+ if resize:
# determine shape of output image
corners = np.array([[1, 1], [1, rows], [cols, rows], [cols, 1]])
corners = tform(corners - 1)
| if not resize : corners = np . array ( [ [ 1 , 1 ] , [ 1 , rows ] , [ cols , rows ] , [ cols , 1 ] ] ) corners = tform ( corners - 1 ) | if resize : corners = np . array ( [ [ 1 , 1 ] , [ 1 , rows ] , [ cols , rows ] , [ cols , 1 ] ] ) corners = tform ( corners - 1 ) | CHANGE_UNARY_OPERATOR | [["Move", ["if_statement", 3, 5, 6, 37], ["identifier:resize", 3, 12, 3, 18], 1], ["Delete", ["not:not", 3, 8, 3, 11]], ["Delete", ["not_operator", 3, 8, 3, 18]]] | matsuken92/scikit-image@22f94d8707d3d9d2a36493403cbaeb61213dd68b | Fix resize argument handling in rotate.
It used to have exactly the opposite effect that it supposed to. | [
{
"sha": "0ace0937418ea1a7da6a1403d6e169cf831be6f5",
"filename": "skimage/transform/_warps.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/22f94d8707d3d9d2a36493403cbaeb61213dd68b/skimage%2Ftransform%2F_warps.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/22f94d8707d3d9d2a36493403cbaeb61213dd68b/skimage%2Ftransform%2F_warps.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ftransform%2F_warps.py?ref=22f94d8707d3d9d2a36493403cbaeb61213dd68b",
"patch": "@@ -163,7 +163,7 @@ def rotate(image, angle, resize=False, order=1, mode='constant', cval=0.):\n tform = tform1 + tform2 + tform3\n \n output_shape = None\n- if not resize:\n+ if resize:\n # determine shape of output image\n corners = np.array([[1, 1], [1, rows], [cols, rows], [cols, 1]])\n corners = tform(corners - 1)"
}
] |
scikit-image | bf28a38f6e50e3bf806b07b533683a76ebdfbd84 | a77923fe4cb95a7223b86bbdcaa6b7489559f2c2 | skimage/segmentation/boundaries.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -13,7 +13,7 @@ def find_boundaries(label_img):
return boundaries
-def mark_boundaries(image, label_img, color=(1, 1, 0), outline_color=None):
+def mark_boundaries(image, label_img, color=(1, 1, 0), outline_color=(0, 0, 0)):
| def mark_boundaries ( image , label_img , color = ( 1 , 1 , 0 ) , outline_color = None ) : | def mark_boundaries ( image , label_img , color = ( 1 , 1 , 0 ) , outline_color = ( 0 , 0 , 0 ) ) : | SINGLE_STMT | [["Insert", ["default_parameter", 3, 56, 3, 74], ["tuple", "N0"], 2], ["Insert", "N0", ["(:(", "T"], 0], ["Insert", "N0", ["integer:0", "T"], 1], ["Insert", "N0", [",:,", "T"], 2], ["Insert", "N0", ["integer:0", "T"], 3], ["Insert", "N0", [",:,", "T"], 4], ["Insert", "N0", ["integer:0", "T"], 5], ["Insert", "N0", ["):)", "T"], 6], ["Delete", ["none:None", 3, 70, 3, 74]]] | matsuken92/scikit-image@bf28a38f6e50e3bf806b07b533683a76ebdfbd84 | ENH: Make black the default boundary color for mark_boundaries.
This improves visibility in light-colored image regions. Note also that the new behavior matches the behavior from the 0.7 release. | [
{
"sha": "c5bf985b4669816a8a3b737c3cda81e1f8c1ead8",
"filename": "skimage/segmentation/boundaries.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/bf28a38f6e50e3bf806b07b533683a76ebdfbd84/skimage%2Fsegmentation%2Fboundaries.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/bf28a38f6e50e3bf806b07b533683a76ebdfbd84/skimage%2Fsegmentation%2Fboundaries.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fsegmentation%2Fboundaries.py?ref=bf28a38f6e50e3bf806b07b533683a76ebdfbd84",
"patch": "@@ -13,7 +13,7 @@ def find_boundaries(label_img):\n return boundaries\n \n \n-def mark_boundaries(image, label_img, color=(1, 1, 0), outline_color=None):\n+def mark_boundaries(image, label_img, color=(1, 1, 0), outline_color=(0, 0, 0)):\n \"\"\"Return image with boundaries between labeled regions highlighted.\n \n Parameters"
}
] |
scikit-image | 32cbf8e22609d97d801ab9967e307231107d2a68 | 5b72c5d52c1ce3e4cd8f810a1d4adbb863fc6846 | skimage/feature/corner.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -325,7 +325,7 @@ def corner_subpix(image, corners, window_size=11, alpha=0.99):
image : ndarray
Input image.
corners : (N, 2) ndarray
- Corner coordinates `(row, cols)`.
+ Corner coordinates `(row, col)`.
window_size : int, optional
Search window size for subpixel estimation.
alpha : float, optional
| `(row, cols)` . window_size : int , optional | `(row, col)` . window_size : int , optional | CHANGE_STRING_LITERAL | [["Update", ["string:`(row, cols)`", 3, 28, 3, 41], "`(row, col)`"]] | matsuken92/scikit-image@32cbf8e22609d97d801ab9967e307231107d2a68 | Fix typo in doc string | [
{
"sha": "a62dcc73dfeeee952d4f62e679a60057751f8b68",
"filename": "skimage/feature/corner.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/32cbf8e22609d97d801ab9967e307231107d2a68/skimage%2Ffeature%2Fcorner.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/32cbf8e22609d97d801ab9967e307231107d2a68/skimage%2Ffeature%2Fcorner.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2Fcorner.py?ref=32cbf8e22609d97d801ab9967e307231107d2a68",
"patch": "@@ -325,7 +325,7 @@ def corner_subpix(image, corners, window_size=11, alpha=0.99):\n image : ndarray\n Input image.\n corners : (N, 2) ndarray\n- Corner coordinates `(row, cols)`.\n+ Corner coordinates `(row, col)`.\n window_size : int, optional\n Search window size for subpixel estimation.\n alpha : float, optional"
}
] |
scikit-image | 9adae8b0c231fe79a6599946b2ebc4f2aebc4acf | 0e34c91e37f7ffbe401012a7f8a161bc95ce7fea | skimage/exposure/tests/test_exposure.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -101,7 +101,7 @@ def test_adapthist_grayscale():
nbins=128)
assert_almost_equal = np.testing.assert_almost_equal
assert img.shape == adapted.shape
- assert_almost_equal(peak_snr(img, adapted), 77.584, 5)
+ assert_almost_equal(peak_snr(img, adapted), 77.584, 3)
assert_almost_equal(norm_brightness_err(img, adapted), 0.038, 3)
return data, adapted
| assert_almost_equal ( peak_snr ( img , adapted ) , 77.584 , 5 ) | assert_almost_equal ( peak_snr ( img , adapted ) , 77.584 , 3 ) | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:5", 3, 57, 3, 58], "3"]] | matsuken92/scikit-image@9adae8b0c231fe79a6599946b2ebc4f2aebc4acf | Fixed last remaining sig figure problem. | [
{
"sha": "b41f53fe9d65bbb07a591b104242de12e69c499f",
"filename": "skimage/exposure/tests/test_exposure.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/9adae8b0c231fe79a6599946b2ebc4f2aebc4acf/skimage%2Fexposure%2Ftests%2Ftest_exposure.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/9adae8b0c231fe79a6599946b2ebc4f2aebc4acf/skimage%2Fexposure%2Ftests%2Ftest_exposure.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fexposure%2Ftests%2Ftest_exposure.py?ref=9adae8b0c231fe79a6599946b2ebc4f2aebc4acf",
"patch": "@@ -101,7 +101,7 @@ def test_adapthist_grayscale():\n nbins=128)\n assert_almost_equal = np.testing.assert_almost_equal\n assert img.shape == adapted.shape\n- assert_almost_equal(peak_snr(img, adapted), 77.584, 5)\n+ assert_almost_equal(peak_snr(img, adapted), 77.584, 3)\n assert_almost_equal(norm_brightness_err(img, adapted), 0.038, 3)\n return data, adapted\n "
}
] |
scikit-image | 67aada9adcea8e77e25f30d07cd23bc090920119 | ece045790e523b402fddd8014daeef9b54230ff7 | skimage/viewer/plugins/lineprofile.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -34,7 +34,7 @@ class LineProfile(PlotPlugin):
name = 'Line Profile'
- def __init__(self, linewidth=1, maxdist=5, epsilon='deprecated',
+ def __init__(self, linewidth=1, maxdist=10, epsilon='deprecated',
limits='image', **kwargs):
super(LineProfile, self).__init__(**kwargs)
| def __init__ ( self , linewidth = 1 , maxdist = 5 , epsilon = 'deprecated' , limits = 'image' , ** kwargs ) : super ( LineProfile , self ) . __init__ ( ** kwargs ) | def __init__ ( self , linewidth = 1 , maxdist = 10 , epsilon = 'deprecated' , limits = 'image' , ** kwargs ) : super ( LineProfile , self ) . __init__ ( ** kwargs ) | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:5", 2, 45, 2, 46], "10"]] | matsuken92/scikit-image@67aada9adcea8e77e25f30d07cd23bc090920119 | ENH: Increase default selection threshold for ease of use | [
{
"sha": "69326ff2e994618dd80562849f771d3d0dd27d1b",
"filename": "skimage/viewer/plugins/lineprofile.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/67aada9adcea8e77e25f30d07cd23bc090920119/skimage%2Fviewer%2Fplugins%2Flineprofile.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/67aada9adcea8e77e25f30d07cd23bc090920119/skimage%2Fviewer%2Fplugins%2Flineprofile.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fviewer%2Fplugins%2Flineprofile.py?ref=67aada9adcea8e77e25f30d07cd23bc090920119",
"patch": "@@ -34,7 +34,7 @@ class LineProfile(PlotPlugin):\n \"\"\"\n name = 'Line Profile'\n \n- def __init__(self, linewidth=1, maxdist=5, epsilon='deprecated',\n+ def __init__(self, linewidth=1, maxdist=10, epsilon='deprecated',\n limits='image', **kwargs):\n super(LineProfile, self).__init__(**kwargs)\n "
}
] |
scikit-image | 04434b008f55e0b7314a5fcf09c2ce013a32cb0d | 1aafdeb7d4c681adfb3523dbb163f2830136d838 | skimage/viewer/viewers/core.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -139,7 +139,7 @@ class ImageViewer(QMainWindow):
self._image_plot.set_array(image)
# Adjust size if new image shape doesn't match the original
- h, w = image.shape
+ h, w = image.shape[:2]
# update data coordinates (otherwise pixel coordinates are off)
self._image_plot.set_extent((0, w, h, 0))
# update display (otherwise image doesn't fill the canvas)
| h , w = image . shape | h , w = image . shape [ : 2 ] | SINGLE_STMT | [["Insert", ["assignment", 3, 9, 3, 27], ["subscript", "N0"], 2], ["Move", "N0", ["attribute", 3, 16, 3, 27], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Insert", "N0", ["slice", "N1"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Insert", "N1", [":::", "T"], 0], ["Insert", "N1", ["integer:2", "T"], 1]] | matsuken92/scikit-image@04434b008f55e0b7314a5fcf09c2ce013a32cb0d | BUG: Fix image viewer for RGB images | [
{
"sha": "1c3697079ab8e4f9d47786076627f098917697cf",
"filename": "skimage/viewer/viewers/core.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/04434b008f55e0b7314a5fcf09c2ce013a32cb0d/skimage%2Fviewer%2Fviewers%2Fcore.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/04434b008f55e0b7314a5fcf09c2ce013a32cb0d/skimage%2Fviewer%2Fviewers%2Fcore.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fviewer%2Fviewers%2Fcore.py?ref=04434b008f55e0b7314a5fcf09c2ce013a32cb0d",
"patch": "@@ -139,7 +139,7 @@ def image(self, image):\n self._image_plot.set_array(image)\n \n # Adjust size if new image shape doesn't match the original\n- h, w = image.shape\n+ h, w = image.shape[:2]\n # update data coordinates (otherwise pixel coordinates are off)\n self._image_plot.set_extent((0, w, h, 0))\n # update display (otherwise image doesn't fill the canvas)"
}
] |
scikit-image | cfe9e7def9454373a46026bcd201bbbcdb9054d7 | 43fecd0cb828dd0bb150b576d795fa24f1cf47bb | skimage/viewer/plugins/measure.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -41,7 +41,7 @@ class Measure(Plugin):
self.line_changed(np.transpose((x, y)))
def help(self):
- helpstr = ("Line profile tool",
+ helpstr = ("Measure tool",
"Select line to measure distance and angle.")
return '\n'.join(helpstr)
| helpstr = ( "Line profile tool" , "Select line to measure distance and angle." ) | helpstr = ( "Measure tool" , "Select line to measure distance and angle." ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"Line profile tool\"", 3, 20, 3, 39], "\"Measure tool\""]] | matsuken92/scikit-image@cfe9e7def9454373a46026bcd201bbbcdb9054d7 | Fix typo | [
{
"sha": "75ee86a470f973fbda637812e15d10b464ab258d",
"filename": "skimage/viewer/plugins/measure.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/cfe9e7def9454373a46026bcd201bbbcdb9054d7/skimage%2Fviewer%2Fplugins%2Fmeasure.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/cfe9e7def9454373a46026bcd201bbbcdb9054d7/skimage%2Fviewer%2Fplugins%2Fmeasure.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fviewer%2Fplugins%2Fmeasure.py?ref=cfe9e7def9454373a46026bcd201bbbcdb9054d7",
"patch": "@@ -41,7 +41,7 @@ def attach(self, image_viewer):\n self.line_changed(np.transpose((x, y)))\n \n def help(self):\n- helpstr = (\"Line profile tool\",\n+ helpstr = (\"Measure tool\",\n \"Select line to measure distance and angle.\")\n return '\\n'.join(helpstr)\n "
}
] |
scikit-image | 67042858599cba303fd8a33c895f946132641661 | 2532c659ec0144fcdd87e2f9b4a963bfa61d9f4e | skimage/viewer/canvastools/recttool.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -11,7 +11,7 @@ from skimage.viewer.canvastools.base import ToolHandles
__all__ = ['RectangleTool']
-class RectangleTool(RectangleSelector, CanvasToolBase):
+class RectangleTool(CanvasToolBase, RectangleSelector):
| class RectangleTool ( RectangleSelector , CanvasToolBase ) : | class RectangleTool ( CanvasToolBase , RectangleSelector ) : | SINGLE_STMT | [["Move", ["identifier:RectangleSelector", 3, 21, 3, 38], ["argument_list", 3, 20, 3, 55], 3], ["Move", [",:,", 3, 38, 3, 39], ["argument_list", 3, 20, 3, 55], 4]] | matsuken92/scikit-image@67042858599cba303fd8a33c895f946132641661 | BUG: Fix MRO bug when matplotlib not installed | [
{
"sha": "dd6886c7d9df2a3d8d8eee184b0b0e7876807ff4",
"filename": "skimage/viewer/canvastools/recttool.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/67042858599cba303fd8a33c895f946132641661/skimage%2Fviewer%2Fcanvastools%2Frecttool.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/67042858599cba303fd8a33c895f946132641661/skimage%2Fviewer%2Fcanvastools%2Frecttool.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fviewer%2Fcanvastools%2Frecttool.py?ref=67042858599cba303fd8a33c895f946132641661",
"patch": "@@ -11,7 +11,7 @@\n __all__ = ['RectangleTool']\n \n \n-class RectangleTool(RectangleSelector, CanvasToolBase):\n+class RectangleTool(CanvasToolBase, RectangleSelector):\n \"\"\"Widget for selecting a rectangular region in a plot.\n \n After making the desired selection, press \"Enter\" to accept the selection"
}
] |
scikit-image | 244e68c232ced5fd58eb6347aa1d94e64cc61dbd | 67042858599cba303fd8a33c895f946132641661 | skimage/viewer/canvastools/linetool.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -73,7 +73,7 @@ class LineTool(CanvasToolBase):
@end_points.setter
def end_points(self, pts):
- self._end_pts = pts
+ self._end_pts = np.asarray(pts)
self._line.set_data(np.transpose(pts))
self._handles.set_data(np.transpose(pts))
| self . _end_pts = pts | self . _end_pts = np . asarray ( pts ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["assignment", 3, 9, 3, 28], ["call", "N0"], 2], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Insert", "N1", ["identifier:np", "T"], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:asarray", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Move", "N2", ["identifier:pts", 3, 25, 3, 28], 1], ["Insert", "N2", ["):)", "T"], 2]] | matsuken92/scikit-image@244e68c232ced5fd58eb6347aa1d94e64cc61dbd | BUG: fix end_points setter when given a tuple
Dragging of end points was broken. | [
{
"sha": "7195e91de4a5713d867a6d49e979b2eb31e77955",
"filename": "skimage/viewer/canvastools/linetool.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/244e68c232ced5fd58eb6347aa1d94e64cc61dbd/skimage%2Fviewer%2Fcanvastools%2Flinetool.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/244e68c232ced5fd58eb6347aa1d94e64cc61dbd/skimage%2Fviewer%2Fcanvastools%2Flinetool.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fviewer%2Fcanvastools%2Flinetool.py?ref=244e68c232ced5fd58eb6347aa1d94e64cc61dbd",
"patch": "@@ -73,7 +73,7 @@ def end_points(self):\n \n @end_points.setter\n def end_points(self, pts):\n- self._end_pts = pts\n+ self._end_pts = np.asarray(pts)\n \n self._line.set_data(np.transpose(pts))\n self._handles.set_data(np.transpose(pts))"
}
] |
scikit-image | e0f4cd097817342ed0ed5cf4b40bd429f8782221 | 450eaee4d9d16a77331354c9adc7a4456fe01dd1 | skimage/__init__.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -71,7 +71,7 @@ except ImportError:
"""This would invoke the skimage test suite, but nose couldn't be
imported so the test suite can not run.
"""
- raise ImportError("Could not load nose. Unit tests not available.")
+ raise ImportError("Could not load nose. Unit tests not available.")
else:
def test(verbose=False):
"""Invoke the skimage test suite."""
| raise ImportError ( "Could not load nose. Unit tests not available." ) | raise ImportError ( "Could not load nose. Unit tests not available." ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"Could not load nose. Unit tests not available.\"", 3, 27, 3, 76], "\"Could not load nose. Unit tests not available.\""]] | matsuken92/scikit-image@e0f4cd097817342ed0ed5cf4b40bd429f8782221 | Fix double space in warning message | [
{
"sha": "1435892c1138bf956994ca60ea0da10aee7a303f",
"filename": "skimage/__init__.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/e0f4cd097817342ed0ed5cf4b40bd429f8782221/skimage%2F__init__.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/e0f4cd097817342ed0ed5cf4b40bd429f8782221/skimage%2F__init__.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2F__init__.py?ref=e0f4cd097817342ed0ed5cf4b40bd429f8782221",
"patch": "@@ -71,7 +71,7 @@ def test(verbose=False):\n \"\"\"This would invoke the skimage test suite, but nose couldn't be\n imported so the test suite can not run.\n \"\"\"\n- raise ImportError(\"Could not load nose. Unit tests not available.\")\n+ raise ImportError(\"Could not load nose. Unit tests not available.\")\n else:\n def test(verbose=False):\n \"\"\"Invoke the skimage test suite.\"\"\""
}
] |
scikit-image | 1fd4042ee6e881e3f1eeb81cd3e9b45634afdac5 | 70f1e6dd486bdd0ef21ae83d16d886d2e4fd5a68 | skimage/viewer/widgets/history.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -2,7 +2,7 @@ import os
from textwrap import dedent
try:
- from PyQt4 import QtGui
+ from PyQt4 import QtGui, QtCore
except ImportError:
print("Could not import PyQt4 -- skimage.viewer not available.")
| from PyQt4 import QtGui | from PyQt4 import QtGui , QtCore | SINGLE_STMT | [["Insert", ["import_from_statement", 3, 5, 3, 28], [",:,", "T"], 4], ["Insert", ["import_from_statement", 3, 5, 3, 28], ["dotted_name", "N0"], 5], ["Insert", "N0", ["identifier:QtCore", "T"], 0]] | matsuken92/scikit-image@1fd4042ee6e881e3f1eeb81cd3e9b45634afdac5 | BUG: Added required QtCore import | [
{
"sha": "0d9d39aea17bcdb5c2ead4df7c7404dc7567b2b4",
"filename": "skimage/viewer/widgets/history.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/1fd4042ee6e881e3f1eeb81cd3e9b45634afdac5/skimage%2Fviewer%2Fwidgets%2Fhistory.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/1fd4042ee6e881e3f1eeb81cd3e9b45634afdac5/skimage%2Fviewer%2Fwidgets%2Fhistory.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fviewer%2Fwidgets%2Fhistory.py?ref=1fd4042ee6e881e3f1eeb81cd3e9b45634afdac5",
"patch": "@@ -2,7 +2,7 @@\n from textwrap import dedent\n \n try:\n- from PyQt4 import QtGui\n+ from PyQt4 import QtGui, QtCore\n except ImportError:\n print(\"Could not import PyQt4 -- skimage.viewer not available.\")\n "
}
] |
scikit-image | c276ec06342b194fffb2cfd5efa4a87416bfcbaa | 3b43cf0dcfa96b453c7ab3f3b47d4ea9475ae567 | skimage/feature/_daisy.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -1,7 +1,7 @@
import numpy as np
from scipy import sqrt, pi, arctan2, cos, sin, exp
from scipy.ndimage import gaussian_filter
-import skimage
+import skimage.color
from skimage import img_as_float, draw
| import skimage | import skimage . color | SINGLE_STMT | [["Insert", ["dotted_name", 3, 8, 3, 15], [".:.", "T"], 1], ["Insert", ["dotted_name", 3, 8, 3, 15], ["identifier:color", "T"], 2]] | matsuken92/scikit-image@c276ec06342b194fffb2cfd5efa4a87416bfcbaa | Fixed submodule import. | [
{
"sha": "f83605b53c2bdcfbb221ac8e3f831ef2f51b8456",
"filename": "skimage/feature/_daisy.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/c276ec06342b194fffb2cfd5efa4a87416bfcbaa/skimage%2Ffeature%2F_daisy.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/c276ec06342b194fffb2cfd5efa4a87416bfcbaa/skimage%2Ffeature%2F_daisy.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2F_daisy.py?ref=c276ec06342b194fffb2cfd5efa4a87416bfcbaa",
"patch": "@@ -1,7 +1,7 @@\n import numpy as np\n from scipy import sqrt, pi, arctan2, cos, sin, exp\n from scipy.ndimage import gaussian_filter\n-import skimage\n+import skimage.color\n from skimage import img_as_float, draw\n \n "
}
] |
scikit-image | 06a8e7af85c0233541bc2b3f3692adfa1a9fc60e | 0e08acd7c96049aa3c04e6c701a6ff80aa55ca37 | skimage/viewer/widgets/history.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -74,7 +74,7 @@ class SaveButtons(BaseWidget):
self.layout.addWidget(self.save_file)
def save_to_stack(self):
- image = self.plugin.image_viewer.image.copy()
+ image = self.plugin.filtered_image.copy()
io.push(image)
| image = self . plugin . image_viewer . image . copy ( ) | image = self . plugin . filtered_image . copy ( ) | SINGLE_STMT | [["Update", ["identifier:image_viewer", 3, 29, 3, 41], "filtered_image"], ["Delete", [".:.", 3, 41, 3, 42]], ["Delete", ["identifier:image", 3, 42, 3, 47]]] | matsuken92/scikit-image@06a8e7af85c0233541bc2b3f3692adfa1a9fc60e | BUG: Fix save to stack so it saves filtered image | [
{
"sha": "ce87f9ac1e88ab1aafe48a985a02c17c36945edc",
"filename": "skimage/viewer/widgets/history.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/06a8e7af85c0233541bc2b3f3692adfa1a9fc60e/skimage%2Fviewer%2Fwidgets%2Fhistory.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/06a8e7af85c0233541bc2b3f3692adfa1a9fc60e/skimage%2Fviewer%2Fwidgets%2Fhistory.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fviewer%2Fwidgets%2Fhistory.py?ref=06a8e7af85c0233541bc2b3f3692adfa1a9fc60e",
"patch": "@@ -74,7 +74,7 @@ def __init__(self, name='Save to:', default_format='png'):\n self.layout.addWidget(self.save_file)\n \n def save_to_stack(self):\n- image = self.plugin.image_viewer.image.copy()\n+ image = self.plugin.filtered_image.copy()\n io.push(image)\n \n msg = dedent('''\\"
}
] |
scikit-image | 42068041750e9ef0c7799e9177917465d8225854 | 8d8b8ef4f74c00fbfb21bf1f603a3841f96a0b4a | skimage/feature/_daisy.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -1,7 +1,7 @@
import numpy as np
from scipy import sqrt, pi, arctan2, cos, sin, exp
from scipy.ndimage import gaussian_filter
-import skimage
+import skimage.color
from skimage import img_as_float, draw
| import skimage | import skimage . color | SINGLE_STMT | [["Insert", ["dotted_name", 3, 8, 3, 15], [".:.", "T"], 1], ["Insert", ["dotted_name", 3, 8, 3, 15], ["identifier:color", "T"], 2]] | matsuken92/scikit-image@42068041750e9ef0c7799e9177917465d8225854 | Fixed submodule import. | [
{
"sha": "f83605b53c2bdcfbb221ac8e3f831ef2f51b8456",
"filename": "skimage/feature/_daisy.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/42068041750e9ef0c7799e9177917465d8225854/skimage%2Ffeature%2F_daisy.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/42068041750e9ef0c7799e9177917465d8225854/skimage%2Ffeature%2F_daisy.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2F_daisy.py?ref=42068041750e9ef0c7799e9177917465d8225854",
"patch": "@@ -1,7 +1,7 @@\n import numpy as np\n from scipy import sqrt, pi, arctan2, cos, sin, exp\n from scipy.ndimage import gaussian_filter\n-import skimage\n+import skimage.color\n from skimage import img_as_float, draw\n \n "
}
] |
scikit-image | 713e5dc734f817601ea4c68c04b918161d1a70fa | eff906bfb3f9dc47a32578d30231ca856372b966 | skimage/exposure/_adapthist.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -226,7 +226,7 @@ def clip_histogram(hist, clip_limit):
n_excess = excess.sum() - excess.size * clip_limit
# Second part: clip histogram and redistribute excess pixels in each bin
- bin_incr = n_excess / hist.size # average binincrement
+ bin_incr = int(n_excess / hist.size) # average binincrement
upper = clip_limit - bin_incr # Bins larger than upper set to cliplimit
hist[excess_mask] = clip_limit
| bin_incr = n_excess / hist . size | bin_incr = int ( n_excess / hist . size ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["assignment", 3, 5, 3, 36], ["call", "N0"], 2], ["Insert", "N0", ["identifier:int", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["binary_operator", 3, 16, 3, 36], 1], ["Insert", "N1", ["):)", "T"], 2]] | matsuken92/scikit-image@713e5dc734f817601ea4c68c04b918161d1a70fa | BUG: Adapthist error caused by divisor operator change in py3k | [
{
"sha": "9178751365780c93572640a3f09758950d2d70d5",
"filename": "skimage/exposure/_adapthist.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/713e5dc734f817601ea4c68c04b918161d1a70fa/skimage%2Fexposure%2F_adapthist.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/713e5dc734f817601ea4c68c04b918161d1a70fa/skimage%2Fexposure%2F_adapthist.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fexposure%2F_adapthist.py?ref=713e5dc734f817601ea4c68c04b918161d1a70fa",
"patch": "@@ -226,7 +226,7 @@ def clip_histogram(hist, clip_limit):\n n_excess = excess.sum() - excess.size * clip_limit\n \n # Second part: clip histogram and redistribute excess pixels in each bin\n- bin_incr = n_excess / hist.size # average binincrement\n+ bin_incr = int(n_excess / hist.size) # average binincrement\n upper = clip_limit - bin_incr # Bins larger than upper set to cliplimit\n \n hist[excess_mask] = clip_limit"
}
] |
scikit-image | 67b408a3fc0de4365884b10bf0ed20f9efc8f209 | 830c6b650b8aad4c1a1a79842233515d053ebef3 | skimage/feature/greycomatrix.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -107,7 +107,7 @@ def greycomatrix(image, distances, angles, levels=256, symmetric=False,
# GLCMs are sometimes all zero, so temporarily suppress warning
old_settings = np.seterr(invalid='ignore')
P /= glcm_sums
- np.seterr(invalid=old_settings['divide'])
+ np.seterr(invalid=old_settings['invalid'])
P = np.nan_to_num(P)
else:
P /= glcm_sums
| np . seterr ( invalid = old_settings [ 'divide' ] ) | np . seterr ( invalid = old_settings [ 'invalid' ] ) | CHANGE_STRING_LITERAL | [["Update", ["string:'divide'", 3, 44, 3, 52], "'invalid'"]] | matsuken92/scikit-image@67b408a3fc0de4365884b10bf0ed20f9efc8f209 | BUG: Fixed warning suppression error | [
{
"sha": "41bcc3a874a69ed48611bdc2a93083125e17b997",
"filename": "skimage/feature/greycomatrix.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/67b408a3fc0de4365884b10bf0ed20f9efc8f209/skimage%2Ffeature%2Fgreycomatrix.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/67b408a3fc0de4365884b10bf0ed20f9efc8f209/skimage%2Ffeature%2Fgreycomatrix.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2Fgreycomatrix.py?ref=67b408a3fc0de4365884b10bf0ed20f9efc8f209",
"patch": "@@ -107,7 +107,7 @@ def greycomatrix(image, distances, angles, levels=256, symmetric=False,\n # GLCMs are sometimes all zero, so temporarily suppress warning\n old_settings = np.seterr(invalid='ignore') \n P /= glcm_sums\n- np.seterr(invalid=old_settings['divide'])\n+ np.seterr(invalid=old_settings['invalid'])\n P = np.nan_to_num(P)\n else:\n P /= glcm_sums"
}
] |
scikit-image | 2d4abbaa8655bea8ccdfb8151e634ac685dacac8 | c0b36010562000b6fd9f0c095fe6828d6d4a2cd6 | skimage/io/collection.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -8,7 +8,7 @@ from glob import glob
import os.path
import numpy as np
-from io import imread
+from ._io import imread
class MultiImage(object):
| from io import imread | from . _io import imread | SINGLE_STMT | [["Insert", ["import_from_statement", 3, 1, 3, 22], ["relative_import", "N0"], 1], ["Insert", "N0", ["import_prefix", "N1"], 0], ["Move", "N0", ["dotted_name", 3, 6, 3, 8], 1], ["Insert", "N1", [".:.", "T"], 0], ["Update", ["identifier:io", 3, 6, 3, 8], "_io"]] | matsuken92/scikit-image@2d4abbaa8655bea8ccdfb8151e634ac685dacac8 | BUG: Import imread from renamed _io module. | [
{
"sha": "317298d155e557c30e2278825194edb1227fe241",
"filename": "skimage/io/collection.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/2d4abbaa8655bea8ccdfb8151e634ac685dacac8/skimage%2Fio%2Fcollection.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/2d4abbaa8655bea8ccdfb8151e634ac685dacac8/skimage%2Fio%2Fcollection.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fio%2Fcollection.py?ref=2d4abbaa8655bea8ccdfb8151e634ac685dacac8",
"patch": "@@ -8,7 +8,7 @@\n import os.path\n \n import numpy as np\n-from io import imread\n+from ._io import imread\n \n \n class MultiImage(object):"
}
] |
scikit-image | cd6d97012ffef2a1d442ed64c7567d4e94dae4a9 | 85531c6ffa002a4ca1a38941b91db3b78eb8ffa4 | skimage/measure/find_contours.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -1,5 +1,5 @@
import numpy as np
-import _find_contours
+from . import _find_contours
from collections import deque
| import _find_contours | from . import _find_contours | SINGLE_STMT | [["Insert", ["module", 0, 1, 5, 0], ["import_from_statement", "N0"], 1], ["Insert", "N0", ["from:from", "T"], 0], ["Insert", "N0", ["relative_import", "N1"], 1], ["Move", "N0", ["import:import", 1, 1, 1, 7], 2], ["Move", "N0", ["dotted_name", 1, 8, 1, 22], 3], ["Insert", "N1", ["import_prefix", "N2"], 0], ["Insert", "N2", [".:.", "T"], 0], ["Delete", ["import_statement", 1, 1, 1, 22]]] | matsuken92/scikit-image@cd6d97012ffef2a1d442ed64c7567d4e94dae4a9 | Fix ImportError on Python 3 | [
{
"sha": "92f848d22704f53d8d74cd46ac6164b17d84d7a2",
"filename": "skimage/measure/find_contours.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/cd6d97012ffef2a1d442ed64c7567d4e94dae4a9/skimage%2Fmeasure%2Ffind_contours.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/cd6d97012ffef2a1d442ed64c7567d4e94dae4a9/skimage%2Fmeasure%2Ffind_contours.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmeasure%2Ffind_contours.py?ref=cd6d97012ffef2a1d442ed64c7567d4e94dae4a9",
"patch": "@@ -1,5 +1,5 @@\n import numpy as np\n-import _find_contours\n+from . import _find_contours\n \n from collections import deque\n "
}
] |
scikit-image | 9133ab932c2761f7f7cbf1fa209c61599b46b58a | cd6d97012ffef2a1d442ed64c7567d4e94dae4a9 | skimage/feature/greycomatrix.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -6,7 +6,7 @@ properties to characterize image textures.
import numpy as np
import skimage.util
-from _greycomatrix import _glcm_loop
+from ._greycomatrix import _glcm_loop
def greycomatrix(image, distances, angles, levels=256, symmetric=False,
| from _greycomatrix import _glcm_loop | from . _greycomatrix import _glcm_loop | SINGLE_STMT | [["Insert", ["import_from_statement", 3, 1, 3, 37], ["relative_import", "N0"], 1], ["Insert", "N0", ["import_prefix", "N1"], 0], ["Move", "N0", ["dotted_name", 3, 6, 3, 19], 1], ["Insert", "N1", [".:.", "T"], 0]] | matsuken92/scikit-image@9133ab932c2761f7f7cbf1fa209c61599b46b58a | Fix ImportError on Python 3 | [
{
"sha": "5212cf63e4eea5fe18fee61f6bedafa2f01a155d",
"filename": "skimage/feature/greycomatrix.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/9133ab932c2761f7f7cbf1fa209c61599b46b58a/skimage%2Ffeature%2Fgreycomatrix.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/9133ab932c2761f7f7cbf1fa209c61599b46b58a/skimage%2Ffeature%2Fgreycomatrix.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2Fgreycomatrix.py?ref=9133ab932c2761f7f7cbf1fa209c61599b46b58a",
"patch": "@@ -6,7 +6,7 @@\n import numpy as np\n import skimage.util\n \n-from _greycomatrix import _glcm_loop\n+from ._greycomatrix import _glcm_loop\n \n \n def greycomatrix(image, distances, angles, levels=256, symmetric=False,"
}
] |
scikit-image | 14c89fefa54f9ae963f4d4a47ded6e02f3b596d5 | 9133ab932c2761f7f7cbf1fa209c61599b46b58a | skimage/morphology/skeletonize.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -5,7 +5,7 @@ Algorithms for computing the skeleton of a binary image
import numpy as np
from scipy import ndimage
-from _skeletonize import _skeletonize_loop, _table_lookup_index
+from ._skeletonize import _skeletonize_loop, _table_lookup_index
# --------- Skeletonization by morphological thinning ---------
| from _skeletonize import _skeletonize_loop , _table_lookup_index | from . _skeletonize import _skeletonize_loop , _table_lookup_index | SINGLE_STMT | [["Insert", ["import_from_statement", 3, 1, 3, 64], ["relative_import", "N0"], 1], ["Insert", "N0", ["import_prefix", "N1"], 0], ["Move", "N0", ["dotted_name", 3, 6, 3, 18], 1], ["Insert", "N1", [".:.", "T"], 0]] | matsuken92/scikit-image@14c89fefa54f9ae963f4d4a47ded6e02f3b596d5 | Fix ImportError on Python 3 | [
{
"sha": "e734d8c6b3064e8455ec087fdc9743f18224317c",
"filename": "skimage/morphology/skeletonize.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/14c89fefa54f9ae963f4d4a47ded6e02f3b596d5/skimage%2Fmorphology%2Fskeletonize.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/14c89fefa54f9ae963f4d4a47ded6e02f3b596d5/skimage%2Fmorphology%2Fskeletonize.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmorphology%2Fskeletonize.py?ref=14c89fefa54f9ae963f4d4a47ded6e02f3b596d5",
"patch": "@@ -5,7 +5,7 @@\n import numpy as np\n from scipy import ndimage\n \n-from _skeletonize import _skeletonize_loop, _table_lookup_index\n+from ._skeletonize import _skeletonize_loop, _table_lookup_index\n \n # --------- Skeletonization by morphological thinning ---------\n "
}
] |
scikit-image | e7d37997d92b911dd2662112474e8574246e513a | 6a6e273d0679e35237db877056b4e85e8ca41e56 | skimage/thresholding/thresholding.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -28,7 +28,7 @@ def threshold_otsu(image, bins=256):
--------
>>> from skimage.data import camera
>>> image = camera()
- >>> thresh = threshold_otsu(camera())
+ >>> thresh = threshold_otsu(image)
>>> binary = image > thresh
| thresh = threshold_otsu ( camera ( ) ) | thresh = threshold_otsu ( image ) | SINGLE_STMT | [["Update", ["identifier:camera", 3, 33, 3, 39], "image"], ["Move", ["argument_list", 3, 32, 3, 42], ["identifier:camera", 3, 33, 3, 39], 1], ["Move", ["argument_list", 3, 32, 3, 42], ["):)", 3, 40, 3, 41], 2], ["Delete", ["(:(", 3, 39, 3, 40]], ["Delete", ["argument_list", 3, 39, 3, 41]], ["Delete", ["call", 3, 33, 3, 41]], ["Delete", ["):)", 3, 41, 3, 42]]] | matsuken92/scikit-image@e7d37997d92b911dd2662112474e8574246e513a | Fix minor typo in docstring example | [
{
"sha": "980dfebaab5c33cbc5451657e658b28d1e9f0ce1",
"filename": "skimage/thresholding/thresholding.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/e7d37997d92b911dd2662112474e8574246e513a/skimage%2Fthresholding%2Fthresholding.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/e7d37997d92b911dd2662112474e8574246e513a/skimage%2Fthresholding%2Fthresholding.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fthresholding%2Fthresholding.py?ref=e7d37997d92b911dd2662112474e8574246e513a",
"patch": "@@ -28,7 +28,7 @@ def threshold_otsu(image, bins=256):\n --------\n >>> from skimage.data import camera\n >>> image = camera()\n- >>> thresh = threshold_otsu(camera())\n+ >>> thresh = threshold_otsu(image)\n >>> binary = image > thresh\n \"\"\"\n hist, bin_centers = histogram(image, bins)"
}
] |
scikit-image | 4df36631f64285b88bdfd044a64a34547b152b17 | c7b3f1e84c435630760bc4a0743e7ef15d708017 | skimage/io/_plugins/util.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -213,7 +213,7 @@ class ThreadDispatch(object):
self.chunks.append((img[(height/2):, :, :],
stateimg[(height/2):, :, :]))
- for i in range(self.cores):
+ for i in range(len(self.chunks)):
self.threads.append(ImgThread(func, self.chunks[i][0],
self.chunks[i][1], *args))
| for i in range ( self . cores ) : self . threads . append ( ImgThread ( func , self . chunks [ i ] [ 0 ] , self . chunks [ i ] [ 1 ] , * args ) ) | for i in range ( len ( self . chunks ) ) : self . threads . append ( ImgThread ( func , self . chunks [ i ] [ 0 ] , self . chunks [ i ] [ 1 ] , * args ) ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 23, 3, 35], ["call", "N0"], 1], ["Insert", ["argument_list", 3, 23, 3, 35], ["):)", "T"], 2], ["Insert", "N0", ["identifier:len", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["attribute", 3, 24, 3, 34], 1], ["Move", "N1", ["):)", 3, 34, 3, 35], 2], ["Update", ["identifier:cores", 3, 29, 3, 34], "chunks"]] | matsuken92/scikit-image@4df36631f64285b88bdfd044a64a34547b152b17 | BUG: Dispatch threads to process entire image. | [
{
"sha": "350b43e548887ecda9d0e2f798e914697a653f10",
"filename": "skimage/io/_plugins/util.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/4df36631f64285b88bdfd044a64a34547b152b17/skimage%2Fio%2F_plugins%2Futil.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/4df36631f64285b88bdfd044a64a34547b152b17/skimage%2Fio%2F_plugins%2Futil.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fio%2F_plugins%2Futil.py?ref=4df36631f64285b88bdfd044a64a34547b152b17",
"patch": "@@ -213,7 +213,7 @@ def __init__(self, img, stateimg, func, *args):\n self.chunks.append((img[(height/2):, :, :],\n stateimg[(height/2):, :, :]))\n \n- for i in range(self.cores):\n+ for i in range(len(self.chunks)):\n self.threads.append(ImgThread(func, self.chunks[i][0],\n self.chunks[i][1], *args))\n "
}
] |
scikit-image | 69444305e868890f36b997bf5ee15162839d0478 | 111a3c1584b51db32e21207825d6b1fdba0b303a | skimage/transform/hough_transform.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -66,15 +66,15 @@ def probabilistic_hough(img, threshold=10, line_length=50, line_gap=10, theta=No
----------
img : (M, N) ndarray
Input image with nonzero values representing edges.
- value_threshold: int
+ threshold : int
Threshold
- line_length: int, optional (default 50)
+ line_length : int, optional (default 50)
Minimum accepted length of detected lines.
Increase the parameter to extract longer lines.
- line_gap: int, optional, (default 10)
+ line_gap : int, optional, (default 10)
Maximum gap between pixels to still form a line.
Increase the parameter to merge broken lines more aggresively.
- theta :1D ndarray, dtype=double, optional, default (-pi/2 .. pi/2)
+ theta : 1D ndarray, dtype=double, optional, default (-pi/2 .. pi/2)
Angles at which to compute the transform, in radians.
Returns
| with nonzero values representing edges . value_threshold : int | with nonzero values representing edges . threshold : int | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:value_threshold", 3, 5, 3, 20], "threshold"]] | matsuken92/scikit-image@69444305e868890f36b997bf5ee15162839d0478 | DOC: fix probabilistic_hough docstring--use correct keyword arg in the docstring, plus a few spacing tweaks. | [
{
"sha": "a1a0187ce1e836b968294d8d2b1b2c89f2a17799",
"filename": "skimage/transform/hough_transform.py",
"status": "modified",
"additions": 4,
"deletions": 4,
"changes": 8,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/69444305e868890f36b997bf5ee15162839d0478/skimage%2Ftransform%2Fhough_transform.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/69444305e868890f36b997bf5ee15162839d0478/skimage%2Ftransform%2Fhough_transform.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ftransform%2Fhough_transform.py?ref=69444305e868890f36b997bf5ee15162839d0478",
"patch": "@@ -66,15 +66,15 @@ def probabilistic_hough(img, threshold=10, line_length=50, line_gap=10, theta=No\n ----------\n img : (M, N) ndarray\n Input image with nonzero values representing edges.\n- value_threshold: int\n+ threshold : int\n Threshold \n- line_length: int, optional (default 50)\n+ line_length : int, optional (default 50)\n Minimum accepted length of detected lines.\n Increase the parameter to extract longer lines.\n- line_gap: int, optional, (default 10)\n+ line_gap : int, optional, (default 10)\n Maximum gap between pixels to still form a line. \n Increase the parameter to merge broken lines more aggresively.\n- theta :1D ndarray, dtype=double, optional, default (-pi/2 .. pi/2)\n+ theta : 1D ndarray, dtype=double, optional, default (-pi/2 .. pi/2)\n Angles at which to compute the transform, in radians.\n \n Returns"
}
] |
scikit-image | a4c986b02ff636d6414bbdff8c346a2e0b0a0d2b | b5dce45446732a0b182924622b6e60e035eb379d | skimage/io/_plugins/freeimage_plugin.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -391,7 +391,7 @@ def _process_multipage(filename, flags, process_func):
def read_multipage(filename, flags=0):
"""Read a multipage image to a list of numpy arrays, where each
array is of shape (width, height) for greyscale images, or shape
- (nchannels, width, height) for RGB or RGBA images.
+ (width, height, nchannels) for RGB or RGBA images.
"""
return _process_multipage(filename, flags, _array_from_bitmap)
| """Read a multipage image to a list of numpy arrays, where each
array is of shape (width, height) for greyscale images, or shape
(nchannels, width, height) for RGB or RGBA images.
""" | """Read a multipage image to a list of numpy arrays, where each
array is of shape (width, height) for greyscale images, or shape
(width, height, nchannels) for RGB or RGBA images.
""" | CHANGE_STRING_LITERAL | [["Update", ["string:\"\"\"Read a multipage image to a list of numpy arrays, where each\n array is of shape (width, height) for greyscale images, or shape\n (nchannels, width, height) for RGB or RGBA images.\n \"\"\"", 1, 5, 4, 8], "\"\"\"Read a multipage image to a list of numpy arrays, where each\n array is of shape (width, height) for greyscale images, or shape\n (width, height, nchannels) for RGB or RGBA images.\n \"\"\""]] | matsuken92/scikit-image@a4c986b02ff636d6414bbdff8c346a2e0b0a0d2b | DOC: Fix read_multipage docstring | [
{
"sha": "a549d6c6a5f89116ee77b1943f3b7044e4b5489a",
"filename": "skimage/io/_plugins/freeimage_plugin.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/a4c986b02ff636d6414bbdff8c346a2e0b0a0d2b/skimage%2Fio%2F_plugins%2Ffreeimage_plugin.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/a4c986b02ff636d6414bbdff8c346a2e0b0a0d2b/skimage%2Fio%2F_plugins%2Ffreeimage_plugin.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fio%2F_plugins%2Ffreeimage_plugin.py?ref=a4c986b02ff636d6414bbdff8c346a2e0b0a0d2b",
"patch": "@@ -391,7 +391,7 @@ def _process_multipage(filename, flags, process_func):\n def read_multipage(filename, flags=0):\n \"\"\"Read a multipage image to a list of numpy arrays, where each\n array is of shape (width, height) for greyscale images, or shape\n- (nchannels, width, height) for RGB or RGBA images.\n+ (width, height, nchannels) for RGB or RGBA images.\n \"\"\"\n return _process_multipage(filename, flags, _array_from_bitmap)\n "
}
] |
scikit-image | 63f17344e59f0fa27920a9221ddb28fe64dec0b7 | fd0e88b9867b1f398912c8a6cd309c26d0d566db | skimage/filter/harris.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -103,7 +103,7 @@ def harris(image, min_distance=10, threshold=0.1, eps=1e-6,
candidate_values = harrisim[candidates]
# sort candidates
- index = np.argsort(candidate_values)
+ index = np.argsort(candidate_values)[::-1]
# store allowed point locations in array
allowed_locations = np.zeros(harrisim.shape)
| index = np . argsort ( candidate_values ) | index = np . argsort ( candidate_values ) [ : : - 1 ] | SINGLE_STMT | [["Insert", ["assignment", 3, 5, 3, 41], ["subscript", "N0"], 2], ["Move", "N0", ["call", 3, 13, 3, 41], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Insert", "N0", ["slice", "N1"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Insert", "N1", [":::", "T"], 0], ["Insert", "N1", [":::", "T"], 1], ["Insert", "N1", ["unary_operator", "N2"], 2], ["Insert", "N2", ["-:-", "T"], 0], ["Insert", "N2", ["integer:1", "T"], 1]] | matsuken92/scikit-image@63f17344e59f0fa27920a9221ddb28fe64dec0b7 | Fix peak detection algorithm.
Reverse sorted values so that max peak is checked first. | [
{
"sha": "2f5b219859ac28df8a5aaa17278dea1025895b54",
"filename": "skimage/filter/harris.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/63f17344e59f0fa27920a9221ddb28fe64dec0b7/skimage%2Ffilter%2Fharris.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/63f17344e59f0fa27920a9221ddb28fe64dec0b7/skimage%2Ffilter%2Fharris.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffilter%2Fharris.py?ref=63f17344e59f0fa27920a9221ddb28fe64dec0b7",
"patch": "@@ -103,7 +103,7 @@ def harris(image, min_distance=10, threshold=0.1, eps=1e-6,\n candidate_values = harrisim[candidates]\n \n # sort candidates\n- index = np.argsort(candidate_values)\n+ index = np.argsort(candidate_values)[::-1]\n \n # store allowed point locations in array\n allowed_locations = np.zeros(harrisim.shape)"
}
] |
scikit-image | 078ed488c8703c103fda1bac3513c8b5b4218095 | cfc1dfa16b1e94dba42f2f5766a41cbbede03f7d | skimage/util/dtype.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -120,7 +120,7 @@ def _convert(image, dtype):
# int8 -> uint32
image = dtype(image)
image *= 2**16 + 2**8 + 1
- result += image
+ result += dtype(image)
return result
if kind == 'i':
# signed integer -> signed integer
| result += image | result += dtype ( image ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["augmented_assignment", 3, 9, 3, 24], ["call", "N0"], 2], ["Insert", "N0", ["identifier:dtype", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["identifier:image", 3, 19, 3, 24], 1], ["Insert", "N1", ["):)", "T"], 2]] | matsuken92/scikit-image@078ed488c8703c103fda1bac3513c8b5b4218095 | Fix casting error when converting from int8 to uint16.
This error only comes up in development versions of numpy, which refuses to cast the input to the correct type for inplace operations. | [
{
"sha": "11199cc805cbef79324911a8dbee1d381a5cbfca",
"filename": "skimage/util/dtype.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/078ed488c8703c103fda1bac3513c8b5b4218095/skimage%2Futil%2Fdtype.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/078ed488c8703c103fda1bac3513c8b5b4218095/skimage%2Futil%2Fdtype.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Futil%2Fdtype.py?ref=078ed488c8703c103fda1bac3513c8b5b4218095",
"patch": "@@ -120,7 +120,7 @@ def prec_loss():\n # int8 -> uint32\n image = dtype(image)\n image *= 2**16 + 2**8 + 1\n- result += image\n+ result += dtype(image)\n return result\n if kind == 'i':\n # signed integer -> signed integer"
}
] |
scikit-image | a17f339b82b7c502cbc3ce5e4d4a391d1ab5b193 | c85ab6906490b86e54cfd59632fecc06a053d311 | skimage/feature/__init__.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -1,4 +1,4 @@
from hog import hog
from greycomatrix import greycomatrix, greycoprops
from peak import peak_local_max
-from harris import harris
+from .harris import harris
| from harris import harris | from . harris import harris | SINGLE_STMT | [["Insert", ["import_from_statement", 3, 1, 3, 26], ["relative_import", "N0"], 1], ["Insert", "N0", ["import_prefix", "N1"], 0], ["Move", "N0", ["dotted_name", 3, 6, 3, 12], 1], ["Insert", "N1", [".:.", "T"], 0]] | matsuken92/scikit-image@a17f339b82b7c502cbc3ce5e4d4a391d1ab5b193 | BUG: Fix import of harris. | [
{
"sha": "fd3616f6b2772ec1f49b6f6fc9211f6c7ce94715",
"filename": "skimage/feature/__init__.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/a17f339b82b7c502cbc3ce5e4d4a391d1ab5b193/skimage%2Ffeature%2F__init__.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/a17f339b82b7c502cbc3ce5e4d4a391d1ab5b193/skimage%2Ffeature%2F__init__.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2F__init__.py?ref=a17f339b82b7c502cbc3ce5e4d4a391d1ab5b193",
"patch": "@@ -1,4 +1,4 @@\n from hog import hog\n from greycomatrix import greycomatrix, greycoprops\n from peak import peak_local_max\n-from harris import harris\n+from .harris import harris"
}
] |
scikit-image | 96f5d14000526727b453b50abfd5361a662a9ee7 | c1c954e19d4d6e56ecdd405a1b58ad073688b6dc | skimage/version.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -1,2 +1,2 @@
# THIS FILE IS GENERATED FROM THE SKIMAGE SETUP.PY
-version='0.5dev'
+version='unbuilt-dev'
| version = '0.5dev' | version = 'unbuilt-dev' | CHANGE_STRING_LITERAL | [["Update", ["string:'0.5dev'", 1, 9, 1, 17], "'unbuilt-dev'"]] | matsuken92/scikit-image@96f5d14000526727b453b50abfd5361a662a9ee7 | FIX: revert version.py | [
{
"sha": "ab15b0be85558c635d85c1d2be5edd1b5d10327c",
"filename": "skimage/version.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/96f5d14000526727b453b50abfd5361a662a9ee7/skimage%2Fversion.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/96f5d14000526727b453b50abfd5361a662a9ee7/skimage%2Fversion.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fversion.py?ref=96f5d14000526727b453b50abfd5361a662a9ee7",
"patch": "@@ -1,2 +1,2 @@\n # THIS FILE IS GENERATED FROM THE SKIMAGE SETUP.PY\n-version='0.5dev'\n+version='unbuilt-dev'"
}
] |
scikit-image | faf92e1a6d9909b8da6772574993530129242fe8 | 7c8c661440ba213870927b09c56f818bd0aeacdc | skimage/segmentation/random_walker_segmentation.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -286,7 +286,7 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True):
data = np.atleast_3d(data)
if copy:
labels = np.copy(labels)
- labels = labels.astype(np.int)
+ labels = labels.astype(np.intp)
# If the array has pruned zones, be sure that no isolated pixels
# exist between pruned zones (they could not be determined)
if np.any(labels < 0):
| labels = labels . astype ( np . int ) | labels = labels . astype ( np . intp ) | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:int", 3, 31, 3, 34], "intp"]] | matsuken92/scikit-image@faf92e1a6d9909b8da6772574993530129242fe8 | Fix TypeError on 64 bit platforms | [
{
"sha": "130be926df7ba0fc202d001d51d27426779e1aff",
"filename": "skimage/segmentation/random_walker_segmentation.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/faf92e1a6d9909b8da6772574993530129242fe8/skimage%2Fsegmentation%2Frandom_walker_segmentation.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/faf92e1a6d9909b8da6772574993530129242fe8/skimage%2Fsegmentation%2Frandom_walker_segmentation.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fsegmentation%2Frandom_walker_segmentation.py?ref=faf92e1a6d9909b8da6772574993530129242fe8",
"patch": "@@ -286,7 +286,7 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True):\n data = np.atleast_3d(data)\n if copy:\n labels = np.copy(labels)\n- labels = labels.astype(np.int)\n+ labels = labels.astype(np.intp)\n # If the array has pruned zones, be sure that no isolated pixels\n # exist between pruned zones (they could not be determined)\n if np.any(labels < 0):"
}
] |
scikit-image | 694fb1a8d702a3c1baff84be1290ae794ee10bcd | 02edb162fd9effe5dafcac76955279da41c9107f | skimage/__init__.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -56,7 +56,7 @@ import os.path as _osp
pkg_dir = _osp.abspath(_osp.dirname(__file__))
data_dir = _osp.join(pkg_dir, 'data')
-from version import version as __version__
+from .version import version as __version__
def _setup_test(verbose=False):
import gzip
| from version import version as __version__ | from . version import version as __version__ | SINGLE_STMT | [["Insert", ["import_from_statement", 3, 1, 3, 43], ["relative_import", "N0"], 1], ["Insert", "N0", ["import_prefix", "N1"], 0], ["Move", "N0", ["dotted_name", 3, 6, 3, 13], 1], ["Insert", "N1", [".:.", "T"], 0]] | matsuken92/scikit-image@694fb1a8d702a3c1baff84be1290ae794ee10bcd | PKG: Fix version import to allow build on 3.2. | [
{
"sha": "ab707d7229c90d02496cfe3ed33d94e45d070879",
"filename": "skimage/__init__.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/694fb1a8d702a3c1baff84be1290ae794ee10bcd/skimage%2F__init__.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/694fb1a8d702a3c1baff84be1290ae794ee10bcd/skimage%2F__init__.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2F__init__.py?ref=694fb1a8d702a3c1baff84be1290ae794ee10bcd",
"patch": "@@ -56,7 +56,7 @@\n pkg_dir = _osp.abspath(_osp.dirname(__file__))\n data_dir = _osp.join(pkg_dir, 'data')\n \n-from version import version as __version__\n+from .version import version as __version__\n \n def _setup_test(verbose=False):\n import gzip"
}
] |
scikit-image | 7419c682def0e2e1949ec3f93b0cbd7286429b87 | f24c9d53ec9149174881e8b2c80441055d2179bf | skimage/util/montage.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -74,7 +74,7 @@ def montage2d(arr_in, fill='mean', rescale_intensity=False):
# -- rescale intensity if necessary
if rescale_intensity:
- for i in xrange(n_images):
+ for i in range(n_images):
arr_in[i] = exposure.rescale_intensity(arr_in[i])
# -- determine alpha
| for i in xrange ( n_images ) : arr_in [ i ] = exposure . rescale_intensity ( arr_in [ i ] ) | for i in range ( n_images ) : arr_in [ i ] = exposure . rescale_intensity ( arr_in [ i ] ) | WRONG_FUNCTION_NAME | [["Update", ["identifier:xrange", 3, 18, 3, 24], "range"]] | matsuken92/scikit-image@7419c682def0e2e1949ec3f93b0cbd7286429b87 | BUG: Fix typo in montage--xrange is no longer supported. | [
{
"sha": "57ec72743b49d3f9517eb8186976dfde679ce368",
"filename": "skimage/util/montage.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/7419c682def0e2e1949ec3f93b0cbd7286429b87/skimage%2Futil%2Fmontage.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/7419c682def0e2e1949ec3f93b0cbd7286429b87/skimage%2Futil%2Fmontage.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Futil%2Fmontage.py?ref=7419c682def0e2e1949ec3f93b0cbd7286429b87",
"patch": "@@ -74,7 +74,7 @@ def montage2d(arr_in, fill='mean', rescale_intensity=False):\n \n # -- rescale intensity if necessary\n if rescale_intensity:\n- for i in xrange(n_images):\n+ for i in range(n_images):\n arr_in[i] = exposure.rescale_intensity(arr_in[i])\n \n # -- determine alpha"
}
] |
scikit-image | e13cc2541fca5542f86bf6e1b5ee87f4359161c0 | 7df3707c3398a6015e1cb44488b6cfda0d114549 | skimage/transform/project.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -4,7 +4,7 @@
import numpy as np
from scipy.ndimage import interpolation as ndii
-from .warp import _stackcopy
+from ._warp import _stackcopy
__all__ = ['homography']
| from . warp import _stackcopy | from . _warp import _stackcopy | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:warp", 3, 7, 3, 11], "_warp"]] | matsuken92/scikit-image@e13cc2541fca5542f86bf6e1b5ee87f4359161c0 | BUG: Fix incorrect import. | [
{
"sha": "030e86a919d0227589d89233bf2371e3867b1081",
"filename": "skimage/transform/project.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/e13cc2541fca5542f86bf6e1b5ee87f4359161c0/skimage%2Ftransform%2Fproject.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/e13cc2541fca5542f86bf6e1b5ee87f4359161c0/skimage%2Ftransform%2Fproject.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ftransform%2Fproject.py?ref=e13cc2541fca5542f86bf6e1b5ee87f4359161c0",
"patch": "@@ -4,7 +4,7 @@\n \n import numpy as np\n from scipy.ndimage import interpolation as ndii\n-from .warp import _stackcopy\n+from ._warp import _stackcopy\n \n __all__ = ['homography']\n "
}
] |
scikit-image | 49349a07c6ca1dd94f157793996597b20704c244 | 19f1021f60c32ffdb8281768309c7801b604b568 | skimage/detection/template.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -29,7 +29,7 @@ def match_template_cv(image, template, out=None, method="norm-coeff"):
dtype=image.dtype)
if method == "norm-corr":
cv.MatchTemplate(image, template, out, cv.CV_TM_CCORR_NORMED)
- elif method == "norm-corr":
+ elif method == "norm-coeff":
cv.MatchTemplate(image, template, out, cv.CV_TM_CCOEFF_NORMED)
else:
raise ValueError("Unknown template method: %s" % method)
| if method == "norm-corr" : cv . MatchTemplate ( image , template , out , cv . CV_TM_CCORR_NORMED ) elif method == "norm-corr" : cv . MatchTemplate ( image , template , out , cv . CV_TM_CCOEFF_NORMED ) else : raise ValueError ( "Unknown template method: %s" % method ) | if method == "norm-corr" : cv . MatchTemplate ( image , template , out , cv . CV_TM_CCORR_NORMED ) elif method == "norm-coeff" : cv . MatchTemplate ( image , template , out , cv . CV_TM_CCOEFF_NORMED ) else : raise ValueError ( "Unknown template method: %s" % method ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"norm-corr\"", 3, 20, 3, 31], "\"norm-coeff\""]] | matsuken92/scikit-image@49349a07c6ca1dd94f157793996597b20704c244 | Fix copy-paste bug | [
{
"sha": "e0ad01ef2dbe7a9e103289adfa809be8e7ab29cb",
"filename": "skimage/detection/template.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/49349a07c6ca1dd94f157793996597b20704c244/skimage%2Fdetection%2Ftemplate.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/49349a07c6ca1dd94f157793996597b20704c244/skimage%2Fdetection%2Ftemplate.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fdetection%2Ftemplate.py?ref=49349a07c6ca1dd94f157793996597b20704c244",
"patch": "@@ -29,7 +29,7 @@ def match_template_cv(image, template, out=None, method=\"norm-coeff\"):\n dtype=image.dtype)\n if method == \"norm-corr\":\n cv.MatchTemplate(image, template, out, cv.CV_TM_CCORR_NORMED)\n- elif method == \"norm-corr\":\n+ elif method == \"norm-coeff\":\n cv.MatchTemplate(image, template, out, cv.CV_TM_CCOEFF_NORMED)\n else:\n raise ValueError(\"Unknown template method: %s\" % method)"
}
] |
scikit-image | 4c3f8a36bad746218a16e29862c0466121be4646 | 06bd3ebd6fc8807be35ddd41dc88cc9a42c6faa4 | doc/examples/plot_match_face_template.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -32,7 +32,7 @@ ax2.set_axis_off()
ax2.set_title('image')
# highlight matched region
-xy = np.unravel_index(np.argmax(result), image.shape)[::-1] # -1 flips ij to xy
+xy = np.unravel_index(np.argmax(result), result.shape)[::-1] #-1 flips ij to xy
wface, hface = head.shape
rect = plt.Rectangle(xy, wface, hface, edgecolor='r', facecolor='none')
ax2.add_patch(rect)
| xy = np . unravel_index ( np . argmax ( result ) , image . shape ) [ : : - 1 ] | xy = np . unravel_index ( np . argmax ( result ) , result . shape ) [ : : - 1 ] | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:image", 3, 42, 3, 47], "result"]] | matsuken92/scikit-image@4c3f8a36bad746218a16e29862c0466121be4646 | Fix template example. | [
{
"sha": "49905941d07d1844ae898010ddda6a0ec963f352",
"filename": "doc/examples/plot_match_face_template.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/4c3f8a36bad746218a16e29862c0466121be4646/doc%2Fexamples%2Fplot_match_face_template.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/4c3f8a36bad746218a16e29862c0466121be4646/doc%2Fexamples%2Fplot_match_face_template.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fexamples%2Fplot_match_face_template.py?ref=4c3f8a36bad746218a16e29862c0466121be4646",
"patch": "@@ -32,7 +32,7 @@\n ax2.set_title('image')\n \n # highlight matched region\n-xy = np.unravel_index(np.argmax(result), image.shape)[::-1] # -1 flips ij to xy\n+xy = np.unravel_index(np.argmax(result), result.shape)[::-1] #-1 flips ij to xy\n wface, hface = head.shape\n rect = plt.Rectangle(xy, wface, hface, edgecolor='r', facecolor='none')\n ax2.add_patch(rect)"
}
] |
scikit-image | 8dbf6f4c581430ae7393d1ed0c5f0b377ffebd7e | 4c3f8a36bad746218a16e29862c0466121be4646 | doc/examples/plot_match_face_template.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -33,7 +33,7 @@ ax2.set_title('image')
# highlight matched region
xy = np.unravel_index(np.argmax(result), result.shape)[::-1] #-1 flips ij to xy
-wface, hface = head.shape
+hface, wface = head.shape
rect = plt.Rectangle(xy, wface, hface, edgecolor='r', facecolor='none')
ax2.add_patch(rect)
| wface , hface = head . shape | hface , wface = head . shape | SINGLE_STMT | [["Move", ["identifier:wface", 3, 1, 3, 6], ["pattern_list", 3, 1, 3, 13], 2], ["Move", [",:,", 3, 6, 3, 7], ["pattern_list", 3, 1, 3, 13], 3]] | matsuken92/scikit-image@8dbf6f4c581430ae7393d1ed0c5f0b377ffebd7e | Fix shape unpacking ((height, width), not (w, h)). | [
{
"sha": "d3cb7905f656dc1618698607c7ac5e3ec26573a4",
"filename": "doc/examples/plot_match_face_template.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/8dbf6f4c581430ae7393d1ed0c5f0b377ffebd7e/doc%2Fexamples%2Fplot_match_face_template.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/8dbf6f4c581430ae7393d1ed0c5f0b377ffebd7e/doc%2Fexamples%2Fplot_match_face_template.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fexamples%2Fplot_match_face_template.py?ref=8dbf6f4c581430ae7393d1ed0c5f0b377ffebd7e",
"patch": "@@ -33,7 +33,7 @@\n \n # highlight matched region\n xy = np.unravel_index(np.argmax(result), result.shape)[::-1] #-1 flips ij to xy\n-wface, hface = head.shape\n+hface, wface = head.shape\n rect = plt.Rectangle(xy, wface, hface, edgecolor='r', facecolor='none')\n ax2.add_patch(rect)\n "
}
] |
scikit-image | fc676d6ae0cc44f55d3bef7ee5b088df810fef63 | 7326b1949f87a8fc56d19e844f8ce8b3826aaaad | skimage/feature/template.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -1,7 +1,7 @@
"""template.py - Template matching
"""
import numpy as np
-import _template
+from . import _template
from skimage.util.dtype import convert
| import _template | from . import _template | SINGLE_STMT | [["Insert", ["module", 0, 1, 7, 0], ["import_from_statement", "N0"], 2], ["Insert", "N0", ["from:from", "T"], 0], ["Insert", "N0", ["relative_import", "N1"], 1], ["Move", "N0", ["import:import", 3, 1, 3, 7], 2], ["Move", "N0", ["dotted_name", 3, 8, 3, 17], 3], ["Insert", "N1", ["import_prefix", "N2"], 0], ["Insert", "N2", [".:.", "T"], 0], ["Delete", ["import_statement", 3, 1, 3, 17]]] | matsuken92/scikit-image@fc676d6ae0cc44f55d3bef7ee5b088df810fef63 | BUG: Correctly import _feature in Python 3. | [
{
"sha": "4f3449bd034cbe6dd190a779650ebaef801ce68a",
"filename": "skimage/feature/template.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/fc676d6ae0cc44f55d3bef7ee5b088df810fef63/skimage%2Ffeature%2Ftemplate.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/fc676d6ae0cc44f55d3bef7ee5b088df810fef63/skimage%2Ffeature%2Ftemplate.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2Ftemplate.py?ref=fc676d6ae0cc44f55d3bef7ee5b088df810fef63",
"patch": "@@ -1,7 +1,7 @@\n \"\"\"template.py - Template matching\n \"\"\"\n import numpy as np\n-import _template\n+from . import _template\n \n from skimage.util.dtype import convert\n "
}
] |
scikit-image | 8e67dd901f95288442f14812d2a12283f10e8200 | 754f0e5d39301cab66259b897d53a55c2f0e7f09 | skimage/util/dtype.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -50,7 +50,7 @@ def convert(image, dtype, force_copy=False, uniform=False):
uniform : bool
Uniformly quantize the floating point range to the integer range.
By default (uniform=False) floating point values are scaled and
- rounded to the nearest integers, which minimized back and forth
+ rounded to the nearest integers, which minimizes back and forth
conversion errors.
References
| are scaled and rounded to the nearest integers , which minimized back and forth | are scaled and rounded to the nearest integers , which minimizes back and forth | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:minimized", 3, 48, 3, 57], "minimizes"]] | matsuken92/scikit-image@8e67dd901f95288442f14812d2a12283f10e8200 | Fix spelling | [
{
"sha": "372eb6835f0c09af4a7b81c60493a385cc739935",
"filename": "skimage/util/dtype.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/8e67dd901f95288442f14812d2a12283f10e8200/skimage%2Futil%2Fdtype.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/8e67dd901f95288442f14812d2a12283f10e8200/skimage%2Futil%2Fdtype.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Futil%2Fdtype.py?ref=8e67dd901f95288442f14812d2a12283f10e8200",
"patch": "@@ -50,7 +50,7 @@ def convert(image, dtype, force_copy=False, uniform=False):\n uniform : bool\n Uniformly quantize the floating point range to the integer range.\n By default (uniform=False) floating point values are scaled and\n- rounded to the nearest integers, which minimized back and forth\n+ rounded to the nearest integers, which minimizes back and forth\n conversion errors.\n \n References"
}
] |
scikit-image | c4552d294acf80cd509699f9c9e4e19e64303492 | 8575a46f4201c32fe6e5a58e412e3c5dedf1e752 | skimage/util/dtype.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -217,7 +217,7 @@ def convert(image, dtype, force_copy=False, uniform=False):
image -= np.iinfo(dtype_in).min
image = _scale(image, 8*itemsize_in, 8*itemsize, copy=False)
image += np.iinfo(dtype).min
- return image
+ return dtype(image)
def img_as_float(image, force_copy=False):
| return image | return dtype ( image ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["return_statement", 3, 5, 3, 17], ["call", "N0"], 1], ["Insert", "N0", ["identifier:dtype", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["identifier:image", 3, 12, 3, 17], 1], ["Insert", "N1", ["):)", "T"], 2]] | matsuken92/scikit-image@c4552d294acf80cd509699f9c9e4e19e64303492 | Return correct dtype | [
{
"sha": "c2d041f053f2bde76bdcef0474ea5b8be38ff22e",
"filename": "skimage/util/dtype.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/c4552d294acf80cd509699f9c9e4e19e64303492/skimage%2Futil%2Fdtype.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/c4552d294acf80cd509699f9c9e4e19e64303492/skimage%2Futil%2Fdtype.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Futil%2Fdtype.py?ref=c4552d294acf80cd509699f9c9e4e19e64303492",
"patch": "@@ -217,7 +217,7 @@ def _scale(a, n, m, copy=True):\n image -= np.iinfo(dtype_in).min\n image = _scale(image, 8*itemsize_in, 8*itemsize, copy=False)\n image += np.iinfo(dtype).min\n- return image\n+ return dtype(image)\n \n \n def img_as_float(image, force_copy=False):"
}
] |
scikit-image | 15c0df33c97b334fe122af5916a1694a198298ee | 11c4ca7f53f5bc69f3afd24653d785a5881b8d74 | skimage/util/dtype.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -162,7 +162,7 @@ def convert(image, dtype, force_copy=False, uniform=False, frange=[-1.5, 1.5]):
if kind_in == 'f':
if frange and np.min(image) < frange[0] or np.max(image) > frange[1]:
raise ValueError("Images of type float must be between %d and %d",
- frange)
+ tuple(frange))
if kind == 'f':
# floating point -> floating point
if itemsize_in > itemsize:
| raise ValueError ( "Images of type float must be between %d and %d" , frange ) | raise ValueError ( "Images of type float must be between %d and %d" , tuple ( frange ) ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["argument_list", 2, 29, 3, 37], ["(:(", "T"], 0], ["Insert", ["argument_list", 2, 29, 3, 37], ["call", "N0"], 4], ["Insert", ["argument_list", 2, 29, 3, 37], ["):)", "T"], 5], ["Insert", "N0", ["identifier:tuple", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Move", "N1", ["(:(", 2, 29, 2, 30], 0], ["Move", "N1", ["identifier:frange", 3, 30, 3, 36], 1], ["Move", "N1", ["):)", 3, 36, 3, 37], 2]] | matsuken92/scikit-image@15c0df33c97b334fe122af5916a1694a198298ee | Fix TypeError | [
{
"sha": "3340434ad9561b907d3abd55391ac51050cc2282",
"filename": "skimage/util/dtype.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/15c0df33c97b334fe122af5916a1694a198298ee/skimage%2Futil%2Fdtype.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/15c0df33c97b334fe122af5916a1694a198298ee/skimage%2Futil%2Fdtype.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Futil%2Fdtype.py?ref=15c0df33c97b334fe122af5916a1694a198298ee",
"patch": "@@ -162,7 +162,7 @@ def _scale(a, n, m, copy=True):\n if kind_in == 'f':\n if frange and np.min(image) < frange[0] or np.max(image) > frange[1]:\n raise ValueError(\"Images of type float must be between %d and %d\",\n- frange)\n+ tuple(frange))\n if kind == 'f':\n # floating point -> floating point\n if itemsize_in > itemsize:"
}
] |
scikit-image | 98245449cb68139fa1aa5b87d63753f488b472cb | 8141f39a2ba80a57e3c4ac511e19de8a9fdb66ea | skimage/util/dtype.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -109,8 +109,8 @@ def convert(image, dtype, force_copy=False, uniform=False):
prec_loss()
if copy:
b = np.empty(a.shape, _dtype2(kind, m))
- np.divide(a, 2**(n - m), out=b, dtype=a.dtype,
- casting='unsafe')
+ np.floor_divide(a, 2**(n - m), out=b, dtype=a.dtype,
+ casting='unsafe')
return b
else:
a //= 2**(n - m)
| np . divide ( a , 2 ** ( n - m ) , out = b , dtype = a . dtype , casting = 'unsafe' ) | np . floor_divide ( a , 2 ** ( n - m ) , out = b , dtype = a . dtype , casting = 'unsafe' ) | WRONG_FUNCTION_NAME | [["Update", ["identifier:divide", 3, 20, 3, 26], "floor_divide"]] | matsuken92/scikit-image@98245449cb68139fa1aa5b87d63753f488b472cb | Fix test failures on Python 3 | [
{
"sha": "b039123cc3d22fa49d91de20315c364b5f545e83",
"filename": "skimage/util/dtype.py",
"status": "modified",
"additions": 2,
"deletions": 2,
"changes": 4,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/98245449cb68139fa1aa5b87d63753f488b472cb/skimage%2Futil%2Fdtype.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/98245449cb68139fa1aa5b87d63753f488b472cb/skimage%2Futil%2Fdtype.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Futil%2Fdtype.py?ref=98245449cb68139fa1aa5b87d63753f488b472cb",
"patch": "@@ -109,8 +109,8 @@ def _scale(a, n, m, copy=True):\n prec_loss()\n if copy:\n b = np.empty(a.shape, _dtype2(kind, m))\n- np.divide(a, 2**(n - m), out=b, dtype=a.dtype,\n- casting='unsafe')\n+ np.floor_divide(a, 2**(n - m), out=b, dtype=a.dtype,\n+ casting='unsafe')\n return b\n else:\n a //= 2**(n - m)"
}
] |
simplePostKB | dabf21b133a06be1d8f77bec54d916cf8f915181 | f3e12cb64a113d88e257cb437b9ef1c1afa0ede7 | kbproj/settings.py | https://github.com/OpenPerpetuum/simplePostKB | true | false | false | @@ -24,7 +24,7 @@ PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = "j)=mt68(o19gvddh7am7fj8v#ka&7ebz4@fp7^hf5w546ya%fi"
# SECURITY WARNING: don't run with debug turned on in production!
-DEBUG = True
+DEBUG = False
# Application definition
| DEBUG = True | DEBUG = False | CHANGE_BOOLEAN_LITERAL | [["Insert", ["assignment", 3, 1, 3, 13], ["false:False", "T"], 2], ["Delete", ["true:True", 3, 9, 3, 13]]] | OpenPerpetuum/simplePostKB@dabf21b133a06be1d8f77bec54d916cf8f915181 | debug off | [
{
"sha": "743f5bfb1c3d01392be83b027e2edb45c80ff5f7",
"filename": "kbproj/settings.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/OpenPerpetuum/simplePostKB/blob/dabf21b133a06be1d8f77bec54d916cf8f915181/kbproj%2Fsettings.py",
"raw_url": "https://github.com/OpenPerpetuum/simplePostKB/raw/dabf21b133a06be1d8f77bec54d916cf8f915181/kbproj%2Fsettings.py",
"contents_url": "https://api.github.com/repos/OpenPerpetuum/simplePostKB/contents/kbproj%2Fsettings.py?ref=dabf21b133a06be1d8f77bec54d916cf8f915181",
"patch": "@@ -24,7 +24,7 @@\n SECRET_KEY = \"j)=mt68(o19gvddh7am7fj8v#ka&7ebz4@fp7^hf5w546ya%fi\"\n \n # SECURITY WARNING: don't run with debug turned on in production!\n-DEBUG = True\n+DEBUG = False\n \n # Application definition\n "
}
] |
hamn | 7db6b1600f98561ac74987d9c1c0ea87d49830ad | 581067ed6f5e44bd27b44e662f4bd9aa4a40a05c | hamnadmin/mailqueue/models.py | https://github.com/dbonne/hamn | true | false | true | @@ -8,5 +8,5 @@ class QueuedMail(models.Model):
# anything, we just push them right in there!
fullmsg = models.TextField(null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return "%s: %s -> %s" % (self.pk, self.sender, self.receiver)
| def __unicode__ ( self ) : return "%s: %s -> %s" % ( self . pk , self . sender , self . receiver ) | def __str__ ( self ) : return "%s: %s -> %s" % ( self . pk , self . sender , self . receiver ) | SINGLE_TOKEN | [["Update", ["identifier:__unicode__", 3, 9, 3, 20], "__str__"]] | dbonne/hamn@7db6b1600f98561ac74987d9c1c0ea87d49830ad | null | null |
arduino_tree | e1ff79254219ca8d8fed34a9f9f6f06bc4b18bce | a4d5fe7e045b19306084cf850c30a41408c05aa1 | tree_master/animations/rand.py | https://github.com/jiridoko/arduino_tree | true | false | true | @@ -10,7 +10,7 @@ class rand(__animation.animation):
self.initialize_argument("speed", "Speed: ", default_value=20)
self.initialize_argument("count", "Count: ", default_value=1)
self.initialize_argument("transition", "Transition time: ", default_value=30)
- self.colours = [(255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0), (255, 0, 255), (0, 255, 255), (255, 255, 255), (255, 127, 0), (127, 255, 0), (127, 0, 255), (255, 0, 127), (0, 255, 127), (0, 127, 255)]
+ self.colours = [(255, 0, 0), (255, 0, 0), (255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0), (255, 0, 255), (0, 255, 255), (255, 255, 255), (255, 127, 0), (127, 255, 0), (127, 0, 255), (0, 127, 255)]
def run(self):
while self.enabled:
for x in range(int(self.get_argument("count"))):
| self . colours = [ ( 255 , 0 , 0 ) , ( 0 , 255 , 0 ) , ( 0 , 0 , 255 ) , ( 255 , 255 , 0 ) , ( 255 , 0 , 255 ) , ( 0 , 255 , 255 ) , ( 255 , 255 , 255 ) , ( 255 , 127 , 0 ) , ( 127 , 255 , 0 ) , ( 127 , 0 , 255 ) , ( 255 , 0 , 127 ) , ( 0 , 255 , 127 ) , ( 0 , 127 , 255 ) ] | self . colours = [ ( 255 , 0 , 0 ) , ( 255 , 0 , 0 ) , ( 255 , 0 , 0 ) , ( 0 , 255 , 0 ) , ( 0 , 0 , 255 ) , ( 255 , 255 , 0 ) , ( 255 , 0 , 255 ) , ( 0 , 255 , 255 ) , ( 255 , 255 , 255 ) , ( 255 , 127 , 0 ) , ( 127 , 255 , 0 ) , ( 127 , 0 , 255 ) , ( 0 , 127 , 255 ) ] | SINGLE_STMT | [["Move", ["tuple", 3, 38, 3, 49], ["list", 3, 24, 3, 215], 5], ["Move", ["tuple", 3, 51, 3, 62], ["list", 3, 24, 3, 215], 8], ["Move", ["tuple", 3, 64, 3, 77], ["list", 3, 24, 3, 215], 10], ["Move", ["tuple", 3, 79, 3, 92], ["list", 3, 24, 3, 215], 12], ["Move", ["tuple", 3, 94, 3, 107], ["list", 3, 24, 3, 215], 14], ["Move", ["tuple", 3, 109, 3, 124], ["list", 3, 24, 3, 215], 16], ["Move", ["tuple", 3, 126, 3, 139], ["list", 3, 24, 3, 215], 18], ["Move", ["tuple", 3, 141, 3, 154], ["list", 3, 24, 3, 215], 20], ["Move", ["tuple", 3, 156, 3, 169], ["list", 3, 24, 3, 215], 22], ["Insert", ["list", 3, 24, 3, 215], ["tuple", "N0"], 3], ["Insert", ["list", 3, 24, 3, 215], ["tuple", "N1"], 6], ["Insert", "N0", ["(:(", "T"], 0], ["Insert", "N0", ["integer:255", "T"], 1], ["Insert", "N0", [",:,", "T"], 2], ["Insert", "N0", ["integer:0", "T"], 3], ["Insert", "N0", [",:,", "T"], 4], ["Insert", "N0", ["integer:0", "T"], 5], ["Insert", "N0", ["):)", "T"], 6], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["integer:255", "T"], 1], ["Insert", "N1", [",:,", "T"], 2], ["Insert", "N1", ["integer:0", "T"], 3], ["Insert", "N1", [",:,", "T"], 4], ["Insert", "N1", ["integer:0", "T"], 5], ["Insert", "N1", ["):)", "T"], 6], ["Delete", ["(:(", 3, 171, 3, 172]], ["Delete", ["integer:255", 3, 172, 3, 175]], ["Delete", [",:,", 3, 175, 3, 176]], ["Delete", ["integer:0", 3, 177, 3, 178]], ["Delete", [",:,", 3, 178, 3, 179]], ["Delete", ["integer:127", 3, 180, 3, 183]], ["Delete", ["):)", 3, 183, 3, 184]], ["Delete", ["tuple", 3, 171, 3, 184]], ["Delete", ["(:(", 3, 186, 3, 187]], ["Delete", ["integer:0", 3, 187, 3, 188]], ["Delete", [",:,", 3, 188, 3, 189]], ["Delete", ["integer:255", 3, 190, 3, 193]], ["Delete", [",:,", 3, 193, 3, 194]], ["Delete", ["integer:127", 3, 195, 3, 198]], ["Delete", ["):)", 3, 198, 3, 199]], ["Delete", ["tuple", 3, 186, 3, 199]]] | jiridoko/arduino_tree@e1ff79254219ca8d8fed34a9f9f6f06bc4b18bce | fixing random colours ... adding more red for whatever reason | [
{
"sha": "60e19bb15caaa02e01ab1f8563e85ae36ace01e6",
"filename": "tree_master/animations/rand.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/jiridoko/arduino_tree/blob/e1ff79254219ca8d8fed34a9f9f6f06bc4b18bce/tree_master%2Fanimations%2Frand.py",
"raw_url": "https://github.com/jiridoko/arduino_tree/raw/e1ff79254219ca8d8fed34a9f9f6f06bc4b18bce/tree_master%2Fanimations%2Frand.py",
"contents_url": "https://api.github.com/repos/jiridoko/arduino_tree/contents/tree_master%2Fanimations%2Frand.py?ref=e1ff79254219ca8d8fed34a9f9f6f06bc4b18bce",
"patch": "@@ -10,7 +10,7 @@ def __init__(self, led):\n self.initialize_argument(\"speed\", \"Speed: \", default_value=20)\n self.initialize_argument(\"count\", \"Count: \", default_value=1)\n self.initialize_argument(\"transition\", \"Transition time: \", default_value=30)\n- self.colours = [(255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0), (255, 0, 255), (0, 255, 255), (255, 255, 255), (255, 127, 0), (127, 255, 0), (127, 0, 255), (255, 0, 127), (0, 255, 127), (0, 127, 255)]\n+ self.colours = [(255, 0, 0), (255, 0, 0), (255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0), (255, 0, 255), (0, 255, 255), (255, 255, 255), (255, 127, 0), (127, 255, 0), (127, 0, 255), (0, 127, 255)]\n def run(self):\n while self.enabled:\n for x in range(int(self.get_argument(\"count\"))):"
}
] |
smt-data-processing | a22a230093acdf0d1a862b4ab6e0471b134eac85 | 3076c22a899cf05b13713f2b7babb71eeb26c09a | smt_tests.py | https://github.com/zhangysh1995/smt-data-processing | true | false | true | @@ -136,7 +136,7 @@ def compare_solvers(flist, Solvers, cpu=0):
print('Testing... ' + os.path.split(fname)[1])
for solver in Solvers:
# print(solver.name + ' ', flush = False)
- testResult = test_with_solver(solver, fname, 2)
+ testResult = test_with_solver(solver, fname, 30)
solver.results.append(testResult.result)
solver.times.append(testResult.runtime)
output_results(Solvers, os.path.split(flist[0])[0] + '/')
| testResult = test_with_solver ( solver , fname , 2 ) | testResult = test_with_solver ( solver , fname , 30 ) | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:2", 3, 49, 3, 50], "30"]] | zhangysh1995/smt-data-processing@a22a230093acdf0d1a862b4ab6e0471b134eac85 | default timeout | [
{
"sha": "82cc21818ce1d10219855725a8da3d0f774555f8",
"filename": "smt_tests.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/zhangysh1995/smt-data-processing/blob/a22a230093acdf0d1a862b4ab6e0471b134eac85/smt_tests.py",
"raw_url": "https://github.com/zhangysh1995/smt-data-processing/raw/a22a230093acdf0d1a862b4ab6e0471b134eac85/smt_tests.py",
"contents_url": "https://api.github.com/repos/zhangysh1995/smt-data-processing/contents/smt_tests.py?ref=a22a230093acdf0d1a862b4ab6e0471b134eac85",
"patch": "@@ -136,7 +136,7 @@ def compare_solvers(flist, Solvers, cpu=0):\n \t\tprint('Testing... ' + os.path.split(fname)[1])\n \t\tfor solver in Solvers:\n \t\t\t# print(solver.name + ' ', flush = False)\n-\t\t\ttestResult = test_with_solver(solver, fname, 2)\n+\t\t\ttestResult = test_with_solver(solver, fname, 30)\n \t\t\tsolver.results.append(testResult.result)\n \t\t\tsolver.times.append(testResult.runtime)\n \toutput_results(Solvers, os.path.split(flist[0])[0] + '/')"
}
] |
meta-chess | e8a0fc16b5c080b4ed0668d24031717a35e6f74f | 7fbd6c9d3c173736d0e1c882e2c1be9219726fea | AiRepl.py | https://github.com/sa2thoms/meta-chess | true | false | true | @@ -112,7 +112,7 @@ class AiRepl:
self.state = result
elif result == 'mate':
winning = 'White'
- if (self.game.turn == self.WHITE):
+ if (self.game.turn == WHITE):
winning = 'Black'
self.game.printBoard()
print("Checkmate! " + winning + " has won by checkmate.")
| if ( self . game . turn == self . WHITE ) : winning = 'Black' | if ( self . game . turn == WHITE ) : winning = 'Black' | SINGLE_STMT | [["Move", ["comparison_operator", 3, 29, 3, 57], ["identifier:WHITE", 3, 52, 3, 57], 2], ["Delete", ["identifier:self", 3, 47, 3, 51]], ["Delete", [".:.", 3, 51, 3, 52]], ["Delete", ["attribute", 3, 47, 3, 57]]] | sa2thoms/meta-chess@e8a0fc16b5c080b4ed0668d24031717a35e6f74f | fixed bug | [
{
"sha": "ea57a6fae06afac32effb0933505287441f85af0",
"filename": "AiRepl.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/sa2thoms/meta-chess/blob/e8a0fc16b5c080b4ed0668d24031717a35e6f74f/AiRepl.py",
"raw_url": "https://github.com/sa2thoms/meta-chess/raw/e8a0fc16b5c080b4ed0668d24031717a35e6f74f/AiRepl.py",
"contents_url": "https://api.github.com/repos/sa2thoms/meta-chess/contents/AiRepl.py?ref=e8a0fc16b5c080b4ed0668d24031717a35e6f74f",
"patch": "@@ -112,7 +112,7 @@ def run(self):\n self.state = result\n elif result == 'mate':\n winning = 'White'\n- if (self.game.turn == self.WHITE):\n+ if (self.game.turn == WHITE):\n winning = 'Black'\n self.game.printBoard()\n print(\"Checkmate! \" + winning + \" has won by checkmate.\")"
}
] |
helpo | 2a6e69050d886509b34dd062228af4f83d91e370 | c4123b3e10daa44693b3f6f7373db3fb1baa14b3 | helpo-api/common/functions.py | https://github.com/Jumpi96/helpo | true | false | true | @@ -19,7 +19,7 @@ def calc_distance_locations(lat_a, long_a, lat_b, long_b):
def get_token_user(request):
token = request.META.get('HTTP_AUTHORIZATION', None)
- if token is not None:
+ if token is not None and len(token) > 0:
objeto_token = AuthToken.objects.get(token_key=token[6:14])
return objeto_token.user_id
| if token is not None : objeto_token = AuthToken . objects . get ( token_key = token [ 6 : 14 ] ) return objeto_token . user_id | if token is not None and len ( token ) > 0 : objeto_token = AuthToken . objects . get ( token_key = token [ 6 : 14 ] ) return objeto_token . user_id | MORE_SPECIFIC_IF | [["Insert", ["if_statement", 3, 5, 5, 36], ["boolean_operator", "N0"], 1], ["Move", "N0", ["comparison_operator", 3, 8, 3, 25], 0], ["Insert", "N0", ["and:and", "T"], 1], ["Insert", "N0", ["comparison_operator", "N1"], 2], ["Insert", "N1", ["call", "N2"], 0], ["Insert", "N1", [">:>", "T"], 1], ["Insert", "N1", ["integer:0", "T"], 2], ["Insert", "N2", ["identifier:len", "T"], 0], ["Insert", "N2", ["argument_list", "N3"], 1], ["Insert", "N3", ["(:(", "T"], 0], ["Insert", "N3", ["identifier:token", "T"], 1], ["Insert", "N3", ["):)", "T"], 2]] | Jumpi96/helpo@2a6e69050d886509b34dd062228af4f83d91e370 | Bug horrible en ConsultaEvento deslogueado | [
{
"sha": "22b75837dd2c5aad2556320391ff8b40a235dc06",
"filename": "helpo-api/common/functions.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Jumpi96/helpo/blob/2a6e69050d886509b34dd062228af4f83d91e370/helpo-api%2Fcommon%2Ffunctions.py",
"raw_url": "https://github.com/Jumpi96/helpo/raw/2a6e69050d886509b34dd062228af4f83d91e370/helpo-api%2Fcommon%2Ffunctions.py",
"contents_url": "https://api.github.com/repos/Jumpi96/helpo/contents/helpo-api%2Fcommon%2Ffunctions.py?ref=2a6e69050d886509b34dd062228af4f83d91e370",
"patch": "@@ -19,7 +19,7 @@ def calc_distance_locations(lat_a, long_a, lat_b, long_b):\n \n def get_token_user(request):\n token = request.META.get('HTTP_AUTHORIZATION', None)\n- if token is not None:\n+ if token is not None and len(token) > 0:\n objeto_token = AuthToken.objects.get(token_key=token[6:14])\n return objeto_token.user_id\n "
}
] |
helpo | e1e667801f2f2bbc1a903615b6dc176405fa94cb | ffac2c705fc4ab22097a89799d6f7d34884458e4 | helpo-api/actividades/views.py | https://github.com/Jumpi96/helpo | true | false | false | @@ -249,7 +249,7 @@ class EventoVoluntarioCreateReadView(ListCreateAPIView):
return eventos
-class ConsultaEventosOrganizacionCreateReadView(AuthTokenMixin, ListCreateAPIView):
+class ConsultaEventosOrganizacionCreateReadView(ListCreateAPIView):
"""
API endpoint para ver todos los eventos próximos
"""
| class ConsultaEventosOrganizacionCreateReadView ( AuthTokenMixin , ListCreateAPIView ) : """
API endpoint para ver todos los eventos próximos
""" | class ConsultaEventosOrganizacionCreateReadView ( ListCreateAPIView ) : """
API endpoint para ver todos los eventos próximos
""" | SINGLE_STMT | [["Delete", ["identifier:AuthTokenMixin", 3, 49, 3, 63]], ["Delete", [",:,", 3, 63, 3, 64]]] | Jumpi96/helpo@e1e667801f2f2bbc1a903615b6dc176405fa94cb | Fix bug consulta_eventos without token | [
{
"sha": "30182f6e9310f85976a0104fbe60f55a3422790e",
"filename": "helpo-api/actividades/views.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Jumpi96/helpo/blob/e1e667801f2f2bbc1a903615b6dc176405fa94cb/helpo-api%2Factividades%2Fviews.py",
"raw_url": "https://github.com/Jumpi96/helpo/raw/e1e667801f2f2bbc1a903615b6dc176405fa94cb/helpo-api%2Factividades%2Fviews.py",
"contents_url": "https://api.github.com/repos/Jumpi96/helpo/contents/helpo-api%2Factividades%2Fviews.py?ref=e1e667801f2f2bbc1a903615b6dc176405fa94cb",
"patch": "@@ -249,7 +249,7 @@ def get_eventos(self, user):\n return eventos\n \n \n-class ConsultaEventosOrganizacionCreateReadView(AuthTokenMixin, ListCreateAPIView):\n+class ConsultaEventosOrganizacionCreateReadView(ListCreateAPIView):\n \"\"\"\n API endpoint para ver todos los eventos próximos\n \"\"\""
}
] |
helpo | e50046304027ebdbb5156b50d98f10585083bb70 | 08aed77bf75fa3483cc594c4cb999ea781c76040 | helpo-api/users/views.py | https://github.com/Jumpi96/helpo | true | false | true | @@ -159,7 +159,7 @@ class VolunteerProfileCreateReadView(ListCreateAPIView):
def get(self, request, *args, **kwargs):
queryset = self.get_queryset()
- limit = min(int(request.query_params.get('limit', 10), 1000))
+ limit = min(int(request.query_params.get('limit', 10)), 1000)
offset = int(request.query_params.get('offset', 0))
return Response({
'data': [VolunteerProfileSerializer(p).data for p in queryset[offset:offset+limit]],
| limit = min ( int ( request . query_params . get ( 'limit' , 10 ) , 1000 ) ) | limit = min ( int ( request . query_params . get ( 'limit' , 10 ) ) , 1000 ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 20, 3, 70], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 20, 3, 70], ["integer:1000", "T"], 3], ["Delete", [",:,", 3, 62, 3, 63]], ["Delete", ["integer:1000", 3, 64, 3, 68]]] | Jumpi96/helpo@e50046304027ebdbb5156b50d98f10585083bb70 | Fixing voluntarios bug | [
{
"sha": "1f15d2eabe94679f98265d9e28c4231491e75104",
"filename": "helpo-api/users/views.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Jumpi96/helpo/blob/e50046304027ebdbb5156b50d98f10585083bb70/helpo-api%2Fusers%2Fviews.py",
"raw_url": "https://github.com/Jumpi96/helpo/raw/e50046304027ebdbb5156b50d98f10585083bb70/helpo-api%2Fusers%2Fviews.py",
"contents_url": "https://api.github.com/repos/Jumpi96/helpo/contents/helpo-api%2Fusers%2Fviews.py?ref=e50046304027ebdbb5156b50d98f10585083bb70",
"patch": "@@ -159,7 +159,7 @@ class VolunteerProfileCreateReadView(ListCreateAPIView):\n \n def get(self, request, *args, **kwargs):\n queryset = self.get_queryset()\n- limit = min(int(request.query_params.get('limit', 10), 1000))\n+ limit = min(int(request.query_params.get('limit', 10)), 1000)\n offset = int(request.query_params.get('offset', 0))\n return Response({\n 'data': [VolunteerProfileSerializer(p).data for p in queryset[offset:offset+limit]],"
}
] |
jasper-client | dcd887f1859c8f43018fd837281751af1cf60cdd | 86695170f6d05ed91406fab0b797c170673a1302 | boot/vocabcompiler.py | https://github.com/pneumaticdeath/jasper-client | true | false | true | @@ -17,7 +17,7 @@ def compile():
- m = dir(modules)
+ m = [name for _, name, _ in pkgutil.iter_modules(['modules'])]
words = []
for module_name in m:
| m = dir ( modules ) | m = [ name for _ , name , _ in pkgutil . iter_modules ( [ 'modules' ] ) ] | SINGLE_STMT | [["Insert", ["assignment", 1, 5, 1, 21], ["list_comprehension", "N0"], 2], ["Insert", "N0", ["[:[", "T"], 0], ["Insert", "N0", ["identifier:name", "T"], 1], ["Insert", "N0", ["for_in_clause", "N1"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Insert", "N1", ["for:for", "T"], 0], ["Insert", "N1", ["pattern_list", "N2"], 1], ["Insert", "N1", ["in:in", "T"], 2], ["Move", "N1", ["call", 1, 9, 1, 21], 3], ["Insert", "N2", ["identifier:_", "T"], 0], ["Insert", "N2", [",:,", "T"], 1], ["Insert", "N2", ["identifier:name", "T"], 2], ["Insert", "N2", [",:,", "T"], 3], ["Insert", "N2", ["identifier:_", "T"], 4], ["Insert", ["call", 1, 9, 1, 21], ["attribute", "N3"], 0], ["Update", ["identifier:dir", 1, 9, 1, 12], "pkgutil"], ["Move", "N3", ["identifier:dir", 1, 9, 1, 12], 0], ["Insert", "N3", [".:.", "T"], 1], ["Insert", "N3", ["identifier:iter_modules", "T"], 2], ["Insert", ["argument_list", 1, 12, 1, 21], ["list", "N4"], 1], ["Insert", "N4", ["[:[", "T"], 0], ["Insert", "N4", ["string:'modules'", "T"], 1], ["Insert", "N4", ["]:]", "T"], 2], ["Delete", ["identifier:modules", 1, 13, 1, 20]]] | pneumaticdeath/jasper-client@dcd887f1859c8f43018fd837281751af1cf60cdd | null | null |
jasper-client | 1e2b8347644f5c9345a1c4680c40d3b1076fe33d | fb278db9062ace52b7d982736d143c3551248585 | client/test.py | https://github.com/pneumaticdeath/jasper-client | true | false | true | @@ -48,7 +48,7 @@ class TestModules(unittest.TestCase):
inputs = ["Who's there?", "Random response"]
outputs = self.runConversation(query, inputs, modules.Joke)
self.assertEqual(len(outputs), 3)
- allJokes = open("JOKES.txt", "r").read()
+ allJokes = open("../static/text/JOKES.txt", "r").read()
self.assertTrue(outputs[2] in allJokes)
def testTime(self):
| allJokes = open ( "JOKES.txt" , "r" ) . read ( ) | allJokes = open ( "../static/text/JOKES.txt" , "r" ) . read ( ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"JOKES.txt\"", 3, 25, 3, 36], "\"../static/text/JOKES.txt\""]] | pneumaticdeath/jasper-client@1e2b8347644f5c9345a1c4680c40d3b1076fe33d | null | null |
jasper-client | ada1810a76f38536824c10e18e80462705aa58aa | 0dde146d017336fa1e1304963f5952b476372111 | client/alteration.py | https://github.com/pneumaticdeath/jasper-client | true | false | true | @@ -12,7 +12,7 @@ def clean(input):
actual speech by the TTS system. This is to fix minior
idiomatic issues, for example, that 1901 is pronounced
"one thousand, ninehundred and one" rather than
- "nineteen ninety one".
+ "nineteen oh one".
Arguments:
input -- original speech text to-be modified
| "nineteen ninety one" . Arguments : input - - original speech text to - be modified | "nineteen oh one" . Arguments : input - - original speech text to - be modified | CHANGE_STRING_LITERAL | [["Update", ["string:\"nineteen ninety one\"", 3, 9, 3, 30], "\"nineteen oh one\""]] | pneumaticdeath/jasper-client@ada1810a76f38536824c10e18e80462705aa58aa | null | null |
jasper-client | e9dcc7ad1145dea2011f8369f07e1dd8be89b214 | 0399c6e3c4cbf2556fdfb5530a267e871965e1bf | client/local_mic.py | https://github.com/pneumaticdeath/jasper-client | true | false | true | @@ -8,7 +8,7 @@ implementation, Jasper is always active listening with local_mic.
class Mic:
prev = None
- def __init__(self, lmd, dictd, lmd_persona, dictd_persona):
+ def __init__(self, speaker, lmd, dictd, lmd_persona, dictd_persona):
return
def passiveListen(self, PERSONA):
| def __init__ ( self , lmd , dictd , lmd_persona , dictd_persona ) : return | def __init__ ( self , speaker , lmd , dictd , lmd_persona , dictd_persona ) : return | SINGLE_STMT | [["Move", ["identifier:lmd", 3, 24, 3, 27], ["parameters", 3, 17, 3, 63], 4], ["Move", ["identifier:dictd", 3, 29, 3, 34], ["parameters", 3, 17, 3, 63], 7], ["Move", ["identifier:lmd_persona", 3, 36, 3, 47], ["parameters", 3, 17, 3, 63], 9], ["Insert", ["parameters", 3, 17, 3, 63], ["identifier:speaker", "T"], 3], ["Insert", ["parameters", 3, 17, 3, 63], [",:,", "T"], 9]] | pneumaticdeath/jasper-client@e9dcc7ad1145dea2011f8369f07e1dd8be89b214 | null | null |
jasper-client | 41674924d70b6c42d9167e06f7acf2c39d9f4461 | 8e316912b8b6f2f38465794a154ebb164cbdb12d | client/mic.py | https://github.com/pneumaticdeath/jasper-client | true | false | true | @@ -232,7 +232,7 @@ class Mic:
write_frames.writeframes(''.join(frames))
write_frames.close()
- return self.active_stt_engine.transcribe(AUDIO_FILE, MUSIC)
+ return self.active_stt_engine.transcribe(AUDIO_FILE, MUSIC=MUSIC)
def say(self, phrase, OPTIONS=" -vdefault+m3 -p 40 -s 160 --stdout > say.wav"):
# alter phrase before speaking
| return self . active_stt_engine . transcribe ( AUDIO_FILE , MUSIC ) | return self . active_stt_engine . transcribe ( AUDIO_FILE , MUSIC = MUSIC ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 49, 3, 68], ["keyword_argument", "N0"], 3], ["Move", "N0", ["identifier:MUSIC", 3, 62, 3, 67], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["identifier:MUSIC", "T"], 2]] | pneumaticdeath/jasper-client@41674924d70b6c42d9167e06f7acf2c39d9f4461 | null | null |
jasper-client | 954ea6dd7181b09029366935f5d93df7a2c4e24b | 72375945d4e98aba57ccb86b965b5abe9634c62a | jasper.py | https://github.com/pneumaticdeath/jasper-client | true | false | false | @@ -25,7 +25,7 @@ from client import vocabcompiler, stt
from client import speaker as speak
from client.conversation import Conversation
-parser = argparse.ArgumentParser(description='Test suite for the Jasper client code.')
+parser = argparse.ArgumentParser(description='Jasper Voice Control Center')
parser.add_argument('--local', action='store_true', help='Use text input instead of a real microphone')
parser.add_argument('--no-network-check', action='store_true', help='Disable the network connection check')
parser.add_argument('--debug', action='store_true', help='Show debug messages')
| parser = argparse . ArgumentParser ( description = 'Test suite for the Jasper client code.' ) | parser = argparse . ArgumentParser ( description = 'Jasper Voice Control Center' ) | CHANGE_STRING_LITERAL | [["Update", ["string:'Test suite for the Jasper client code.'", 3, 46, 3, 86], "'Jasper Voice Control Center'"]] | pneumaticdeath/jasper-client@954ea6dd7181b09029366935f5d93df7a2c4e24b | null | null |
jasper-client | 836c95aa5ac70cbab50c53c40ccbbd664ec74b04 | 92d0b1160f62a93ba60429fb5b9d98140f0f3e76 | jasper.py | https://github.com/pneumaticdeath/jasper-client | true | false | false | @@ -85,7 +85,7 @@ if __name__ == "__main__":
try:
app = Jasper()
except IOError:
- logger.exception("Can't read config file.")
+ logger.exception("Can't read profile file.")
sys.exit(1)
except OSError:
logger.exception("Language model or associated files missing.")
| logger . exception ( "Can't read config file." ) | logger . exception ( "Can't read profile file." ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"Can't read config file.\"", 3, 26, 3, 51], "\"Can't read profile file.\""]] | pneumaticdeath/jasper-client@836c95aa5ac70cbab50c53c40ccbbd664ec74b04 | null | null |
jasper-client | c2ac7f31d7777d6bcc83385409cbfe34af695a8a | 001b1884bdbb125d4689e310f7dfb22f4c54b31f | client/stt.py | https://github.com/pneumaticdeath/jasper-client | true | false | true | @@ -29,7 +29,7 @@ class AbstractSTTEngine(object):
return True
@abstractmethod
- def transcribe(self, audio_file_path, PERSONA_ONLY=False, MUSIC=False):
+ def transcribe(self, audio_file_path, mode=TranscriptionMode.NORMAL):
pass
class PocketSphinxSTT(AbstractSTTEngine):
| def transcribe ( self , audio_file_path , PERSONA_ONLY = False , MUSIC = False ) : pass | def transcribe ( self , audio_file_path , mode = TranscriptionMode . NORMAL ) : pass | SINGLE_STMT | [["Insert", ["parameters", 3, 19, 3, 75], ["default_parameter", "N0"], 5], ["Update", ["identifier:PERSONA_ONLY", 3, 43, 3, 55], "mode"], ["Move", "N0", ["identifier:PERSONA_ONLY", 3, 43, 3, 55], 0], ["Move", "N0", ["=:=", 3, 55, 3, 56], 1], ["Insert", "N0", ["attribute", "N1"], 2], ["Update", ["identifier:MUSIC", 3, 63, 3, 68], "TranscriptionMode"], ["Move", "N1", ["identifier:MUSIC", 3, 63, 3, 68], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:NORMAL", "T"], 2], ["Delete", ["false:False", 3, 56, 3, 61]], ["Delete", ["default_parameter", 3, 43, 3, 61]], ["Delete", [",:,", 3, 61, 3, 62]], ["Delete", ["=:=", 3, 68, 3, 69]], ["Delete", ["false:False", 3, 69, 3, 74]], ["Delete", ["default_parameter", 3, 63, 3, 74]]] | pneumaticdeath/jasper-client@c2ac7f31d7777d6bcc83385409cbfe34af695a8a | null | null |
jasper-client | 55e295f6b7a5149bbc05f884b56e91c47e66263d | 96f718e4524c4c7631438d37df47bf2f61d26f4f | client/stt.py | https://github.com/pneumaticdeath/jasper-client | true | false | true | @@ -254,4 +254,4 @@ def newSTTEngine(stt_engine, **kwargs):
engine = selected_engines[0]
if not engine.is_available():
raise ValueError("STT engine '%s' is not available (due to missing dependencies, missing dependencies, etc.)" % stt_engine)
- return engine(engine.get_config())
+ return engine(**engine.get_config())
| return engine ( engine . get_config ( ) ) | return engine ( ** engine . get_config ( ) ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 22, 3, 43], ["dictionary_splat", "N0"], 1], ["Insert", "N0", ["**:**", "T"], 0], ["Move", "N0", ["call", 3, 23, 3, 42], 1]] | pneumaticdeath/jasper-client@55e295f6b7a5149bbc05f884b56e91c47e66263d | null | null |
jasper-client | b3906039d283db22412380d9cc61874f7a5b86b1 | 98ac7559322931e21df3e8dffbeb167861b64567 | client/speaker.py | https://github.com/pneumaticdeath/jasper-client | true | false | false | @@ -241,7 +241,7 @@ if __name__ == '__main__':
for engine in AbstractSpeaker.__subclasses__():
if hasattr(engine, 'SLUG'):
instance = engine()
- if instance.is_available:
+ if instance.is_available():
engines.append(instance)
for engine in engines:
| if instance . is_available : engines . append ( instance ) | if instance . is_available ( ) : engines . append ( instance ) | SINGLE_STMT | [["Insert", ["if_statement", 3, 13, 4, 41], ["call", "N0"], 1], ["Move", "N0", ["attribute", 3, 16, 3, 37], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["):)", "T"], 1]] | pneumaticdeath/jasper-client@b3906039d283db22412380d9cc61874f7a5b86b1 | null | null |
scikit-image | 1a1476841d2d0e484a5c4245c3140c6c58039870 | 691dc07771b4a40f092314c32a339e7f419f3174 | doc/examples/plot_matching.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -72,7 +72,7 @@ def gaussian_weights(window_ext, sigma=1):
def match_corner(coord, window_ext=5):
- r, c = np.round(coord)
+ r, c = np.round(coord).astype(np.intp)
window_orig = img_orig[r-window_ext:r+window_ext+1,
c-window_ext:c+window_ext+1, :]
| r , c = np . round ( coord ) | r , c = np . round ( coord ) . astype ( np . intp ) | ADD_METHOD_CALL | [["Insert", ["call", 3, 13, 3, 28], ["attribute", "N0"], 0], ["Insert", ["call", 3, 13, 3, 28], ["argument_list", "N1"], 1], ["Move", "N0", ["call", 3, 13, 3, 28], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:astype", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["attribute", "N2"], 1], ["Insert", "N1", ["):)", "T"], 2], ["Insert", "N2", ["identifier:np", "T"], 0], ["Insert", "N2", [".:.", "T"], 1], ["Insert", "N2", ["identifier:intp", "T"], 2]] | matsuken92/scikit-image@1a1476841d2d0e484a5c4245c3140c6c58039870 | Fix deprecation warnings in matching example | [
{
"sha": "314c45d2b46edbbb16d4fdec2f25a04b73aaa420",
"filename": "doc/examples/plot_matching.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/1a1476841d2d0e484a5c4245c3140c6c58039870/doc%2Fexamples%2Fplot_matching.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/1a1476841d2d0e484a5c4245c3140c6c58039870/doc%2Fexamples%2Fplot_matching.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fexamples%2Fplot_matching.py?ref=1a1476841d2d0e484a5c4245c3140c6c58039870",
"patch": "@@ -72,7 +72,7 @@ def gaussian_weights(window_ext, sigma=1):\n \n \n def match_corner(coord, window_ext=5):\n- r, c = np.round(coord)\n+ r, c = np.round(coord).astype(np.intp)\n window_orig = img_orig[r-window_ext:r+window_ext+1,\n c-window_ext:c+window_ext+1, :]\n "
}
] |
scikit-image | 739dca0201f963ea2ebb4aaf56031eed63690748 | 9e1cc80dd32b7fc29184c1161cc48ace9b2898e3 | skimage/novice/_novice.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -226,7 +226,7 @@ class Picture(object):
Get the bottom-left pixel
>>> pic[0, 0]
- Pixel(red=255, green=0, blue=0)
+ Pixel(red=255, green=0, blue=0, alpha=255)
Get the top row of the picture
>>> pic[:, pic.height-1]
| Pixel ( red = 255 , green = 0 , blue = 0 ) | Pixel ( red = 255 , green = 0 , blue = 0 , alpha = 255 ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 10, 3, 36], [",:,", "T"], 6], ["Insert", ["argument_list", 3, 10, 3, 36], ["keyword_argument", "N0"], 7], ["Insert", "N0", ["identifier:alpha", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["integer:255", "T"], 2]] | matsuken92/scikit-image@739dca0201f963ea2ebb4aaf56031eed63690748 | Fix novice doc test | [
{
"sha": "b953b0c86ecb5b821f5e04c35f44508ea0beddbf",
"filename": "skimage/novice/_novice.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/739dca0201f963ea2ebb4aaf56031eed63690748/skimage%2Fnovice%2F_novice.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/739dca0201f963ea2ebb4aaf56031eed63690748/skimage%2Fnovice%2F_novice.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fnovice%2F_novice.py?ref=739dca0201f963ea2ebb4aaf56031eed63690748",
"patch": "@@ -226,7 +226,7 @@ class Picture(object):\n \n Get the bottom-left pixel\n >>> pic[0, 0]\n- Pixel(red=255, green=0, blue=0)\n+ Pixel(red=255, green=0, blue=0, alpha=255)\n \n Get the top row of the picture\n >>> pic[:, pic.height-1]"
}
] |
scikit-image | 4aa162fc783629075baaf1a4bc615c95551ee3fa | fbda63962a34f2d62d41fdd404edc49aef215319 | skimage/segmentation/random_walker_segmentation.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -389,7 +389,7 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True,
dims = data[..., 0].shape # To reshape final labeled result
data = img_as_float(data)
if data.ndim == 3: # 2D multispectral, needs singleton in 3rd axis
- data = data[:, :, np.newaxis, :].transpose((0, 1, 3, 2))
+ data = data[:, :, np.newaxis, :]
# Spacing kwarg checks
if spacing is None:
| data = data [ : , : , np . newaxis , : ] . transpose ( ( 0 , 1 , 3 , 2 ) ) | data = data [ : , : , np . newaxis , : ] | SINGLE_STMT | [["Move", ["assignment", 3, 13, 3, 69], ["subscript", 3, 20, 3, 45], 2], ["Delete", [".:.", 3, 45, 3, 46]], ["Delete", ["identifier:transpose", 3, 46, 3, 55]], ["Delete", ["attribute", 3, 20, 3, 55]], ["Delete", ["(:(", 3, 55, 3, 56]], ["Delete", ["(:(", 3, 56, 3, 57]], ["Delete", ["integer:0", 3, 57, 3, 58]], ["Delete", [",:,", 3, 58, 3, 59]], ["Delete", ["integer:1", 3, 60, 3, 61]], ["Delete", [",:,", 3, 61, 3, 62]], ["Delete", ["integer:3", 3, 63, 3, 64]], ["Delete", [",:,", 3, 64, 3, 65]], ["Delete", ["integer:2", 3, 66, 3, 67]], ["Delete", ["):)", 3, 67, 3, 68]], ["Delete", ["tuple", 3, 56, 3, 68]], ["Delete", ["):)", 3, 68, 3, 69]], ["Delete", ["argument_list", 3, 55, 3, 69]], ["Delete", ["call", 3, 20, 3, 69]]] | matsuken92/scikit-image@4aa162fc783629075baaf1a4bc615c95551ee3fa | FIX: Remove unnecessary .transpose introduced in PR #984 | [
{
"sha": "731518e39ee696af90ef69b8ac939589b5f645ee",
"filename": "skimage/segmentation/random_walker_segmentation.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/4aa162fc783629075baaf1a4bc615c95551ee3fa/skimage%2Fsegmentation%2Frandom_walker_segmentation.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/4aa162fc783629075baaf1a4bc615c95551ee3fa/skimage%2Fsegmentation%2Frandom_walker_segmentation.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fsegmentation%2Frandom_walker_segmentation.py?ref=4aa162fc783629075baaf1a4bc615c95551ee3fa",
"patch": "@@ -389,7 +389,7 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True,\n dims = data[..., 0].shape # To reshape final labeled result\n data = img_as_float(data)\n if data.ndim == 3: # 2D multispectral, needs singleton in 3rd axis\n- data = data[:, :, np.newaxis, :].transpose((0, 1, 3, 2))\n+ data = data[:, :, np.newaxis, :]\n \n # Spacing kwarg checks\n if spacing is None:"
}
] |
scikit-image | 3fab7c00570fad21e918403f27e3701725bf336b | 26793068b1102765165d2aa216b90f830d68e029 | skimage/segmentation/_join.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -118,7 +118,7 @@ def relabel_sequential(label_field, offset=1):
if not np.issubdtype(label_field.dtype, np.int):
new_type = np.min_scalar_type(int(m))
label_field = label_field.astype(new_type)
- m = np.round(m).astype(new_type) # Ensures m is an integer
+ m = m.astype(new_type) # Ensures m is an integer
labels = np.unique(label_field)
labels0 = labels[labels != 0]
if m == len(labels0): # nothing to do, already 1...n labels
| m = np . round ( m ) . astype ( new_type ) | m = m . astype ( new_type ) | SINGLE_STMT | [["Move", ["attribute", 3, 13, 3, 31], ["identifier:m", 3, 22, 3, 23], 0], ["Move", ["attribute", 3, 13, 3, 31], [".:.", 3, 15, 3, 16], 1], ["Delete", ["identifier:np", 3, 13, 3, 15]], ["Delete", ["identifier:round", 3, 16, 3, 21]], ["Delete", ["attribute", 3, 13, 3, 21]], ["Delete", ["(:(", 3, 21, 3, 22]], ["Delete", ["):)", 3, 23, 3, 24]], ["Delete", ["argument_list", 3, 21, 3, 24]], ["Delete", ["call", 3, 13, 3, 24]], ["Delete", [".:.", 3, 24, 3, 25]]] | matsuken92/scikit-image@3fab7c00570fad21e918403f27e3701725bf336b | Remove incorrect np.round statement (directly cast `m`) | [
{
"sha": "7b6d2a3eaf6754cb8174c32657a75330253a8b3a",
"filename": "skimage/segmentation/_join.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/3fab7c00570fad21e918403f27e3701725bf336b/skimage%2Fsegmentation%2F_join.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/3fab7c00570fad21e918403f27e3701725bf336b/skimage%2Fsegmentation%2F_join.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fsegmentation%2F_join.py?ref=3fab7c00570fad21e918403f27e3701725bf336b",
"patch": "@@ -118,7 +118,7 @@ def relabel_sequential(label_field, offset=1):\n if not np.issubdtype(label_field.dtype, np.int):\n new_type = np.min_scalar_type(int(m))\n label_field = label_field.astype(new_type)\n- m = np.round(m).astype(new_type) # Ensures m is an integer\n+ m = m.astype(new_type) # Ensures m is an integer\n labels = np.unique(label_field)\n labels0 = labels[labels != 0]\n if m == len(labels0): # nothing to do, already 1...n labels"
}
] |
scikit-image | adbc2efbfa2156eb9fd7b74f3484e413d203b5d9 | 98c426d58319b0a2b4fccc7f079c8a899ab6ecc5 | skimage/color/colorconv.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -806,7 +806,7 @@ def lab2rgb(lab):
Parameters
----------
- rgb : array_like
+ lab : array_like
The image in Lab format, in a 3-D array of shape ``(.., .., 3)``.
Returns
| - - - - - - - - - - rgb : array_like | - - - - - - - - - - lab : array_like | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:rgb", 3, 5, 3, 8], "lab"]] | matsuken92/scikit-image@adbc2efbfa2156eb9fd7b74f3484e413d203b5d9 | Fix copy/paste error in docstring. | [
{
"sha": "80f115ee6973e191379a591c649fb77ed5b222c1",
"filename": "skimage/color/colorconv.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/adbc2efbfa2156eb9fd7b74f3484e413d203b5d9/skimage%2Fcolor%2Fcolorconv.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/adbc2efbfa2156eb9fd7b74f3484e413d203b5d9/skimage%2Fcolor%2Fcolorconv.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fcolor%2Fcolorconv.py?ref=adbc2efbfa2156eb9fd7b74f3484e413d203b5d9",
"patch": "@@ -806,7 +806,7 @@ def lab2rgb(lab):\n \n Parameters\n ----------\n- rgb : array_like\n+ lab : array_like\n The image in Lab format, in a 3-D array of shape ``(.., .., 3)``.\n \n Returns"
}
] |
scikit-image | fb4729d60d193133a983c2d51056b23ad5b9fd32 | ea6c9b27abe0595064b3517a24d0507ae23af2a9 | doc/gh-pages.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -117,7 +117,7 @@ if __name__ == '__main__':
try:
cd(pages_dir)
status = sh2('git status | head -1')
- branch = re.match('\# On branch (.*)$', status).group(1)
+ branch = re.match('On branch (.*)$', status).group(1)
if branch != 'gh-pages':
e = 'On %r, git branch is %r, MUST be "gh-pages"' % (pages_dir,
branch)
| branch = re . match ( '\# On branch (.*)$' , status ) . group ( 1 ) | branch = re . match ( 'On branch (.*)$' , status ) . group ( 1 ) | CHANGE_STRING_LITERAL | [["Update", ["string:'\\# On branch (.*)$'", 3, 27, 3, 47], "'On branch (.*)$'"]] | matsuken92/scikit-image@fb4729d60d193133a983c2d51056b23ad5b9fd32 | Fix gh-pages build script | [
{
"sha": "80020b6633163e739c795c8a184a8e47f509b309",
"filename": "doc/gh-pages.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/fb4729d60d193133a983c2d51056b23ad5b9fd32/doc%2Fgh-pages.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/fb4729d60d193133a983c2d51056b23ad5b9fd32/doc%2Fgh-pages.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fgh-pages.py?ref=fb4729d60d193133a983c2d51056b23ad5b9fd32",
"patch": "@@ -117,7 +117,7 @@ def init_repo(path):\n try:\n cd(pages_dir)\n status = sh2('git status | head -1')\n- branch = re.match('\\# On branch (.*)$', status).group(1)\n+ branch = re.match('On branch (.*)$', status).group(1)\n if branch != 'gh-pages':\n e = 'On %r, git branch is %r, MUST be \"gh-pages\"' % (pages_dir,\n branch)"
}
] |
scikit-image | b70d423aab5a443cf608c65c880d163c73b2190e | d72163a0379dff0d1d7d39d2536a969f9189d4f0 | skimage/color/colorlabel.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -156,7 +156,7 @@ def _label2rgb_overlay(label, image=None, colors=None, alpha=0.3,
return result
-def _label2rgb_avg(label_field, image, bg_label, bg_color):
+def _label2rgb_avg(label_field, image, bg_label=0, bg_color=(0, 0, 0)):
| def _label2rgb_avg ( label_field , image , bg_label , bg_color ) : | def _label2rgb_avg ( label_field , image , bg_label = 0 , bg_color = ( 0 , 0 , 0 ) ) : | SINGLE_STMT | [["Insert", ["parameters", 3, 19, 3, 59], ["default_parameter", "N0"], 5], ["Insert", ["parameters", 3, 19, 3, 59], ["default_parameter", "N1"], 8], ["Insert", ["parameters", 3, 19, 3, 59], ["):)", "T"], 9], ["Move", "N0", ["identifier:bg_label", 3, 40, 3, 48], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["integer:0", "T"], 2], ["Move", "N1", ["identifier:bg_color", 3, 50, 3, 58], 0], ["Insert", "N1", ["=:=", "T"], 1], ["Insert", "N1", ["tuple", "N2"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["integer:0", "T"], 1], ["Insert", "N2", [",:,", "T"], 2], ["Insert", "N2", ["integer:0", "T"], 3], ["Insert", "N2", [",:,", "T"], 4], ["Insert", "N2", ["integer:0", "T"], 5], ["Move", "N2", ["):)", 3, 58, 3, 59], 6]] | matsuken92/scikit-image@b70d423aab5a443cf608c65c880d163c73b2190e | Add default values for background in _label2rgb_avg | [
{
"sha": "e373dc16d164be6f9cb1ca9ec000dd45631497b3",
"filename": "skimage/color/colorlabel.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/b70d423aab5a443cf608c65c880d163c73b2190e/skimage%2Fcolor%2Fcolorlabel.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/b70d423aab5a443cf608c65c880d163c73b2190e/skimage%2Fcolor%2Fcolorlabel.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fcolor%2Fcolorlabel.py?ref=b70d423aab5a443cf608c65c880d163c73b2190e",
"patch": "@@ -156,7 +156,7 @@ def _label2rgb_overlay(label, image=None, colors=None, alpha=0.3,\n return result\n \n \n-def _label2rgb_avg(label_field, image, bg_label, bg_color):\n+def _label2rgb_avg(label_field, image, bg_label=0, bg_color=(0, 0, 0)):\n \"\"\"Visualise each segment in `label_field` with its mean color in `image`.\n \n Parameters"
}
] |
scikit-image | 83d0717986f66b47ecc323328befdcb50a67fe54 | 7d9f9c46d9707e02bb7f9d94cc8d84c0b0f3e697 | skimage/io/tests/test_freeimage.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -39,7 +39,7 @@ def test_imread():
@skipif(not FI_available)
def test_imread_truncated_jpg():
- assert_raises(RuntimeError,
+ assert_raises((RuntimeError, ValueError),
sio.imread,
os.path.join(si.data_dir, 'truncated.jpg'))
| assert_raises ( RuntimeError , sio . imread , os . path . join ( si . data_dir , 'truncated.jpg' ) ) | assert_raises ( ( RuntimeError , ValueError ) , sio . imread , os . path . join ( si . data_dir , 'truncated.jpg' ) ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 18, 5, 62], ["tuple", "N0"], 1], ["Insert", ["argument_list", 3, 18, 5, 62], [",:,", "T"], 2], ["Insert", "N0", ["(:(", "T"], 0], ["Move", "N0", ["identifier:RuntimeError", 3, 19, 3, 31], 1], ["Move", "N0", [",:,", 3, 31, 3, 32], 2], ["Insert", "N0", ["identifier:ValueError", "T"], 3], ["Insert", "N0", ["):)", "T"], 4]] | matsuken92/scikit-image@83d0717986f66b47ecc323328befdcb50a67fe54 | [test_freeimage] Allow ValueError to be raised
With the truncated image, sometimes ValueError is raised. This allows
either RuntimeError (i.e. libfreeimage error) or ValueError to be
raised. | [
{
"sha": "4e64bd168cb105119ad9d4a74b310f8f1a6d7be9",
"filename": "skimage/io/tests/test_freeimage.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/83d0717986f66b47ecc323328befdcb50a67fe54/skimage%2Fio%2Ftests%2Ftest_freeimage.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/83d0717986f66b47ecc323328befdcb50a67fe54/skimage%2Fio%2Ftests%2Ftest_freeimage.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fio%2Ftests%2Ftest_freeimage.py?ref=83d0717986f66b47ecc323328befdcb50a67fe54",
"patch": "@@ -39,7 +39,7 @@ def test_imread():\n \n @skipif(not FI_available)\n def test_imread_truncated_jpg():\n- assert_raises(RuntimeError,\n+ assert_raises((RuntimeError, ValueError),\n sio.imread,\n os.path.join(si.data_dir, 'truncated.jpg'))\n "
}
] |
scikit-image | 7a074d5dd165536cb05fd87ea94a29510edac1a7 | 6887f2cb90c59e2379041c1efa08746b08ad7333 | skimage/segmentation/_join.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -124,7 +124,7 @@ def relabel_sequential(label_field, offset=1):
if m == len(labels0): # nothing to do, already 1...n labels
return label_field, labels, labels
forward_map = np.zeros(m + 1, int)
- forward_map[labels0] = np.arange(offset, offset + len(labels0) + 1)
+ forward_map[labels0] = np.arange(offset, offset + len(labels0))
if not (labels == 0).any():
labels = np.concatenate(([0], labels))
inverse_map = np.zeros(offset - 1 + len(labels), dtype=np.intp)
| forward_map [ labels0 ] = np . arange ( offset , offset + len ( labels0 ) + 1 ) | forward_map [ labels0 ] = np . arange ( offset , offset + len ( labels0 ) ) | SINGLE_STMT | [["Delete", ["+:+", 3, 68, 3, 69]], ["Delete", ["integer:1", 3, 70, 3, 71]]] | matsuken92/scikit-image@7a074d5dd165536cb05fd87ea94a29510edac1a7 | BUG: Fix slicing error revealed by numpy 1.9.0.
Numpy 1.9.0 no longer allows oversize data to be assigned to a
boolean indexed 1-d array by discarding excess elements.
Closes #1050. | [
{
"sha": "5cceeb5b9957aeee5f2df0b3255f744f1244e2bf",
"filename": "skimage/segmentation/_join.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/7a074d5dd165536cb05fd87ea94a29510edac1a7/skimage%2Fsegmentation%2F_join.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/7a074d5dd165536cb05fd87ea94a29510edac1a7/skimage%2Fsegmentation%2F_join.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fsegmentation%2F_join.py?ref=7a074d5dd165536cb05fd87ea94a29510edac1a7",
"patch": "@@ -124,7 +124,7 @@ def relabel_sequential(label_field, offset=1):\n if m == len(labels0): # nothing to do, already 1...n labels\n return label_field, labels, labels\n forward_map = np.zeros(m + 1, int)\n- forward_map[labels0] = np.arange(offset, offset + len(labels0) + 1)\n+ forward_map[labels0] = np.arange(offset, offset + len(labels0))\n if not (labels == 0).any():\n labels = np.concatenate(([0], labels))\n inverse_map = np.zeros(offset - 1 + len(labels), dtype=np.intp)"
}
] |
scikit-image | 21364e8741da905c9e382118cca780ff47d1776e | 9cd276f754da36e9b50a62e14ad2376dc8652c77 | doc/examples/plot_rag_mean_color.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -19,7 +19,7 @@ labels1 = segmentation.slic(img, compactness=30, n_segments=400)
out1 = color.label2rgb(labels1, img, kind='avg')
g = graph.rag_mean_color(img, labels1)
-labels2 = graph.cut_threshold(labels1, g, 30)
+labels2 = graph.cut_threshold(labels1, g, 29)
out2 = color.label2rgb(labels2, img, kind='avg')
plt.figure()
| labels2 = graph . cut_threshold ( labels1 , g , 30 ) | labels2 = graph . cut_threshold ( labels1 , g , 29 ) | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:30", 3, 43, 3, 45], "29"]] | matsuken92/scikit-image@21364e8741da905c9e382118cca780ff47d1776e | Fixed threshold in example | [
{
"sha": "ab962e65ea720f5dd6ddb8ec7a073b9564012f48",
"filename": "doc/examples/plot_rag_mean_color.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/21364e8741da905c9e382118cca780ff47d1776e/doc%2Fexamples%2Fplot_rag_mean_color.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/21364e8741da905c9e382118cca780ff47d1776e/doc%2Fexamples%2Fplot_rag_mean_color.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fexamples%2Fplot_rag_mean_color.py?ref=21364e8741da905c9e382118cca780ff47d1776e",
"patch": "@@ -19,7 +19,7 @@\n out1 = color.label2rgb(labels1, img, kind='avg')\n \n g = graph.rag_mean_color(img, labels1)\n-labels2 = graph.cut_threshold(labels1, g, 30)\n+labels2 = graph.cut_threshold(labels1, g, 29)\n out2 = color.label2rgb(labels2, img, kind='avg')\n \n plt.figure()"
}
] |
scikit-image | 838617cb394c9ab9c948ebd64439d0485edfbf0d | 278a0d6862e25a479f38a29f5451f33232fdc3cf | skimage/filter/tests/test_thresholding.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -67,7 +67,7 @@ class TestSimpleImage():
def test_isodata_linspace(self):
assert -63.8 < threshold_isodata(np.linspace(-127, 0, 256)) < -63.6
- def test_isodata_16bit():
+ def test_isodata_16bit(self):
np.random.seed(0)
imfloat = np.random.rand(256, 256)
t = threshold_isodata(imfloat, nbins=1024)
| def test_isodata_16bit ( ) : np . random . seed ( 0 ) imfloat = np . random . rand ( 256 , 256 ) t = threshold_isodata ( imfloat , nbins = 1024 ) | def test_isodata_16bit ( self ) : np . random . seed ( 0 ) imfloat = np . random . rand ( 256 , 256 ) t = threshold_isodata ( imfloat , nbins = 1024 ) | SINGLE_STMT | [["Insert", ["parameters", 3, 27, 3, 29], ["identifier:self", "T"], 1]] | matsuken92/scikit-image@838617cb394c9ab9c948ebd64439d0485edfbf0d | Fix incorrect test function signature | [
{
"sha": "8464cb21e45f96b117b8c1f02429bcd40a14b266",
"filename": "skimage/filter/tests/test_thresholding.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/838617cb394c9ab9c948ebd64439d0485edfbf0d/skimage%2Ffilter%2Ftests%2Ftest_thresholding.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/838617cb394c9ab9c948ebd64439d0485edfbf0d/skimage%2Ffilter%2Ftests%2Ftest_thresholding.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffilter%2Ftests%2Ftest_thresholding.py?ref=838617cb394c9ab9c948ebd64439d0485edfbf0d",
"patch": "@@ -67,7 +67,7 @@ def test_isodata_blank_zero(self):\n def test_isodata_linspace(self):\n assert -63.8 < threshold_isodata(np.linspace(-127, 0, 256)) < -63.6\n \n- def test_isodata_16bit():\n+ def test_isodata_16bit(self):\n np.random.seed(0)\n imfloat = np.random.rand(256, 256)\n t = threshold_isodata(imfloat, nbins=1024)"
}
] |
scikit-image | 332469c6df8fcb0d3151b457a76abccb1c136c1b | 6b9ecd80b91ad4c2ded3536ac34d21d09ba33bc8 | doc/examples/applications/plot_coins_segmentation.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -91,7 +91,7 @@ Small spurious objects are easily removed by setting a minimum size for valid
from skimage import morphology
-coins_cleaned = morphology.remove_small_connected_components(fill_coins, 21)
+coins_cleaned = morphology.remove_small_objects(fill_coins, 21)
plt.figure(figsize=(4, 3))
plt.imshow(coins_cleaned, cmap=plt.cm.gray, interpolation='nearest')
| coins_cleaned = morphology . remove_small_connected_components ( fill_coins , 21 ) | coins_cleaned = morphology . remove_small_objects ( fill_coins , 21 ) | WRONG_FUNCTION_NAME | [["Update", ["identifier:remove_small_connected_components", 1, 28, 1, 61], "remove_small_objects"]] | matsuken92/scikit-image@332469c6df8fcb0d3151b457a76abccb1c136c1b | Fix missed rename in example | [
{
"sha": "0d1d8a3439da7143b88e299d7c3f1a0ae1b9f8e7",
"filename": "doc/examples/applications/plot_coins_segmentation.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/332469c6df8fcb0d3151b457a76abccb1c136c1b/doc%2Fexamples%2Fapplications%2Fplot_coins_segmentation.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/332469c6df8fcb0d3151b457a76abccb1c136c1b/doc%2Fexamples%2Fapplications%2Fplot_coins_segmentation.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fexamples%2Fapplications%2Fplot_coins_segmentation.py?ref=332469c6df8fcb0d3151b457a76abccb1c136c1b",
"patch": "@@ -91,7 +91,7 @@\n objects.\n \"\"\"\n from skimage import morphology\n-coins_cleaned = morphology.remove_small_connected_components(fill_coins, 21)\n+coins_cleaned = morphology.remove_small_objects(fill_coins, 21)\n \n plt.figure(figsize=(4, 3))\n plt.imshow(coins_cleaned, cmap=plt.cm.gray, interpolation='nearest')"
}
] |
scikit-image | 0a6b72bfe4f47b48e883591e61e43b0065793ea3 | 7f5b331f22589093aa93e570f9a8a93868872923 | skimage/color/tests/test_colorconv.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -124,15 +124,15 @@ class TestColorconv(TestCase):
# RGB<->HED roundtrip
def test_hed_rgb_roundtrip(self):
- test = np.array([[[97, 105, 152],
- [217, 187, 225],
- [117, 107, 168]],
- [[217, 187, 225],
- [176, 135, 83],
- [234, 144, 205]],
- [[97, 105, 152],
- [117, 107, 168],
- [217, 187, 225]]], dtype=np.uint8)
+ img_rgb = np.array([[[97, 105, 152],
+ [217, 187, 225],
+ [117, 107, 168]],
+ [[217, 187, 225],
+ [176, 135, 83],
+ [234, 144, 205]],
+ [[97, 105, 152],
+ [117, 107, 168],
+ [217, 187, 225]]], dtype=np.uint8)
assert_array_almost_equal(hed2rgb(rgb2hed(img_rgb)), img_rgb)
# RGB to RGB CIE
| test = np . array ( [ [ [ 97 , 105 , 152 ] , [ 217 , 187 , 225 ] , [ 117 , 107 , 168 ] ] , [ [ 217 , 187 , 225 ] , [ 176 , 135 , 83 ] , [ 234 , 144 , 205 ] ] , [ [ 97 , 105 , 152 ] , [ 117 , 107 , 168 ] , [ 217 , 187 , 225 ] ] ] , dtype = np . uint8 ) | img_rgb = np . array ( [ [ [ 97 , 105 , 152 ] , [ 217 , 187 , 225 ] , [ 117 , 107 , 168 ] ] , [ [ 217 , 187 , 225 ] , [ 176 , 135 , 83 ] , [ 234 , 144 , 205 ] ] , [ [ 97 , 105 , 152 ] , [ 117 , 107 , 168 ] , [ 217 , 187 , 225 ] ] ] , dtype = np . uint8 ) | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:test", 3, 9, 3, 13], "img_rgb"]] | matsuken92/scikit-image@0a6b72bfe4f47b48e883591e61e43b0065793ea3 | FIX: Fixed test_hed_rgb_roundtrip. | [
{
"sha": "7e76ded3e920baad573351d399a05896bde3aed4",
"filename": "skimage/color/tests/test_colorconv.py",
"status": "modified",
"additions": 9,
"deletions": 9,
"changes": 18,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/0a6b72bfe4f47b48e883591e61e43b0065793ea3/skimage%2Fcolor%2Ftests%2Ftest_colorconv.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/0a6b72bfe4f47b48e883591e61e43b0065793ea3/skimage%2Fcolor%2Ftests%2Ftest_colorconv.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fcolor%2Ftests%2Ftest_colorconv.py?ref=0a6b72bfe4f47b48e883591e61e43b0065793ea3",
"patch": "@@ -124,15 +124,15 @@ def test_xyz_rgb_roundtrip(self):\n \n # RGB<->HED roundtrip\n def test_hed_rgb_roundtrip(self):\n- test = np.array([[[97, 105, 152],\n- [217, 187, 225],\n- [117, 107, 168]],\n- [[217, 187, 225],\n- [176, 135, 83],\n- [234, 144, 205]],\n- [[97, 105, 152],\n- [117, 107, 168], \n- [217, 187, 225]]], dtype=np.uint8)\n+ img_rgb = np.array([[[97, 105, 152],\n+ [217, 187, 225],\n+ [117, 107, 168]],\n+ [[217, 187, 225],\n+ [176, 135, 83],\n+ [234, 144, 205]],\n+ [[97, 105, 152],\n+ [117, 107, 168], \n+ [217, 187, 225]]], dtype=np.uint8)\n assert_array_almost_equal(hed2rgb(rgb2hed(img_rgb)), img_rgb)\n \n # RGB to RGB CIE"
}
] |
scikit-image | 7ca08cf7630787201636da4ea4409741b558d613 | dda83fdb5586d69b06043d57ba312a12f277c05c | skimage/transform/hough_transform.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -164,7 +164,7 @@ def hough_circle(img, radius, normalize=True):
- return _hough_circle(img, radius, normalize)
+ return _hough_circle(img, radius.astype(np.intp), normalize)
def hough_peaks(hspace, angles, dists, min_distance=10, min_angle=10,
threshold=None, num_peaks=np.inf):
| return _hough_circle ( img , radius , normalize ) | return _hough_circle ( img , radius . astype ( np . intp ) , normalize ) | ADD_METHOD_CALL | [["Insert", ["argument_list", 0, 25, 0, 49], ["call", "N0"], 3], ["Insert", ["argument_list", 0, 25, 0, 49], ["):)", "T"], 7], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["identifier:radius", 0, 31, 0, 37], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:astype", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["attribute", "N3"], 1], ["Move", "N2", ["):)", 0, 48, 0, 49], 2], ["Insert", "N3", ["identifier:np", "T"], 0], ["Insert", "N3", [".:.", "T"], 1], ["Insert", "N3", ["identifier:intp", "T"], 2]] | matsuken92/scikit-image@7ca08cf7630787201636da4ea4409741b558d613 | Fix `ValueError: Buffer dtype mismatch` on win-amd64 | [
{
"sha": "e83cecd55e7d76b282e84e9d4aa4c5d69cfcf2d6",
"filename": "skimage/transform/hough_transform.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/7ca08cf7630787201636da4ea4409741b558d613/skimage%2Ftransform%2Fhough_transform.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/7ca08cf7630787201636da4ea4409741b558d613/skimage%2Ftransform%2Fhough_transform.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ftransform%2Fhough_transform.py?ref=7ca08cf7630787201636da4ea4409741b558d613",
"patch": "@@ -164,7 +164,7 @@ def hough_circle(img, radius, normalize=True):\n Hough transform accumulator for each radius\n \n \"\"\"\n- return _hough_circle(img, radius, normalize)\n+ return _hough_circle(img, radius.astype(np.intp), normalize)\n \n def hough_peaks(hspace, angles, dists, min_distance=10, min_angle=10,\n threshold=None, num_peaks=np.inf):"
}
] |
scikit-image | 042b75d05fb68ec6ba89156936881baea9c68be2 | 920e41398d6c9264d163dafd3fb7469449f27e10 | skimage/feature/tests/test_corner.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -107,7 +107,7 @@ def test_num_peaks():
lena_corners = corner_harris(data.lena())
- for i in xrange(20):
+ for i in range(20):
n = np.random.random_integers(20)
results = peak_local_max(lena_corners, num_peaks=n)
assert (results.shape[0] == n)
| for i in xrange ( 20 ) : n = np . random . random_integers ( 20 ) results = peak_local_max ( lena_corners , num_peaks = n ) assert ( results . shape [ 0 ] == n ) | for i in range ( 20 ) : n = np . random . random_integers ( 20 ) results = peak_local_max ( lena_corners , num_peaks = n ) assert ( results . shape [ 0 ] == n ) | WRONG_FUNCTION_NAME | [["Update", ["identifier:xrange", 3, 14, 3, 20], "range"]] | matsuken92/scikit-image@042b75d05fb68ec6ba89156936881baea9c68be2 | FIX: changed xrange to range so Python 3 works. | [
{
"sha": "fa8ddd17d440d7cca829aa5e2c5d1f38680d64ca",
"filename": "skimage/feature/tests/test_corner.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/042b75d05fb68ec6ba89156936881baea9c68be2/skimage%2Ffeature%2Ftests%2Ftest_corner.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/042b75d05fb68ec6ba89156936881baea9c68be2/skimage%2Ffeature%2Ftests%2Ftest_corner.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2Ftests%2Ftest_corner.py?ref=042b75d05fb68ec6ba89156936881baea9c68be2",
"patch": "@@ -107,7 +107,7 @@ def test_num_peaks():\n \n lena_corners = corner_harris(data.lena())\n \n- for i in xrange(20):\n+ for i in range(20):\n n = np.random.random_integers(20)\n results = peak_local_max(lena_corners, num_peaks=n)\n assert (results.shape[0] == n)"
}
] |
scikit-image | 0238e388acf86144f3d03f5b65809c3ac2301f7e | 9ddb9e42aa7890d0dc247cb5545f5287f475e5d2 | skimage/morphology/_skeletonize.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -146,7 +146,7 @@ def skeletonize(image):
pixelRemoved = True
skeleton[code_mask] = 0
- return skeleton
+ return skeleton.astype(bool)
# --------- Skeletonization by medial axis transform --------
| return skeleton | return skeleton . astype ( bool ) | ADD_METHOD_CALL | [["Insert", ["return_statement", 3, 5, 3, 20], ["call", "N0"], 1], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["identifier:skeleton", 3, 12, 3, 20], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:astype", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["identifier:bool", "T"], 1], ["Insert", "N2", ["):)", "T"], 2]] | matsuken92/scikit-image@0238e388acf86144f3d03f5b65809c3ac2301f7e | Make return type of skeletonize function boolean | [
{
"sha": "13025c644722257b26381affb205aa52297f49d4",
"filename": "skimage/morphology/_skeletonize.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/0238e388acf86144f3d03f5b65809c3ac2301f7e/skimage%2Fmorphology%2F_skeletonize.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/0238e388acf86144f3d03f5b65809c3ac2301f7e/skimage%2Fmorphology%2F_skeletonize.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmorphology%2F_skeletonize.py?ref=0238e388acf86144f3d03f5b65809c3ac2301f7e",
"patch": "@@ -146,7 +146,7 @@ def skeletonize(image):\n pixelRemoved = True\n skeleton[code_mask] = 0\n \n- return skeleton\n+ return skeleton.astype(bool)\n \n # --------- Skeletonization by medial axis transform --------\n "
}
] |
scikit-image | 41007b417b9af300a2488850c12e8f066469c166 | 82ea5cf446ac873fef03398b42e7b3e2499930da | doc/examples/plot_rank_mean.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -25,7 +25,7 @@ from skimage import data
from skimage.morphology import disk
import skimage.filter.rank as rank
-a16 = (data.coins()).astype('uint16') * 16
+a16 = (data.coins()).astype(np.uint16) * 16
selem = disk(20)
f1 = rank.percentile_mean(a16, selem=selem, p0=.1, p1=.9)
| a16 = ( data . coins ( ) ) . astype ( 'uint16' ) * 16 | a16 = ( data . coins ( ) ) . astype ( np . uint16 ) * 16 | SINGLE_STMT | [["Insert", ["argument_list", 3, 28, 3, 38], ["attribute", "N0"], 1], ["Insert", "N0", ["identifier:np", "T"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:uint16", "T"], 2], ["Delete", ["string:'uint16'", 3, 29, 3, 37]]] | matsuken92/scikit-image@41007b417b9af300a2488850c12e8f066469c166 | Use numpy dtype rather than string | [
{
"sha": "e23beb18f410ff1dd72ef273d2ca64f9db7bd7ce",
"filename": "doc/examples/plot_rank_mean.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/41007b417b9af300a2488850c12e8f066469c166/doc%2Fexamples%2Fplot_rank_mean.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/41007b417b9af300a2488850c12e8f066469c166/doc%2Fexamples%2Fplot_rank_mean.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fexamples%2Fplot_rank_mean.py?ref=41007b417b9af300a2488850c12e8f066469c166",
"patch": "@@ -25,7 +25,7 @@\n from skimage.morphology import disk\n import skimage.filter.rank as rank\n \n-a16 = (data.coins()).astype('uint16') * 16\n+a16 = (data.coins()).astype(np.uint16) * 16\n selem = disk(20)\n \n f1 = rank.percentile_mean(a16, selem=selem, p0=.1, p1=.9)"
}
] |
scikit-image | 5f0665264876764f52dd75341795c96446cb8e79 | 529d46a67b235d4fda6cad14362b0bcdfa63d946 | skimage/color/tests/test_colorconv.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -126,7 +126,7 @@ class TestColorconv(TestCase):
# RGB<->HED roundtrip with ubyte image
def test_hed_rgb_roundtrip(self):
- img_rgb = self.img_rgb
+ img_rgb = img_as_ubyte(self.img_rgb)
assert_equal(img_as_ubyte(hed2rgb(rgb2hed(img_rgb))), img_rgb)
# RGB<->HED roundtrip with float image
| img_rgb = self . img_rgb | img_rgb = img_as_ubyte ( self . img_rgb ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["assignment", 3, 9, 3, 31], ["call", "N0"], 2], ["Insert", "N0", ["identifier:img_as_ubyte", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["attribute", 3, 19, 3, 31], 1], ["Insert", "N1", ["):)", "T"], 2]] | matsuken92/scikit-image@5f0665264876764f52dd75341795c96446cb8e79 | Fix dtype bug in color tests for python 3 | [
{
"sha": "7f1d7c7384435fef3cc23a40521bdaa47832db45",
"filename": "skimage/color/tests/test_colorconv.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/5f0665264876764f52dd75341795c96446cb8e79/skimage%2Fcolor%2Ftests%2Ftest_colorconv.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/5f0665264876764f52dd75341795c96446cb8e79/skimage%2Fcolor%2Ftests%2Ftest_colorconv.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fcolor%2Ftests%2Ftest_colorconv.py?ref=5f0665264876764f52dd75341795c96446cb8e79",
"patch": "@@ -126,7 +126,7 @@ def test_xyz_rgb_roundtrip(self):\n \n # RGB<->HED roundtrip with ubyte image\n def test_hed_rgb_roundtrip(self):\n- img_rgb = self.img_rgb\n+ img_rgb = img_as_ubyte(self.img_rgb)\n assert_equal(img_as_ubyte(hed2rgb(rgb2hed(img_rgb))), img_rgb)\n \n # RGB<->HED roundtrip with float image"
}
] |
scikit-image | df801a887666a489bf6148490d10598af3f6367b | 65f26e7e9d2722e6556f6838ba1af961ecfad631 | skimage/measure/fit.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -444,7 +444,7 @@ class EllipseModel(BaseModel):
def ransac(data, model_class, min_samples, residual_threshold,
- max_trials=1000):
+ max_trials=100):
| def ransac ( data , model_class , min_samples , residual_threshold , max_trials = 1000 ) : | def ransac ( data , model_class , min_samples , residual_threshold , max_trials = 100 ) : | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:1000", 3, 23, 3, 27], "100"]] | matsuken92/scikit-image@df801a887666a489bf6148490d10598af3f6367b | Reduce default number of max trials | [
{
"sha": "aaccc060da0fbe1e0e0f58cc5883891d39184ecb",
"filename": "skimage/measure/fit.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/df801a887666a489bf6148490d10598af3f6367b/skimage%2Fmeasure%2Ffit.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/df801a887666a489bf6148490d10598af3f6367b/skimage%2Fmeasure%2Ffit.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmeasure%2Ffit.py?ref=df801a887666a489bf6148490d10598af3f6367b",
"patch": "@@ -444,7 +444,7 @@ def predict_xy(self, t, params=None):\n \n \n def ransac(data, model_class, min_samples, residual_threshold,\n- max_trials=1000):\n+ max_trials=100):\n '''Fits a model to data with the RANSAC (random sample consensus) algorithm.\n \n Parameters"
}
] |
scikit-image | b58f52e40e5e8dbf3557124f31362bbfaeddca00 | 62b25455dc8b7a1312e0401e8e5991bcacfc26f2 | skimage/measure/fit.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -132,7 +132,7 @@ class LineModel(BaseModel):
if params is None:
params = self._params
dist, theta = params
- return (dist - y * math.cos(theta)) / math.cos(theta)
+ return (dist - y * math.sin(theta)) / math.cos(theta)
def predict_y(self, x, params=None):
| return ( dist - y * math . cos ( theta ) ) / math . cos ( theta ) | return ( dist - y * math . sin ( theta ) ) / math . cos ( theta ) | WRONG_FUNCTION_NAME | [["Update", ["identifier:cos", 3, 33, 3, 36], "sin"]] | matsuken92/scikit-image@b58f52e40e5e8dbf3557124f31362bbfaeddca00 | Fix bug in predict_x of line model | [
{
"sha": "3b2d7d32c23883398e34add2e52e356dcf8b21ea",
"filename": "skimage/measure/fit.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/b58f52e40e5e8dbf3557124f31362bbfaeddca00/skimage%2Fmeasure%2Ffit.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/b58f52e40e5e8dbf3557124f31362bbfaeddca00/skimage%2Fmeasure%2Ffit.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmeasure%2Ffit.py?ref=b58f52e40e5e8dbf3557124f31362bbfaeddca00",
"patch": "@@ -132,7 +132,7 @@ def predict_x(self, y, params=None):\n if params is None:\n params = self._params\n dist, theta = params\n- return (dist - y * math.cos(theta)) / math.cos(theta)\n+ return (dist - y * math.sin(theta)) / math.cos(theta)\n \n def predict_y(self, x, params=None):\n '''Predict y-coordinates using the estimated model."
}
] |
scikit-image | e7ca4b6138443c0f52bda5485c24ed0355e36bbf | 124e38751ca15137b1d896e3ab0d9bc646e945f8 | skimage/viewer/widgets/core.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -81,7 +81,7 @@ class Slider(BaseWidget):
Range of slider values.
value : float
Default slider value. If None, use midpoint between `low` and `high`.
- value : {'float' | 'int'}
+ value_type : {'float' | 'int'}
Numeric type of slider value.
ptype : {'arg' | 'kwarg' | 'plugin'}
Parameter type.
| Default slider value . If None , use midpoint between `low` and `high` . value : { 'float' | 'int' } | Default slider value . If None , use midpoint between `low` and `high` . value_type : { 'float' | 'int' } | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:value", 3, 5, 3, 10], "value_type"]] | matsuken92/scikit-image@e7ca4b6138443c0f52bda5485c24ed0355e36bbf | Fix parameter name in docstring | [
{
"sha": "0000bebbf33b680c388c7fc4c4b1418a587d16d2",
"filename": "skimage/viewer/widgets/core.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/e7ca4b6138443c0f52bda5485c24ed0355e36bbf/skimage%2Fviewer%2Fwidgets%2Fcore.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/e7ca4b6138443c0f52bda5485c24ed0355e36bbf/skimage%2Fviewer%2Fwidgets%2Fcore.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fviewer%2Fwidgets%2Fcore.py?ref=e7ca4b6138443c0f52bda5485c24ed0355e36bbf",
"patch": "@@ -81,7 +81,7 @@ class Slider(BaseWidget):\n Range of slider values.\n value : float\n Default slider value. If None, use midpoint between `low` and `high`.\n- value : {'float' | 'int'}\n+ value_type : {'float' | 'int'}\n Numeric type of slider value.\n ptype : {'arg' | 'kwarg' | 'plugin'}\n Parameter type."
}
] |
scikit-image | 0a8ff1b3641a5cb24ce5885c2b86c8eb667fa9ad | afd1b1b835ff09e716643f5608103c61a3251104 | skimage/viewer/viewers/core.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -285,7 +285,7 @@ class CollectionViewer(ImageViewer):
----------
image_collection : list of images
List of images to be displayed.
- update_on : {'on_slide' | 'on_release'}
+ update_on : {'move' | 'release'}
Control whether image is updated on slide or release of the image
slider. Using 'on_release' will give smoother behavior when displaying
large images or when writing a plugin/subclass that requires heavy
| be displayed . update_on : { 'on_slide' | 'on_release' } | be displayed . update_on : { 'move' | 'release' } | SINGLE_STMT | [["Update", ["string:'on_slide'", 3, 18, 3, 28], "'move'"], ["Update", ["string:'on_release'", 3, 31, 3, 43], "'release'"]] | matsuken92/scikit-image@0a8ff1b3641a5cb24ce5885c2b86c8eb667fa9ad | Fix docstring for CollectionViewer slider. | [
{
"sha": "3a5f8ad35b9fbdce7bbf040f18a4646d1f4245d6",
"filename": "skimage/viewer/viewers/core.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/0a8ff1b3641a5cb24ce5885c2b86c8eb667fa9ad/skimage%2Fviewer%2Fviewers%2Fcore.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/0a8ff1b3641a5cb24ce5885c2b86c8eb667fa9ad/skimage%2Fviewer%2Fviewers%2Fcore.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fviewer%2Fviewers%2Fcore.py?ref=0a8ff1b3641a5cb24ce5885c2b86c8eb667fa9ad",
"patch": "@@ -285,7 +285,7 @@ class CollectionViewer(ImageViewer):\n ----------\n image_collection : list of images\n List of images to be displayed.\n- update_on : {'on_slide' | 'on_release'}\n+ update_on : {'move' | 'release'}\n Control whether image is updated on slide or release of the image\n slider. Using 'on_release' will give smoother behavior when displaying\n large images or when writing a plugin/subclass that requires heavy"
}
] |
scikit-image | 71601a2bde778b2dcc81099725ae83e23475a9ae | 79a5ab0e126f810245a4f333771a5302fbd5f59d | skimage/viewer/__init__.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -1 +1 @@
-from viewers import ImageViewer, CollectionViewer
+from .viewers import ImageViewer, CollectionViewer
| from viewers import ImageViewer , CollectionViewer | from . viewers import ImageViewer , CollectionViewer | SINGLE_STMT | [["Insert", ["import_from_statement", 0, 1, 0, 50], ["relative_import", "N0"], 1], ["Insert", "N0", ["import_prefix", "N1"], 0], ["Move", "N0", ["dotted_name", 0, 6, 0, 13], 1], ["Insert", "N1", [".:.", "T"], 0]] | matsuken92/scikit-image@71601a2bde778b2dcc81099725ae83e23475a9ae | fix path import viewers | [
{
"sha": "5eed958995e7579799624cf3d4418fd6841ae4a0",
"filename": "skimage/viewer/__init__.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/71601a2bde778b2dcc81099725ae83e23475a9ae/skimage%2Fviewer%2F__init__.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/71601a2bde778b2dcc81099725ae83e23475a9ae/skimage%2Fviewer%2F__init__.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fviewer%2F__init__.py?ref=71601a2bde778b2dcc81099725ae83e23475a9ae",
"patch": "@@ -1 +1 @@\n-from viewers import ImageViewer, CollectionViewer\n+from .viewers import ImageViewer, CollectionViewer"
}
] |
scikit-image | cae693cb699b46d0554f50cf051d09cb7201ce15 | dae0156230807f265fe9b8773f1ae9b5fd3f7a1b | skimage/viewer/utils/core.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -22,7 +22,7 @@ __all__ = ['init_qtapp', 'start_qtapp', 'RequiredAttr', 'figimage',
'update_axes_image']
-global QApp
+QApp = None
def init_qtapp():
| global QApp | QApp = None | SINGLE_STMT | [["Insert", ["module", 0, 12, 7, 0], ["expression_statement", "N0"], 1], ["Insert", "N0", ["assignment", "N1"], 0], ["Move", "N1", ["identifier:QApp", 3, 8, 3, 12], 0], ["Insert", "N1", ["=:=", "T"], 1], ["Insert", "N1", ["none:None", "T"], 2], ["Delete", ["global:global", 3, 1, 3, 7]], ["Delete", ["global_statement", 3, 1, 3, 12]]] | matsuken92/scikit-image@cae693cb699b46d0554f50cf051d09cb7201ce15 | Change QApp default to previous behavior. | [
{
"sha": "0a053784278ecf70891da9a9fc6baa7c7c391fb7",
"filename": "skimage/viewer/utils/core.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/cae693cb699b46d0554f50cf051d09cb7201ce15/skimage%2Fviewer%2Futils%2Fcore.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/cae693cb699b46d0554f50cf051d09cb7201ce15/skimage%2Fviewer%2Futils%2Fcore.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fviewer%2Futils%2Fcore.py?ref=cae693cb699b46d0554f50cf051d09cb7201ce15",
"patch": "@@ -22,7 +22,7 @@\n 'update_axes_image']\n \n \n-global QApp\n+QApp = None\n \n \n def init_qtapp():"
}
] |
scikit-image | 6f775400b5643fe4b015b11c65be8a331ee2d238 | 19a3d335730b11085852e29bbe8d358b1cd8c158 | skimage/viewer/plugins/lineprofile.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -107,7 +107,7 @@ class LineProfile(PlotPlugin):
scan = profile_line(self.image_viewer.original_image, end_points,
linewidth=self.line_tool.linewidth)
- if scan[1].shape != len(self.profile):
+ if scan.shape[1] != len(self.profile):
self.reset_axes(scan)
for i in range(len(scan[0])):
| if scan [ 1 ] . shape != len ( self . profile ) : self . reset_axes ( scan ) | if scan . shape [ 1 ] != len ( self . profile ) : self . reset_axes ( scan ) | SINGLE_STMT | [["Move", ["comparison_operator", 3, 12, 3, 46], ["subscript", 3, 12, 3, 19], 0], ["Insert", ["subscript", 3, 12, 3, 19], ["attribute", "N0"], 0], ["Move", "N0", ["identifier:scan", 3, 12, 3, 16], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:shape", "T"], 2], ["Delete", [".:.", 3, 19, 3, 20]], ["Delete", ["identifier:shape", 3, 20, 3, 25]], ["Delete", ["attribute", 3, 12, 3, 25]]] | matsuken92/scikit-image@6f775400b5643fe4b015b11c65be8a331ee2d238 | FIX: No longer reset for each update | [
{
"sha": "0d555eb59bd25a08533108b6fcd9fa3c4696c6be",
"filename": "skimage/viewer/plugins/lineprofile.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/6f775400b5643fe4b015b11c65be8a331ee2d238/skimage%2Fviewer%2Fplugins%2Flineprofile.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/6f775400b5643fe4b015b11c65be8a331ee2d238/skimage%2Fviewer%2Fplugins%2Flineprofile.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fviewer%2Fplugins%2Flineprofile.py?ref=6f775400b5643fe4b015b11c65be8a331ee2d238",
"patch": "@@ -107,7 +107,7 @@ def line_changed(self, end_points):\n scan = profile_line(self.image_viewer.original_image, end_points,\n linewidth=self.line_tool.linewidth)\n \n- if scan[1].shape != len(self.profile):\n+ if scan.shape[1] != len(self.profile):\n self.reset_axes(scan)\n \n for i in range(len(scan[0])):"
}
] |
scikit-image | 8f40e05aab3850bcba6ff3f92c4b532cef52fb2a | 94dc84f5b719c4114325a2e93f4ef8a476f76c38 | skimage/filter/_canny.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -158,7 +158,7 @@ def canny(image, sigma=1., low_threshold=None, high_threshold=None, mask=None):
raise TypeError("The input 'image' must be a two-dimensional array.")
if low_threshold is None:
- low_threshold = 0.1 * dtype_limits(image)[0]
+ low_threshold = 0.1 * dtype_limits(image)[1]
if high_threshold is None:
high_threshold = 0.2 * dtype_limits(image)[1]
| low_threshold = 0.1 * dtype_limits ( image ) [ 0 ] | low_threshold = 0.1 * dtype_limits ( image ) [ 1 ] | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:0", 3, 51, 3, 52], "1"]] | matsuken92/scikit-image@8f40e05aab3850bcba6ff3f92c4b532cef52fb2a | Fixed relative threshold: you consider 10% and 20% of the max for range of
corresponding dtype. | [
{
"sha": "13731ac6bc4128ead6ceca0475e0882cf15e73e3",
"filename": "skimage/filter/_canny.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/8f40e05aab3850bcba6ff3f92c4b532cef52fb2a/skimage%2Ffilter%2F_canny.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/8f40e05aab3850bcba6ff3f92c4b532cef52fb2a/skimage%2Ffilter%2F_canny.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffilter%2F_canny.py?ref=8f40e05aab3850bcba6ff3f92c4b532cef52fb2a",
"patch": "@@ -158,7 +158,7 @@ def canny(image, sigma=1., low_threshold=None, high_threshold=None, mask=None):\n raise TypeError(\"The input 'image' must be a two-dimensional array.\")\n \n if low_threshold is None:\n- low_threshold = 0.1 * dtype_limits(image)[0]\n+ low_threshold = 0.1 * dtype_limits(image)[1]\n \n if high_threshold is None:\n high_threshold = 0.2 * dtype_limits(image)[1]"
}
] |
scikit-image | 42e07a8ef6b75343ddc8b6382ca1180bdcf2d87f | c76daa97a9a1f3014345e6e1bd0fceae2822fc0a | doc/examples/plot_local_binary_pattern.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -207,7 +207,7 @@ plt.gray()
ax1.imshow(brick)
ax1.axis('off')
-hist(ax, refs['brick'])
+hist(ax4, refs['brick'])
ax4.set_ylabel('Percentage')
ax2.imshow(grass)
| hist ( ax , refs [ 'brick' ] ) | hist ( ax4 , refs [ 'brick' ] ) | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:ax", 3, 6, 3, 8], "ax4"]] | matsuken92/scikit-image@42e07a8ef6b75343ddc8b6382ca1180bdcf2d87f | Fix naming bug | [
{
"sha": "c97a792d7050ce5dbfc4f5c2ff3c541227683076",
"filename": "doc/examples/plot_local_binary_pattern.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/42e07a8ef6b75343ddc8b6382ca1180bdcf2d87f/doc%2Fexamples%2Fplot_local_binary_pattern.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/42e07a8ef6b75343ddc8b6382ca1180bdcf2d87f/doc%2Fexamples%2Fplot_local_binary_pattern.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fexamples%2Fplot_local_binary_pattern.py?ref=42e07a8ef6b75343ddc8b6382ca1180bdcf2d87f",
"patch": "@@ -207,7 +207,7 @@ def match(refs, img):\n \n ax1.imshow(brick)\n ax1.axis('off')\n-hist(ax, refs['brick'])\n+hist(ax4, refs['brick'])\n ax4.set_ylabel('Percentage')\n \n ax2.imshow(grass)"
}
] |
scikit-image | 55fe6ce2d685e25cfc9e0894c517bccd6b7bf4fe | 5a43e0306100fc8f5109000f6708a265853bf972 | skimage/segmentation/slic_superpixels.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -85,7 +85,7 @@ def slic(image, n_segments=100, ratio=10., max_iter=10, sigma=1,
warnings.warn(RuntimeWarning(msg))
multichannel = True
elif multichannel is None:
- multichannel = (spatial_dims == image.ndim + 1)
+ multichannel = (spatial_dims + 1 == image.ndim)
if ((not multichannel and image.ndim not in [2, 3]) or
(multichannel and image.ndim not in [3, 4]) or
(multichannel and image.shape[-1] != 3)):
| ( spatial_dims == image . ndim + 1 ) | ( spatial_dims + 1 == image . ndim ) | SINGLE_STMT | [["Insert", ["comparison_operator", 3, 25, 3, 55], ["binary_operator", "N0"], 0], ["Move", ["comparison_operator", 3, 25, 3, 55], ["attribute", 3, 41, 3, 51], 3], ["Move", "N0", ["identifier:spatial_dims", 3, 25, 3, 37], 0], ["Insert", "N0", ["+:+", "T"], 1], ["Insert", "N0", ["integer:1", "T"], 2], ["Delete", ["+:+", 3, 52, 3, 53]], ["Delete", ["integer:1", 3, 54, 3, 55]], ["Delete", ["binary_operator", 3, 41, 3, 55]]] | matsuken92/scikit-image@55fe6ce2d685e25cfc9e0894c517bccd6b7bf4fe | Bug fix: spatial vs image dimension comparison reversed | [
{
"sha": "1c9b8510e521eacfe230fcc97c9f214944965efc",
"filename": "skimage/segmentation/slic_superpixels.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/55fe6ce2d685e25cfc9e0894c517bccd6b7bf4fe/skimage%2Fsegmentation%2Fslic_superpixels.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/55fe6ce2d685e25cfc9e0894c517bccd6b7bf4fe/skimage%2Fsegmentation%2Fslic_superpixels.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fsegmentation%2Fslic_superpixels.py?ref=55fe6ce2d685e25cfc9e0894c517bccd6b7bf4fe",
"patch": "@@ -85,7 +85,7 @@ def slic(image, n_segments=100, ratio=10., max_iter=10, sigma=1,\n warnings.warn(RuntimeWarning(msg))\n multichannel = True\n elif multichannel is None:\n- multichannel = (spatial_dims == image.ndim + 1)\n+ multichannel = (spatial_dims + 1 == image.ndim)\n if ((not multichannel and image.ndim not in [2, 3]) or\n (multichannel and image.ndim not in [3, 4]) or\n (multichannel and image.shape[-1] != 3)):"
}
] |
agbot | 7962293313279aa5cb4a90bd8860c126c7754c0e | 242389e5444d907e0d2207ac6c041f4a8fcbd22b | scrapers/reports.py | https://github.com/texas-justice-initiative/agbot | true | false | true | @@ -96,5 +96,5 @@ class Reports:
smtp.sendmail(self.email_from, send_to, msg.as_string())
smtp.close()
except Exception:
- print(f'Failed to send the email')
+ print(f'Failed to send the email for:\n{text}')
raise
| except Exception : print ( f'Failed to send the email' ) | except Exception : print ( f'Failed to send the email for:\n{text}' ) | CHANGE_STRING_LITERAL | [["Update", ["string:f'Failed to send the email'", 3, 19, 3, 46], "f'Failed to send the email for:\\n{text}'"]] | texas-justice-initiative/agbot@7962293313279aa5cb4a90bd8860c126c7754c0e | Improved error message for failed emails | [
{
"sha": "1cb79cc1c49a913fbf80e0c96d1d829f86984da4",
"filename": "scrapers/reports.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/texas-justice-initiative/agbot/blob/7962293313279aa5cb4a90bd8860c126c7754c0e/scrapers%2Freports.py",
"raw_url": "https://github.com/texas-justice-initiative/agbot/raw/7962293313279aa5cb4a90bd8860c126c7754c0e/scrapers%2Freports.py",
"contents_url": "https://api.github.com/repos/texas-justice-initiative/agbot/contents/scrapers%2Freports.py?ref=7962293313279aa5cb4a90bd8860c126c7754c0e",
"patch": "@@ -96,5 +96,5 @@ def send_email(self, subject, text, attachment):\n smtp.sendmail(self.email_from, send_to, msg.as_string())\n smtp.close()\n except Exception:\n- print(f'Failed to send the email')\n+ print(f'Failed to send the email for:\\n{text}')\n raise"
}
] |
agbot | 7cc8ae4cc508beea2173276044b2e2e1249b827a | 01a6ac99365dd8b091e8732da5397ae554ffb205 | utils/email.py | https://github.com/texas-justice-initiative/agbot | true | false | true | @@ -32,7 +32,7 @@ class Email:
smtp.ehlo()
smtp.starttls()
smtp.login(self.email_from, self.gmail_password)
- smtp.sendmail(self.email_from, send_to, msg.as_string())
+ smtp.sendmail(self.email_from, self.email_to, msg.as_string())
smtp.close()
except Exception:
print(f'Failed to send the email for:\n{text}')
| smtp . sendmail ( self . email_from , send_to , msg . as_string ( ) ) | smtp . sendmail ( self . email_from , self . email_to , msg . as_string ( ) ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 26, 3, 69], ["attribute", "N0"], 3], ["Update", ["identifier:send_to", 3, 44, 3, 51], "self"], ["Move", "N0", ["identifier:send_to", 3, 44, 3, 51], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:email_to", "T"], 2]] | texas-justice-initiative/agbot@7cc8ae4cc508beea2173276044b2e2e1249b827a | Bugfix: send_to list was incorrect | [
{
"sha": "3d8e585d576981e3a0e66ed499f5b1f15df7b385",
"filename": "utils/email.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/texas-justice-initiative/agbot/blob/7cc8ae4cc508beea2173276044b2e2e1249b827a/utils%2Femail.py",
"raw_url": "https://github.com/texas-justice-initiative/agbot/raw/7cc8ae4cc508beea2173276044b2e2e1249b827a/utils%2Femail.py",
"contents_url": "https://api.github.com/repos/texas-justice-initiative/agbot/contents/utils%2Femail.py?ref=7cc8ae4cc508beea2173276044b2e2e1249b827a",
"patch": "@@ -32,7 +32,7 @@ def send(self, subject, text, attachment):\n smtp.ehlo()\n smtp.starttls()\n smtp.login(self.email_from, self.gmail_password)\n- smtp.sendmail(self.email_from, send_to, msg.as_string())\n+ smtp.sendmail(self.email_from, self.email_to, msg.as_string())\n smtp.close()\n except Exception:\n print(f'Failed to send the email for:\\n{text}')"
}
] |
agbot | 6ac305e32e7b489599d68041c04076c23fb79924 | 2bf6ae5f24db28c173ddc6433b5115b15adf822b | lambda_handler.py | https://github.com/texas-justice-initiative/agbot | true | false | true | @@ -9,7 +9,7 @@ def handle(event, context):
print('Scraping reports')
reports = reports_scraper.scrape()
- print('Found:', [r['metadata']['file'] for r in reports])
+ print('Found:', [r['file_url'] for r in reports])
print('Sending emails to', email.email_to)
for report in reports:
| print ( 'Found:' , [ r [ 'metadata' ] [ 'file' ] for r in reports ] ) | print ( 'Found:' , [ r [ 'file_url' ] for r in reports ] ) | SINGLE_STMT | [["Update", ["string:'metadata'", 3, 24, 3, 34], "'file_url'"], ["Delete", ["[:[", 3, 35, 3, 36]], ["Delete", ["string:'file'", 3, 36, 3, 42]], ["Delete", ["]:]", 3, 42, 3, 43]]] | texas-justice-initiative/agbot@6ac305e32e7b489599d68041c04076c23fb79924 | Bugfix: incorrect file_url path | [
{
"sha": "ffe1b55a9896299346d13acb63eb28ec33b2ef9e",
"filename": "lambda_handler.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/texas-justice-initiative/agbot/blob/6ac305e32e7b489599d68041c04076c23fb79924/lambda_handler.py",
"raw_url": "https://github.com/texas-justice-initiative/agbot/raw/6ac305e32e7b489599d68041c04076c23fb79924/lambda_handler.py",
"contents_url": "https://api.github.com/repos/texas-justice-initiative/agbot/contents/lambda_handler.py?ref=6ac305e32e7b489599d68041c04076c23fb79924",
"patch": "@@ -9,7 +9,7 @@ def handle(event, context):\n \n print('Scraping reports')\n reports = reports_scraper.scrape()\n- print('Found:', [r['metadata']['file'] for r in reports])\n+ print('Found:', [r['file_url'] for r in reports])\n \n print('Sending emails to', email.email_to)\n for report in reports:"
}
] |
stores-rest-api | 5f7738f45cc267548f7c55ed9a20f79f574d2817 | e01b77a313e229df469efdf7816d885221eab478 | run.py | https://github.com/Brock1212/stores-rest-api | true | false | false | @@ -1,4 +1,4 @@
-from app import app
+from app import app as application
from db import db
db.init_app(app)
| from app import app | from app import app as application | SINGLE_STMT | [["Insert", ["import_from_statement", 0, 1, 0, 20], ["aliased_import", "N0"], 3], ["Move", "N0", ["dotted_name", 0, 17, 0, 20], 0], ["Insert", "N0", ["as:as", "T"], 1], ["Insert", "N0", ["identifier:application", "T"], 2]] | Brock1212/stores-rest-api@5f7738f45cc267548f7c55ed9a20f79f574d2817 | fixed not importing db when running the app | [
{
"sha": "812a9fdd865b8b7d358de87a71be2ed57a5a5772",
"filename": "run.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Brock1212/stores-rest-api/blob/5f7738f45cc267548f7c55ed9a20f79f574d2817/run.py",
"raw_url": "https://github.com/Brock1212/stores-rest-api/raw/5f7738f45cc267548f7c55ed9a20f79f574d2817/run.py",
"contents_url": "https://api.github.com/repos/Brock1212/stores-rest-api/contents/run.py?ref=5f7738f45cc267548f7c55ed9a20f79f574d2817",
"patch": "@@ -1,4 +1,4 @@\n-from app import app\n+from app import app as application\n from db import db\n \n db.init_app(app)"
}
] |
stores-rest-api | 79ffbb3b8b32b5dc3d1665bfc10368889184cf6b | 5903e76cdb9ba6d37b689570bbd6a0ab931cb529 | run.py | https://github.com/Brock1212/stores-rest-api | true | false | false | @@ -1,4 +1,4 @@
-from app import app as application
+from app import app
from db import db
db.init_app(app)
| from app import app as application | from app import app | SINGLE_STMT | [["Move", ["import_from_statement", 0, 1, 0, 35], ["dotted_name", 0, 17, 0, 20], 3], ["Delete", ["as:as", 0, 21, 0, 23]], ["Delete", ["identifier:application", 0, 24, 0, 35]], ["Delete", ["aliased_import", 0, 17, 0, 35]]] | Brock1212/stores-rest-api@79ffbb3b8b32b5dc3d1665bfc10368889184cf6b | fixed not importing db when running the app | [
{
"sha": "1c04ad74dbe119afb8f806df0214acc57df7e85e",
"filename": "run.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Brock1212/stores-rest-api/blob/79ffbb3b8b32b5dc3d1665bfc10368889184cf6b/run.py",
"raw_url": "https://github.com/Brock1212/stores-rest-api/raw/79ffbb3b8b32b5dc3d1665bfc10368889184cf6b/run.py",
"contents_url": "https://api.github.com/repos/Brock1212/stores-rest-api/contents/run.py?ref=79ffbb3b8b32b5dc3d1665bfc10368889184cf6b",
"patch": "@@ -1,4 +1,4 @@\n-from app import app as application\n+from app import app\n from db import db\n \n db.init_app(app)"
}
] |