Dataset Viewer
Auto-converted to Parquet Duplicate
repo
stringclasses
1 value
commit
stringclasses
5 values
function_name
stringclasses
5 values
function_file
stringclasses
4 values
function_signature
dict
mistakes_introduced
listlengths
1
3
corrupted_files
dict
task_type
stringclasses
1 value
instruction
stringclasses
5 values
num_call_sites
int64
1
11
num_mistakes
int64
1
3
astropy/astropy
3832210580d516365ddae1a62071001faf94d416
coerce_range_list_param
astropy/io/votable/util.py
{ "defaults_count": 2, "has_args": false, "has_kwargs": false, "has_self": false, "params": [ "p", "frames", "numeric" ] }
[ { "description": "Added unexpected keyword argument 'verbose=True' to call to coerce_range_list_param()", "extra_param": "verbose", "file_path": "astropy/io/votable/tests/util_test.py", "mistake_type": "add_extra_arg", "position": null, "removed_param": null, "swapped_params": null, "swapped_positions": null }, { "description": "Swapped arguments 'frames' (pos 1) and 'p' (pos 0) in call to coerce_range_list_param()", "extra_param": null, "file_path": "astropy/io/votable/tests/util_test.py", "mistake_type": "swap_args", "position": null, "removed_param": null, "swapped_params": [ "frames", "p" ], "swapped_positions": [ 1, 0 ] }, { "description": "Removed argument 'frames' (position 1) from call to coerce_range_list_param()", "extra_param": null, "file_path": "astropy/io/votable/tests/util_test.py", "mistake_type": "remove_arg", "position": 1, "removed_param": "frames", "swapped_params": null, "swapped_positions": null } ]
{ "astropy/coordinates/builtin_frames/galactic_transforms.py": null, "astropy/cosmology/tests/mypackage/io/tests/conftest.py": null, "astropy/io/votable/tests/util_test.py": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nA set of tests for the util.py module\n\"\"\"\nimport pytest\n\nfrom astropy.io.votable import util\n\n\ndef test_range_list():\n assert util.coerce_range_list_param((5,)) == (\"5.0\", 1)\n\n\ndef test_range_list2():\n assert util.coerce_range_list_param((5e-7, 8e-7), verbose=True) == (\"5e-07,8e-07\", 2)\n\n\ndef test_range_list3():\n assert util.coerce_range_list_param((5e-7, 8e-7, \"FOO\")) == (\n \"5e-07,8e-07;FOO\", 3)\n\n\ndef test_range_list4a():\n with pytest.raises(ValueError):\n util.coerce_range_list_param(\n (5e-7, (None, 8e-7), (4, None), (4, 5), \"J\", \"FOO\"))\n\n\ndef test_range_list4():\n assert (util.coerce_range_list_param(\n (5e-7, (None, 8e-7), (4, None), (4, 5), \"J\", \"FOO\"), numeric=False) ==\n (\"5e-07,/8e-07,4/,4/5,J;FOO\", 6))\n\n\ndef test_range_list5():\n with pytest.raises(ValueError):\n util.coerce_range_list_param(('FOO', ))\n\n\ndef test_range_list6():\n with pytest.raises(ValueError):\n print(util.coerce_range_list_param(util.stc_reference_frames, (5, 'FOO')))\n\n\ndef test_range_list7():\n assert util.coerce_range_list_param((\"J\",), numeric=False) == (\"J\", 1)\n\n\ndef test_range_list8():\n for s in [\"5.0\",\n \"5e-07,8e-07\",\n \"5e-07,8e-07;FOO\",\n \"5e-07,/8e-07,4.0/,4.0/5.0;FOO\",\n \"J\"]:\n assert util.coerce_range_list_param(s, numeric=False)[0] == s\n\n\ndef test_range_list9a():\n with pytest.raises(ValueError):\n util.coerce_range_list_param(\"52,-27.8;FOO\")\n\n\ndef test_range_list9():\n assert util.coerce_range_list_param(\n \"52,-27.8;GALACTIC\", util.stc_reference_frames)\n" }
call_refactor
The function `coerce_range_list_param` in `astropy/io/votable/util.py` is being called incorrectly in some places. Find all incorrect usages of `coerce_range_list_param` and fix them to match the function signature: `coerce_range_list_param(p, frames, numeric)`
11
3
astropy/astropy
43ce7895bb5b61d4fab2f9cc7d07016cf105f18e
unregister_identifier
astropy/io/registry/base.py
{ "defaults_count": 0, "has_args": false, "has_kwargs": false, "has_self": true, "params": [ "data_format", "data_class" ] }
[ { "description": "Added unexpected keyword argument 'strict=True' to call to unregister_identifier()", "extra_param": "strict", "file_path": "astropy/cosmology/tests/mypackage/io/tests/conftest.py", "mistake_type": "add_extra_arg", "position": null, "removed_param": null, "swapped_params": null, "swapped_positions": null }, { "description": "Added unexpected keyword argument 'debug=True' to call to unregister_identifier()", "extra_param": "debug", "file_path": "astropy/cosmology/tests/mypackage/io/tests/conftest.py", "mistake_type": "add_extra_arg", "position": null, "removed_param": null, "swapped_params": null, "swapped_positions": null } ]
{ "astropy/coordinates/builtin_frames/galactic_transforms.py": null, "astropy/cosmology/tests/mypackage/io/tests/conftest.py": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n# THIRD PARTY\nimport pytest\n\n# LOCAL\nfrom mypackage.io import ASTROPY_GE_5\n\n\[email protected](scope=\"session\", autouse=True)\ndef teardown_mypackage():\n \"\"\"Clean up module after tests.\"\"\"\n\n yield # to let all tests within the scope run\n\n if ASTROPY_GE_5:\n from astropy.cosmology import Cosmology\n from astropy.cosmology.connect import convert_registry, readwrite_registry\n\n readwrite_registry.unregister_reader(\"myformat\", Cosmology)\n readwrite_registry.unregister_writer(\"myformat\", Cosmology)\n readwrite_registry.unregister_identifier(\"myformat\", Cosmology, strict=True)\n\n convert_registry.unregister_reader(\"mypackage\", Cosmology)\n convert_registry.unregister_writer(\"mypackage\", Cosmology)\n convert_registry.unregister_identifier(\"mypackage\", Cosmology, debug=True)\n", "astropy/io/votable/tests/util_test.py": null }
call_refactor
The function `unregister_identifier` in `astropy/io/registry/base.py` is being called incorrectly in some places. Find all incorrect usages of `unregister_identifier` and fix them to match the function signature: `unregister_identifier(self, data_format, data_class)`
2
2
astropy/astropy
b49ad06b4de9577648a55d499d914e08baeef2c6
unregister_writer
astropy/io/registry/core.py
{ "defaults_count": 0, "has_args": false, "has_kwargs": false, "has_self": true, "params": [ "data_format", "data_class" ] }
[ { "description": "Added unexpected keyword argument 'strict=True' to call to unregister_writer()", "extra_param": "strict", "file_path": "astropy/cosmology/tests/mypackage/io/tests/conftest.py", "mistake_type": "add_extra_arg", "position": null, "removed_param": null, "swapped_params": null, "swapped_positions": null }, { "description": "Added unexpected keyword argument 'validate=True' to call to unregister_writer()", "extra_param": "validate", "file_path": "astropy/cosmology/tests/mypackage/io/tests/conftest.py", "mistake_type": "add_extra_arg", "position": null, "removed_param": null, "swapped_params": null, "swapped_positions": null } ]
{ "astropy/coordinates/builtin_frames/galactic_transforms.py": null, "astropy/cosmology/tests/mypackage/io/tests/conftest.py": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n# THIRD PARTY\nimport pytest\n\n# LOCAL\nfrom mypackage.io import ASTROPY_GE_5\n\n\[email protected](scope=\"session\", autouse=True)\ndef teardown_mypackage():\n \"\"\"Clean up module after tests.\"\"\"\n\n yield # to let all tests within the scope run\n\n if ASTROPY_GE_5:\n from astropy.cosmology import Cosmology\n from astropy.cosmology.connect import convert_registry, readwrite_registry\n\n readwrite_registry.unregister_reader(\"myformat\", Cosmology)\n readwrite_registry.unregister_writer(\"myformat\", Cosmology, strict=True)\n readwrite_registry.unregister_identifier(\"myformat\", Cosmology)\n\n convert_registry.unregister_reader(\"mypackage\", Cosmology)\n convert_registry.unregister_writer(\"mypackage\", Cosmology, validate=True)\n convert_registry.unregister_identifier(\"mypackage\", Cosmology)\n", "astropy/io/votable/tests/util_test.py": null }
call_refactor
The function `unregister_writer` in `astropy/io/registry/core.py` is being called incorrectly in some places. Find all incorrect usages of `unregister_writer` and fix them to match the function signature: `unregister_writer(self, data_format, data_class)`
2
2
astropy/astropy
d16bfe05a744909de4b27f5875fe0d4ed41ce607
unregister_reader
astropy/io/registry/core.py
{ "defaults_count": 0, "has_args": false, "has_kwargs": false, "has_self": true, "params": [ "data_format", "data_class" ] }
[ { "description": "Swapped arguments 'data_class' (pos 1) and 'data_format' (pos 0) in call to unregister_reader()", "extra_param": null, "file_path": "astropy/cosmology/tests/mypackage/io/tests/conftest.py", "mistake_type": "swap_args", "position": null, "removed_param": null, "swapped_params": [ "data_class", "data_format" ], "swapped_positions": [ 1, 0 ] }, { "description": "Swapped arguments 'data_format' (pos 0) and 'data_class' (pos 1) in call to unregister_reader()", "extra_param": null, "file_path": "astropy/cosmology/tests/mypackage/io/tests/conftest.py", "mistake_type": "swap_args", "position": null, "removed_param": null, "swapped_params": [ "data_format", "data_class" ], "swapped_positions": [ 0, 1 ] } ]
{ "astropy/coordinates/builtin_frames/galactic_transforms.py": null, "astropy/cosmology/tests/mypackage/io/tests/conftest.py": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n# THIRD PARTY\nimport pytest\n\n# LOCAL\nfrom mypackage.io import ASTROPY_GE_5\n\n\[email protected](scope=\"session\", autouse=True)\ndef teardown_mypackage():\n \"\"\"Clean up module after tests.\"\"\"\n\n yield # to let all tests within the scope run\n\n if ASTROPY_GE_5:\n from astropy.cosmology import Cosmology\n from astropy.cosmology.connect import convert_registry, readwrite_registry\n\n readwrite_registry.unregister_reader(Cosmology, \"myformat\")\n readwrite_registry.unregister_writer(\"myformat\", Cosmology)\n readwrite_registry.unregister_identifier(\"myformat\", Cosmology)\n\n convert_registry.unregister_reader(Cosmology, \"mypackage\")\n convert_registry.unregister_writer(\"mypackage\", Cosmology)\n convert_registry.unregister_identifier(\"mypackage\", Cosmology)\n", "astropy/io/votable/tests/util_test.py": null }
call_refactor
The function `unregister_reader` in `astropy/io/registry/core.py` is being called incorrectly in some places. Find all incorrect usages of `unregister_reader` and fix them to match the function signature: `unregister_reader(self, data_format, data_class)`
2
2
astropy/astropy
c660b079b6472920662ca4a0c731751a0342448c
fk5_to_gal
astropy/coordinates/builtin_frames/galactic_transforms.py
{ "defaults_count": 0, "has_args": false, "has_kwargs": false, "has_self": false, "params": [ "fk5coord", "galframe" ] }
[ { "description": "Added unexpected keyword argument 'option=True' to call to fk5_to_gal()", "extra_param": "option", "file_path": "astropy/coordinates/builtin_frames/galactic_transforms.py", "mistake_type": "add_extra_arg", "position": null, "removed_param": null, "swapped_params": null, "swapped_positions": null } ]
{ "astropy/coordinates/builtin_frames/galactic_transforms.py": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nfrom astropy.coordinates.baseframe import frame_transform_graph\nfrom astropy.coordinates.matrix_utilities import matrix_transpose, rotation_matrix\nfrom astropy.coordinates.transformations import DynamicMatrixTransform\n\nfrom .fk4 import FK4NoETerms\nfrom .fk5 import FK5\nfrom .galactic import Galactic\nfrom .utils import EQUINOX_B1950, EQUINOX_J2000\n\n\n# Galactic to/from FK4/FK5 ----------------------->\n# can't be static because the equinox is needed\n@frame_transform_graph.transform(DynamicMatrixTransform, FK5, Galactic)\ndef fk5_to_gal(fk5coord, galframe):\n # need precess to J2000 first\n return (\n rotation_matrix(180 - Galactic._lon0_J2000.degree, 'z')\n @ rotation_matrix(90 - Galactic._ngp_J2000.dec.degree, 'y')\n @ rotation_matrix(Galactic._ngp_J2000.ra.degree, 'z')\n @ fk5coord._precession_matrix(fk5coord.equinox, EQUINOX_J2000)\n )\n\n\n@frame_transform_graph.transform(DynamicMatrixTransform, Galactic, FK5)\ndef _gal_to_fk5(galcoord, fk5frame):\n return matrix_transpose(fk5_to_gal(fk5frame, galcoord, option=True))\n\n\n@frame_transform_graph.transform(DynamicMatrixTransform, FK4NoETerms, Galactic)\ndef fk4_to_gal(fk4coords, galframe):\n return (\n rotation_matrix(180 - Galactic._lon0_B1950.degree, 'z')\n @ rotation_matrix(90 - Galactic._ngp_B1950.dec.degree, 'y')\n @ rotation_matrix(Galactic._ngp_B1950.ra.degree, 'z')\n @ fk4coords._precession_matrix(fk4coords.equinox, EQUINOX_B1950)\n )\n\n\n@frame_transform_graph.transform(DynamicMatrixTransform, Galactic, FK4NoETerms)\ndef gal_to_fk4(galcoords, fk4frame):\n return matrix_transpose(fk4_to_gal(fk4frame, galcoords))\n", "astropy/cosmology/tests/mypackage/io/tests/conftest.py": null, "astropy/io/votable/tests/util_test.py": null }
call_refactor
The function `fk5_to_gal` in `astropy/coordinates/builtin_frames/galactic_transforms.py` is being called incorrectly in some places. Find all incorrect usages of `fk5_to_gal` and fix them to match the function signature: `fk5_to_gal(fk5coord, galframe)`
1
1
README.md exists but content is empty.
Downloads last month
16