Dataset Viewer
Auto-converted to Parquet
instance_id
stringlengths
14
53
repo
stringlengths
10
49
base_commit
stringlengths
40
40
patch
stringlengths
332
2.26M
language
stringclasses
1 value
non_code_patch
stringclasses
1 value
test_patch
stringlengths
0
21.5M
created_at
stringlengths
26
26
problem_statement
stringlengths
5
24.6k
hints_text
stringlengths
0
44.9k
version
stringclasses
1 value
environment_setup_commit
stringlengths
40
40
FAIL_TO_PASS
stringlengths
19
71.6k
PASS_TO_PASS
stringlengths
2
807k
FAIL_TO_FAIL
stringlengths
2
43.9k
license
dict
matthewwithanm__python-markdownify-142
matthewwithanm/python-markdownify
959561879693bf4a576f99c6733b50b01186aa08
diff --git a/markdownify/__init__.py b/markdownify/__init__.py index c34e57e..3272ce5 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -213,7 +213,7 @@ class MarkdownConverter(object): n = int(m.group(1)) def convert_tag(el, text, convert_as_inline): - return self.convert_hn(n, el, text, convert_as_inline) + return self._convert_hn(n, el, text, convert_as_inline) convert_tag.__name__ = 'convert_h%s' % n setattr(self, convert_tag.__name__, convert_tag) @@ -311,7 +311,8 @@ class MarkdownConverter(object): convert_kbd = convert_code - def convert_hn(self, n, el, text, convert_as_inline): + def _convert_hn(self, n, el, text, convert_as_inline): + """ Method name prefixed with _ to prevent <hn> to call this """ if convert_as_inline: return text
python
diff --git a/tests/test_conversions.py b/tests/test_conversions.py index 1c5f9c2..2283c29 100644 --- a/tests/test_conversions.py +++ b/tests/test_conversions.py @@ -134,6 +134,7 @@ def test_hn(): assert md('<h5>Hello</h5>') == '\n##### Hello\n\n' assert md('<h6>Hello</h6>') == '\n###### Hello\n\n' assert md('<h10>Hello</h10>') == md('<h6>Hello</h6>') + assert md('<hn>Hello</hn>') == md('Hello') def test_hn_chained():
2024-11-24T20:20:57+00:00Z
TypeError is shown if html has wrong h tag markdownify in ./.venv/lib/python3.8/site-packages (0.13.1) The issue is found with atheris library Code to reproduce `markdownify("<hn>")` The error is: ``` Traceback (most recent call last): File "/home/redacted/code/other/atheris/pythonProject/test_unit_009-1.py", line 26, in <module> markdownify("<hn>") File "/home/redacted/code/other/atheris/pythonProject/.venv/lib/python3.8/site-packages/markdownify/__init__.py", line 433, in markdownify return MarkdownConverter(**options).convert(html) File "/home/redacted/code/other/atheris/pythonProject/.venv/lib/python3.8/site-packages/markdownify/__init__.py", line 105, in convert return self.convert_soup(soup) File "/home/redacted/code/other/atheris/pythonProject/.venv/lib/python3.8/site-packages/markdownify/__init__.py", line 108, in convert_soup return self.process_tag(soup, convert_as_inline=False, children_only=True) File "/home/redacted/code/other/atheris/pythonProject/.venv/lib/python3.8/site-packages/markdownify/__init__.py", line 151, in process_tag text += self.process_tag(el, convert_children_as_inline) File "/home/redacted/code/other/atheris/pythonProject/.venv/lib/python3.8/site-packages/markdownify/__init__.py", line 156, in process_tag text = convert_fn(node, text, convert_as_inline) TypeError: convert_hn() missing 1 required positional argument: 'convert_as_inline' ```
Implement error handling to catch this specific TypeError. For example: ```py html_input = "<hn>Title</hn>" try: markdown_output = md(html_input) except TypeError as e: print(f"Error: {e}") print(f"Offending HTML: {html_input}") ``` Thanks for finding this!
0.0.1-alpha
3466061ca9d33afd06532e2e79b418b8e478d66b
["tests.test_conversions::test_hn"]
["tests.test_advanced::test_chomp", "tests.test_advanced::test_nested", "tests.test_advanced::test_ignore_comments", "tests.test_advanced::test_ignore_comments_with_other_tags", "tests.test_advanced::test_code_with_tricky_content", "tests.test_advanced::test_special_tags", "tests.test_args::test_strip", "tests.test_args::test_do_not_strip", "tests.test_args::test_convert", "tests.test_args::test_do_not_convert", "tests.test_basic::test_single_tag", "tests.test_basic::test_soup", "tests.test_basic::test_whitespace", "tests.test_conversions::test_a", "tests.test_conversions::test_a_spaces", "tests.test_conversions::test_a_with_title", "tests.test_conversions::test_a_shortcut", "tests.test_conversions::test_a_no_autolinks", "tests.test_conversions::test_b", "tests.test_conversions::test_b_spaces", "tests.test_conversions::test_blockquote", "tests.test_conversions::test_blockquote_with_nested_paragraph", "tests.test_conversions::test_blockquote_with_paragraph", "tests.test_conversions::test_blockquote_nested", "tests.test_conversions::test_br", "tests.test_conversions::test_caption", "tests.test_conversions::test_code", "tests.test_conversions::test_del", "tests.test_conversions::test_div", "tests.test_conversions::test_em", "tests.test_conversions::test_header_with_space", "tests.test_conversions::test_h1", "tests.test_conversions::test_h2", "tests.test_conversions::test_hn_chained", "tests.test_conversions::test_hn_nested_tag_heading_style", "tests.test_conversions::test_hn_nested_simple_tag", "tests.test_conversions::test_hn_nested_img", "tests.test_conversions::test_hn_atx_headings", "tests.test_conversions::test_hn_atx_closed_headings", "tests.test_conversions::test_head", "tests.test_conversions::test_hr", "tests.test_conversions::test_i", "tests.test_conversions::test_img", "tests.test_conversions::test_kbd", "tests.test_conversions::test_p", "tests.test_conversions::test_pre", "tests.test_conversions::test_script", "tests.test_conversions::test_style", "tests.test_conversions::test_s", "tests.test_conversions::test_samp", "tests.test_conversions::test_strong", "tests.test_conversions::test_strong_em_symbol", "tests.test_conversions::test_sub", "tests.test_conversions::test_sup", "tests.test_conversions::test_lang", "tests.test_conversions::test_lang_callback", "tests.test_conversions::test_spaces", "tests.test_custom_converter::test_img", "tests.test_custom_converter::test_soup", "tests.test_escaping::test_asterisks", "tests.test_escaping::test_underscore", "tests.test_escaping::test_xml_entities", "tests.test_escaping::test_named_entities", "tests.test_escaping::test_hexadecimal_entities", "tests.test_escaping::test_single_escaping_entities", "tests.test_escaping::test_misc", "tests.test_lists::test_ol", "tests.test_lists::test_nested_ols", "tests.test_lists::test_ul", "tests.test_lists::test_inline_ul", "tests.test_lists::test_nested_uls", "tests.test_lists::test_bullets", "tests.test_lists::test_li_text", "tests.test_tables::test_table"]
[]
{ "key": "mit", "name": "MIT License", "spdx_id": "MIT", "url": "https://api.github.com/licenses/mit" }
physiopy__phys2bids-136
physiopy/phys2bids
3a6fc72dc84f46dadc558a8081ef21a67c4a6b74
"diff --git a/.travis.yml b/.travis.yml\nindex a82c8fd..c275082 100755\n--- a/.travis.yml\n+++ b/.tr(...TRUNCATED)
python
"diff --git a/phys2bids/tests/data/Test_2minRest_trig_multifreq_header_comment.txt b/phys2bids/tests(...TRUNCATED)
2020-02-05T11:38:48+00:00Z
"Add unit tests for txt.py\n\n<!--- Provide a general summary of the issue in the Title above -->\r\(...TRUNCATED)
"@vinferrer, if you want help on the code you can open a draft PR and we can have a look\r\n\nactual(...TRUNCATED)
0.0.1-alpha
88133df59d10258546f259f733b086fc40079bb2
"[\"phys2bids.tests.test_txt::test_read_header_and_channels\", \"phys2bids.tests.test_txt::test_popu(...TRUNCATED)
"[\"phys2bids.tests.test_phys2bids::test_print_summary\", \"phys2bids.tests.test_phys2bids::test_pri(...TRUNCATED)
[]
{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com(...TRUNCATED)
sepandhaghighi__nafas-99
sepandhaghighi/nafas
3cb2bc7f482c582242f645a8e8d45007e1953f07
"diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex eba0f73..fc7b444 100644\n--- a/CHANGELOG.md\n+++ b/(...TRUNCATED)
python
"diff --git a/test/test.py b/test/test.py\nindex cfaf851..1387186 100644\n--- a/test/test.py\n+++ b/(...TRUNCATED)
2025-01-13T00:48:13+00:00Z
"[Feature]: New programs\n\n### Describe the feature you want to add\n\nAdd new programs\r\n\r\nRefe(...TRUNCATED)
0.0.1-alpha
fc52cdca482c6de0856c84b3dd8f5965b4ce5a7e
["test.test::test"]
[]
[]
{ "key": "mit", "name": "MIT License", "spdx_id": "MIT", "url": "https://api.github.com/licenses/mit" }
shirtsgroup__physical_validation-59
shirtsgroup/physical_validation
bf18bc9c9da3f6fc52781c96c8ac4e718a12ff02
"diff --git a/physical_validation/data/lammps_parser.py b/physical_validation/data/lammps_parser.py\(...TRUNCATED)
python
"diff --git a/physical_validation/tests/test_data_lammps_parser.py b/physical_validation/tests/test_(...TRUNCATED)
2021-04-28T21:54:09+00:00Z
"physical_validation needs testing!\n\nTest coverage right now is close to zero. This is a catch-it-(...TRUNCATED)
"Let's write up some specific modules/areas of code that need testing.\r\n\r\nWe can then distribute(...TRUNCATED)
0.0.1-alpha
02f66b69e4521630e430225cc94ed84288c5014d
["physical_validation.tests.test_data_lammps_parser.TestLammpsParser::test_read_lammps"]
"[\"physical_validation.tests.test_data_flatfile_parser.TestFlatFileParser::test_flat_file_input\", (...TRUNCATED)
"[\"physical_validation.tests.test_data_gromacs_parser.TestGromacsParser::test_gromacs_and_flat_file(...TRUNCATED)
{ "key": "mit", "name": "MIT License", "spdx_id": "MIT", "url": "https://api.github.com/licenses/mit" }
oskvr37__tiddl-68
oskvr37/tiddl
791f100300baebeecc212bd988c9bcc8f42408bd
"diff --git a/tiddl/utils.py b/tiddl/utils.py\nindex b6ba52e..913543b 100644\n--- a/tiddl/utils.py\n(...TRUNCATED)
python
"diff --git a/tests/test_utils.py b/tests/test_utils.py\nindex 34d8d2b..24e5aeb 100644\n--- a/tests/(...TRUNCATED)
2025-01-23T18:26:03+00:00Z
"Need a tag \"albumartist\" to keep directory structure clean\n\nRight now, when an album is downloa(...TRUNCATED)
"Thanks for submitting.\n\nThe {album_artist} tag will be added in tiddl 2.0 and the tag will be set(...TRUNCATED)
0.0.1-alpha
5eac4598f5681d34ff9b42bd6afac7a361245324
["tests.test_utils.TestFormatTrack::test_templating"]
"[\"tests.test_utils.TestTidalResource::test_failing_cases\", \"tests.test_utils.TestTidalResource::(...TRUNCATED)
"[\"tests.test_api.TestApi::test_album\", \"tests.test_api.TestApi::test_album_items\", \"tests.test(...TRUNCATED)
{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com(...TRUNCATED)
talonhub__community-616
talonhub/community
cb54f258f73a744da2d14af54ae1e5ddef121132
"diff --git a/core/text/formatters.py b/core/text/formatters.py\nindex 361cd58..1e9bd86 100644\n--- (...TRUNCATED)
python
"diff --git a/test/test_formatters.py b/test/test_formatters.py\nindex 4a6603a..5fbb13a 100644\n--- (...TRUNCATED)
2024-11-16T06:40:25+00:00Z
"Capitalize formatter does not capitalze first word if there is leading whitespace in selection.\n\n(...TRUNCATED)
"Retest after #696 \nRe #696: as described here it wouldn't be fixed because this is a shortcoming o(...TRUNCATED)
0.0.1-alpha
d049c53509cbdd4778b438ea631a51e032fb83b5
["test.test_formatters::test_capitalize", "test.test_formatters::test_capitalize_first_word"]
"[\"plugin.talon_draft_window.test_draft_ui::test_finds_anchors\", \"plugin.talon_draft_window.test_(...TRUNCATED)
[]
{ "key": "mit", "name": "MIT License", "spdx_id": "MIT", "url": "https://api.github.com/licenses/mit" }
pytest-dev__pytest-bdd-311
pytest-dev/pytest-bdd
d71bb906ff42d35b9b0ed1017e44fc52edf67a71
"diff --git a/CHANGES.rst b/CHANGES.rst\nindex 7d2b6c4..4eb8037 100644\n--- a/CHANGES.rst\n+++ b/CHA(...TRUNCATED)
python
"diff --git a/tests/feature/test_description.py b/tests/feature/test_description.py\nindex 9678bff..(...TRUNCATED)
2023-02-27T20:00:54+00:00Z
"Scenario descriptions cause odd results\n\nPerhaps it is not part of pytest-bdd's \"subset\" of Ghe(...TRUNCATED)
"Hey @rcasperson-jc, thanks for the report. Would you be interested in trying to fix it and make a p(...TRUNCATED)
0.0.1-alpha
b5f90f6f6bba06f1ed35c43fb2dd0ce622a66b41
["tests.feature.test_description::test_description"]
"[\"tests.test_hooks::test_conftest_module_evaluated_twice\", \"tests.test_hooks::test_item_collecti(...TRUNCATED)
[]
{ "key": "mit", "name": "MIT License", "spdx_id": "MIT", "url": "https://api.github.com/licenses/mit" }
okta__okta-sdk-python-162
okta/okta-sdk-python
b0c344823014fc7a1b3b87cb3f3483ac2be86cda
"diff --git a/okta/constants.py b/okta/constants.py\nindex a84a325..a0ebd6f 100644\n--- a/okta/const(...TRUNCATED)
python
"diff --git a/tests/integration/cassettes/test_users_it/TestUsersResource.test_change_user_password.(...TRUNCATED)
2021-01-16T13:10:37+00:00Z
"Rate limit date format isn't handled properly and prevents hitting backoff code\n\nin okta.request_(...TRUNCATED)
"@JonsSpaghetti Thank you for a detailed description of the issue. I'm looking into it. Is it a bloc(...TRUNCATED)
0.0.1-alpha
13fe52fba1730dda2fc0e25a7ad171405ba0ce5d
["tests.integration.test_users_it.TestUsersResource::test_change_user_password"]
"[\"tests.integration.test_applications_it.TestApplicationsResource::test_create_bookmark_app\", \"t(...TRUNCATED)
["tests.unit.test_http_client::test_client_invalid_url"]
{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com(...TRUNCATED)
python-rope__pylsp-rope-4
python-rope/pylsp-rope
9245130880d467f1a3bcacf52ba7fdf8ad2287b2
"diff --git a/pylsp_rope/plugin.py b/pylsp_rope/plugin.py\nindex 7fcc9d6..cce1a79 100644\n--- a/pyls(...TRUNCATED)
python
"diff --git a/test/test_extract.py b/test/test_extract.py\nindex c8334e1..38fe725 100644\n--- a/test(...TRUNCATED)
2021-10-04T07:40:53+00:00Z
"CoC would not call the `workspace/executeCommand` in response to codeAction\n\npylsp-rope version: (...TRUNCATED)
0.0.1-alpha
4e93d7bd5e1c18407bcb92d406840b7101a403ed
"[\"test.test_extract::test_extract_variable\", \"test.test_extract::test_extract_method\", \"test.t(...TRUNCATED)
"[\"test.test_commands::test_command_registration\", \"test.test_extract::test_extract_variable_not_(...TRUNCATED)
[]
{ "key": "mit", "name": "MIT License", "spdx_id": "MIT", "url": "https://api.github.com/licenses/mit" }
redimp__otterwiki-153
redimp/otterwiki
0c05f0f8680771cc20c7c7a030c5060c6caada05
"diff --git a/otterwiki/renderer.py b/otterwiki/renderer.py\nindex 494ff05..ad53d7d 100644\n--- a/ot(...TRUNCATED)
python
"diff --git a/tests/test_renderer.py b/tests/test_renderer.py\nindex bb88fbc..188adb0 100644\n--- a/(...TRUNCATED)
2024-10-23T22:28:23+00:00Z
"Allow copy of code\n\nMany sites that display markdown (e.g., GitHub) present a neat button to copy(...TRUNCATED)
Released in [v2.7.0](https://github.com/redimp/otterwiki/releases/tag/v2.7.0).
0.0.1-alpha
408ecad8cc2387a94baaa270dd999829a70a70b7
["tests.test_renderer::test_clean_html_render"]
"[\"tests.test_attachments::test_app_with_attachments\", \"tests.test_attachments::test_list_attachm(...TRUNCATED)
[]
{ "key": "mit", "name": "MIT License", "spdx_id": "MIT", "url": "https://api.github.com/licenses/mit" }
End of preview. Expand in Data Studio

Codeset-Gym-Python

A gym for training code agents resolve real-world software issues. This version contains issues from Python repositories.


Dataset Structure

Column Type Description
instance_id str Formatted as owner__repo-issueNumber (e.g. psf__requests-6091)
repo str owner/repo
patch str Source-code diff that resolves the issue (tests omitted)
test_patch str Diff of test files added/changed by the issue resolving commit
base_commit str Commit hash before the issue resolution
environment_setup_commit str Commit hash of the resolved version, from which the environment was built
created_at str ISO timestamp of the issue resolving commit
problem_statement str Issue title + body
hints_text str Concatenated Issue comments prior to the patch
version str Environment version tags
FAIL_TO_PASS List[str] A json list of strings that represent the set of tests resolved by the PR and tied to the issue resolution.
PASS_TO_PASS List[str] A json list of strings that represent tests that should pass before and after the PR application.

Usage

from datasets import load_dataset

ds = load_dataset("codeset/codeset-gym-python", split="train")

sample = ds[0]
print(sample["problem_statement"])
print(sample["patch"])

The dataset ships as a single train split.


Built by Codeset

Downloads last month
109